Package dev.jeka.core.tool.builtins.base
Class BaseKBean
java.lang.Object
dev.jeka.core.tool.KBean
dev.jeka.core.tool.builtins.base.BaseKBean
- All Implemented Interfaces:
JkBuildable.Supplier
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class dev.jeka.core.tool.KBean
KBean.JkDirAgnostic -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringfinal JkConsumers<JkManifest> final JkRunnablesActions to execute whenpack()is invoked. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbuild()buildJar()Builds a JAR file using the provided jarMakervoidcreateJavadocJar(Path target) Creates a Javadoc Jar file at the specified target path.voidcreateMainJar(Path target) Creates a main JAR file at the specified target path.voidcreateSourceJar(Path target) Creates a source JAR file at the specified target path.voiddepTree()Returns aJkPathTreerepresenting the class files and sub-folders contained in the "bin" directory.Returns the application classpath.Returns a List of Path objects representing the libraries used by the application.Returns a JkPathTree representing the application sources.Returns the JkBaseScaffold object associated with this BaseKBean.Returns the path to the JAR file created bybuildJar()method.Returns the base name of the JAR file path created by thebuildJar()method.Returns the actual main class to be used for launching the application or executable JAR.Returns theJkManifestfor the application.Returns the module ID for this object.Returns the version of the application/library.voidinfo()protected voidinit()This method is called by JeKa engine, right after public fields from command-line or properties have been injected.voidpack()Prepares ainvalid input: 'ready to run.'voidrunJar()voidrunMain()voidscaffold()setJarMaker(Consumer<Path> jarMaker) Sets the jarMaker for creating a runnable fat jar.setMainClassFinder(Supplier<String> mainClassFinder) Sets the main class finder for this project.setModuleId(String moduleId) Sets the module ID for this object.setVersion(String version) Sets the version for this BaseKBean.setVersionSupplier(Supplier<JkVersion> versionSupplier) Sets the version supplier for this BaseKBean.voidtest()Methods inherited from class dev.jeka.core.tool.KBean
cleanOutput, find, getBaseDir, getBaseDirName, getBasePath, getOutputDir, getRunbase, load, toString
-
Field Details
-
CREATE_JAR_ACTION
- See Also:
-
jvmOptions
-
programArgs
-
moduleId
-
jarType
-
gitVersioning
-
packActions
Actions to execute whenpack()is invoked.By default, the build action creates a fat jar. It can be replaced by an action creating other jars/artifacts or doing special action as publishing a Docker image, for example.
-
manifestCustomizers
-
-
Constructor Details
-
BaseKBean
public BaseKBean()
-
-
Method Details
-
init
protected void init()Description copied from class:KBeanThis method is called by JeKa engine, right after public fields from command-line or properties have been injected.Put your initialization/configuration code here.
-
runMain
public void runMain() -
test
public void test() -
pack
public void pack() -
build
public void build() -
runJar
public void runJar() -
info
public void info() -
depTree
public void depTree() -
scaffold
public void scaffold() -
buildJar
Builds a JAR file using the provided jarMaker -
getJarPath
Returns the path to the JAR file created bybuildJar()method. -
getJarPathBaseName
Returns the base name of the JAR file path created by thebuildJar()method. -
setJarMaker
Sets the jarMaker for creating a runnable fat jar. -
setVersionSupplier
Sets the version supplier for this BaseKBean. The version represents the version of the application/library. -
setVersion
Sets the version for this BaseKBean. The version represents the version of the application/library. -
getVersion
Returns the version of the application/library. The version might be used in Manifest file, docker image name or Maven publication. -
getModuleId
Returns the module ID for this object. The module ID is used for naming Docker image and in Maven publication. -
setModuleId
Sets the module ID for this object. The module id might be used for naming Docker image and in Maven publication.- Parameters:
moduleId- The module ID formatted as group:name.
-
getMainClass
Returns the actual main class to be used for launching the application or executable JAR. This method returnsnullif no main class has been detected. -
getBaseScaffold
Returns the JkBaseScaffold object associated with this BaseKBean. The JkBaseScaffold provides methods for configuring the project scaffold, such as adding file entries and setting options. -
setMainClassFinder
Sets the main class finder for this project. The main class finder is responsible for providing the name of the main class to use in the project. This can be used for running the project or building Docker images. -
getAppClasspath
Returns the application classpath. This contains class dir + libraries. -
getAppLibs
Returns a List of Path objects representing the libraries used by the application. It contains the classpath minus the class dir. -
getAppClasses
Returns aJkPathTreerepresenting the class files and sub-folders contained in the "bin" directory. The tree includes all files in the root directory and its subdirectories, except for files matching the specified patterns. -
getManifest
Returns theJkManifestfor the application. The manifest includes the created by attribute, the main class attribute, and the build JDK attribute. -
createMainJar
Creates a main JAR file at the specified target path. -
createJavadocJar
Creates a Javadoc Jar file at the specified target path. -
createSourceJar
Creates a source JAR file at the specified target path. -
getAppSources
Returns a JkPathTree representing the application sources. -
prepareRunJar
Prepares ainvalid input: 'ready to run.' -
setMainArtifactJarType
-
asBuildable
- Specified by:
asBuildablein interfaceJkBuildable.Supplier
-