public interface ProjectOperations
Provides various operations which typically would require the Project or ProjectLayout instances to resolve.
| Type Params | Return Type | Name and description |
|---|---|---|
|
public Provider<ProjectOperations> |
asProvider()A provider to this instance. |
|
public boolean |
atConfigurationTime()Value that can be read safely at configuration time |
|
public Provider<File> |
buildDirDescendant(Object stringy)Safely resolve the stringy item as a path relative to the build directory. |
|
public ReadableResource |
bzip2Resource(Object file)Creates resource that points to a bzip2 compressed file at the given path. |
|
public CopySpec |
copySpec()Creates an empty CopySpec. |
|
public CopySpec |
copySpec(Action<? super CopySpec> action)Creates a CopySpec which can later be used to copy files or create an archive. |
|
public static ProjectOperations |
create(Project project)Creates a reference to ProjectOperations instance. |
|
public WorkResult |
delete(Action<? super DeleteSpec> action)Deletes the specified files. |
|
public Provider<String> |
environmentVariable(Object name)Creates a provider to an environmental variable. |
|
public Provider<String> |
environmentVariable(Object name, boolean configurationTimeSafety)Creates a provider to an environmental variable. |
|
public ExecResult |
exec(Action<? super ExecSpec> action)Executes the specified external process. |
|
public ConfigurableFileTree |
fileTree(Object base)Creates a new ConfigurableFileTree. |
|
public static ProjectOperations |
find(Project project)Attempts to find the extension. |
|
public Provider<File> |
getBuildDir()Provider for the build directory. |
|
public ConfigurationTools |
getConfigurations()Tools to deal with Gradle configurations. |
|
public ConsoleOutput |
getConsoleOutput()Console output mode |
|
public ExecTools |
getExecTools()Tools to deal with out-of-process, non-JVM, executables. |
|
public FileSystemOperations |
getFsOperations()Returns an object instance for filesystem operations that deals coprrectly with the functionality of the curretn Gradle version. |
|
public String |
getFullProjectPath()Get the full project path including the root project name in case of a multi-project. |
|
public Provider<File> |
getGradleHomeDir()Gradle distribution home directory. |
|
public LogLevel |
getGradleLogLevel()Get the minimum log level for Gradle. |
|
public Provider<File> |
getGradleUserHomeDir()Gradle user home directory. |
|
public Provider<String> |
getGroupProvider()Lazy-evaluated project group. |
|
public JvmTools |
getJvmTools()Tools for dealing for JVM/Java operations. |
|
public File |
getProjectCacheDir()Returns the project cache directory for the given project. |
|
public File |
getProjectDir()Returns the project directory. |
|
public String |
getProjectName()The project name |
|
public String |
getProjectPath()Get project path. |
|
public File |
getProjectRootDir()Returns the root directory of the project. |
|
public ProjectTools |
getProjectTools()Tools to deal with project & configuration specifics down to Gradle 4.0. |
|
public ProviderTools |
getProviderTools()Tools to deal with provider down to Gradle 4.0. |
|
public ProviderFactory |
getProviders()A reference to the provider factory. |
|
public RepositoryTools |
getRepositoryTools()Tools for dealing with repositories. |
|
public StringTools |
getStringTools()Tools for dealing with conversions of various objects into string or lists of strings. |
|
public TaskTools |
getTasks()Utilities for working with tasks in a consistent manner across Gradle versions. |
|
public Provider<String> |
getVersionProvider()Lazy-evaluated project version. |
|
public Provider<String> |
gradleProperty(Object name)Creates a provider to a project property. |
|
public Provider<String> |
gradleProperty(Object name, boolean configurationTimeSafety)Creates a provider to a project property. |
|
public ReadableResource |
gzipResource(Object file)Creates resource that points to a gzip compressed file at the given path. |
|
public boolean |
isConfigurationCacheEnabled()Whether configuration cache is enabled for a build. |
|
public boolean |
isOffline()Whether Gradle is operating in offline mode. |
|
public boolean |
isRefreshDependencies()Whether dependencies should be refreshed. |
|
public boolean |
isRerunTasks()Whether tasks should be re-ruin |
|
public boolean |
isRoot()Whether current project is the root project. |
|
public ExecResult |
javaexec(Action<? super JavaExecSpec> action)Executes the specified external java process. |
|
public static ProjectOperations |
maybeCreateExtension(Project project)Creates a grolifant extension if it does not exist. |
<T> |
public Provider<T> |
provider(java.util.concurrent.Callable<? extends T> var1)Returns a provider. |
|
public Provider<String> |
resolveProperty(Object name)Searches by Gradle property, then system property and finally by environment variable using the PropertyResolver convention. |
|
public Provider<String> |
resolveProperty(Object name, boolean configurationTimeSafety)Searches by Gradle property, then system property and finally by environment variable using the PropertyResolver convention. |
|
public Provider<String> |
resolveProperty(Object name, Object defaultValue)Searches by Gradle property, then system property and finally by environment variable using the PropertyResolver convention. |
|
public Provider<String> |
resolveProperty(Object name, Object defaultValue, boolean configurationTimeSafety)Searches by Gradle property, then system property and finally by environment variable using the PropertyResolver convention. |
|
public void |
setVersionProvider(Object newVersion)Sets a new version for a project. |
|
public Provider<String> |
systemProperty(Object name)Creates a provider to a system property. |
|
public Provider<String> |
systemProperty(Object name, boolean configurationTimeSafety)Creates a provider to a system property. |
|
public FileTree |
tarTree(Object tarPath)Returns a TAR tree presentation |
|
public FileTree |
zipTree(Object zipPath)Returns a ZIP tree presentation |
A provider to this instance.
Value that can be read safely at configuration time
As from Gradle 8.0, methods take this as an input, will ignore this value as all providers that can be resolved at configuration-time are available.
Safely resolve the stringy item as a path relative to the build directory.
Shortcut to getFsOperations().FileSystemOperations.buildDirDescendant. Use the latter where possible.
stringy - Any item that can be resolved to a string using
org.ysb33r.grolifant5.core.api.grolifant.StringTools#stringize.Creates resource that points to a bzip2 compressed file at the given path.
file - File evaluated as per getFsOperations().FileSystemOperations.file.Creates a CopySpec which can later be used to copy files or create an archive. The given action is used to configure the CopySpec before it is returned by this method.
action - Action to configure the CopySpecCreates a reference to ProjectOperations instance.
project - Contextual projectDeletes the specified files. The given action is used to configure a DeleteSpec, which is then used to delete the files.
Example:
project.delete {
delete 'somefile'
followSymlinks = true
}
action - Action to configure the DeleteSpecCreates a provider to an environmental variable.
name - Anything convertible to a stringCreates a provider to an environmental variable.
name - Anything convertible to a stringconfigurationTimeSafety - Whether this property can be read safely at configuration time. It is suggested
to just use atConfigurationTime for this parameter. As from Gradle 8.0
this value is ignored.Executes the specified external process.
Creates a new ConfigurableFileTree. The tree will have no base dir specified.
base - Base directory for file tree,Attempts to find the extension.
Do not call this method once the configuration phase has finished.
project - Contextual projectTools to deal with Gradle configurations.
Console output mode
Tools to deal with out-of-process, non-JVM, executables.
Returns an object instance for filesystem operations that deals coprrectly with the functionality of the curretn Gradle version.
Get the full project path including the root project name in case of a multi-project.
Gradle distribution home directory.
Shortcut for getFsOperations().FileSystemOperations.getGradleHomeDir. It is recommended to use the latter, unless this is access directly from a buildscript.
Get the minimum log level for Gradle.
Gradle user home directory. Usually ~/.gradle on non -Windows.
Shortcut for getFsOperations().FileSystemOperations.getGradleUserHomeDir. It is recommended to use the latter, unless this is access directly from a buildscript.
Lazy-evaluated project group.
Tools for dealing for JVM/Java operations.
Returns the project cache directory for the given project.
Shortcut for getFsOperations().FileSystemOperations.getProjectCacheDir. It is recommended to use the latter, unless this is access directly from a buildscript.
null.Returns the project directory.
Shortcut for getFsOperations().FileSystemOperations.getProjectDir. It is recommended to use the latter, unless this is access directly from a buildscript.
The project name
Get project path.
Returns the root directory of the project.
Tools to deal with project & configuration specifics down to Gradle 4.0.
Tools to deal with provider down to Gradle 4.0.
A reference to the provider factory.
Tools for dealing with repositories.
Tools for dealing with conversions of various objects into string or lists of strings.
Utilities for working with tasks in a consistent manner across Gradle versions.
Lazy-evaluated project version.
Creates a provider to a project property.
name - Anything convertible to a stringCreates a provider to a project property.
name - Anything convertible to a stringconfigurationTimeSafety - Whether this property can be read safely at configuration time. It is suggested
to just use atConfigurationTime for this parameter. As from Gradle 8.0
this value is ignored.Creates resource that points to a gzip compressed file at the given path.
file - File evaluated as pergetFsOperations().FileSystemOperations.file.Whether configuration cache is enabled for a build.
true is configuration cache is available and enabled.Whether Gradle is operating in offline mode.
true if offline.Whether dependencies should be refreshed.
true to check dependencies again.Whether tasks should be re-ruin
true if tasks were set to be re-run.Whether current project is the root project.
true is current project is root project.Executes the specified external java process.
Creates a grolifant extension if it does not exist.
project - Contextual projectReturns a provider.
var1 - Anything that adheres to a Callable including Groovy closures or Java lambdas. Searches by Gradle property, then system property and finally by environment variable using the
PropertyResolver convention.
name - Anything convertible to a string Searches by Gradle property, then system property and finally by environment variable using the
PropertyResolver convention.
name - Anything convertible to a stringconfigurationTimeSafety - Whether this property can be read safely at configuration time. It is suggested
to just use atConfigurationTime for this parameter. As from Gradle 8.0
this value is ignored. Searches by Gradle property, then system property and finally by environment variable using the
PropertyResolver convention.
name - Anything convertible to a stringdefaultValue - Default value to return if the property search order does not return any value.
Can be null. Anything convertible to a string. Searches by Gradle property, then system property and finally by environment variable using the
PropertyResolver convention.
Shortcut to getProviderTools().ProviderTools.resolveProperty.
name - Anything convertible to a stringdefaultValue - Default value to return if the property search order does not return any value.
Can be null. Anything convertible to a string.configurationTimeSafety - Whether this property can be read safely at configuration time. It is suggested
to just use atConfigurationTime for this parameter. As from Gradle 8.0
this value is ignored.Sets a new version for a project.
This creates an internal objhect that can safely be evaluated by Gradle's Project.getVersion.
newVersion - Anything that can be converted to a string using
StringTools.Creates a provider to a system property.
Shortcut to getProviderTools().ProviderTools.systemProperty.
name - Anything convertible to a stringCreates a provider to a system property.
Shortcut to getProviderTools().ProviderTools.systemProperty.
name - Anything convertible to a stringconfigurationTimeSafety - Whether this property can be read safely at configuration time. It is suggested
to just use atConfigurationTime for this parameter. As from Gradle 8.0
this value is ignored.Returns a TAR tree presentation
Shortcut for getFsOperations().FileSystemOperations.tarTree. It is recommended to use the latter, unless this is access directly from a buildscript.
tarPath - Path to tar fileReturns a ZIP tree presentation
Shortcut for getFsOperations().FileSystemOperations.zipTree. It is recommended to use the latter, unless this is access directly from a buildscript.
zipPath - Path to zip file