public final class JkRunbase
extends java.lang.Object
Each runBase has :
Modifier and Type | Method and Description |
---|---|
<T extends KBean> |
find(java.lang.Class<T> beanClass)
Returns the KBean of the exact specified class, present in this runbase.
|
static JkRunbase |
get(java.nio.file.Path baseDir)
Returns the JkRunbase instance associated with the specified project base directory.
|
java.nio.file.Path |
getBaseDir() |
java.util.List<KBean> |
getBeans()
Returns the list of registered KBeans.
|
JkBuildable |
getBuildable()
Get either a ProjectKBean or a BaseKBean present in this runbase.
|
java.lang.Class<? extends KBean> |
getBuildableKBeanClass() |
JkRunbase |
getChildRunbase(java.lang.String name) |
java.util.List<JkRunbase> |
getChildRunbases() |
JkPathSequence |
getClasspath()
Returns the classpath used to compile jeka-src.
|
JkDependencyResolver |
getDependencyResolver()
Returns the dependency resolver used to fetch 3rd party build dependencies.
|
JkPathSequence |
getExportedClasspath()
Returns the exported classpath used by the JkRunbase instance.
|
JkDependencySet |
getExportedDependencies()
Returns the exported dependencies of the JkRunbase instance.
|
JkDependencySet |
getFullDependencies()
Returns the complete dependencies of the JkRunbase instance.
|
JkPathSequence |
getImportBaseDirs()
Returns root path of imported projects.
|
JkProperties |
getProperties()
Returns the JkProperties object associated with the current instance of JkRunBase.
|
<T extends KBean> |
load(java.lang.Class<T> beanClass)
Instantiates the specified KBean into the current runbase, if it is not already present.
|
<T extends KBean> |
loadChildren(java.lang.Class<T> beanClass) |
void |
registerCLeanAction(java.lang.String name,
java.lang.Runnable runnable)
Register extra file-system clean action to run when --clean option is specified.
|
java.lang.String |
toString() |
public static JkRunbase get(java.nio.file.Path baseDir)
public JkDependencyResolver getDependencyResolver()
public JkPathSequence getClasspath()
public JkPathSequence getExportedClasspath()
The exported classpath is the classpath minus 'private' dependencies. Private dependencies
are declared using @JkDep
in a class that is in package with root
folder name stating with _
.
public JkDependencySet getExportedDependencies()
The exported dependencies is the dependencies minus 'private' dependencies. Private dependencies
are declared using @JkDep
in a class that is in package with root
folder name stating with _
.
public JkDependencySet getFullDependencies()
public JkPathSequence getImportBaseDirs()
public <T extends KBean> java.util.Optional<T> find(java.lang.Class<T> beanClass)
public <T extends KBean> T load(java.lang.Class<T> beanClass)
Since KBeans are singletons within a runbase, calling this method has no effect if the bean is already loaded.
beanClass
- The class of the KBean to load.public java.util.List<KBean> getBeans()
load(Class)
is invoked.public java.util.List<JkRunbase> getChildRunbases()
public JkRunbase getChildRunbase(java.lang.String name)
public <T extends KBean> java.util.List<T> loadChildren(java.lang.Class<T> beanClass)
public JkProperties getProperties()
public java.nio.file.Path getBaseDir()
public JkBuildable getBuildable()
This methods never returns null
, if no such KBean is present in the runbase
a ProjectKBean is created if the presence of *src* dir is detected, otherwise it returns
a BaseKBean instance.
public java.lang.Class<? extends KBean> getBuildableKBeanClass()
public void registerCLeanAction(java.lang.String name, java.lang.Runnable runnable)
name
- runnable
- public java.lang.String toString()
toString
in class java.lang.Object