Groovy Documentation

grails.util
[Groovy] Class PluginBuildSettings

java.lang.Object
  grails.util.PluginBuildSettings

class PluginBuildSettings
extends java.lang.Object

Uses the project BuildSettings object to discover information about the installed plugin such as the jar files they provide, the plugin descriptors and so on.

Authors:
Graeme Rocher
Since:
1.2


Field Summary
static java.lang.Object EXCLUDED_RESOURCES

Resources to be excluded from the final packaged plugin.

 
Property Summary
PluginScopeInfo buildScopePluginInfo

BuildSettings buildSettings

PluginScopeInfo compileScopePluginInfo

java.lang.String pluginDirPath

java.lang.Object pluginManager

PluginScopeInfo providedScopePluginInfo

groovy.lang.Closure resourceResolver

A default resolver used if none is specified to the resource resolving methods in this class.

PluginScopeInfo testScopePluginInfo

 
Constructor Summary
PluginBuildSettings(BuildSettings buildSettings)

PluginBuildSettings(BuildSettings buildSettings, java.lang.Object pluginManager)

 
Method Summary
protected java.lang.Object addPluginScopeInfoForDirAndInfo(PluginScopeInfo compileInfo, GrailsPluginInfo info, org.springframework.core.io.Resource dir)

void clearCache()

Clears any cached entries.

org.springframework.core.io.Resource[] getArtefactResources()

Obtains a reference to all artefact resources (all Groovy files contained within the grails-app directory of plugins or applications).

org.springframework.core.io.Resource[] getArtefactResourcesForCurrentEnvironment()

Returns all the artefact resources for the current environment where the environment is to be executed using the embedded container (not WAR deployed)

org.springframework.core.io.Resource[] getArtefactResourcesForOne(java.lang.String projectDir)

Returns an array of all artefacts in the given application or plugin directory as Spring resources.

org.springframework.core.io.Resource[] getAvailableScripts()

Obtains an array of all Gant scripts that are availabe for execution in a Grails application.

org.springframework.core.io.Resource getBasePluginDescriptor()

Obtains the 'base' plugin descriptor, which is the plugin descriptor of the current plugin project.

java.util.List getCompileScopedArtefactResources()

@return A list of plugin infos that are supported and scoped for compile or runtime

java.util.List getCompileScopedSupportedPluginInfos()

@return A list of plugin infos that are supported and scoped for compile or runtime

org.springframework.core.io.Resource getDescriptorForPlugin(org.springframework.core.io.Resource pluginDir)

Returns the descriptor location for the given plugin directory.

java.lang.String getGlobalPluginsPath()

Obtains the path to the global plugins directory.

java.util.List getImplicitPluginDirectories()

Returns a list of all plugin directories in both the given path and the global "plugins" directory together.

org.springframework.core.io.Resource[] getInlinePluginDirectories()

Returns an array of the inplace plugin locations.

groovy.util.slurpersupport.GPathResult getMetadataForPlugin(java.lang.String pluginName)

Returns XML about the plugin.

groovy.util.slurpersupport.GPathResult getMetadataForPlugin(org.springframework.core.io.Resource pluginDir)

Returns XML metadata for the plugin.

java.util.List getPluginBaseDirectories()

Gets a list of all the known plugin base directories (directories where plugins are installed to).

org.springframework.core.io.Resource getPluginDescriptor(org.springframework.core.io.Resource pluginDir)

Returns the plugin descriptor for the Given plugin directory.

org.springframework.core.io.Resource[] getPluginDescriptors()

Obtains an array of all plugin descriptors (the root classes that end with *GrailsPlugin.groovy).

org.springframework.core.io.Resource[] getPluginDescriptorsForCurrentEnvironment()

org.springframework.core.io.Resource getPluginDirForName(java.lang.String pluginName)

Obtains a plugin directory for the given name.

org.springframework.core.io.Resource[] getPluginDirectories()

Obtains a list of plugin directories for the application

