Author: jocaba
Date: Thu Mar  3 07:09:33 2011
New Revision: 1076540

URL: http://svn.apache.org/viewvc?rev=1076540&view=rev
Log:
[NPANDAY-325] Additional parameters for wix-maven-plugin

Applied patch as submitted by Dmitry L from 
http://npanday.codeplex.com/workitem/14105

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

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=1076540&r1=1076539&r2=1076540&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
 Thu Mar  3 07:09:33 2011
@@ -31,4 +31,11 @@ public abstract class AbstractWixMojo
     * @parameter
     */
     protected String[] extensions;
+    
+    /**
+     * Agruments to pass to WiX executable as is
+     * @parameter expression="${arguments}"
+     */
+
+     protected String arguments;
 }

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=1076540&r1=1076539&r2=1076540&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
 Thu Mar  3 07:09:33 2011
@@ -3,22 +3,17 @@ package npanday.plugin.wix;
 /*
  * Copyright ---
  *
-* Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
  *
- *   http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
 
 import org.apache.commons.exec.CommandLine;
@@ -52,8 +47,14 @@ public class CandleMojo
      * @parameter expression="${definitions}"
      */
     private String[] definitions;
-    
-    
+
+    /**
+     * x86, intel, x64, intel64, or ia64 (default: x86)
+     * @parameter expression="${arch}"
+     */
+    private String arch;
+
+
     /**
      * Output file
      * @parameter expression="${outputDirectory}"
@@ -99,12 +100,19 @@ public class CandleMojo
               line = line + "-out " + outputDirectory.getAbsolutePath() + "\\";
             }
           }
+          if ( arch != null ) {
+            line += " -arch " + arch;
+          }
           if ( extensions != null ) {
             for ( String ext : extensions ) {
               line += " -ext " + ext;
             }
           }
 
+          if ( arguments != null ) {
+            line += " " + arguments;
+          }
+
           line += " " + paths;
           
           CommandLine commandLine = CommandLine.parse(line);
@@ -121,4 +129,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=1076540&r1=1076539&r2=1076540&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
 Thu Mar  3 07:09:33 2011
@@ -3,22 +3,17 @@ package npanday.plugin.wix;
 /*
  * Copyright ---
  *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
  *
- *   http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
 
 import org.apache.commons.exec.CommandLine;
@@ -74,9 +69,9 @@ public class LightMojo
           File f = objectFiles[x];
           if ( !f.exists() )
           {
-               throw new MojoExecutionException( "Object file does not exist " 
+ objectFiles[x] );
+             throw new MojoExecutionException( "Object file does not exist " + 
objectFiles[x] );
           } else {
-               paths = paths + objectFiles[x].getAbsolutePath() + " ";
+            paths = paths + objectFiles[x].getAbsolutePath() + " ";
           }
         }
 
@@ -110,16 +105,20 @@ public class LightMojo
             }
           }
 
+          if ( arguments != null ) {
+            line += " " + arguments;
+          }
+
           CommandLine commandLine = CommandLine.parse(line);
           DefaultExecutor executor = new DefaultExecutor();
           int exitValue = executor.execute(commandLine);
           
           if ( exitValue != 0 ) {
-                 throw new MojoExecutionException( "Problem executing light, 
return code " + exitValue );
+              throw new MojoExecutionException( "Problem executing light, 
return code " + exitValue );
           }
          
         } catch (ExecuteException e) {
-          throw new MojoExecutionException( "Problem executing light", e );
+         throw new MojoExecutionException( "Problem executing light", e );
         } catch (IOException e ) {
           throw new MojoExecutionException( "Problem executing light", e );
         }


Reply via email to