summaryrefslogtreecommitdiff
path: root/src/main/java/org
diff options
context:
space:
mode:
authorPeter Janes <github.com@peterjanes.ca>2010-02-02 02:06:15 +0800
committerMark Donszelmann <Mark.Donszelmann@gmail.com>2010-05-14 00:58:53 +0800
commitaac23b5083a919983887a448f29fd8e72075e6bd (patch)
tree2b0e9cade015c2e60ae6ebecaaa0fb5ce97aab18 /src/main/java/org
parent00ff935bf62e58a1bfe937be8df7c329942bf025 (diff)
downloadmaven-nar-plugin-aac23b5083a919983887a448f29fd8e72075e6bd.tar.gz
maven-nar-plugin-aac23b5083a919983887a448f29fd8e72075e6bd.tar.bz2
maven-nar-plugin-aac23b5083a919983887a448f29fd8e72075e6bd.tar.xz
maven-nar-plugin-aac23b5083a919983887a448f29fd8e72075e6bd.zip
Attempt to run buildconf if autogen.sh doesn't exist
Diffstat (limited to 'src/main/java/org')
-rw-r--r--src/main/java/org/apache/maven/plugin/nar/NarGnuConfigureMojo.java44
1 files changed, 29 insertions, 15 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 924bda3..571698d 100644
--- a/src/main/java/org/apache/maven/plugin/nar/NarGnuConfigureMojo.java
+++ b/src/main/java/org/apache/maven/plugin/nar/NarGnuConfigureMojo.java
@@ -38,7 +38,7 @@ public class NarGnuConfigureMojo
extends AbstractGnuMojo
{
/**
- * Skip running of autogen.sh.
+ * Skip running of autogen.sh (aka buildconf).
*
* @parameter expression="${nar.gnu.autogen.skip}" default-value="false"
*/
@@ -53,6 +53,8 @@ public class NarGnuConfigureMojo
private static final String AUTOGEN = "autogen.sh";
+ private static final String BUILDCONF = "buildconf";
+
private static final String CONFIGURE = "configure";
public final void narExecute()
@@ -79,22 +81,17 @@ public class NarGnuConfigureMojo
throw new MojoExecutionException( "Failed to copy GNU sources", e );
}
- File autogen = new File( targetDir, AUTOGEN );
- if ( !gnuConfigureSkip && !gnuAutogenSkip && autogen.exists() )
+ if ( !gnuConfigureSkip && !gnuAutogenSkip )
{
- getLog().info( "Running GNU " + AUTOGEN );
-
- // fix missing config directory
- File configDir = new File(targetDir, "config");
- if (!configDir.exists()) {
- configDir.mkdirs();
- }
-
- NarUtil.makeExecutable( autogen, getLog() );
- int result = NarUtil.runCommand( "./" + autogen.getName(), null, targetDir, null, getLog() );
- if ( result != 0 )
+ File autogen = new File( targetDir, AUTOGEN );
+ File buildconf = new File( targetDir, BUILDCONF );
+ if ( autogen.exists() )
{
- throw new MojoExecutionException( "'" + AUTOGEN + "' errorcode: " + result );
+ getLog().info( "Running GNU " + AUTOGEN );
+ runAutogen(autogen, targetDir);
+ } else if ( buildconf.exists() ) {
+ getLog().info( "Running GNU " + BUILDCONF );
+ runAutogen(buildconf, targetDir);
}
}
@@ -113,4 +110,21 @@ public class NarGnuConfigureMojo
}
}
}
+
+ private void runAutogen(File autogen, File targetDir)
+ throws MojoExecutionException, MojoFailureException
+ {
+ // fix missing config directory
+ File configDir = new File(targetDir, "config");
+ if (!configDir.exists()) {
+ configDir.mkdirs();
+ }
+
+ NarUtil.makeExecutable( autogen, getLog() );
+ int result = NarUtil.runCommand( "./" + autogen.getName(), null, targetDir, null, getLog() );
+ if ( result != 0 )
+ {
+ throw new MojoExecutionException( "'" + autogen.getName() + "' errorcode: " + result );
+ }
+ }
}