From ba12beea79817971caa6f0c9a6e9afa3afde7fa4 Mon Sep 17 00:00:00 2001 From: Mark Donszelmann Date: Wed, 21 Oct 2009 10:17:18 +0200 Subject: Better fix for NAR-77 --- .../org/apache/maven/plugin/nar/NarGnuConfigureMojo.java | 16 ++++++++++------ .../java/org/apache/maven/plugin/nar/NarGnuProcess.java | 3 --- 2 files changed, 10 insertions(+), 9 deletions(-) (limited to 'src/main/java/org') 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 697dcf1..c8ec983 100644 --- a/src/main/java/org/apache/maven/plugin/nar/NarGnuConfigureMojo.java +++ b/src/main/java/org/apache/maven/plugin/nar/NarGnuConfigureMojo.java @@ -61,14 +61,12 @@ public class NarGnuConfigureMojo if ( shouldSkip() ) return; - if ( !useGnu() ) - return; - + // always copy, in case we need libs or include dirs + File targetDir = getGnuAOLSourceDirectory(); if ( gnuSourceDirectory.exists() ) { getLog().info( "Copying GNU sources" ); - File targetDir = getGnuAOLSourceDirectory(); try { FileUtils.mkdir( targetDir.getPath() ); @@ -78,7 +76,13 @@ public class NarGnuConfigureMojo { throw new MojoExecutionException( "Failed to copy GNU sources", e ); } + } + if ( !useGnu() ) + return; + + if ( targetDir.exists() ) + { File autogen = new File( targetDir, AUTOGEN ); if ( !gnuConfigureSkip && !gnuAutogenSkip && autogen.exists() ) { @@ -88,7 +92,7 @@ public class NarGnuConfigureMojo if ( result != 0 ) { System.err.println( targetDir ); - throw new MojoExecutionException( "'"+AUTOGEN+"' errorcode: " + result ); + throw new MojoExecutionException( "'" + AUTOGEN + "' errorcode: " + result ); } } @@ -102,7 +106,7 @@ public class NarGnuConfigureMojo "--prefix=" + getGnuAOLTargetDirectory().getAbsolutePath() }, targetDir, null, getLog() ); if ( result != 0 ) { - throw new MojoExecutionException( "'"+CONFIGURE+"' errorcode: " + result ); + throw new MojoExecutionException( "'" + CONFIGURE + "' errorcode: " + result ); } } } diff --git a/src/main/java/org/apache/maven/plugin/nar/NarGnuProcess.java b/src/main/java/org/apache/maven/plugin/nar/NarGnuProcess.java index 2b9336f..0a6aea4 100644 --- a/src/main/java/org/apache/maven/plugin/nar/NarGnuProcess.java +++ b/src/main/java/org/apache/maven/plugin/nar/NarGnuProcess.java @@ -41,9 +41,6 @@ public class NarGnuProcess if ( shouldSkip() ) return; - if ( !useGnu() ) - return; - File srcDir = getGnuAOLTargetDirectory(); if ( srcDir.exists() ) { -- cgit v1.2.3