org.springframework.core.io.Resource[] getPluginI18nDirectories()

Obtains an array of all plugin i18n directories.

GrailsPluginInfo getPluginInfo(java.lang.String pluginBaseDir)

Obtains a PluginInfo for the installed plugin directory.

GrailsPluginInfo getPluginInfoForName(java.lang.String pluginName)

Obtains a PluginInfo for the installed plugin directory.

GrailsPluginInfo getPluginInfoForSource(java.lang.String sourceFile)

Gets a PluginInfo for a particular source file if its contained within that plugin

GrailsPluginInfo[] getPluginInfos(java.lang.String pluginDirPath = this.pluginDirPath)

Returns an array of PluginInfo objects

org.springframework.core.io.Resource[] getPluginJarFiles()

Obtains an array of all plugin provided JAR files

org.springframework.core.io.Resource[] getPluginLibDirectories()

Obtains an array of all plugin lib directories.

org.springframework.core.io.Resource[] getPluginResourceBundles()

Obtains an array of all plugin provided resource bundles.

org.springframework.core.io.Resource[] getPluginScripts()

.groovy").each { if (!

org.springframework.core.io.Resource[] getPluginSourceDirectories()

Obtains an array of all plugin provided source directories

org.springframework.core.io.Resource[] getPluginSourceDirectories(java.io.File pluginDir)

Gets all the plugin source directories for the given plugin directory

org.springframework.core.io.Resource[] getPluginSourceFiles()

