Package org.codehaus.mojo.natives.plugin
Class NativeCompileMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.codehaus.mojo.natives.plugin.AbstractNativeMojo
-
- org.codehaus.mojo.natives.plugin.NativeCompileMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
@Mojo(name="compile", defaultPhase=COMPILE) public class NativeCompileMojo extends AbstractNativeMojoCompile source files into native object files
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.ListcompilerEndOptionsCompiler optionsprivate java.lang.StringcompilerExecutableUse this field to override provider specific compiler executableprivate java.util.ListcompilerMiddleOptionsCompiler optionsprotected java.io.FilecompilerOutputDirectoryCompiler output files ( .o, .obj, etc) locationprivate java.lang.StringcompilerProviderCompiler Provider Typeprivate java.util.ListcompilerStartOptionsCompiler optionsprivate CompilerConfigurationconfigFor unittest onlyprivate java.lang.StringjavahOSJavah OS name.private java.io.FilejdkIncludePathJDK native include directoryprivate CompilerManagermanagerprotected intnumberOfConcurrentCompilationNumber of parallel compilation threadsprivate java.lang.StringobjectFileExtensionUse this field to override object file extension.protected NativeSources[]sourcesArray of NativeSources containing include directories and source files.-
Fields inherited from class org.codehaus.mojo.natives.plugin.AbstractNativeMojo
dependencyIncludeDirectory, EMPTY_FILE_LIST, envFactoryManager, INCZIP_FOUND, INCZIP_TYPE, LINKER_INPUT_LIST_NAME, LINKER_OUTPUT_PATH, project, workingDirectory
-
-
Constructor Summary
Constructors Constructor Description NativeCompileMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidaddAdditionalIncludePath()Pickup additional source paths that previous phases added to source root Note: we intentionally ignore the first item of source root ( ie ${project.build.directory}/classes since this plugin never use it.private voidaddJavaHIncludePaths()protected CompilerConfigurationcreateProviderConfiguration()voidexecute()protected CompilerConfigurationgetCompilerConfiguration()Internal only for test harness purpose-
Methods inherited from class org.codehaus.mojo.natives.plugin.AbstractNativeMojo
getAllCompilersOutputFileList, getEnvFactory, getProject, removeEmptyOptions, saveCompilerOutputFilePaths
-
-
-
-
Field Detail
-
compilerProvider
@Parameter(defaultValue="generic", required=true) private java.lang.String compilerProviderCompiler Provider Type
-
objectFileExtension
@Parameter private java.lang.String objectFileExtension
Use this field to override object file extension. The default extensions are .obj and .o on Windows and Unix respectively
-
compilerExecutable
@Parameter private java.lang.String compilerExecutable
Use this field to override provider specific compiler executable
-
compilerStartOptions
@Parameter private java.util.List compilerStartOptions
Compiler options
-
compilerMiddleOptions
@Parameter private java.util.List compilerMiddleOptions
Compiler options
-
compilerEndOptions
@Parameter private java.util.List compilerEndOptions
Compiler options
-
javahOS
@Parameter private java.lang.String javahOS
Javah OS name. ${jdkIncludePath} and ${jdkIncludePath}/${javaOS} are added to system include path when this field is set
-
jdkIncludePath
@Parameter(defaultValue="${java.home}/../include") private java.io.File jdkIncludePathJDK native include directory
-
sources
@Parameter protected NativeSources[] sources
Array of NativeSources containing include directories and source files.
-
compilerOutputDirectory
@Parameter(defaultValue="${project.build.directory}/objs", required=true) protected java.io.File compilerOutputDirectoryCompiler output files ( .o, .obj, etc) location
-
numberOfConcurrentCompilation
@Parameter(defaultValue="1") protected int numberOfConcurrentCompilation
Number of parallel compilation threads
-
manager
@Component private CompilerManager manager
-
config
private CompilerConfiguration config
For unittest only
-
-
Method Detail
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
addJavaHIncludePaths
private void addJavaHIncludePaths()
-
addAdditionalIncludePath
private void addAdditionalIncludePath() throws org.apache.maven.plugin.MojoExecutionExceptionPickup additional source paths that previous phases added to source root Note: we intentionally ignore the first item of source root ( ie ${project.build.directory}/classes since this plugin never use it.- Throws:
org.apache.maven.plugin.MojoExecutionException
-
createProviderConfiguration
protected CompilerConfiguration createProviderConfiguration() throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
getCompilerConfiguration
protected CompilerConfiguration getCompilerConfiguration()
Internal only for test harness purpose
-
-