Class AbstractProject
- All Implemented Interfaces:
Project, ResourceProvider
- Direct Known Subclasses:
BootstrapBuild, BootstrapRoot
Project.-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface Project
Project.Properties -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractProject(NamedParameter<?>... params) Base class constructor for all projects. -
Method Summary
Modifier and TypeMethodDescriptioncommandAlias(String name) Define command, seeRootProject.commandAlias(String).dependency(Intent intent, ResourceProvider provider) Dependency.Directory.protected static NamedParameter<Path> Named parameter for specifying the directory.doProvide(ResourceRequest<T> request) Invoked byResourceProviderSpi.provide(ResourceRequest)after checking if the invocation is allowed.booleanGenerator.<T> Tget(PropertyKey property) Returns the.inthashCode()protected static NamedParameter<Path> Hack to passcontext().jdbldDirectory()as named parameter for the directory to the constructor.name()Returns the name of this resource provider.protected static NamedParameter<String> Named parameter for specifying the name.<T extends Resource>
TnewResource(ResourceType<T> type, Object... args) Convenience function to create a new resource.protected static NamedParameter<Class<? extends Project>> Named parameter for specifying the parent project.Parent project.Project.Provide the projects matching the pattern.Providers.Providers.final RootProjectRoot project.set(PropertyKey property, Object value) Sets the.toString()Methods inherited from class AbstractProvider
context, of, rename, vavrStreamMethods inherited from interface Project
buildDirectory, dependency, generator, providers, readString, relativizeMethods inherited from interface ResourceProvider
context, of, of, resources
-
Constructor Details
-
AbstractProject
Base class constructor for all projects. The behavior depends on whether the project is a root project (implements
RootProject) or a subproject and on whether the project specifies a parent project.RootProjects must invoke this constructor with a null parent project class.A sub project that wants to specify a parent project must invoke this constructor with the parent project's class. If a sub project does not specify a parent project, the root project is used as parent. In both cases, the constructor adds a
Intent.Forwarddependency between the parent project and the new project. This can then be overridden in the sub project's constructor.- Parameters:
params-the named parameters
-
parent - the class of the parent project
-
name - the name of the project. If not provided the name is set to the (simple) class name
-
directory - the directory of the project. If not provided, the directory is set to the name with uppercase letters converted to lowercase for subprojects.
If a project implements
MergedTestProjectand does not specify a directory, its directory is set to the parent project's directory.For root projects the directory is always set to the current working directory.
-
-
-
Method Details
-
parent
-
name
Named parameter for specifying the name.- Parameters:
name- the name- Returns:
- the named parameter
-
directory
Named parameter for specifying the directory.- Parameters:
directory- the directory- Returns:
- the named parameter
-
jdbldDirectory
Hack to passcontext().jdbldDirectory()as named parameter for the directory to the constructor. This is required because you cannot "refer to an instance method while explicitly invoking a constructor".- Returns:
- the named parameter
-
rootProject
Root project.- Specified by:
rootProjectin interfaceProject- Returns:
- the root project
-
project
-
parentProject
Parent project.- Specified by:
parentProjectin interfaceProject- Returns:
- the optional
-
name
Description copied from interface:ResourceProviderReturns the name of this resource provider.- Specified by:
namein interfaceResourceProvider- Overrides:
namein classAbstractProvider- Returns:
- the string
-
directory
-
generator
-
dependency
Dependency.- Specified by:
dependencyin interfaceProject- Parameters:
intent- the intentprovider- the provider- Returns:
- the project
- See Also:
-
providers
Providers. -
providers
-
get
Returns the. -
set
Sets the. -
doProvide
Description copied from class:AbstractProviderInvoked byResourceProviderSpi.provide(ResourceRequest)after checking if the invocation is allowed.- Specified by:
doProvidein classAbstractProvider- Type Parameters:
T- the generic type- Parameters:
request- the requested- Returns:
- the stream
-
newResource
Description copied from class:AbstractProviderConvenience function to create a new resource. Short for invokingResourceFactory.create(ResourceType, Project, Object...)with the requested resource type,nullfor the project and the remaining given arguments appended.- Specified by:
newResourcein interfaceProject- Overrides:
newResourcein classAbstractProvider- Type Parameters:
T- the resource type- Parameters:
type- the typeargs- the arguments- Returns:
- the resource
-
commandAlias
Define command, seeRootProject.commandAlias(String).- Parameters:
name- the name- Returns:
- the root project
-
projects
-
hashCode
-
equals
-
toString
- Overrides:
toStringin classAbstractProvider
-