Author: brett
Date: Wed Jan 4 14:45:38 2012
New Revision: 1227173
URL: http://svn.apache.org/viewvc?rev=1227173&view=rev
Log:
[NPANDAY-510] build incrementally to avoid quoting issues
Modified:
incubator/npanday/trunk/plugins/wix-maven-plugin/src/main/java/npanday/plugin/wix/CandleMojo.java
incubator/npanday/trunk/plugins/wix-maven-plugin/src/main/java/npanday/plugin/wix/LightMojo.java
Modified:
incubator/npanday/trunk/plugins/wix-maven-plugin/src/main/java/npanday/plugin/wix/CandleMojo.java
URL:
http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/wix-maven-plugin/src/main/java/npanday/plugin/wix/CandleMojo.java?rev=1227173&r1=1227172&r2=1227173&view=diff
==============================================================================
---
incubator/npanday/trunk/plugins/wix-maven-plugin/src/main/java/npanday/plugin/wix/CandleMojo.java
(original)
+++
incubator/npanday/trunk/plugins/wix-maven-plugin/src/main/java/npanday/plugin/wix/CandleMojo.java
Wed Jan 4 14:45:38 2012
@@ -78,16 +78,14 @@ public class CandleMojo
}
try {
- String line = getWixPath( "candle" ) + " -nologo -sw ";
- String dftns = "";
+ CommandLine commandLine = new CommandLine( getWixPath( "candle" ) );
if(definitions.length>0)
{
for (int x = 0; x < definitions.length; x++)
{
- dftns=dftns+"-d"+definitions[x]+" ";
+ commandLine.addArgument( "-d" + definitions[x] );
}
- line += dftns;
}
if(outputDirectory != null)
@@ -95,29 +93,27 @@ public class CandleMojo
if (!outputDirectory.exists())
{
outputDirectory.mkdir();
- line = line + "-out " + outputDirectory.getAbsolutePath() + "\\";
- }
- else
- {
- line = line + "-out " + outputDirectory.getAbsolutePath() + "\\";
}
+ commandLine.addArgument( "-out" );
+ commandLine.addArgument( outputDirectory.getAbsolutePath() + "\\"
);
}
if ( arch != null ) {
- line += " -arch " + arch;
+ commandLine.addArgument( "-arch" );
+ commandLine.addArgument( arch );
}
if ( extensions != null ) {
for ( String ext : extensions ) {
- line += " -ext " + ext;
+ commandLine.addArgument( "-ext" );
+ commandLine.addArgument( ext );
}
}
if ( arguments != null ) {
- line += " " + arguments;
+ commandLine.addArguments( arguments );
}
- line += " " + paths;
+ commandLine.addArguments( paths );
- CommandLine commandLine = CommandLine.parse(line);
DefaultExecutor executor = new DefaultExecutor();
int exitValue = executor.execute(commandLine);
Modified:
incubator/npanday/trunk/plugins/wix-maven-plugin/src/main/java/npanday/plugin/wix/LightMojo.java
URL:
http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/wix-maven-plugin/src/main/java/npanday/plugin/wix/LightMojo.java?rev=1227173&r1=1227172&r2=1227173&view=diff
==============================================================================
---
incubator/npanday/trunk/plugins/wix-maven-plugin/src/main/java/npanday/plugin/wix/LightMojo.java
(original)
+++
incubator/npanday/trunk/plugins/wix-maven-plugin/src/main/java/npanday/plugin/wix/LightMojo.java
Wed Jan 4 14:45:38 2012
@@ -93,26 +93,29 @@ public class LightMojo
}
try {
- String line = getWixPath( "light" ) + " " + paths;
+ CommandLine commandLine = new CommandLine( getWixPath( "light" ) );
+ commandLine.addArguments( paths );
if (outputFile != null) {
- line = line + " -o " + outputFile.getAbsolutePath();
+ commandLine.addArgument( "-o" );
+ commandLine.addArgument( outputFile.getAbsolutePath() );
}
else if (outputDirectory != null) {
- line = line + " -out " + outputDirectory.getAbsolutePath() + "\\";
+ commandLine.addArgument( "-out" );
+ commandLine.addArgument( outputDirectory.getAbsolutePath() + "\\"
);
}
if ( extensions != null ) {
for ( String ext : extensions ) {
- line += " -ext " + ext;
+ commandLine.addArgument( "-ext" );
+ commandLine.addArgument( ext );
}
}
if ( arguments != null ) {
- line += " " + arguments;
+ commandLine.addArguments( arguments );
}
- CommandLine commandLine = CommandLine.parse(line);
DefaultExecutor executor = new DefaultExecutor();
int exitValue = executor.execute(commandLine);