Package org.bytedeco.javacpp.tools
Class Builder
java.lang.Object
org.bytedeco.javacpp.tools.Builder
The Builder is responsible for coordinating efforts between the Parser, the
Generator, and the native compiler. It contains the main() method, and basically
takes care of the tasks one would expect from a command line build tool, but
can also be used programmatically by setting its properties and calling build().
- Author:
- Samuel Audet
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddProperty(String key, String... values) Adds values to a given property key, seperating them with "platform.path.separator".File[]build()Starts the build process and returns an array ofFileproduced.buildCommand(String[] buildCommand) Sets thebuildCommandfield to the argument.classesOrPackages(String... classesOrPackages) Requests theclassScannerto add a class or all classes from a package.classPaths(String classPaths) Splits argument withFile.pathSeparatorand appends result to paths of theclassScanner.classPaths(String... classPaths) Appends argument to the paths of theclassScanner.clean(boolean clean) Sets thecleanfield to the argument.commandExecutor(CommandExecutor commandExecutor) Sets thecommandExecutorfield to the argument.compile(boolean compile) Sets thecompilefield to the argument.compilerOptions(String... options) Appends arguments to thecompilerOptionsfield.configDirectory(File configDirectory) Sets theconfigDirectoryfield to the argument.configDirectory(String configDirectory) Sets theconfigDirectoryfield to the argument.copyLibs(boolean copyLibs) Sets thecopyLibsfield to the argument.copyResources(boolean copyResources) Sets thecopyResourcesfield to the argument.deleteJniFiles(boolean deleteJniFiles) Sets thedeleteJniFilesfield to the argument.Sets theencodingfield to the argument.environmentVariables(Map<String, String> environmentVariables) Sets theenvironmentVariablesfield to the argument.generate(boolean generate) Sets thegeneratefield to the argument.Returnsproperties.getProperty(String key) Returnsproperties.getProperty(key).header(boolean header) Sets theheaderfield to the argument.Sets thejarPrefixfield to the argument.static voidThe terminal shell interface to the Builder.outputDirectory(File outputDirectory) Sets theoutputDirectoryfield to the argument.outputDirectory(String outputDirectory) Sets theoutputDirectoryfield to the argument.outputName(String outputName) Sets theoutputNamefield to the argument.static voidSimply prints out to the display the command line usage.properties(String platform) Sets thepropertiesfield to the ones loaded from resources for the specified platform.properties(Properties properties) Adds all the properties of the argument to thepropertiesfield.Sets a property of thepropertiesfield, in either "key=value" or "key:value" format.Sets a key/value pair property of thepropertiesfield.propertyFile(File propertyFile) Sets thepropertiesfield to the ones loaded from the specified file.propertyFile(String filename) Sets thepropertiesfield to the ones loaded from the specified file.workingDirectory(File workingDirectory) Sets theworkingDirectoryfield to the argument.workingDirectory(String workingDirectory) Sets theworkingDirectoryfield to the argument.
-
Constructor Details
-
Builder
public Builder()Default constructor that simply initializes everything. -
Builder
Constructor that simply initializes everything.- Parameters:
logger- where to send messages
-
-
Method Details
-
classPaths
Splits argument withFile.pathSeparatorand appends result to paths of theclassScanner. -
classPaths
Appends argument to the paths of theclassScanner. -
encoding
Sets theencodingfield to the argument. -
outputDirectory
Sets theoutputDirectoryfield to the argument. -
outputDirectory
Sets theoutputDirectoryfield to the argument. -
clean
Sets thecleanfield to the argument. -
generate
Sets thegeneratefield to the argument. -
compile
Sets thecompilefield to the argument. -
deleteJniFiles
Sets thedeleteJniFilesfield to the argument. -
header
Sets theheaderfield to the argument. -
copyLibs
Sets thecopyLibsfield to the argument. -
copyResources
Sets thecopyResourcesfield to the argument. -
outputName
Sets theoutputNamefield to the argument. -
configDirectory
Sets theconfigDirectoryfield to the argument. -
configDirectory
Sets theconfigDirectoryfield to the argument. -
jarPrefix
Sets thejarPrefixfield to the argument. -
properties
Sets thepropertiesfield to the ones loaded from resources for the specified platform. -
properties
Adds all the properties of the argument to thepropertiesfield. -
propertyFile
Sets thepropertiesfield to the ones loaded from the specified file.- Throws:
IOException
-
propertyFile
Sets thepropertiesfield to the ones loaded from the specified file.- Throws:
IOException
-
property
Sets a property of thepropertiesfield, in either "key=value" or "key:value" format. -
property
Sets a key/value pair property of thepropertiesfield. -
getProperties
Returnsproperties. -
getProperty
Returnsproperties.getProperty(key). -
addProperty
Adds values to a given property key, seperating them with "platform.path.separator". -
classesOrPackages
public Builder classesOrPackages(String... classesOrPackages) throws IOException, ClassNotFoundException, NoClassDefFoundError Requests theclassScannerto add a class or all classes from a package. Anullargument indicates the unnamed package. -
buildCommand
Sets thebuildCommandfield to the argument. -
workingDirectory
Sets theworkingDirectoryfield to the argument. -
workingDirectory
Sets theworkingDirectoryfield to the argument. -
environmentVariables
Sets theenvironmentVariablesfield to the argument. -
compilerOptions
Appends arguments to thecompilerOptionsfield. -
commandExecutor
Sets thecommandExecutorfield to the argument. -
build
Starts the build process and returns an array ofFileproduced.- Returns:
- the array of File produced
- Throws:
IOExceptionInterruptedExceptionParserException
-
printHelp
public static void printHelp()Simply prints out to the display the command line usage. -
main
The terminal shell interface to the Builder.- Parameters:
args- an array of arguments as described byprintHelp()- Throws:
Exception
-