summaryrefslogtreecommitdiff
path: root/src/main/java/org/apache
diff options
context:
space:
mode:
authorMark Donszelmann <Mark.Donszelmann@gmail.com>2009-12-01 22:14:28 +0100
committerMark Donszelmann <Mark.Donszelmann@gmail.com>2009-12-01 22:14:28 +0100
commit9faec425225fcb21d7227aace994188d98989236 (patch)
treefd8a1ac862a56eb286c8d399986cc420a7383f7b /src/main/java/org/apache
parent29a4aa114462e569281e8f821cb67506f629c5e8 (diff)
downloadmaven-nar-plugin-9faec425225fcb21d7227aace994188d98989236.tar.gz
maven-nar-plugin-9faec425225fcb21d7227aace994188d98989236.tar.bz2
maven-nar-plugin-9faec425225fcb21d7227aace994188d98989236.tar.xz
maven-nar-plugin-9faec425225fcb21d7227aace994188d98989236.zip
Fixed NAR-3 and NAR-114
Diffstat (limited to 'src/main/java/org/apache')
-rw-r--r--src/main/java/org/apache/maven/plugin/nar/Linker.java31
1 files changed, 23 insertions, 8 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 053462d..51c89cb 100644
--- a/src/main/java/org/apache/maven/plugin/nar/Linker.java
+++ b/src/main/java/org/apache/maven/plugin/nar/Linker.java
@@ -155,8 +155,9 @@ public class Linker
{
this.name = name;
}
-
- public final String getName() {
+
+ public final String getName()
+ {
return name;
}
@@ -218,6 +219,20 @@ public class Linker
throw new MojoFailureException( "Cannot deduce version number from: " + out );
}
}
+ else if ( name.equals( "icc" ) || name.equals( "icpc" ) )
+ {
+ NarUtil.runCommand( "icc", new String[] { "--version" }, null, null, out, err, dbg );
+ Pattern p = Pattern.compile( "\\d+\\.\\d+" );
+ Matcher m = p.matcher( out.toString() );
+ if ( m.find() )
+ {
+ version = m.group( 0 );
+ }
+ else
+ {
+ throw new MojoFailureException( "Cannot deduce version number from: " + out );
+ }
+ }
else
{
throw new MojoFailureException( "Cannot find version number for linker '" + name + "'" );
@@ -225,7 +240,8 @@ public class Linker
return version;
}
- public final LinkerDef getLinker( AbstractCompileMojo mojo, Project antProject, String os, String prefix, String type )
+ public final LinkerDef getLinker( AbstractCompileMojo mojo, Project antProject, String os, String prefix,
+ String type )
throws MojoFailureException, MojoExecutionException
{
if ( name == null )
@@ -300,16 +316,15 @@ public class Linker
linker.addConfiguredLinkerArg( arg );
}
}
-
+
// FIXME, this should be done in CPPTasks at some point, and may not be necessary, but was for VS 2010 beta 2
- if ( os.equals( OS.WINDOWS )
- && getName( null, null ).equals( "msvc" ) && !getVersion().startsWith( "6." ) ) {
+ if ( os.equals( OS.WINDOWS ) && getName( null, null ).equals( "msvc" ) && !getVersion().startsWith( "6." ) )
+ {
LinkerArgument arg = new LinkerArgument();
arg.setValue( "/MANIFEST" );
- linker.addConfiguredLinkerArg( arg );
+ linker.addConfiguredLinkerArg( arg );
}
-
// Add options to linker
if ( options != null )
{