|
Griffon 1.2.0 | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | PROPERTY | CONSTR | METHOD | DETAIL: FIELD | PROPERTY | CONSTR | METHOD |
java.lang.Objectgriffon.util.AbstractBuildSettings
griffon.util.BuildSettings
class BuildSettings extends AbstractBuildSettings
Represents the project paths and other build settings that the user can change when running the Griffon commands. Defaults are provided for all settings, but the user can override those by setting the appropriate system property or specifying a value for it in the BuildConfig.groovy file.
Warning The behaviour is poorly defined if you explicitly set some of the project paths (such as projectWorkDir), but not others. If you set one of them explicitly, set all of them to ensure consistent behaviour.
Field Summary | |
---|---|
static String |
APP_BASE_DIR
The base directory of the application |
static String |
BUILD_LISTENERS
The name of the system property for multiple buildListeners. |
private static String |
GRIFFON_APP
|
private static Logger |
LOG
|
static String |
PLUGINS_DIR
The name of the system property for projectPluginsDir. |
static String |
PROJECT_CLASSES_DIR
The name of the system property for classesDir. |
static String |
PROJECT_DOCS_OUTPUT_DIR
The name of the system property for testReportsDir. |
static String |
PROJECT_RESOURCES_DIR
The name of the system property for resourcesDir. |
static String |
PROJECT_SOURCE_DIR
The name of the system property for sourceDir. |
static String |
PROJECT_TARGET_DIR
The name of the system property for projectTargetDir. |
static String |
PROJECT_TEST_CLASSES_DIR
The name of the system property for testClassesDir. |
static String |
PROJECT_TEST_REPORTS_DIR
The name of the system property for testReportsDir. |
static String |
PROJECT_TEST_RESOURCES_DIR
The name of the system property for testResourcesDir. |
static String |
PROJECT_TEST_SOURCE_DIR
The name of the system property for testSourceDir. |
static String |
PROJECT_WORK_DIR
The name of the system property for projectWorkDir. |
static int |
RESOLUTION_ERROR
|
static int |
RESOLUTION_OK
|
static int |
RESOLUTION_SKIPPED
|
private static PathMatchingResourcePatternResolver |
RESOLVER
|
static String |
WORK_DIR
The name of the system property for griffonWorkDir. |
ArtifactSettings |
artifactSettings
|
private List |
buildDependencies
|
private boolean |
buildListenersSet
|
private boolean |
classesDirSet
|
private List |
compileDependencies
|
private boolean |
defaultBuildDepsAdded
|
private boolean |
defaultCompileDepsAdded
|
private boolean |
defaultRuntimeDepsAdded
|
private boolean |
defaultTestDepsAdded
|
private boolean |
docsOutputDirSet
|
private GroovyClassLoader |
gcl
|
private boolean |
griffonWorkDirSet
|
private List |
internalBuildDependencies
List containing the dependencies required for the build system only |
private List |
internalCompileDependencies
List containing the default (resolved via the dependencyManager) compile-time dependencies of the app as File instances. |
private List |
internalRuntimeDependencies
List containing the default runtime-time dependencies of the app as File instances. |
private List |
internalTestDependencies
List containing the default test-time dependencies of the app as File instances. |
PluginSettings |
pluginSettings
|
private boolean |
projectTargetDirSet
|
private boolean |
projectWorkDirSet
|
private boolean |
readFromCache
|
private Map |
resolveCache
|
private String |
resolveChecksum
|
private boolean |
resourcesDirSet
|
private List |
runtimeDependencies
|
protected boolean |
settingsFileLoaded
|
private boolean |
sourceDirSet
|
private boolean |
sourceEncodingSet
|
private boolean |
testClassesDirSet
|
private List |
testDependencies
|
private boolean |
testReportsDirSet
|
private boolean |
testResourcesDirSet
|
private boolean |
testSourceDirSet
|
private boolean |
verboseCompileSet
|
Fields inherited from class AbstractBuildSettings | |
---|---|
cache, config, flatConfig, projectPluginsDir, projectPluginsDirSet |
Property Summary | |
---|---|
static Closure |
ARTIFACT_FILTER
|
static Pattern |
JAR_PATTERN
|
ResolveReport |
allDependenciesReport
The dependency report for all configurations |
String |
antVersion
|
List |
applicationJars
List of jars provided in the applications 'lib' directory |
File |
baseDir
The base directory for the build, which is normally the root directory of the current project. |
List |
buildListeners
|
ResolveReport |
buildResolveReport
|
File |
classesDir
The location to which Griffon compiles a project's classes. |
ResolveReport |
compileResolveReport
|
String |
compilerDebug
|
String |
compilerSourceLevel
The compiler source level to use |
String |
compilerTargetLevel
The compiler target level to use |
List |
defaultBuildDependencies
|
List |
defaultCompileDependencies
|
boolean |
defaultEnv
|
List |
defaultRuntimeDependencies
|
List |
defaultTestDependencies
|
boolean |
dependenciesExternallyConfigured
Whether the project required build dependencies are externally configured (by Maven for example) or not |
IvyDependencyManager |
dependencyManager
Manages dependencies and dependency resolution in a Griffon application |
File |
docsOutputDir
The location of the documentation output. |
boolean |
enableResolve
Whether to enable resolving dependencies |
String |
griffonEnv
The environment for the current script. |
File |
griffonHome
Location of the Griffon distribution as usually identified by the Griffon_HOME environment variable. |
Closure |
griffonScriptClosure
Implementation of the "griffonScript()" method used in Griffon scripts. |
String |
griffonVersion
The version of Griffon being used for the current script. |
File |
griffonWorkDir
The location of the Griffon working directory where non-project-specific temporary files are stored. |
String |
groovyVersion
|
boolean |
includeJavadoc
whether to include javadoc attachments in a resolve |
Closure |
includePluginScriptClosure
Implementation of the "includePluginScript()" method used in Griffon scripts. |
Closure |
includeScriptClosure
Implementation of the "includeScript()" method used in Griffon scripts. |
boolean |
includeSource
whether to include source attachments in a resolve |
String |
log4jVersion
|
boolean |
modified
Return whether the BuildConfig has been modified |
File |
projectTargetDir
The location of the project target directory where reports, artifacts and so on are output. |
File |
projectWorkDir
The location of the project working directory for project-specific temporary files. |
ConfigObject |
proxySettings
The settings used to establish the HTTP proxy to use for dependency resolution etc. |
File |
proxySettingsFile
The file containing the proxy settings |
Closure |
resolveResourcesClosure
Implementation of the "resolveResources()" method used in Griffon scripts. |
File |
resourcesDir
The location where Griffon keeps temporary copies of a project's resources. |
URLClassLoader |
rootLoader
The root loader for the build. |
ResolveReport |
runtimeResolveReport
|
String |
slf4jVersion
|
File |
sourceDir
The location of the plain source. |
String |
sourceEncoding
Src Encoding |
String |
springVersion
|
Map |
systemProperties
|
File |
testClassesDir
The location to which Griffon compiles a project's test classes. |
File |
testReportsDir
The location of the test reports. |
ResolveReport |
testResolveReport
|
File |
testResourcesDir
The location to which Griffon writes a project's test resources. |
File |
testSourceDir
The location of the test source. |
File |
userHome
Location of the current user's home directory - equivalent to "user.home" system property. |
Constructor Summary | |
BuildSettings()
|
|
BuildSettings(String griffonHome)
|
|
BuildSettings(File griffonHome)
|
|
BuildSettings(File griffonHome, File baseDir)
|
Method Summary | |
---|---|
IvyDependencyManager
|
configureDependencyManager(ConfigObject config)
|
ConfigReader
|
createConfigReader()
|
private File
|
establishBaseDir()
|
private void
|
establishProjectStructure()
|
File
|
getBaseDir()
Returns the current base directory of this project. |
List
|
getBuildDependencies()
List containing the runtime dependencies of the app as File instances. |
Object[]
|
getBuildListeners()
|
List
|
getCompileDependencies()
List containing the compile-time dependencies of the app as File instances. |
Object
|
getConfigValue(String key, Object defaultValue)
|
Object
|
getPropertyValue(String propertyName, Object defaultValue)
|
List
|
getRuntimeDependencies()
List containing the runtime dependencies of the app as File instances. |
List
|
getTestDependencies()
List containing the test-time dependencies of the app as File instances. |
private Object
|
getValueFromSystemOrBuild(String propertyName, Properties props)
|
private Object
|
getValueOf(String propertyName, Properties props, Object defaultValue)
|
File
|
isAddonPlugin()
|
File
|
isArchetypeProject()
|
boolean
|
isGriffonProject()
|
boolean
|
isOfflineMode()
|
File
|
isPluginProject()
|
private def
|
loadBuildPropertiesFromClasspath(Properties buildProps)
|
ConfigObject
|
loadConfig()
Loads the application's BuildConfig.groovy file if it exists and returns the corresponding config object. |
ConfigObject
|
loadConfig(File configFile)
Loads the given configuration file if it exists and returns the corresponding config object. |
ConfigObject
|
loadConfig(ConfigObject config)
|
protected ConfigObject
|
loadSettingsFile()
|
GroovyClassLoader
|
obtainGroovyClassLoader()
|
protected void
|
parseGriffonBuildListeners()
|
Closure
|
pluginDependencyHandler()
|
Closure
|
pluginDependencyHandler(IvyDependencyManager dependencyManager)
|
protected void
|
postLoadConfig()
|
ConfigObject
|
resetConfig()
|
void
|
setBaseDir(File newBaseDir)
|
void
|
setBuildDependencies(List deps)
Sets the runtime dependencies for the project |
void
|
setBuildListeners(def buildListeners)
|
void
|
setClassesDir(File dir)
|
void
|
setCompileDependencies(List deps)
Sets the compile time dependencies for the project |
void
|
setGriffonWorkDir(File dir)
|
void
|
setProjectTargetDir(File dir)
|
void
|
setProjectWorkDir(File dir)
|
void
|
setResourcesDir(File dir)
|
void
|
setRuntimeDependencies(List deps)
Sets the runtime dependencies for the project |
void
|
setSourceDir(File dir)
|
void
|
setSourceEncoding(String encoding)
|
void
|
setTestClassesDir(File dir)
|
void
|
setTestDependencies(List deps)
Sets the test time dependencies for the project |
void
|
setTestReportsDir(File dir)
|
void
|
setTestResourcesDir(File dir)
|
void
|
setTestSourceDir(File dir)
|
protected boolean
|
shouldResolve()
|
void
|
updateDependenciesFor(String conf, List dependencies)
|
Methods inherited from class AbstractBuildSettings | |
---|---|
clearCache, debug, getBaseDir, getConfig, getDefaultAnswerNonInteractive, getProjectPluginsDir, isDebugEnabled, setConfig, setProjectPluginsDir |
Field Detail |
---|
public static final String APP_BASE_DIR
public static final String BUILD_LISTENERS
private static final String GRIFFON_APP
private static final Logger LOG
public static final String PLUGINS_DIR
public static final String PROJECT_CLASSES_DIR
public static final String PROJECT_DOCS_OUTPUT_DIR
public static final String PROJECT_RESOURCES_DIR
public static final String PROJECT_SOURCE_DIR
public static final String PROJECT_TARGET_DIR
public static final String PROJECT_TEST_CLASSES_DIR
public static final String PROJECT_TEST_REPORTS_DIR
public static final String PROJECT_TEST_RESOURCES_DIR
public static final String PROJECT_TEST_SOURCE_DIR
public static final String PROJECT_WORK_DIR
public static final int RESOLUTION_ERROR
public static final int RESOLUTION_OK
public static final int RESOLUTION_SKIPPED
private static final PathMatchingResourcePatternResolver RESOLVER
public static final String WORK_DIR
public final ArtifactSettings artifactSettings
private List buildDependencies
private boolean buildListenersSet
private boolean classesDirSet
private List compileDependencies
private boolean defaultBuildDepsAdded
private boolean defaultCompileDepsAdded
private boolean defaultRuntimeDepsAdded
private boolean defaultTestDepsAdded
private boolean docsOutputDirSet
private GroovyClassLoader gcl
private boolean griffonWorkDirSet
private List internalBuildDependencies
private List internalCompileDependencies
private List internalRuntimeDependencies
private List internalTestDependencies
public final PluginSettings pluginSettings
private boolean projectTargetDirSet
private boolean projectWorkDirSet
private boolean readFromCache
private Map resolveCache
private String resolveChecksum
private boolean resourcesDirSet
private List runtimeDependencies
protected boolean settingsFileLoaded
private boolean sourceDirSet
private boolean sourceEncodingSet
private boolean testClassesDirSet
private List testDependencies
private boolean testReportsDirSet
private boolean testResourcesDirSet
private boolean testSourceDirSet
private boolean verboseCompileSet
Property Detail |
---|
static final Closure ARTIFACT_FILTER
static final Pattern JAR_PATTERN
@Lazy ResolveReport allDependenciesReport
final String antVersion
List applicationJars
File baseDir
List buildListeners
ResolveReport buildResolveReport
File classesDir
ResolveReport compileResolveReport
String compilerDebug
String compilerSourceLevel
String compilerTargetLevel
@Lazy List defaultBuildDependencies
@Lazy List defaultCompileDependencies
boolean defaultEnv
true
if the default environment for a script should be used.
@Lazy List defaultRuntimeDependencies
@Lazy List defaultTestDependencies
boolean dependenciesExternallyConfigured
IvyDependencyManager dependencyManager
File docsOutputDir
boolean enableResolve
String griffonEnv
File griffonHome
null
if Griffon_HOME is not set, for example if a
project uses the Griffon JAR files directly.
Closure griffonScriptClosure
final String griffonVersion
File griffonWorkDir
final String groovyVersion
boolean includeJavadoc
Closure includePluginScriptClosure
Closure includeScriptClosure
boolean includeSource
final String log4jVersion
boolean modified
File projectTargetDir
File projectWorkDir
ConfigObject proxySettings
File proxySettingsFile
Closure resolveResourcesClosure
File resourcesDir
URLClassLoader rootLoader
ResolveReport runtimeResolveReport
final String slf4jVersion
File sourceDir
String sourceEncoding
final String springVersion
final Map systemProperties
File testClassesDir
File testReportsDir
ResolveReport testResolveReport
File testResourcesDir
File testSourceDir
File userHome
Constructor Detail |
---|
BuildSettings()
BuildSettings(String griffonHome)
BuildSettings(File griffonHome)
BuildSettings(File griffonHome, File baseDir)
Method Detail |
---|
IvyDependencyManager configureDependencyManager(ConfigObject config)
ConfigReader createConfigReader()
private File establishBaseDir()
private void establishProjectStructure()
File getBaseDir()
List getBuildDependencies()
Object[] getBuildListeners()
List getCompileDependencies()
Object getConfigValue(String key, Object defaultValue)
Object getPropertyValue(String propertyName, Object defaultValue)
List getRuntimeDependencies()
List getTestDependencies()
private Object getValueFromSystemOrBuild(String propertyName, Properties props)
private Object getValueOf(String propertyName, Properties props, Object defaultValue)
File isAddonPlugin()
File isArchetypeProject()
boolean isGriffonProject()
boolean isOfflineMode()
File isPluginProject()
private def loadBuildPropertiesFromClasspath(Properties buildProps)
ConfigObject loadConfig()
ConfigObject loadConfig(File configFile)
ConfigObject loadConfig(ConfigObject config)
protected ConfigObject loadSettingsFile()
GroovyClassLoader obtainGroovyClassLoader()
protected void parseGriffonBuildListeners()
Closure pluginDependencyHandler()
Closure pluginDependencyHandler(IvyDependencyManager dependencyManager)
protected void postLoadConfig()
ConfigObject resetConfig()
void setBaseDir(File newBaseDir)
Changes the base directory, making sure that everything that depends on it gets refreshed too. If you have have previously loaded a configuration file, you should load it again after calling this method.
Warning This method resets the project paths, so if they have been set manually by the caller, then that information will be lost!
void setBuildDependencies(List deps)
void setBuildListeners(def buildListeners)
void setClassesDir(File dir)
void setCompileDependencies(List deps)
void setGriffonWorkDir(File dir)
void setProjectTargetDir(File dir)
void setProjectWorkDir(File dir)
void setResourcesDir(File dir)
void setRuntimeDependencies(List deps)
void setSourceDir(File dir)
void setSourceEncoding(String encoding)
void setTestClassesDir(File dir)
void setTestDependencies(List deps)
void setTestReportsDir(File dir)
void setTestResourcesDir(File dir)
void setTestSourceDir(File dir)
protected boolean shouldResolve()
void updateDependenciesFor(String conf, List dependencies)
Groovy Documentation