/*.properties") } }

org.springframework.core.io.Resource[] getPluginSourceFiles(java.io.File pluginDir)

@deprecated Use getPluginSourceDirectories

org.springframework.core.io.Resource[] getPluginXmlMetadata()

Obtains a Resource array of the Plugin metadata XML files used to describe the plugins provided resources

GrailsPluginInfo[] getSupportedPluginInfos()

Returns only the PluginInfo objects that support the current Environment and BuildScope.

org.springframework.core.io.Resource[] getUnmanagedPluginJarFiles()

Obtains an array of all plugin provided JAR files for plugins that don't define a dependencies.groovy.

boolean isGlobalPluginLocation(org.springframework.core.io.Resource pluginDir)

Returns true if the specified plugin directory is a global plugin.

boolean isInlinePluginLocation(org.springframework.core.io.Resource pluginLocation)

Returns true if the specified plugin location is an inline location.

java.util.List readMetadataFromZip(java.lang.String zipLocation)

Reads plugin metadata from a plugin zip file and returns a list containing the plugin name, version and XML metadata.

GrailsPluginInfo readPluginInfoFromZip(java.lang.String zipLocation)

Reads plugin info from the zip file location

void registerNewPluginInstall(java.io.File zip)

protected java.lang.Object registerPluginZipWithScope(java.io.File pluginZip, PluginScopeInfo scopeInfo)

 
Methods inherited from class java.lang.Object
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Field Detail

EXCLUDED_RESOURCES

public static final java.lang.Object EXCLUDED_RESOURCES
Resources to be excluded from the final packaged plugin. Defined as Ant paths.


 
Property Detail

buildScopePluginInfo

PluginScopeInfo buildScopePluginInfo


buildSettings

BuildSettings buildSettings


compileScopePluginInfo

PluginScopeInfo compileScopePluginInfo


pluginDirPath

java.lang.String pluginDirPath


pluginManager

java.lang.Object pluginManager


providedScopePluginInfo

PluginScopeInfo providedScopePluginInfo


resourceResolver

groovy.lang.Closure resourceResolver
A default resolver used if none is specified to the resource resolving methods in this class.


testScopePluginInfo

PluginScopeInfo testScopePluginInfo


 
Constructor Detail

PluginBuildSettings

PluginBuildSettings(BuildSettings buildSettings)


PluginBuildSettings

PluginBuildSettings(BuildSettings buildSettings, java.lang.Object pluginManager)


 
Method Detail

addPluginScopeInfoForDirAndInfo

protected java.lang.Object addPluginScopeInfoForDirAndInfo(PluginScopeInfo compileInfo, GrailsPluginInfo info, org.springframework.core.io.Resource dir)


clearCache

void clearCache()
Clears any cached entries.


getArtefactResources

org.springframework.core.io.Resource[] getArtefactResources()
Obtains a reference to all artefact resources (all Groovy files contained within the grails-app directory of plugins or applications).


getArtefactResourcesForCurrentEnvironment

org.springframework.core.io.Resource[] getArtefactResourcesForCurrentEnvironment()
Returns all the artefact resources for the current environment where the environment is to be executed using the embedded container (not WAR deployed)
Returns:
An array of all artefact resources


getArtefactResourcesForOne

org.springframework.core.io.Resource[] getArtefactResourcesForOne(java.lang.String projectDir)
Returns an array of all artefacts in the given application or plugin directory as Spring resources.


getAvailableScripts

org.springframework.core.io.Resource[] getAvailableScripts()
Obtains an array of all Gant scripts that are availabe for execution in a Grails application.


getBasePluginDescriptor

org.springframework.core.io.Resource getBasePluginDescriptor()
Obtains the 'base' plugin descriptor, which is the plugin descriptor of the current plugin project.


getCompileScopedArtefactResources

java.util.List getCompileScopedArtefactResources()
Returns:
A list of plugin infos that are supported and scoped for compile or runtime


getCompileScopedSupportedPluginInfos

java.util.List getCompileScopedSupportedPluginInfos()
Returns:
A list of plugin infos that are supported and scoped for compile or runtime


getDescriptorForPlugin

org.springframework.core.io.Resource getDescriptorForPlugin(org.springframework.core.io.Resource pluginDir)
Returns the descriptor location for the given plugin directory. The descriptor is the Groovy file that ends with *GrailsPlugin.groovy


getGlobalPluginsPath

java.lang.String getGlobalPluginsPath()
Obtains the path to the global plugins directory.


getImplicitPluginDirectories

java.util.List getImplicitPluginDirectories()
Returns a list of all plugin directories in both the given path and the global "plugins" directory together.


getInlinePluginDirectories

org.springframework.core.io.Resource[] getInlinePluginDirectories()
Returns an array of the inplace plugin locations.


getMetadataForPlugin

groovy.util.slurpersupport.GPathResult getMetadataForPlugin(java.lang.String pluginName)
Returns XML about the plugin.


getMetadataForPlugin

groovy.util.slurpersupport.GPathResult getMetadataForPlugin(org.springframework.core.io.Resource pluginDir)
Returns XML metadata for the plugin.


getPluginBaseDirectories

java.util.List getPluginBaseDirectories()
Gets a list of all the known plugin base directories (directories where plugins are installed to).


getPluginDescriptor

org.springframework.core.io.Resource getPluginDescriptor(org.springframework.core.io.Resource pluginDir)
Returns the plugin descriptor for the Given plugin directory.
Parameters:
pluginDir - The plugin directory
Returns:
The plugin descriptor


getPluginDescriptors

org.springframework.core.io.Resource[] getPluginDescriptors()
Obtains an array of all plugin descriptors (the root classes that end with *GrailsPlugin.groovy).


getPluginDescriptorsForCurrentEnvironment

org.springframework.core.io.Resource[] getPluginDescriptorsForCurrentEnvironment()


getPluginDirForName

org.springframework.core.io.Resource getPluginDirForName(java.lang.String pluginName)
Obtains a plugin directory for the given name.


getPluginDirectories

org.springframework.core.io.Resource[] getPluginDirectories()
Obtains a list of plugin directories for the application


getPluginI18nDirectories

org.springframework.core.io.Resource[] getPluginI18nDirectories()
Obtains an array of all plugin i18n directories.


getPluginInfo

GrailsPluginInfo getPluginInfo(java.lang.String pluginBaseDir)
Obtains a PluginInfo for the installed plugin directory.


getPluginInfoForName

GrailsPluginInfo getPluginInfoForName(java.lang.String pluginName)
Obtains a PluginInfo for the installed plugin directory.


getPluginInfoForSource

GrailsPluginInfo getPluginInfoForSource(java.lang.String sourceFile)
Gets a PluginInfo for a particular source file if its contained within that plugin


getPluginInfos

GrailsPluginInfo[] getPluginInfos(java.lang.String pluginDirPath = this.pluginDirPath)
Returns an array of PluginInfo objects


getPluginJarFiles

org.springframework.core.io.Resource[] getPluginJarFiles()
Obtains an array of all plugin provided JAR files


getPluginLibDirectories

org.springframework.core.io.Resource[] getPluginLibDirectories()
Obtains an array of all plugin lib directories.


getPluginResourceBundles

org.springframework.core.io.Resource[] getPluginResourceBundles()
Obtains an array of all plugin provided resource bundles.


getPluginScripts

org.springframework.core.io.Resource[] getPluginScripts()
.groovy").each { if (!it.file.name.startsWith('_')) scripts << it } } resourceResolver("file:${basedir}/scripts/*.groovy").each { if (!it.file.name.startsWith('_')) scripts << it } pluginScripts.each { if (!it.file.name.startsWith('_')) scripts << it } resourceResolver("file:${userHome}/.grails/scripts/*.groovy").each { if (!it.file.name.startsWith('_')) scripts << it } availableScripts = scripts as Resource[] cache['availableScripts'] = availableScripts } return availableScripts } /** Obtains an array of plugin provided Gant scripts available to a Grails application.


getPluginSourceDirectories

org.springframework.core.io.Resource[] getPluginSourceDirectories()
Obtains an array of all plugin provided source directories


getPluginSourceDirectories

org.springframework.core.io.Resource[] getPluginSourceDirectories(java.io.File pluginDir)
Gets all the plugin source directories for the given plugin directory


getPluginSourceFiles

org.springframework.core.io.Resource[] getPluginSourceFiles()
/*.properties") } } /** Obtains an array of all plugin provided source directories
deprecated:
Use getPluginSourceDirectories


getPluginSourceFiles

org.springframework.core.io.Resource[] getPluginSourceFiles(java.io.File pluginDir)
deprecated:
Use getPluginSourceDirectories


getPluginXmlMetadata

org.springframework.core.io.Resource[] getPluginXmlMetadata()
Obtains a Resource array of the Plugin metadata XML files used to describe the plugins provided resources


getSupportedPluginInfos

GrailsPluginInfo[] getSupportedPluginInfos()
Returns only the PluginInfo objects that support the current Environment and BuildScope.
See Also:
Environment
BuildScope


getUnmanagedPluginJarFiles

org.springframework.core.io.Resource[] getUnmanagedPluginJarFiles()
Obtains an array of all plugin provided JAR files for plugins that don't define a dependencies.groovy.


isGlobalPluginLocation

boolean isGlobalPluginLocation(org.springframework.core.io.Resource pluginDir)
Returns true if the specified plugin directory is a global plugin.


isInlinePluginLocation

boolean isInlinePluginLocation(org.springframework.core.io.Resource pluginLocation)
Returns true if the specified plugin location is an inline location.


readMetadataFromZip

java.util.List readMetadataFromZip(java.lang.String zipLocation)
Reads plugin metadata from a plugin zip file and returns a list containing the plugin name, version and XML metadata. Designed for use with Groovy's multiple assignment operator
Parameters:
zipLocation - The zip location
Returns:
A list


readPluginInfoFromZip

GrailsPluginInfo readPluginInfoFromZip(java.lang.String zipLocation)
Reads plugin info from the zip file location
Parameters:
zipLocation - The zip location
Returns:


registerNewPluginInstall

void registerNewPluginInstall(java.io.File zip)


registerPluginZipWithScope

protected java.lang.Object registerPluginZipWithScope(java.io.File pluginZip, PluginScopeInfo scopeInfo)


 

Groovy Documentation