diff options
Diffstat (limited to 'src/main/java/org/apache/maven/plugin/nar/AbstractCompileMojo.java')
-rw-r--r-- | src/main/java/org/apache/maven/plugin/nar/AbstractCompileMojo.java | 183 |
1 files changed, 106 insertions, 77 deletions
diff --git a/src/main/java/org/apache/maven/plugin/nar/AbstractCompileMojo.java b/src/main/java/org/apache/maven/plugin/nar/AbstractCompileMojo.java index 9f182d7..e949a40 100644 --- a/src/main/java/org/apache/maven/plugin/nar/AbstractCompileMojo.java +++ b/src/main/java/org/apache/maven/plugin/nar/AbstractCompileMojo.java @@ -28,46 +28,48 @@ import org.apache.tools.ant.Project; /** * @author Mark Donszelmann */ -public abstract class AbstractCompileMojo extends AbstractDependencyMojo { +public abstract class AbstractCompileMojo + extends AbstractDependencyMojo +{ /** * C++ Compiler - * + * * @parameter expression="" */ private Cpp cpp; /** * C Compiler - * + * * @parameter expression="" */ private C c; /** * Fortran Compiler - * + * * @parameter expression="" */ private Fortran fortran; - + /** * Maximum number of Cores/CPU's to use. 0 means unlimited. * * @parameter expression="" */ private int maxCores = 0; - + /** * Name of the output - * + * * @parameter expression="${project.artifactId}-${project.version}" */ private String output; - + /** * Fail on compilation/linking error. - * + * * @parameter expression="" default-value="true" * @required */ @@ -75,151 +77,178 @@ public abstract class AbstractCompileMojo extends AbstractDependencyMojo { /** * Sets the type of runtime library, possible values "dynamic", "static". - * + * * @parameter expression="" default-value="dynamic" * @required */ private String runtime; /** - * Set use of libtool. If set to true, the "libtool " will be prepended to the command line for compatible processors. - * + * Set use of libtool. If set to true, the "libtool " will be prepended to the command line for compatible + * processors. + * * @parameter expression="" default-value="false" * @required */ private boolean libtool; /** - * The home of the Java system. - * Defaults to a derived value from ${java.home} which is OS specific. - * + * The home of the Java system. Defaults to a derived value from ${java.home} which is OS specific. + * * @parameter expression="" * @readonly */ private File javaHome; - + /** * List of libraries to create - * + * * @parameter expression="" */ private List libraries; /** * List of tests to create - * + * * @parameter expression="" */ private List tests; - + /** * Javah info - * + * * @parameter expression="" */ private Javah javah; - + /** * Java info for includes and linking - * + * * @parameter expression="" */ private Java java; - + private NarInfo narInfo; - private List/*<String>*/ dependencyLibOrder; + private List/* <String> */dependencyLibOrder; private Project antProject; - protected Project getAntProject() { - if (antProject == null) { + protected Project getAntProject() + { + if ( antProject == null ) + { // configure ant project antProject = new Project(); - antProject.setName("NARProject"); - antProject.addBuildListener(new NarLogger(getLog())); + antProject.setName( "NARProject" ); + antProject.addBuildListener( new NarLogger( getLog() ) ); } return antProject; } - protected C getC() { - if (c == null) c = new C(); - c.setAbstractCompileMojo(this); + protected C getC() + { + if ( c == null ) + c = new C(); + c.setAbstractCompileMojo( this ); return c; } - - protected Cpp getCpp() { - if (cpp == null) cpp = new Cpp(); - cpp.setAbstractCompileMojo(this); + + protected Cpp getCpp() + { + if ( cpp == null ) + cpp = new Cpp(); + cpp.setAbstractCompileMojo( this ); return cpp; } - - protected Fortran getFortran() { - if (fortran == null) fortran = new Fortran(); - fortran.setAbstractCompileMojo(this); + + protected Fortran getFortran() + { + if ( fortran == null ) + fortran = new Fortran(); + fortran.setAbstractCompileMojo( this ); return fortran; } - protected int getMaxCores(AOL aol) { - return getNarInfo().getProperty(aol, "maxCores", maxCores); + protected int getMaxCores( AOL aol ) + { + return getNarInfo().getProperty( aol, "maxCores", maxCores ); } - - protected boolean useLibtool(AOL aol) { - return getNarInfo().getProperty(aol, "libtool", libtool); + + protected boolean useLibtool( AOL aol ) + { + return getNarInfo().getProperty( aol, "libtool", libtool ); } - - protected boolean failOnError(AOL aol) { - return getNarInfo().getProperty(aol, "failOnError", failOnError); + + protected boolean failOnError( AOL aol ) + { + return getNarInfo().getProperty( aol, "failOnError", failOnError ); } - - protected String getRuntime(AOL aol) { - return getNarInfo().getProperty(aol, "runtime", runtime); + + protected String getRuntime( AOL aol ) + { + return getNarInfo().getProperty( aol, "runtime", runtime ); } - - protected String getOutput(AOL aol) { - return getNarInfo().getProperty(aol, "output", output); + + protected String getOutput( AOL aol ) + { + return getNarInfo().getProperty( aol, "output", output ); } - protected File getJavaHome(AOL aol) { - // FIXME should be easier by specifying default... - return getNarInfo().getProperty(aol, "javaHome", NarUtil.getJavaHome(javaHome, getOS())); + protected File getJavaHome( AOL aol ) + { + // FIXME should be easier by specifying default... + return getNarInfo().getProperty( aol, "javaHome", NarUtil.getJavaHome( javaHome, getOS() ) ); } - protected List getLibraries() { - if (libraries == null) libraries = Collections.EMPTY_LIST; + protected List getLibraries() + { + if ( libraries == null ) + libraries = Collections.EMPTY_LIST; return libraries; } - - protected List getTests() { - if (tests == null) tests = Collections.EMPTY_LIST; + + protected List getTests() + { + if ( tests == null ) + tests = Collections.EMPTY_LIST; return tests; } - protected Javah getJavah() { - if (javah == null) javah = new Javah(); - javah.setAbstractCompileMojo(this); + protected Javah getJavah() + { + if ( javah == null ) + javah = new Javah(); + javah.setAbstractCompileMojo( this ); return javah; } - - protected Java getJava() { - if (java == null) java = new Java(); - java.setAbstractCompileMojo(this); + + protected Java getJava() + { + if ( java == null ) + java = new Java(); + java.setAbstractCompileMojo( this ); return java; } - public void setDependencyLibOrder(List/*<String>*/ order) { + public void setDependencyLibOrder( List/* <String> */order ) + { dependencyLibOrder = order; } - protected List/*<String>*/ getDependencyLibOrder() { + protected List/* <String> */getDependencyLibOrder() + { return dependencyLibOrder; } - - protected NarInfo getNarInfo() { - if (narInfo == null) { - narInfo = new NarInfo(getMavenProject().getGroupId(), getMavenProject() - .getArtifactId(), getMavenProject().getVersion(), getLog()); - } - return narInfo; + + protected NarInfo getNarInfo() + { + if ( narInfo == null ) + { + narInfo = + new NarInfo( getMavenProject().getGroupId(), getMavenProject().getArtifactId(), + getMavenProject().getVersion(), getLog() ); + } + return narInfo; } } |