Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Excerpt
hiddentrue

Groovy Enhancement Proposal

Metadata

Number:

GEP-9

Title:

Modularization

Version:

4

Type:

Feature

Status:

Draft

Leader:

Paul King

Created:

2011-10-26

Last modification:

2011-10-26

...

Groovy bootstraps its configuration using a file in the conf/groovy-starter.conf file. It has entries like this:

Code Block

# load required libraries
load !{groovy.home}/lib/*.jar

...

The groovy install will now likely have a "modules" (or components or repository) directory.
The groovy-starter.conf file will have additional entries such as:

Code Block

# load SQL component
grab org.codehaus.groovy groovy-sql 1.9.0
# load XML component
grab org.codehaus.groovy groovy-xml 1.9.0

Grapes are loaded via Ivy and configured from a settings file. This file might have an additional entry:

Code Block

<ibiblio name="modules" root="file:${groovy.home}/modules/" m2compatible="true"/>

...

potential hook

purpose

META-INF/services/groovy/defaultGroovyMethodsorg.codehaus.groovy.runtime.CategoryMethods

allow the module to define additional category methods

META-INF/services/groovy/defaultGroovyStaticMethodsorg.codehaus.groovy.runtime.StaticCategoryMethods

allow the module to define additional static category methods

META-INF/services/groovy/defaultExpandoMethodsorg.codehaus.groovy.runtime.ExpandoMethods

allow the module to define additional expandometaclass methods

META-INF/services/groovy/defaultMetaClassesorg.codehaus.groovy.runtime.DefaultMetaClasses

allow the module to define additional metaclasses similar to the current magic package mechanism**

META-INF/services/org.codehaus.groovy.runtime.SerializedCategoryMethods

allow the module to define additional category methods which have been serialized

META-INF/services/groovy/defaultImports

allow the module to define additional normal, star, static imports, aliases

META-INF/services/groovy/defaultExtensions

allow the module to define supported file extensions

META-INF/services/groovy/defaultAstTransforms

allow the module to define AST transforms

?

provide a way to register builder metadata

?

should there by a way to 'publish' new commandline level startup scripts e.g. java2groovy

?

provide a way to register a runner class, e.g. EasyB - there might also be a need to detect runner types

?

provide a way to register special compiler flags, e.g. '--indy'

?

provide a way to inject special AST customizations

**This needs to mesh in with the existing magic package mechanism for defining custom metaclasses.

...

In Groovy you can currently determine the Groovy version using:

Code Block

println GroovySystem.version

...