diff options
author | Andrew Johnson <ajohnson@arizona.(none)> | 2010-02-25 16:02:27 -0500 |
---|---|---|
committer | Mark Donszelmann <duns@macserver.donszelmann.org> | 2010-05-14 00:22:19 +0200 |
commit | 286d10a763f9db3d240277b45ccb7020223e98b0 (patch) | |
tree | ac739f6d06e4c1bda4d63917a88dad83a9e830b5 /src/main/java/org | |
parent | 4b643dd163d3a9cfd079967eff481dbc01b69683 (diff) | |
download | maven-nar-plugin-286d10a763f9db3d240277b45ccb7020223e98b0.tar.gz maven-nar-plugin-286d10a763f9db3d240277b45ccb7020223e98b0.tar.bz2 maven-nar-plugin-286d10a763f9db3d240277b45ccb7020223e98b0.tar.xz maven-nar-plugin-286d10a763f9db3d240277b45ccb7020223e98b0.zip |
Fix for GNU configure arguments
Diffstat (limited to 'src/main/java/org')
-rw-r--r-- | src/main/java/org/apache/maven/plugin/nar/NarGnuConfigureMojo.java | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/src/main/java/org/apache/maven/plugin/nar/NarGnuConfigureMojo.java b/src/main/java/org/apache/maven/plugin/nar/NarGnuConfigureMojo.java index 571698d..f2f8f20 100644 --- a/src/main/java/org/apache/maven/plugin/nar/NarGnuConfigureMojo.java +++ b/src/main/java/org/apache/maven/plugin/nar/NarGnuConfigureMojo.java @@ -21,6 +21,7 @@ package org.apache.maven.plugin.nar; import java.io.File; import java.io.IOException; +import java.util.Arrays; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; @@ -99,10 +100,31 @@ public class NarGnuConfigureMojo if ( !gnuConfigureSkip && configure.exists() ) { getLog().info( "Running GNU " + CONFIGURE ); + NarUtil.makeExecutable( configure, getLog() ); - int result = - NarUtil.runCommand( "./" + configure.getName(), new String[] { - "--prefix=" + getGnuAOLTargetDirectory().getAbsolutePath() }, targetDir, null, getLog() ); + String[] args = null; + + // create the array to hold constant and additional args + if ( gnuConfigureArgs != null ) + { + String[] a = gnuConfigureArgs.split( " " ); + args = new String[a.length + 2]; + for ( int i = 0; i < a.length; i++ ) + { + args[i+2] = a[i]; + } + } + else + { + args = new String[2]; + } + + //first 2 args are constant + args[0] = "./" + configure.getName(); + args[1] = "--prefix=" + getGnuAOLTargetDirectory().getAbsolutePath(); + + getLog().info( "args: " + Arrays.toString(args) ); + int result = NarUtil.runCommand( "sh", args, targetDir, null, getLog() ); if ( result != 0 ) { throw new MojoExecutionException( "'" + CONFIGURE + "' errorcode: " + result ); |