Author: brett Date: Wed Jan 4 14:44:23 2012 New Revision: 1227172 URL: http://svn.apache.org/viewvc?rev=1227172&view=rev Log: [NPANDAY-510] Allow wix-maven-plugin to configure wix home Submitted by: Adrián Boimvaser (applied with some modifications)
Modified: incubator/npanday/trunk/plugins/wix-maven-plugin/src/main/java/npanday/plugin/wix/AbstractWixMojo.java 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 incubator/npanday/trunk/pom.xml Modified: incubator/npanday/trunk/plugins/wix-maven-plugin/src/main/java/npanday/plugin/wix/AbstractWixMojo.java URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/wix-maven-plugin/src/main/java/npanday/plugin/wix/AbstractWixMojo.java?rev=1227172&r1=1227171&r2=1227172&view=diff ============================================================================== --- incubator/npanday/trunk/plugins/wix-maven-plugin/src/main/java/npanday/plugin/wix/AbstractWixMojo.java (original) +++ incubator/npanday/trunk/plugins/wix-maven-plugin/src/main/java/npanday/plugin/wix/AbstractWixMojo.java Wed Jan 4 14:44:23 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/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=1227172&r1=1227171&r2=1227172&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:44:23 2012 @@ -57,7 +57,6 @@ public class CandleMojo */ private String arch; - /** * Output file * @parameter expression="${outputDirectory}" @@ -79,7 +78,7 @@ public class CandleMojo } try { - String line = "candle -nologo -sw "; + String line = getWixPath( "candle" ) + " -nologo -sw "; String dftns = ""; if(definitions.length>0) @@ -132,4 +131,4 @@ public class CandleMojo throw new MojoExecutionException( "Problem executing candle", e ); } } -} \ No newline at end of file +} 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=1227172&r1=1227171&r2=1227172&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:44:23 2012 @@ -93,8 +93,8 @@ public class LightMojo } try { - String line = "light " + paths; - + String line = getWixPath( "light" ) + " " + paths; + if (outputFile != null) { line = line + " -o " + outputFile.getAbsolutePath(); } Modified: incubator/npanday/trunk/pom.xml URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/pom.xml?rev=1227172&r1=1227171&r2=1227172&view=diff ============================================================================== --- incubator/npanday/trunk/pom.xml (original) +++ incubator/npanday/trunk/pom.xml Wed Jan 4 14:44:23 2012 @@ -284,6 +284,9 @@ under the License. <contributor> <name>Stoyan Damov</name> </contributor> + <contributor> + <name>Adrián Boimvaser</name> + </contributor> </contributors> <modules> <module>components</module>