summaryrefslogtreecommitdiff
path: root/src/main/java/org
diff options
context:
space:
mode:
authorMark Donszelmann <Mark.Donszelmann@gmail.com>2009-10-21 10:17:18 +0200
committerMark Donszelmann <Mark.Donszelmann@gmail.com>2009-10-21 10:17:18 +0200
commitba12beea79817971caa6f0c9a6e9afa3afde7fa4 (patch)
tree63efb55e451b6597dc7c6a30b2648795c9d72abb /src/main/java/org
parentaeeba6671f95cec7b4a9f289d8e00e7efd042887 (diff)
downloadmaven-nar-plugin-ba12beea79817971caa6f0c9a6e9afa3afde7fa4.tar.gz
maven-nar-plugin-ba12beea79817971caa6f0c9a6e9afa3afde7fa4.tar.bz2
maven-nar-plugin-ba12beea79817971caa6f0c9a6e9afa3afde7fa4.tar.xz
maven-nar-plugin-ba12beea79817971caa6f0c9a6e9afa3afde7fa4.zip
Better fix for NAR-77
Diffstat (limited to 'src/main/java/org')
-rw-r--r--src/main/java/org/apache/maven/plugin/nar/NarGnuConfigureMojo.java16
-rw-r--r--src/main/java/org/apache/maven/plugin/nar/NarGnuProcess.java3
2 files changed, 10 insertions, 9 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 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() )
{