Package org.fusesource.hawtjni.maven
Class GenerateMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.fusesource.hawtjni.maven.GenerateMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
@Mojo(name="generate", defaultPhase=PROCESS_CLASSES) public class GenerateMojo extends org.apache.maven.plugin.AbstractMojoThis goal generates the native source code and a autoconf/msbuild based build system needed to build a JNI library for any HawtJNI annotated classes in your maven project.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<java.lang.String>autogenArgsExtra arguments you want to pass to the autogen.sh command.private booleancallbacksSet this value to false to disable the callback support in HawtJNI.private java.io.FileclassesDirectoryThe directory where the java classes files are located.private CLIcliprivate java.lang.StringcopyrightThe copyright header template that will be added to the generated source files.private java.io.FilecustomPackageDirectoryThe list of additional files to be included in the package will be placed.private java.lang.StringencodingThe text encoding of the files.private booleanforceAutogenShould we force executing the autogen.sh file.private java.io.FilegeneratedNativeSourceDirectoryThe directory where the generated native source files are located.private java.lang.StringnameThe base name of the library, used to determine generated file names.private java.io.FilenativeSourceDirectoryThe directory where the native source files are located.private java.io.FilepackageDirectoryThe directory where the generated build package is located..private java.util.List<java.lang.String>packagesRestrict looking for JNI classes to the specified package.protected org.apache.maven.project.MavenProjectprojectThe maven project.private booleanskipAutogenShould we skip executing the autogen.sh file.private java.io.FiletargetSrcDirprivate booleanverboseShould we display all the native build output?private java.lang.StringwindowsBuildToolThe build tool to use on Windows systems.private booleanwindowsCustomPropsSet this value to true to include the import of a custom properties file in your vcxproj (not applicable to vs2008).private java.lang.StringwindowsPlatformToolsetThe platform toolset version used in your vcxproj (not applicable to vs2008).private java.lang.StringwindowsProjectNameThe name of the msbuild/vcbuild project to use.private java.lang.StringwindowsTargetPlatformVersionThe target platform version used in your vcxproj (not applicable to vs2008).private java.lang.StringwindowsToolsVersionThe tools version used in the header of your vcxproj (not applicable to vs2008).
-
Constructor Summary
Constructors Constructor Description GenerateMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidcopyNativeSourceFiles()private voidcopyTemplateResource(java.lang.String file, boolean filter)private voidcopyTemplateResource(java.lang.String file, java.lang.String output, boolean filter)voidexecute()private org.codehaus.plexus.util.FileUtils.FilterWrapper[]filters(boolean filter)private voidgenerateBuildSystem()private voidgenerateNativeSourceFiles()private java.util.ArrayList<java.lang.String>getClasspath()
-
-
-
Field Detail
-
project
@Parameter(defaultValue="${project}", readonly=true) protected org.apache.maven.project.MavenProject projectThe maven project.
-
nativeSourceDirectory
@Parameter private java.io.File nativeSourceDirectory
The directory where the native source files are located.
-
generatedNativeSourceDirectory
@Parameter(defaultValue="${project.build.directory}/generated-sources/hawtjni/native-src") private java.io.File generatedNativeSourceDirectoryThe directory where the generated native source files are located.
-
name
@Parameter(defaultValue="${project.artifactId}") private java.lang.String nameThe base name of the library, used to determine generated file names.
-
copyright
@Parameter(defaultValue="") private java.lang.String copyright
The copyright header template that will be added to the generated source files. Use the '%END_YEAR%' token to have it replaced with the current year.
-
packages
@Parameter private java.util.List<java.lang.String> packages
Restrict looking for JNI classes to the specified package.
-
classesDirectory
@Parameter(defaultValue="${project.build.outputDirectory}") private java.io.File classesDirectoryThe directory where the java classes files are located.
-
packageDirectory
@Parameter(defaultValue="${project.build.directory}/generated-sources/hawtjni/native-package") private java.io.File packageDirectoryThe directory where the generated build package is located..
-
customPackageDirectory
@Parameter(defaultValue="${basedir}/src/main/native-package") private java.io.File customPackageDirectoryThe list of additional files to be included in the package will be placed.
-
encoding
@Parameter(defaultValue="UTF-8") private java.lang.String encoding
The text encoding of the files.
-
skipAutogen
@Parameter(defaultValue="${skip-autogen}") private boolean skipAutogenShould we skip executing the autogen.sh file.
-
forceAutogen
@Parameter(defaultValue="${force-autogen}") private boolean forceAutogenShould we force executing the autogen.sh file.
-
verbose
@Parameter(defaultValue="${hawtjni-verbose}") private boolean verboseShould we display all the native build output?
-
autogenArgs
@Parameter private java.util.List<java.lang.String> autogenArgs
Extra arguments you want to pass to the autogen.sh command.
-
callbacks
@Parameter(defaultValue="true") private boolean callbacks
Set this value to false to disable the callback support in HawtJNI. Disabling callback support can substantially reduce the size of the generated native library.
-
windowsBuildTool
@Parameter(defaultValue="detect") private java.lang.String windowsBuildTool
The build tool to use on Windows systems. Set to 'msbuild', 'vcbuild', or 'detect' or 'none'
-
windowsProjectName
@Parameter private java.lang.String windowsProjectName
The name of the msbuild/vcbuild project to use. Defaults to 'vs2010' for 'msbuild' and 'vs2008' for 'vcbuild'.
-
windowsCustomProps
@Parameter(defaultValue="false") private boolean windowsCustomProps
Set this value to true to include the import of a custom properties file in your vcxproj (not applicable to vs2008). This greatly simplifies the configurability of your project.
-
windowsToolsVersion
@Parameter(defaultValue="4.0") private java.lang.String windowsToolsVersion
The tools version used in the header of your vcxproj (not applicable to vs2008).
-
windowsTargetPlatformVersion
@Parameter private java.lang.String windowsTargetPlatformVersion
The target platform version used in your vcxproj (not applicable to vs2008). Not supplied by default.
-
windowsPlatformToolset
@Parameter private java.lang.String windowsPlatformToolset
The platform toolset version used in your vcxproj (not applicable to vs2008). Not supplied by default.
-
targetSrcDir
private java.io.File targetSrcDir
-
cli
private CLI cli
-
-
Method Detail
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
copyNativeSourceFiles
private void copyNativeSourceFiles() throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
generateNativeSourceFiles
private void generateNativeSourceFiles() throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
generateBuildSystem
private void generateBuildSystem() throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
getClasspath
private java.util.ArrayList<java.lang.String> getClasspath() throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
copyTemplateResource
private void copyTemplateResource(java.lang.String file, boolean filter) throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
copyTemplateResource
private void copyTemplateResource(java.lang.String file, java.lang.String output, boolean filter) throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
filters
private org.codehaus.plexus.util.FileUtils.FilterWrapper[] filters(boolean filter) throws java.io.IOException- Throws:
java.io.IOException
-
-