public class JkProjectCompilation
extends java.lang.Object
JkJavaCompilerToolChain
and JkJavaCompileSpec
to use.Modifier and Type | Field and Description |
---|---|
JkDependencySetModifier |
dependencies |
static java.lang.String |
JAVA_SOURCES_COMPILE_ACTION |
JkCompileLayout |
layout |
JkRunnables |
postCompileActions
The
JkRunnables to be run after compilation. |
JkRunnables |
preCompileActions
The
JkRunnables to run after source and resource generation. |
JkResourceProcessor |
resourceProcessor |
static java.lang.String |
RESOURCES_PROCESS_ACTION |
Modifier and Type | Method and Description |
---|---|
JkProjectCompilation |
addJavaCompilerOptions(java.lang.String... options)
Adds options to be passed to Java compiler
|
JkProjectCompilation |
addSourceGenerator(JkProjectSourceGenerator sourceGenerator)
Adds a source generator responsible for generating source files to the project compilation process.
|
JkProjectCompilation |
addSourceGenerator(java.lang.String generatorName,
java.util.function.BiConsumer<JkProject,java.nio.file.Path> generator)
Adds a source generator responsible for generating source files to the project compilation process.
|
JkProjectCompilation |
addSourceGenerator(java.lang.String generatorName,
java.util.function.Consumer<java.nio.file.Path> generator)
Adds a source generator responsible for generating source files to the project compilation process.
|
JkProjectCompilation |
apply(java.util.function.Consumer<JkProjectCompilation> consumer) |
protected JkDependencySet |
baseDependencies() |
protected JkPathSequence |
classpath() |
void |
generateSources() |
java.util.List<java.lang.String> |
getExtraJavaCompilerOptions()
Returns extra compile options passed to the compiler
|
java.util.List<java.nio.file.Path> |
getGeneratedSourceDirs() |
protected JkCompileLayout |
initialLayout() |
boolean |
isDone() |
protected java.lang.String |
purpose() |
java.util.List<java.nio.file.Path> |
resolveDependenciesAsFiles() |
void |
run()
Performs entire compilation phase.
|
void |
runIfNeeded()
As #run but perform only if not already done.
|
void |
skipJavaCompilation() |
public static final java.lang.String RESOURCES_PROCESS_ACTION
public static final java.lang.String JAVA_SOURCES_COMPILE_ACTION
public final JkRunnables preCompileActions
JkRunnables
to run after source and resource generation. User can chain its own runnable
to customise the process. Contains RESOURCES_PROCESS_ACTION
by defaultpublic final JkRunnables postCompileActions
JkRunnables
to be run after compilation. User can chain its own runnable
to customise the process. Empty by default.public final JkResourceProcessor resourceProcessor
public final JkCompileLayout layout
public final JkDependencySetModifier dependencies
public JkProjectCompilation apply(java.util.function.Consumer<JkProjectCompilation> consumer)
public void generateSources()
public void run()
public void runIfNeeded()
public void skipJavaCompilation()
public java.util.List<java.lang.String> getExtraJavaCompilerOptions()
public JkProjectCompilation addJavaCompilerOptions(java.lang.String... options)
public java.util.List<java.nio.file.Path> resolveDependenciesAsFiles()
public JkProjectCompilation addSourceGenerator(JkProjectSourceGenerator sourceGenerator)
sourceGenerator
- the JkProjectSourceGenerator
instance used for generating sourcesJkProjectCompilation
to allow method chainingpublic JkProjectCompilation addSourceGenerator(java.lang.String generatorName, java.util.function.BiConsumer<JkProject,java.nio.file.Path> generator)
BiConsumer
action that takes a JkProject
and a Path
representing the generated source directory.generatorName
- the name assigned to the source generatorgenerator
- a BiConsumer
defining the generation behavior by taking a JkProject
instance and the directory where sources will be generatedJkProjectCompilation
to allow method chainingpublic JkProjectCompilation addSourceGenerator(java.lang.String generatorName, java.util.function.Consumer<java.nio.file.Path> generator)
generatorName
- the name assigned to the source generatorgenerator
- a Consumer
defining the generation behavior by accepting the directory
where sources will be generatedJkProjectCompilation
to allow method chainingpublic boolean isDone()
public java.util.List<java.nio.file.Path> getGeneratedSourceDirs()
protected JkCompileLayout initialLayout()
protected JkPathSequence classpath()
protected JkDependencySet baseDependencies()
protected java.lang.String purpose()