public class JkProjectFlatFacade
extends java.lang.Object
JkProject
to access its configuration
through a single entry point.
This class organizes its methods into the following categories for easier exploration,
following a consistent naming convention:
Modifier and Type | Class and Description |
---|---|
class |
JkProjectFlatFacade.JkDependencyFacade |
Modifier and Type | Field and Description |
---|---|
JkProjectFlatFacade.JkDependencyFacade |
dependencies |
Modifier and Type | Method and Description |
---|---|
JkProjectFlatFacade |
addCompileOnlyDeps(java.lang.String coordinate)
Adds compile-only dependencies to the project.
|
JkProjectFlatFacade |
addShadeJarArtifact(java.lang.String classifier) |
JkProjectFlatFacade |
addSourceGenerator(JkProjectSourceGenerator sourceGenerator)
Adds a source generator to the project.
|
JkProjectFlatFacade |
addTestExcludeSuffixIf(boolean condition,
java.lang.String suffix)
By default, every class in test folder are run.
|
JkProjectFlatFacade |
addTestIncludeSuffixIf(boolean condition,
java.lang.String suffix)
By default, every class in test folder are run.
|
JkProjectFlatFacade |
addTestMavenIncludePattern(boolean condition)
Adds a test include filters for test classes named as
^(Test.*|.+[.$]Test.*|.*Tests?)$ . |
JkProjectFlatFacade |
doFastPack()
Same as
doPack() but skips the testing phase. |
JkProjectFlatFacade |
doPack()
Executes the packing process for this project, which includes compiling, testing, and creating JAR files.
|
java.nio.file.Path |
getClassDir()
Returns the directory where compiled classes are stored.
|
java.nio.file.Path |
getMainJar()
Returns the main JAR file produced by the build.
|
JkProject |
getProject()
Returns the project associated with this facade.
|
java.util.List<java.nio.file.Path> |
getRuntimeClasspath()
Returns the classpath used for running the built jar.
|
JkProjectFlatFacade |
removeAllTestIncludePatterns()
Removes all test include patterns, effectively clearing any previously set
test class inclusion filters.
|
JkProjectFlatFacade |
setBaseDir(java.nio.file.Path baseDir)
Sets the base directory for this Project.
|
JkProjectFlatFacade |
setBaseDir(java.lang.String baseDir)
Sets the base directory for this Project by specifying a String representing the
base directory path.
|
JkProjectFlatFacade |
setJvmTargetVersion(JkJavaVersion version)
Sets the Java JVM version that will be used to compile sources and generate bytecode.
|
JkProjectFlatFacade |
setLayoutStyle(JkCompileLayout.Style style)
Sets the layout style for the project's compilation layout.
|
JkProjectFlatFacade |
setMainArtifactJarType(JkProjectPackaging.JarType jarType)
Sets if the project should produce regular or fat jar by default.
|
JkProjectFlatFacade |
setMainClass(java.lang.String mainClass)
Sets the main class name to use in #runXxx and for building docker images.
|
JkProjectFlatFacade |
setMixResourcesAndSources()
The resources will be located in same the dir than the sources.
|
JkProjectFlatFacade |
setModuleId(java.lang.String moduleId) |
JkProjectFlatFacade |
setSourceEncoding(java.lang.String encoding)
Sets the source encoding for the project.
|
JkProjectFlatFacade |
setTestProgressStyle(JkTestProcessor.JkProgressStyle style)
Sets the style for displaying test progress during test execution.
|
JkProjectFlatFacade |
setTestsSkipped(boolean skipped)
Sets whether to skip running tests for the project.
|
JkProjectFlatFacade |
setVersion(java.lang.String version)
Sets the version of the project.
|
JkProjectFlatFacade |
setVersionFromGitTag()
The published version will be computed according the current git tag.
|
JkProjectFlatFacade |
setVersionFromGitTagCommitMessage(java.lang.String suffixKeyword)
The published version will be computed according the last Git commit message.
|
JkProjectFlatFacade |
setVersionSupplier(java.util.function.Supplier<java.lang.String> versionSupplier)
Sets the supplier for computing the project version.
|
public final JkProjectFlatFacade.JkDependencyFacade dependencies
public JkProjectFlatFacade setJvmTargetVersion(JkJavaVersion version)
public JkProjectFlatFacade setMainArtifactJarType(JkProjectPackaging.JarType jarType)
public JkProjectFlatFacade addShadeJarArtifact(java.lang.String classifier)
public JkProjectFlatFacade setSourceEncoding(java.lang.String encoding)
public JkProjectFlatFacade setBaseDir(java.nio.file.Path baseDir)
public JkProjectFlatFacade setBaseDir(java.lang.String baseDir)
public JkProjectFlatFacade setLayoutStyle(JkCompileLayout.Style style)
public JkProjectFlatFacade setMixResourcesAndSources()
public JkProjectFlatFacade setMainClass(java.lang.String mainClass)
"auto"
means that it will e auto-discovered.JkProjectPackaging.setMainClass(String)
public JkProjectFlatFacade addCompileOnlyDeps(java.lang.String coordinate)
coordinate
- the dependency to be added in the format of group:artifactId:versionpublic JkProjectFlatFacade setTestsSkipped(boolean skipped)
public JkProjectFlatFacade setVersionSupplier(java.util.function.Supplier<java.lang.String> versionSupplier)
versionSupplier
- the supplier for computing the project version.public JkProjectFlatFacade setVersion(java.lang.String version)
version
- the version to set for the project.public JkProjectFlatFacade setVersionFromGitTag()
JkGit.getVersionFromTag()
public JkProjectFlatFacade setVersionFromGitTagCommitMessage(java.lang.String suffixKeyword)
public JkProjectFlatFacade setModuleId(java.lang.String moduleId)
moduleId
- group + artifactId to use when publishing on a binary repository.
Must be formatted as 'group:artifactId'public JkProjectFlatFacade addTestExcludeSuffixIf(boolean condition, java.lang.String suffix)
condition
- : the filter will be added only if this parameter is true
.public JkProjectFlatFacade addTestIncludeSuffixIf(boolean condition, java.lang.String suffix)
condition
- : the filter will be added only if this parameter is true
.public JkProjectFlatFacade addTestMavenIncludePattern(boolean condition)
^(Test.*|.+[.$]Test.*|.*Tests?)$
.
This is a standard filter in many tools.addTestIncludeSuffixIf(boolean, String)
public JkProjectFlatFacade removeAllTestIncludePatterns()
public JkProjectFlatFacade setTestProgressStyle(JkTestProcessor.JkProgressStyle style)
public JkProjectFlatFacade addSourceGenerator(JkProjectSourceGenerator sourceGenerator)
public JkProjectFlatFacade doPack()
JkProject.packActions
public JkProjectFlatFacade doFastPack()
doPack()
but skips the testing phase.public JkProject getProject()
public java.nio.file.Path getMainJar()
public java.nio.file.Path getClassDir()
public java.util.List<java.nio.file.Path> getRuntimeClasspath()