TSelf - this typepublic abstract class BaseProject<TSelf extends BaseProject<TSelf>> extends Object implements ProjectContext
BasicProject| Constructor and Description |
|---|
BaseProject() |
| Modifier and Type | Method and Description |
|---|---|
protected <T> TSelf |
configure(T object,
TryConsumer<? super T,IOException> configurator)
Configures the given object.
|
Map<String,String> |
environment()
Returns the environment variables.
|
String |
environment(String name)
Returns the environment variable.
|
protected Bundle |
getBundle(Path path)
Returns a project related bundle.
|
CommandLauncher |
getCommandLauncher()
Returns a command launcher of this context.
|
Bundle |
getContents()
Returns the project bundle.
|
protected abstract Path |
getDirectory()
Returns the project directory.
|
TSelf |
gradle(String... tasks)
Launches Gradle tasks.
|
TSelf |
gradle(TryConsumer<? super GradleAdapter,IOException> configurator)
Proceeds Gradle actions on this project.
|
Map<String,String> |
properties()
Returns the system properties.
|
String |
property(String key)
Returns the system property.
|
protected TSelf |
self()
Returns this object.
|
TSelf |
with(Consumer<? super TSelf> configurator)
Configures this project.
|
TSelf |
withContents(TryConsumer<? super Bundle,IOException> configurator)
Returns the project bundle.
|
TSelf |
withEnvironment(Consumer<? super Map<String,String>> configurator)
Sets the environment variables.
|
TSelf |
withEnvironment(String name,
String value)
Puts an environment variable.
|
TSelf |
withProperties(Consumer<? super Map<String,String>> configurator)
Sets the system properties.
|
TSelf |
withProperty(String name,
String value)
Puts an system property.
|
protected TSelf self()
public Map<String,String> environment()
ProjectContextenvironment in interface ProjectContextpublic Map<String,String> properties()
ProjectContextproperties in interface ProjectContextpublic String environment(String name)
ProjectContextenvironment in interface ProjectContextname - the variable namenull if it is not definedpublic String property(String key)
ProjectContextproperty in interface ProjectContextkey - the property keynull if it is not definedprotected abstract Path getDirectory()
public CommandLauncher getCommandLauncher()
ProjectContextgetCommandLauncher in interface ProjectContextpublic TSelf with(Consumer<? super TSelf> configurator)
configurator - the configuratorpublic TSelf withEnvironment(String name, String value)
name - the variable namevalue - the variable value (nullable)public TSelf withEnvironment(Consumer<? super Map<String,String>> configurator)
configurator - the configuratorpublic TSelf withProperty(String name, String value)
name - the variable namevalue - the variable value (nullable)public TSelf withProperties(Consumer<? super Map<String,String>> configurator)
configurator - the configuratorpublic Bundle getContents()
public TSelf withContents(TryConsumer<? super Bundle,IOException> configurator)
configurator - the project configuratorpublic TSelf gradle(String... tasks)
tasks - the task namesgradle(TryConsumer)public TSelf gradle(TryConsumer<? super GradleAdapter,IOException> configurator)
configurator - the Gradle action configuratorgradle(String...)protected Bundle getBundle(Path path)
path - the bundle pathprotected <T> TSelf configure(T object, TryConsumer<? super T,IOException> configurator)
T - the object typeobject - the target objectconfigurator - the object configuratorCopyright © 2011–2019 Asakusa Framework Team. All rights reserved.