Object Factory
@ServiceScope(value = [Global::class, BuildTree::class, Project::class ] )
A factory for creating various kinds of model objects.
An instance of the factory can be injected into a task, plugin or other object by annotating a public constructor or property getter method with javax.inject.Inject. It is also available via getObjects.
Since
4.0
Functions
Link copied to clipboard
Creates a new DirectoryProperty that uses the project directory to resolve relative paths, if required.
Link copied to clipboard
abstract fun <T> domainObjectContainer(elementType: Class<T>, factory: NamedDomainObjectFactory<T>): NamedDomainObjectContainer<T>
Creates a new NamedDomainObjectContainer for managing named objects of the specified type.
Link copied to clipboard
Creates a new DomainObjectSet for managing objects of the specified type.
Link copied to clipboard
Creates a new ConfigurableFileCollection.
Link copied to clipboard
Creates a new RegularFileProperty that uses the project directory to resolve relative paths, if required.
Link copied to clipboard
Creates a new ConfigurableFileTree.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Creates a new NamedDomainObjectList for managing named objects of the specified type.
Link copied to clipboard
Creates a new NamedDomainObjectSet for managing named objects of the specified type.
Link copied to clipboard
Link copied to clipboard
abstract fun <T> polymorphicDomainObjectContainer(elementType: Class<T>): ExtensiblePolymorphicDomainObjectContainer<T>
Creates a new ExtensiblePolymorphicDomainObjectContainer for managing named objects of the specified type.
Link copied to clipboard
Link copied to clipboard
Creates a SourceDirectorySet.