@Mojo(name="build", defaultPhase=PROCESS_CLASSES, threadSafe=true) 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[] |
buildCommand
Execute a build command instead of JavaCPP itself, and return.
|
(package private) String |
buildPath
Add the path to the "platform.buildpath" property.
|
(package private) String[] |
buildPaths
Add the paths to the "platform.buildpath" property.
|
(package private) String |
buildResource
Add the path to the "platform.buildresource" property.
|
(package private) String[] |
buildResources
Add the paths to the "platform.buildresource" property.
|
(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 |
clean
Delete all files from
outputDirectory before generating anything in it. |
(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 |
copyResources
Copy to output directory resources listed in properties.
|
(package private) boolean |
deleteJniFiles
Delete generated C++ JNI files after compilation
|
(package private) String |
encoding
Specify the character encoding used for input and output.
|
(package private) Map<String,String> |
environmentVariables
Add environment variables to the compiler subprocess.
|
(package private) String |
executablePath
Add the path to the "platform.executablepath" property.
|
(package private) String[] |
executablePaths
Add the paths to the "platform.executablepath" property.
|
(package private) boolean |
generate
Generate .cpp files from Java interfaces if found, parsing from header files if not.
|
(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 |
includeResource
Add the path to the "platform.includeresource" property.
|
(package private) String[] |
includeResources
Add the paths to the "platform.includeresource" 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) String |
linkResource
Add the path to the "platform.linkresource" property.
|
(package private) String[] |
linkResources
Add the paths to the "platform.linkresource" 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) PluginDescriptor |
plugin |
(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) String |
preloadResource
Add the path to the "platform.preloadresource" property.
|
(package private) String[] |
preloadResources
Add the paths to the "platform.preloadresource" 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) String |
resourcePath
Add the path to the "platform.resourcepath" property.
|
(package private) String[] |
resourcePaths
Add the paths to the "platform.resourcepath" property.
|
(package private) boolean |
skip
Skip the execution.
|
(package private) String[] |
targetDirectories
Add to Maven project source directory of Java files generated by buildCommand.
|
(package private) String |
targetDirectory
Add to Maven project source directory of Java files generated by buildCommand.
|
(package private) File |
workingDirectory
Set the working directory of the build subprocess.
|
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.includeResource") String includeResource
@Parameter(property="javacpp.includeResources") String[] includeResources
@Parameter(property="javacpp.buildPath") String buildPath
@Parameter(property="javacpp.buildPaths") String[] buildPaths
@Parameter(property="javacpp.buildResource") String buildResource
@Parameter(property="javacpp.buildResources") String[] buildResources
@Parameter(property="javacpp.linkPath") String linkPath
@Parameter(property="javacpp.linkPaths") String[] linkPaths
@Parameter(property="javacpp.linkResource") String linkResource
@Parameter(property="javacpp.linkResources") String[] linkResources
@Parameter(property="javacpp.preloadPath") String preloadPath
@Parameter(property="javacpp.preloadPaths") String[] preloadPaths
@Parameter(property="javacpp.preloadResource") String preloadResource
@Parameter(property="javacpp.preloadResources") String[] preloadResources
@Parameter(property="javacpp.resourcePath") String resourcePath
@Parameter(property="javacpp.resourcePaths") String[] resourcePaths
@Parameter(property="javacpp.executablePath") String executablePath
@Parameter(property="javacpp.executablePaths") String[] executablePaths
@Parameter(property="javacpp.encoding") String encoding
@Parameter(property="javacpp.outputDirectory") File outputDirectory
@Parameter(property="javacpp.outputName") String outputName
@Parameter(property="javacpp.clean", defaultValue="false") boolean clean
outputDirectory
before generating anything in it.@Parameter(property="javacpp.generate", defaultValue="true") boolean generate
@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.copyResources", defaultValue="false") boolean copyResources
@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.buildCommand") String[] buildCommand
@Parameter(property="javacpp.targetDirectory") String targetDirectory
@Parameter(property="javacpp.targetDirectories") String[] targetDirectories
@Parameter(property="javacpp.workingDirectory") File workingDirectory
@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
@Parameter(defaultValue="${plugin}", required=true, readonly=true) PluginDescriptor plugin
public void execute() throws MojoExecutionException
MojoExecutionException
Copyright © 2020. All rights reserved.