Package org.bytedeco.javacpp.tools
Class BuildMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.bytedeco.javacpp.tools.BuildMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
ParseMojo
@Mojo(name="build",
defaultPhase=PROCESS_CLASSES,
threadSafe=true)
public class BuildMojo
extends org.apache.maven.plugin.AbstractMojo
A Maven Mojo to call the
Builder
(C++ header file -> Java class -> C++ JNI -> native library).
Can also be considered as an example of how to use the Builder programmatically.-
Field Summary
FieldsModifier and TypeFieldDescription(package private) String[]
Execute a build command instead of JavaCPP itself, and return.(package private) String
Add the path to the "platform.buildpath" property.(package private) String[]
Add the paths to the "platform.buildpath" property.(package private) String
Add the path to the "platform.buildresource" property.(package private) String[]
Add the paths to the "platform.buildresource" property.(package private) String
Process only this class or package (suffixed with .* or .**).(package private) String[]
Process only these classes or packages (suffixed with .* or .**).(package private) String
Load user classes from classPath.(package private) String[]
Load user classes from classPaths.(package private) boolean
Delete all files fromoutputDirectory
before generating anything in it.(package private) boolean
Compile and delete the generated .cpp files.(package private) String[]
Pass compilerOptions directly to compiler.(package private) String
Also create config files for GraalVM native-image in directory.(package private) boolean
Copy to output directory dependent libraries (link and preload).(package private) boolean
Copy to output directory resources listed in properties.(package private) boolean
Delete generated C++ JNI files after compilation(package private) String
Specify the character encoding used for input and output.Add environment variables to the compiler subprocess.(package private) String
Add the path to the "platform.executablepath" property.(package private) String[]
Add the paths to the "platform.executablepath" property.(package private) boolean
Generate .cpp files from Java interfaces if found, parsing from header files if not.(package private) boolean
Generate header file with declarations of callbacks functions.(package private) String
Add the path to the "platform.includepath" property.(package private) String[]
Add the paths to the "platform.includepath" property.(package private) String
Add the path to the "platform.includeresource" property.(package private) String[]
Add the paths to the "platform.includeresource" property.(package private) String
Also create a JAR file named<jarPrefix>-<platform>.jar
.(package private) String
Add the path to the "platform.linkpath" property.(package private) String[]
Add the paths to the "platform.linkpath" property.(package private) String
Add the path to the "platform.linkresource" property.(package private) String[]
Add the paths to the "platform.linkresource" property.(package private) File
Output all generated files to outputDirectory.(package private) String
Output everything in a file named after given outputName.(package private) org.apache.maven.plugin.descriptor.PluginDescriptor
(package private) String
Add the path to the "platform.preloadpath" property.(package private) String[]
Add the paths to the "platform.preloadpath" property.(package private) String
Add the path to the "platform.preloadresource" property.(package private) String[]
Add the paths to the "platform.preloadresource" property.(package private) org.apache.maven.project.MavenProject
(package private) String
Load all properties from resource.(package private) File
Load all properties from file.(package private) Properties
Set property keys to values.(package private) String
Add the path to the "platform.resourcepath" property.(package private) String[]
Add the paths to the "platform.resourcepath" property.(package private) boolean
Skip the execution.(package private) String[]
Add to Maven project source directory of Java files generated by buildCommand.(package private) String
Add to Maven project source directory of Java files generated by buildCommand.(package private) File
Set the working directory of the build subprocess.Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
classPath
@Parameter(property="javacpp.classPath", defaultValue="${project.build.outputDirectory}") String classPathLoad user classes from classPath. -
classPaths
Load user classes from classPaths. -
includePath
Add the path to the "platform.includepath" property. -
includePaths
Add the paths to the "platform.includepath" property. -
includeResource
Add the path to the "platform.includeresource" property. -
includeResources
Add the paths to the "platform.includeresource" property. -
buildPath
Add the path to the "platform.buildpath" property. -
buildPaths
Add the paths to the "platform.buildpath" property. -
buildResource
Add the path to the "platform.buildresource" property. -
buildResources
Add the paths to the "platform.buildresource" property. -
linkPath
Add the path to the "platform.linkpath" property. -
linkPaths
Add the paths to the "platform.linkpath" property. -
linkResource
Add the path to the "platform.linkresource" property. -
linkResources
Add the paths to the "platform.linkresource" property. -
preloadPath
Add the path to the "platform.preloadpath" property. -
preloadPaths
Add the paths to the "platform.preloadpath" property. -
preloadResource
Add the path to the "platform.preloadresource" property. -
preloadResources
Add the paths to the "platform.preloadresource" property. -
resourcePath
Add the path to the "platform.resourcepath" property. -
resourcePaths
Add the paths to the "platform.resourcepath" property. -
executablePath
Add the path to the "platform.executablepath" property. -
executablePaths
Add the paths to the "platform.executablepath" property. -
encoding
Specify the character encoding used for input and output. -
outputDirectory
Output all generated files to outputDirectory. -
outputName
Output everything in a file named after given outputName. -
clean
@Parameter(property="javacpp.clean", defaultValue="false") boolean cleanDelete all files fromoutputDirectory
before generating anything in it. -
generate
@Parameter(property="javacpp.generate", defaultValue="true") boolean generateGenerate .cpp files from Java interfaces if found, parsing from header files if not. -
compile
@Parameter(property="javacpp.compile", defaultValue="true") boolean compileCompile and delete the generated .cpp files. -
deleteJniFiles
@Parameter(property="javacpp.deleteJniFiles", defaultValue="true") boolean deleteJniFilesDelete generated C++ JNI files after compilation -
header
@Parameter(property="javacpp.header", defaultValue="false") boolean headerGenerate header file with declarations of callbacks functions. -
copyLibs
@Parameter(property="javacpp.copyLibs", defaultValue="false") boolean copyLibsCopy to output directory dependent libraries (link and preload). -
copyResources
@Parameter(property="javacpp.copyResources", defaultValue="false") boolean copyResourcesCopy to output directory resources listed in properties. -
configDirectory
Also create config files for GraalVM native-image in directory. -
jarPrefix
Also create a JAR file named<jarPrefix>-<platform>.jar
. -
properties
Load all properties from resource. -
propertyFile
Load all properties from file. -
propertyKeysAndValues
Set property keys to values. -
classOrPackageName
Process only this class or package (suffixed with .* or .**). -
classOrPackageNames
Process only these classes or packages (suffixed with .* or .**). -
buildCommand
Execute a build command instead of JavaCPP itself, and return. -
targetDirectory
Add to Maven project source directory of Java files generated by buildCommand. -
targetDirectories
Add to Maven project source directory of Java files generated by buildCommand. -
workingDirectory
Set the working directory of the build subprocess. -
environmentVariables
Add environment variables to the compiler subprocess. -
compilerOptions
Pass compilerOptions directly to compiler. -
skip
@Parameter(property="javacpp.skip", defaultValue="false") boolean skipSkip the execution. -
project
@Parameter(defaultValue="${project}", required=true, readonly=true) org.apache.maven.project.MavenProject project -
plugin
@Parameter(defaultValue="${plugin}", required=true, readonly=true) org.apache.maven.plugin.descriptor.PluginDescriptor plugin
-
-
Constructor Details
-
BuildMojo
public BuildMojo()
-
-
Method Details
-
merge
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-