@Mojo(name="build", defaultPhase=PROCESS_CLASSES) public class BuildMojo extends AbstractMojo
Builder
(C++ header file -> Java class -> C++ JNI -> native library).
Can also be considered as an example of how to use the Builder programmatically.Modifier and Type | Field and Description |
---|---|
(package private) String |
classOrPackageName
Process only this class or package (suffixed with .* or .**).
|
(package private) String[] |
classOrPackageNames
Process only these classes or packages (suffixed with .* or .**).
|
(package private) String |
classPath
Load user classes from classPath.
|
(package private) String[] |
classPaths
Load user classes from classPaths.
|
(package private) boolean |
compile
Compile and delete the generated .cpp files.
|
(package private) String[] |
compilerOptions
Pass compilerOptions directly to compiler.
|
(package private) boolean |
copyLibs
Copy to output directory dependent libraries (link and preload).
|
(package private) boolean |
deleteJniFiles
Delete generated C++ JNI files after compilation
|
(package private) Map<String,String> |
environmentVariables
Add environment variables to the compiler subprocess.
|
(package private) boolean |
header
Generate header file with declarations of callbacks functions.
|
(package private) String |
includePath
Add the path to the "platform.includepath" property.
|
(package private) String[] |
includePaths
Add the paths to the "platform.includepath" property.
|
(package private) String |
jarPrefix
Also create a JAR file named
<jarPrefix>-<platform>.jar . |
(package private) String |
linkPath
Add the path to the "platform.linkpath" property.
|
(package private) String[] |
linkPaths
Add the paths to the "platform.linkpath" property.
|
(package private) File |
outputDirectory
Output all generated files to outputDirectory.
|
(package private) String |
outputName
Output everything in a file named after given outputName.
|
(package private) String |
preloadPath
Add the path to the "platform.preloadpath" property.
|
(package private) String[] |
preloadPaths
Add the paths to the "platform.preloadpath" property.
|
(package private) MavenProject |
project |
(package private) String |
properties
Load all properties from resource.
|
(package private) File |
propertyFile
Load all properties from file.
|
(package private) Properties |
propertyKeysAndValues
Set property keys to values.
|
(package private) boolean |
skip
Skip the execution.
|
Constructor and Description |
---|
BuildMojo() |
Modifier and Type | Method and Description |
---|---|
void |
execute() |
(package private) String[] |
merge(String[] ss,
String s) |
getLog, getPluginContext, setLog, setPluginContext
@Parameter(property="javacpp.classPath", defaultValue="${project.build.outputDirectory}") String classPath
@Parameter(property="javacpp.classPaths") String[] classPaths
@Parameter(property="javacpp.includePath") String includePath
@Parameter(property="javacpp.includePaths") String[] includePaths
@Parameter(property="javacpp.linkPath") String linkPath
@Parameter(property="javacpp.linkPaths") String[] linkPaths
@Parameter(property="javacpp.preloadPath") String preloadPath
@Parameter(property="javacpp.preloadPaths") String[] preloadPaths
@Parameter(property="javacpp.outputDirectory") File outputDirectory
@Parameter(property="javacpp.outputName") String outputName
@Parameter(property="javacpp.compile", defaultValue="true") boolean compile
@Parameter(property="javacpp.deleteJniFiles", defaultValue="true") boolean deleteJniFiles
@Parameter(property="javacpp.header", defaultValue="false") boolean header
@Parameter(property="javacpp.copyLibs", defaultValue="false") boolean copyLibs
@Parameter(property="javacpp.jarPrefix") String jarPrefix
<jarPrefix>-<platform>.jar
.@Parameter(property="javacpp.properties") String properties
@Parameter(property="javacpp.propertyFile") File propertyFile
@Parameter(property="javacpp.propertyKeysAndValues") Properties propertyKeysAndValues
@Parameter(property="javacpp.classOrPackageName") String classOrPackageName
@Parameter(property="javacpp.classOrPackageNames") String[] classOrPackageNames
@Parameter(property="javacpp.environmentVariables") Map<String,String> environmentVariables
@Parameter(property="javacpp.compilerOptions") String[] compilerOptions
@Parameter(property="javacpp.skip", defaultValue="false") boolean skip
@Parameter(defaultValue="${project}", required=true, readonly=true) MavenProject project
public void execute() throws MojoExecutionException
MojoExecutionException
Copyright © 2016. All rights reserved.