|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.gradle.StartParameter
public class StartParameter
StartParameter
defines the configuration used by a GradleLauncher
instance to execute a build. The
properties of StartParameter
generally correspond to the command-line options of Gradle. You pass a StartParameter
instance to GradleLauncher.newInstance(StartParameter)
when you create a new Gradle
instance.
You can obtain an instance of a StartParameter
by either creating a new one, or duplicating an existing
one using newInstance()
or newBuild()
.
GradleLauncher
Nested Class Summary | |
---|---|
static class |
StartParameter.ShowStacktrace
Specifies the detail to include in stacktraces. |
Field Summary | |
---|---|
static File |
DEFAULT_GRADLE_USER_HOME
The default user home directory. |
static String |
GRADLE_USER_HOME_PROPERTY_KEY
|
Constructor Summary | |
---|---|
StartParameter()
Creates a StartParameter with default values. |
Method Summary | |
---|---|
void |
addInitScript(File initScriptFile)
Adds the given file to the list of init scripts that are run before the build starts. |
boolean |
equals(Object obj)
|
org.gradle.execution.BuildExecuter |
getBuildExecuter()
Returns the BuildExecuter to use for the build. |
File |
getBuildFile()
Returns the build file to use to select the default project. |
org.gradle.groovy.scripts.ScriptSource |
getBuildScriptSource()
Returns the ScriptSource to use for the build file for this build. |
CacheUsage |
getCacheUsage()
|
File |
getCurrentDir()
Returns the directory to use to select the default project, and to search for the settings file. |
org.gradle.initialization.ProjectSpec |
getDefaultProjectSelector()
Returns the selector used to choose the default project of the build. |
Set<String> |
getExcludedTaskNames()
Returns the names of the tasks to be excluded from this build. |
File |
getGradleUserHomeDir()
Returns the directory to use as the user home directory. |
List<File> |
getInitScripts()
Returns all explicitly added init scripts that will be run before the build starts. |
LogLevel |
getLogLevel()
|
String |
getProjectCacheDir()
Returns the project's cache dir. |
org.gradle.api.internal.artifacts.ProjectDependenciesBuildInstruction |
getProjectDependenciesBuildInstruction()
|
Map<String,String> |
getProjectProperties()
|
org.gradle.groovy.scripts.ScriptSource |
getSettingsScriptSource()
Returns the ScriptSource to use for the settings script for this build. |
StartParameter.ShowStacktrace |
getShowStacktrace()
|
Map<String,String> |
getSystemPropertiesArgs()
|
List<String> |
getTaskNames()
Returns the names of the tasks to execute in this build. |
int |
hashCode()
|
boolean |
isColorOutput()
Returns true if logging output should be displayed in color when Gradle is running in a terminal which supports color output. |
boolean |
isDryRun()
|
boolean |
isNoOpt()
|
boolean |
isProfile()
Returns true if a profile report will be generated. |
boolean |
isSearchUpwards()
|
StartParameter |
newBuild()
Creates the parameters for a new build, using these parameters as a template. |
StartParameter |
newInstance()
Duplicates this StartParameter instance. |
void |
setBuildExecuter(org.gradle.execution.BuildExecuter buildExecuter)
Sets the BuildExecuter to use for the build. |
void |
setBuildFile(File buildFile)
Sets the build file to use to select the default project. |
StartParameter |
setBuildScriptSource(org.gradle.groovy.scripts.ScriptSource buildScript)
Specifies that the given script should be used as the build file for this build. |
void |
setCacheUsage(CacheUsage cacheUsage)
|
void |
setColorOutput(boolean colorOutput)
Specifies whether logging output should be displayed in color. |
void |
setCurrentDir(File currentDir)
Sets the directory to use to select the default project, and to search for the settings file. |
void |
setDefaultProjectSelector(org.gradle.initialization.ProjectSpec defaultProjectSelector)
Sets the selector used to choose the default project of the build. |
void |
setDryRun(boolean dryRun)
|
void |
setExcludedTaskNames(Collection<String> excludedTaskNames)
Sets the tasks to exclude from this build. |
void |
setGradleUserHomeDir(File gradleUserHomeDir)
Sets the directory to use as the user home directory. |
void |
setInitScripts(List<File> initScripts)
|
void |
setLogLevel(LogLevel logLevel)
|
void |
setNoOpt(boolean noOpt)
|
void |
setProfile(boolean profile)
Specifies if a profile report should be generated. |
void |
setProjectCacheDir(String projectCacheDir)
Sets the project's cache location. |
void |
setProjectDependenciesBuildInstruction(org.gradle.api.internal.artifacts.ProjectDependenciesBuildInstruction projectDependenciesBuildInstruction)
|
void |
setProjectDir(File projectDir)
Sets the project directory to use to select the default project. |
void |
setProjectProperties(Map<String,String> projectProperties)
|
void |
setSearchUpwards(boolean searchUpwards)
|
void |
setSettingsFile(File settingsFile)
Sets the settings file to use for the build. |
void |
setSettingsScriptSource(org.gradle.groovy.scripts.ScriptSource settingsScriptSource)
Sets the ScriptSource to use for the settings script. |
void |
setShowStacktrace(StartParameter.ShowStacktrace showStacktrace)
|
void |
setSystemPropertiesArgs(Map<String,String> systemPropertiesArgs)
|
void |
setTaskNames(Collection<String> taskNames)
Sets the tasks to execute in this build. |
String |
toString()
|
StartParameter |
useEmbeddedBuildFile(String buildScriptText)
Specifies that the given script should be used as the build file for this build. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String GRADLE_USER_HOME_PROPERTY_KEY
public static final File DEFAULT_GRADLE_USER_HOME
Constructor Detail |
---|
public StartParameter()
StartParameter
with default values. This is roughly equivalent to running Gradle on the
command-line with no arguments.
Method Detail |
---|
public void setProjectCacheDir(String projectCacheDir)
projectCacheDir
- public String getProjectCacheDir()
public StartParameter newInstance()
StartParameter
instance.
public StartParameter newBuild()
Creates the parameters for a new build, using these parameters as a template. Copies the environmental properties from this parameter (eg gradle user home dir, etc), but does not copy the build specific properties (eg task names).
public boolean equals(Object obj)
equals
in class Object
public int hashCode()
hashCode
in class Object
public File getBuildFile()
public void setBuildFile(File buildFile)
buildFile
- The build file. May be null.public org.gradle.groovy.scripts.ScriptSource getBuildScriptSource()
Returns the ScriptSource
to use for the build file for this build. Returns null when the default build
file(s) are to be used. This source is used for all projects included in the build.
public org.gradle.groovy.scripts.ScriptSource getSettingsScriptSource()
Returns the ScriptSource
to use for the settings script for this build. Returns null when the default
settings script is to be used.
public void setSettingsScriptSource(org.gradle.groovy.scripts.ScriptSource settingsScriptSource)
Sets the ScriptSource
to use for the settings script. Set to null to use the default settings
script.
settingsScriptSource
- The settings script source.public StartParameter useEmbeddedBuildFile(String buildScriptText)
Specifies that the given script should be used as the build file for this build. Uses an empty settings file.
buildScriptText
- The script to use as the build file.
public StartParameter setBuildScriptSource(org.gradle.groovy.scripts.ScriptSource buildScript)
Specifies that the given script should be used as the build file for this build. Uses an empty settings file.
buildScript
- The script to use as the build file.
public org.gradle.execution.BuildExecuter getBuildExecuter()
Returns the BuildExecuter
to use for the build.
BuildExecuter
. Never returns null.public void setBuildExecuter(org.gradle.execution.BuildExecuter buildExecuter)
Sets the BuildExecuter
to use for the build. You can use the method to change the algorithm used to
execute the build, by providing your own BuildExecuter
implementation.
Set to null to use the default executer. When this property is set to a non-null value, the taskNames and mergedBuild properties are ignored.
buildExecuter
- The executer to use, or null to use the default executer.public List<String> getTaskNames()
public void setTaskNames(Collection<String> taskNames)
Sets the tasks to execute in this build. Set to an empty list, or null, to execute the default tasks for the project. The tasks are executed in the order provided, subject to dependency between the tasks.
taskNames
- the names of the tasks to execute in this build.public Set<String> getExcludedTaskNames()
public void setExcludedTaskNames(Collection<String> excludedTaskNames)
excludedTaskNames
- The task names. Can be null.public File getCurrentDir()
public void setCurrentDir(File currentDir)
currentDir
- The directory. Should not be null.public boolean isSearchUpwards()
public void setSearchUpwards(boolean searchUpwards)
public Map<String,String> getProjectProperties()
public void setProjectProperties(Map<String,String> projectProperties)
public Map<String,String> getSystemPropertiesArgs()
public void setSystemPropertiesArgs(Map<String,String> systemPropertiesArgs)
public File getGradleUserHomeDir()
public void setGradleUserHomeDir(File gradleUserHomeDir)
gradleUserHomeDir
- The home directory. May be null.public org.gradle.api.internal.artifacts.ProjectDependenciesBuildInstruction getProjectDependenciesBuildInstruction()
public void setProjectDependenciesBuildInstruction(org.gradle.api.internal.artifacts.ProjectDependenciesBuildInstruction projectDependenciesBuildInstruction)
public CacheUsage getCacheUsage()
public void setCacheUsage(CacheUsage cacheUsage)
public boolean isDryRun()
public void setDryRun(boolean dryRun)
public boolean isNoOpt()
public void setNoOpt(boolean noOpt)
public void setSettingsFile(File settingsFile)
settingsFile
- The settings file to use. May be null.public void addInitScript(File initScriptFile)
initScriptFile
- The init script to be run during the Gradle invocation.public void setInitScripts(List<File> initScripts)
public List<File> getInitScripts()
public LogLevel getLogLevel()
public void setLogLevel(LogLevel logLevel)
public StartParameter.ShowStacktrace getShowStacktrace()
public void setShowStacktrace(StartParameter.ShowStacktrace showStacktrace)
public org.gradle.initialization.ProjectSpec getDefaultProjectSelector()
public void setDefaultProjectSelector(org.gradle.initialization.ProjectSpec defaultProjectSelector)
defaultProjectSelector
- The selector. Should not be null.public void setProjectDir(File projectDir)
projectDir
- The project directory. May be null.public boolean isColorOutput()
public void setColorOutput(boolean colorOutput)
colorOutput
- true if logging output should be displayed in color.public void setProfile(boolean profile)
profile
- true if a profile report should be generatedpublic boolean isProfile()
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |