From 9af270beb1414531363aa1fcb6cba7565ca0075a Mon Sep 17 00:00:00 2001 From: Mark Donszelmann Date: Tue, 26 Oct 2010 00:39:07 +0200 Subject: Fixed NAR-165 --- .../java/org/apache/maven/plugin/nar/NarUtil.java | 30 +++++----------------- 1 file changed, 6 insertions(+), 24 deletions(-) (limited to 'src/main/java/org/apache/maven/plugin/nar/NarUtil.java') diff --git a/src/main/java/org/apache/maven/plugin/nar/NarUtil.java b/src/main/java/org/apache/maven/plugin/nar/NarUtil.java index cb77355..b739f0e 100644 --- a/src/main/java/org/apache/maven/plugin/nar/NarUtil.java +++ b/src/main/java/org/apache/maven/plugin/nar/NarUtil.java @@ -30,7 +30,6 @@ import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; -import java.util.Properties; import java.util.Set; import java.util.regex.Pattern; @@ -41,7 +40,6 @@ import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.plugin.logging.Log; import org.apache.maven.project.MavenProject; import org.codehaus.plexus.util.FileUtils; -import org.codehaus.plexus.util.PropertyUtils; import org.codehaus.plexus.util.cli.Commandline; /** @@ -54,24 +52,6 @@ public final class NarUtil // never instantiate } - private static Properties defaults; - - public static Properties getDefaults() - throws MojoFailureException - { - // read properties file with defaults - if ( defaults == null ) - { - defaults = PropertyUtils.loadProperties( NarUtil.class.getResourceAsStream( "aol.properties" ) ); - } - if ( defaults == null ) - { - throw new MojoFailureException( "NAR: Could not load default properties file: 'aol.properties'." ); - } - - return defaults; - } - public static String getOS( String defaultOs ) { String os = defaultOs; @@ -111,22 +91,23 @@ public final class NarUtil return link; } - public static String getLinkerName( String architecture, String os, Linker linker ) + public static String getLinkerName(MavenProject project, String architecture, String os, Linker linker ) throws MojoFailureException, MojoExecutionException { - return getLinker( linker ).getName( getDefaults(), getArchitecture( architecture ) + "." + getOS( os ) + "." ); + return getLinker( linker ).getName( NarProperties.getInstance(project), getArchitecture( architecture ) + "." + getOS( os ) + "." ); } - public static AOL getAOL( String architecture, String os, Linker linker, String aol ) + public static AOL getAOL(MavenProject project, String architecture, String os, Linker linker, String aol ) throws MojoFailureException, MojoExecutionException { // adjust aol - return aol == null ? new AOL( getArchitecture( architecture ), getOS( os ), getLinkerName( architecture, os, + return aol == null ? new AOL( getArchitecture( architecture ), getOS( os ), getLinkerName( project, architecture, os, linker ) ) : new AOL( aol ); } // FIXME, should go to AOL. +/* NOT USED ? public static String getAOLKey( String architecture, String os, Linker linker ) throws MojoFailureException, MojoExecutionException { @@ -134,6 +115,7 @@ public final class NarUtil return getArchitecture( architecture ) + "." + getOS( os ) + "." + getLinkerName( architecture, os, linker ) + "."; } +*/ public static String getAOLKey( String aol ) { -- cgit v1.2.3