summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMark Donszelmann <duns@macserver.donszelmann.org>2010-10-25 22:24:06 +0200
committerMark Donszelmann <duns@macserver.donszelmann.org>2010-10-25 22:24:06 +0200
commit7482bfe33dc8db7ccc1b02d80f6c3b6dbac601ca (patch)
tree2b0f5e22b691989d452b4ec8e90809dea47ceb2f /src
parent94886fc2b89832a030c802e6f0068dac8225475e (diff)
downloadmaven-nar-plugin-7482bfe33dc8db7ccc1b02d80f6c3b6dbac601ca.tar.gz
maven-nar-plugin-7482bfe33dc8db7ccc1b02d80f6c3b6dbac601ca.tar.bz2
maven-nar-plugin-7482bfe33dc8db7ccc1b02d80f6c3b6dbac601ca.tar.xz
maven-nar-plugin-7482bfe33dc8db7ccc1b02d80f6c3b6dbac601ca.zip
Partial FIX to NAR-155
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/apache/maven/plugin/nar/Linker.java30
1 files changed, 14 insertions, 16 deletions
diff --git a/src/main/java/org/apache/maven/plugin/nar/Linker.java b/src/main/java/org/apache/maven/plugin/nar/Linker.java
index dfdea08..810c540 100644
--- a/src/main/java/org/apache/maven/plugin/nar/Linker.java
+++ b/src/main/java/org/apache/maven/plugin/nar/Linker.java
@@ -200,10 +200,6 @@ public class Linker
{
version = m.group( 0 );
}
- else
- {
- throw new MojoFailureException( "Cannot deduce version number from: " + out );
- }
}
else if ( name.equals( "msvc" ) )
{
@@ -214,10 +210,6 @@ public class Linker
{
version = m.group( 0 );
}
- else
- {
- throw new MojoFailureException( "Cannot deduce version number from: " + out );
- }
}
else if ( name.equals( "icc" ) || name.equals( "icpc" ) )
{
@@ -228,10 +220,6 @@ public class Linker
{
version = m.group( 0 );
}
- else
- {
- throw new MojoFailureException( "Cannot deduce version number from: " + out );
- }
}
else if ( name.equals( "icl" ) )
{
@@ -242,15 +230,25 @@ public class Linker
{
version = m.group( 0 );
}
- else
- {
- throw new MojoFailureException( "Cannot deduce version number from: " + out.toString() );
- }
+ }
+ else if ( name.equals( "CC" ) )
+ {
+ NarUtil.runCommand( "CC", new String[] { "-V" }, null, null, out, err, dbg );
+ Pattern p = Pattern.compile( "\\d+\\.d+" );
+ Matcher m = p.matcher( err.toString() );
+ if ( m.find() )
+ {
+ version = m.group( 0 );
+ }
}
else
{
throw new MojoFailureException( "Cannot find version number for linker '" + name + "'" );
}
+
+ if (version == null) {
+ throw new MojoFailureException( "Cannot deduce version number from: " + out.toString() );
+ }
return version;
}