Skip to content

Commit

Permalink
WINDUP-885 Upgrade windup-maven-plugin to latest WindUp core version
Browse files Browse the repository at this point in the history
  • Loading branch information
OndraZizka committed Feb 25, 2016
1 parent 9c74980 commit 6f50a40
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 1 deletion.
Expand Up @@ -48,6 +48,11 @@
import org.jboss.windup.util.Logging;
import org.jboss.windup.util.exception.WindupException;


/**
* This is the interactive command-line user interface of Windup
* which does basic validation of the input and then runs WindupProcessorImpl.
*/
public class RunWindupCommand implements Command, FurnaceDependent
{
private static final Logger log = Logging.get(RunWindupCommand.class);
Expand Down Expand Up @@ -255,6 +260,7 @@ else if (Boolean.class.isAssignableFrom(option.getType()))
windupConfiguration
.setProgressMonitor(progressMonitor)
.setGraphContext(graphContext);
// Run Windup.
getWindupProcessor().execute(windupConfiguration);

Path indexHtmlPath = windupConfiguration.getOutputDirectory().resolve("index.html").normalize().toAbsolutePath();
Expand Down
Expand Up @@ -108,7 +108,15 @@ public List<RuleProvider> getProviders(GraphContext context)
WindupConfigurationModel cfg = WindupConfigurationService.getConfigurationModel(context);
for (FileModel userRulesFileModel : cfg.getUserRulesPaths())
{
for (URL resource : getWindupUserDirectoryXmlFiles(userRulesFileModel))
// Log the files found
final Collection<URL> userXmlRulesetFiles = getWindupUserDirectoryXmlFiles(userRulesFileModel);
StringBuilder sb = new StringBuilder("\nFound " + userXmlRulesetFiles.size() + " user XML rules in: " + userRulesFileModel.getFilePath());
for (URL resource : userXmlRulesetFiles)
sb.append("\n\t" + resource.toString());
LOG.info(sb.toString());

// Parse each file
for (URL resource : userXmlRulesetFiles)
{
try
{
Expand Down
Expand Up @@ -61,4 +61,11 @@ private Set<String> initSet(Collection<String> values)
return new HashSet<>(values);
}
}


@Override
public String toString()
{
return "SourceAndTargetPredicate{" + "sources=" + sources + ", targets=" + targets + '}';
}
}
Expand Up @@ -84,4 +84,12 @@ public boolean accept(RuleProvider provider)

return result;
}


@Override
public String toString()
{
return "TaggedRuleProviderPredicate{incl " + includeTags.size() + ", excl" + excludeTags.size() + ", requireAllIncl=" + requireAllIncludeTags + ", requireAllExcl=" + requireAllExcludeTags + '}';
}

}
Expand Up @@ -5,6 +5,7 @@
import java.util.Collection;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.logging.Logger;

Expand Down Expand Up @@ -77,6 +78,7 @@ public void execute(WindupConfiguration configuration)
long startTime = System.currentTimeMillis();

validateConfig(configuration);
printConfigInfo(configuration);

GraphContext context = configuration.getGraphContext();
context.setOptions(configuration.getOptionMap());
Expand Down Expand Up @@ -248,4 +250,29 @@ private void validateConfig(WindupConfiguration windupConfiguration)
Checks.checkDirectoryToBeFilled(outputDirectory.toFile(), "Output directory");
}

private void printConfigInfo(WindupConfiguration windupConfiguration)
{
LOG.info("");
if (windupConfiguration.getInputPaths().size() == 1)
{
LOG.info("Input Application:" + windupConfiguration.getInputPaths().iterator().next());
}
else
{
LOG.info("Input Applications:");
for (Path inputPath : windupConfiguration.getInputPaths())
{
LOG.info("\t" + inputPath);
}
LOG.info("");
}
LOG.info("Output Path:" + windupConfiguration.getOutputDirectory());
LOG.info("");

for (Map.Entry<String, Object> entrySet : windupConfiguration.getOptionMap().entrySet())
{
LOG.info("\t" + entrySet.getKey() + ": " + entrySet.getValue());
}
}

}

0 comments on commit 6f50a40

Please sign in to comment.