You are viewing a plain text version of this content. The canonical link for it is here.
Posted to npanday-commits@incubator.apache.org by br...@apache.org on 2012/01/04 14:53:57 UTC
svn commit: r1227176 - in /incubator/npanday/branches/npanday-1.4.x: ./
plugins/wix-maven-plugin/src/main/java/npanday/plugin/wix/
Author: brett
Date: Wed Jan 4 14:53:57 2012
New Revision: 1227176
URL: http://svn.apache.org/viewvc?rev=1227176&view=rev
Log:
[NPANDAY-510] Allow wix-maven-plugin to configure wix home
Merged from trunk
Modified:
incubator/npanday/branches/npanday-1.4.x/ (props changed)
incubator/npanday/branches/npanday-1.4.x/plugins/wix-maven-plugin/src/main/java/npanday/plugin/wix/AbstractWixMojo.java
incubator/npanday/branches/npanday-1.4.x/plugins/wix-maven-plugin/src/main/java/npanday/plugin/wix/CandleMojo.java
incubator/npanday/branches/npanday-1.4.x/plugins/wix-maven-plugin/src/main/java/npanday/plugin/wix/LightMojo.java
incubator/npanday/branches/npanday-1.4.x/pom.xml
Propchange: incubator/npanday/branches/npanday-1.4.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Jan 4 14:53:57 2012
@@ -1,4 +1,4 @@
/incubator/npanday/branches/NPANDAY-410:1210743-1210765
/incubator/npanday/branches/npanday-uac-removed:1002005-1024539
/incubator/npanday/branches/npanday-vs2010-support:1002029-1025477
-/incubator/npanday/trunk:1221087,1221092,1221101,1221116-1221117,1221159,1222098-1222180,1222459-1222547,1226035,1227061,1227127,1227131-1227150
+/incubator/npanday/trunk:1221087,1221092,1221101,1221116-1221117,1221159,1222098-1222180,1222459-1222547,1226035,1227061,1227127,1227131-1227175
Modified: incubator/npanday/branches/npanday-1.4.x/plugins/wix-maven-plugin/src/main/java/npanday/plugin/wix/AbstractWixMojo.java
URL: http://svn.apache.org/viewvc/incubator/npanday/branches/npanday-1.4.x/plugins/wix-maven-plugin/src/main/java/npanday/plugin/wix/AbstractWixMojo.java?rev=1227176&r1=1227175&r2=1227176&view=diff
==============================================================================
--- incubator/npanday/branches/npanday-1.4.x/plugins/wix-maven-plugin/src/main/java/npanday/plugin/wix/AbstractWixMojo.java (original)
+++ incubator/npanday/branches/npanday-1.4.x/plugins/wix-maven-plugin/src/main/java/npanday/plugin/wix/AbstractWixMojo.java Wed Jan 4 14:53:57 2012
@@ -19,6 +19,8 @@ package npanday.plugin.wix;
* under the License.
*/
+import java.io.File;
+
import org.apache.maven.plugin.AbstractMojo;
public abstract class AbstractWixMojo
@@ -36,4 +38,19 @@ public abstract class AbstractWixMojo
*/
protected String arguments;
+
+ /**
+ * @parameter expression="${wix.home}" default-value="${env.WIX}"
+ */
+ private File wixHome;
+
+ public String getWixPath( String name )
+ {
+ if ( wixHome != null )
+ {
+ return new File( new File( wixHome, "bin" ), name ).getAbsolutePath();
+ }
+ return name;
+ }
+
}
Modified: incubator/npanday/branches/npanday-1.4.x/plugins/wix-maven-plugin/src/main/java/npanday/plugin/wix/CandleMojo.java
URL: http://svn.apache.org/viewvc/incubator/npanday/branches/npanday-1.4.x/plugins/wix-maven-plugin/src/main/java/npanday/plugin/wix/CandleMojo.java?rev=1227176&r1=1227175&r2=1227176&view=diff
==============================================================================
--- incubator/npanday/branches/npanday-1.4.x/plugins/wix-maven-plugin/src/main/java/npanday/plugin/wix/CandleMojo.java (original)
+++ incubator/npanday/branches/npanday-1.4.x/plugins/wix-maven-plugin/src/main/java/npanday/plugin/wix/CandleMojo.java Wed Jan 4 14:53:57 2012
@@ -57,7 +57,6 @@ public class CandleMojo
*/
private String arch;
-
/**
* Output file
* @parameter expression="${outputDirectory}"
@@ -79,16 +78,14 @@ public class CandleMojo
}
try {
- String line = "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)
@@ -96,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);
@@ -132,4 +127,4 @@ public class CandleMojo
throw new MojoExecutionException( "Problem executing candle", e );
}
}
-}
\ No newline at end of file
+}
Modified: incubator/npanday/branches/npanday-1.4.x/plugins/wix-maven-plugin/src/main/java/npanday/plugin/wix/LightMojo.java
URL: http://svn.apache.org/viewvc/incubator/npanday/branches/npanday-1.4.x/plugins/wix-maven-plugin/src/main/java/npanday/plugin/wix/LightMojo.java?rev=1227176&r1=1227175&r2=1227176&view=diff
==============================================================================
--- incubator/npanday/branches/npanday-1.4.x/plugins/wix-maven-plugin/src/main/java/npanday/plugin/wix/LightMojo.java (original)
+++ incubator/npanday/branches/npanday-1.4.x/plugins/wix-maven-plugin/src/main/java/npanday/plugin/wix/LightMojo.java Wed Jan 4 14:53:57 2012
@@ -93,26 +93,29 @@ public class LightMojo
}
try {
- String line = "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);
Modified: incubator/npanday/branches/npanday-1.4.x/pom.xml
URL: http://svn.apache.org/viewvc/incubator/npanday/branches/npanday-1.4.x/pom.xml?rev=1227176&r1=1227175&r2=1227176&view=diff
==============================================================================
--- incubator/npanday/branches/npanday-1.4.x/pom.xml (original)
+++ incubator/npanday/branches/npanday-1.4.x/pom.xml Wed Jan 4 14:53:57 2012
@@ -274,6 +274,9 @@ under the License.
<contributor>
<name>Stoyan Damov</name>
</contributor>
+ <contributor>
+ <name>Adrián Boimvaser</name>
+ </contributor>
</contributors>
<modules>
<module>components</module>