- All Implemented Interfaces:
Artifact
The Artifact
representing the project to build.
A proper implementation must provide project information like group, name and version as well as the paths to project resources such as project's classes, working folder uded for intermediary build resources and a target folder where project's deliverables are generated.
Build tasks execution is hierarchical, some tasks depends on the others, consistent sequences of build tasks are fluently created from the Project
. For instance, the following shows how to
package an application:
Project project = ...
project
.modularizeDependencies() // Modularize project's dependencies
.buildJmod() // Build the project's module JMOD
.buildRuntime() // Create the project's runtime
.packageApplication() // Create the project's application package (image + .deb)
.types(Set.of(PackageType.DEB))
.archive() // Archive the project's application package (.zip)
.formats(Set.of("zip"))
.execute();
Note that build tasks does not operate on project sources but on compiled sources and packaged dependencies (JAR) which results from external build tools execution (e.g. Maven, Gradle...) for
which specific Project
implementations shall be provided.
- Since:
- 1.4
- Author:
- Jeremy Kuhn
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
System property to set to display or not the progress bar while executing the build tasks. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract Path
Returns the path to the classes directory which contains project module.class
files.abstract Set
<? extends Dependency> Returns project module dependencies.Returns the final name to use when generating project deliverables.Returns the target path where project deliverables are generated.the working path where intermediate build states are generated.Creates a modularize dependencies task.modularizeDependencies
(Consumer<ModularizeDependenciesTask> configurer) Creates and configure a modularize dependencies task.final StopTask
stop()
Creates a stop task.final StopTask
Creates and configures a stop task.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.inverno.tool.buildtools.Artifact
getGroup, getName, getVersion
-
Field Details
-
PROPERY_DISPLAY_PROGRESS_BAR
System property to set to display or not the progress bar while executing the build tasks.- See Also:
-
-
Constructor Details
-
Project
Creates a project.
- Parameters:
targetPath
- the target path where project deliverables are generatedworkingPath
- the working path used to generate intermediate build states, default totargetPath
if null
-
-
Method Details
-
getClassesPath
Returns the path to the classes directory which contains project module
.class
files.- Returns:
- the path to the project module classes
-
getDependencies
Returns project module dependencies.
- Returns:
- a set of dependency modules
-
getTargetPath
Returns the target path where project deliverables are generated.
- Returns:
- the target path
-
getWorkingPath
the working path where intermediate build states are generated.
- Returns:
- the working path
-
getFinalName
Returns the final name to use when generating project deliverables.
Defaults to
Artifact.getName()
-Artifact.getVersion()
- Returns:
- the final name of the project
-
modularizeDependencies
Creates a modularize dependencies task.
- Returns:
- a modularized dependencies task
-
modularizeDependencies
public final ModularizeDependenciesTask modularizeDependencies(Consumer<ModularizeDependenciesTask> configurer) Creates and configure a modularize dependencies task.
- Parameters:
configurer
- a configurer- Returns:
- a configured modularized dependencies task
-
stop
Creates a stop task.
- Returns:
- a stop task
-
stop
Creates and configures a stop task.
- Parameters:
configurer
- a configurer- Returns:
- a configured stop task
-