Mirror of Apache Groovy
Java Groovy GAP HTML CSS Shell Other
Switch branches/tags
GROOVY_3_0_0_ALPHA_3 GROOVY_3_0_0_ALPHA_2 GROOVY_3_0_0_ALPHA_1 GROOVY_2_6_0_ALPHA_4 GROOVY_2_6_0_ALPHA_3 GROOVY_2_6_0_ALPHA_2 GROOVY_2_6_0_ALPHA_1 GROOVY_2_5_2 GROOVY_2_5_1 GROOVY_2_5_0 GROOVY_2_5_0_RC_3 GROOVY_2_5_0_RC_2 GROOVY_2_5_0_RC_1 GROOVY_2_5_0_BETA_3 GROOVY_2_5_0_BETA_2 GROOVY_2_5_0_BETA_1 GROOVY_2_5_0_ALPHA_1 GROOVY_2_4_15 GROOVY_2_4_14 GROOVY_2_4_13 GROOVY_2_4_12 GROOVY_2_4_11 GROOVY_2_4_10 GROOVY_2_4_9 GROOVY_2_4_8 GROOVY_2_4_7 GROOVY_2_4_6 GROOVY_2_4_5 GROOVY_2_4_4 GROOVY_2_4_3 GROOVY_2_4_2 GROOVY_2_4_1 GROOVY_2_4_0 GROOVY_2_4_0_RC_2 GROOVY_2_4_0_RC_1 GROOVY_2_4_0_BETA_4 GROOVY_2_4_0_BETA_3 GROOVY_2_4_0_BETA_2 GROOVY_2_4_0_BETA_1 GROOVY_2_3_11 GROOVY_2_3_10 GROOVY_2_3_9 GROOVY_2_3_8 GROOVY_2_3_7 GROOVY_2_3_6 GROOVY_2_3_5 GROOVY_2_3_4 GROOVY_2_3_3 GROOVY_2_3_2 GROOVY_2_3_1 GROOVY_2_3_0 GROOVY_2_3_0_RC_4 GROOVY_2_3_0_RC_3 GROOVY_2_3_0_RC_2 GROOVY_2_3_0_RC_1 GROOVY_2_3_0_BETA_2 GROOVY_2_3_0_BETA_1 GROOVY_2_2_2 GROOVY_2_2_1 GROOVY_2_2_0 GROOVY_2_2_0_RC_3 GROOVY_2_2_0_RC_2 GROOVY_2_2_0_RC_1 GROOVY_2_2_0_BETA_1 GROOVY_2_1_9 GROOVY_2_1_8 GROOVY_2_1_7 GROOVY_2_1_6 GROOVY_2_1_5 GROOVY_2_1_4 GROOVY_2_1_3 GROOVY_2_1_2 GROOVY_2_1_1 GROOVY_2_1_0 GROOVY_2_1_0_RC_3 GROOVY_2_1_0_RC_2 GROOVY_2_1_0_RC_1 GROOVY_2_1_0_BETA_1 GROOVY_2_0_8 GROOVY_2_0_7 GROOVY_2_0_6 GROOVY_2_0_5 GROOVY_2_0_4 GROOVY_2_0_2 GROOVY_2_0_1 GROOVY_2_0_0 GROOVY_2_0_0_RC_4 GROOVY_2_0_0_RC_3 GROOVY_2_0_0_RC_2 GROOVY_2_0_0_RC_1 GROOVY_2_0_0_BETA_3 GROOVY_2_0_0_BETA_2 GROOVY_2_0_0_BETA_1 GROOVY_2_0_BETA_2 GROOVY_1_9_BETA_4 GROOVY_1_9_BETA_3 GROOVY_1_9_BETA_1 GROOVY_1_8_9 GROOVY_1_8_8 GROOVY_1_8_7
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
benchmark Added a compiler performance test module Sep 21, 2015
buildSrc GROOVY-8480: org.codehaus.groovy.runtime.ExtensionModule should move … Feb 24, 2018
config GROOVY-8178: Codenarc broken in quality build May 8, 2017
gradle fix javadoc build config for JDK11 Aug 19, 2018
licenses GROOVY-8710: license changes for bundled JAXB jars Jul 25, 2018
notices tidy up licenses/notices wrt no longer needing groovy-all jar Jul 25, 2018
security Grant read "line.separator" property permission to ScriptTest.groovy Apr 24, 2018
src Update javadoc for `GenericsTypeName` Aug 19, 2018
subprojects fix groovydoc build config for JDK11 Aug 19, 2018
xdocs/images Remove the Maven 1 build files since we have now officially moved to … May 22, 2007
.gitignore Bump gradle version to 4.0.1 Jul 8, 2017
.travis.yml ignore jdk11 on travis for now Jul 8, 2018
DOAP.rdf Adding Apache Groovy DOAP file (closes #223) Dec 23, 2015
LICENSE tidy up licenses/notices wrt no longer needing groovy-all jar Jul 25, 2018
NOTICE update copyright year in notices Jan 3, 2018
README.adoc GROOVY-8654: fixed documentation build command (closes #761) Jun 21, 2018
appveyor.yml add license header Nov 4, 2017
build.gradle move examples to their own repo Aug 12, 2018
gradle.properties Bump gradle to 4.9 Jul 18, 2018
gradlew Upgrade to Gradle 4.0 Jun 16, 2017
gradlew.bat use final version of gradle 3.0 Aug 22, 2016
jitpack.yml Add jitpack configuration file Feb 23, 2018
settings.gradle GROOVY-8692: Remove DirectFastStringServiceFactory for Groovy 3 Jul 9, 2018
wrapper.gradle GROOVY-8378: Gradle wrapper bootstrapping should be more independent … Nov 14, 2017

README.adoc

Apache Groovy

medium

jdk Apache License 2 teamcity build status travis build status bintray download follow on Twitter

Groovy is a powerful, optionally typed and dynamic language, with static-typing and static compilation capabilities, for the Java platform aimed at multiplying developers’ productivity thanks to a concise, familiar and easy to learn syntax.

It integrates smoothly with any Java program, and immediately delivers to your application powerful features, including scripting capabilities, Domain-Specific Language authoring, runtime and compile-time meta-programming and functional programming.

Downloading

Latest Groovy version is available on Bintray Bintray latest version

Binary distribution links are on the package page.

Maven, Gradle and Ivy dependency declaration snippets are available on specific files of a particular module.

Get automatic notifications about new "groovy" versions link=https://bintray.com/groovy/maven/groovy/view?source=watch

Obtaining the Source

You don’t need the source code to use Apache Groovy but if you wish to explore its inner workings or build it for yourself there are two ways to obtain the source files.

Checking out from Version Control

Apache Groovy uses Git. The official Git repository is at:

https://git-wip-us.apache.org/repos/asf/groovy.git

And a mirror is hosted on Github:

https://github.com/apache/groovy

The Github mirror is read-only and provides convenience to users and developers to explore the code and for the community to accept contributions via Github pull requests.

Simply git clone the repo (or the repo you forked via the github website) and you will have the complete source.

Unpacking the src distribution

Alternatively, you can download the source distribution and unpack it.

If obtaining the source from the source distribution and you intend to build from source, you also need to download and install Gradle and use the downloaded Gradle to execute one bootstrap step.

Bootstrapping Gradle

As mentioned in the previous paragraph, if you download the source distribution you need to bootstrap Gradle. This isn’t needed if you clone from the Github repo.

Each version of Groovy is built and tested using a specific version of Gradle. That version is specified by the gradle_version property defined in the gradle.properties file within the root directory. Luckily you shouldn’t need to know that version and, after bootstrapping, you should use the gradlew command which will ensure the correct version is always used.

The version of Gradle used for the bootstrap step has some flexibility though in general you might need to download a version similar to the version of Groovy the build is expecting.

To bootstrap Gradle, at the top directory of your unpacked source, run the command:

gradle -b wrapper.gradle wrapper

On Unix-like systems, use ./gradle. If the version of Gradle you have installed is close to the required version, you might be able to get away without the -b wrapper.gradle above, but if in doubt leave it in.

NOTE: At this point, the Gradle wrapper should be set up and from now on you should use the gradlew command instead of gradle. (On Unix-like systems, use ./gradlew).

Building from Source

Build is build status.

To build you will need:

To build everything using Gradle, use the following command (./gradlew on Unix-like systems):

gradlew clean dist

Note: The gradlew command automatically downloads the correct Gradle version if needed, you do not need to download it first.

This will generate a distribution similar to the zip you can download on the Groovy download page.

To build everything and launch unit tests, use:

gradlew test

If you want to launch one unit test, use this. <TestClassName> is like groovy.GroovyMethodsTest.

gradlew :test --tests <TestClassName>

To build from IntelliJ IDEA:

gradlew jar idea

Then open the generated project in IDEA.

To build from Eclipse:

gradlew jar eclipse

Then open the generated project and the generated subprojects in Eclipse. But be aware that Eclipse tends to be more limited in its ability to reproduce a Gradle build structure. The generated project files may contain a circular dependency which may or may not prevent Eclipse from using them. It depends on the Eclipse version, if this is an issue or not.

To build the documentation (Groovy Language Documentation):

gradlew asciidoc

All code samples of the documentation guide are pulled from actual test cases. To run a single documentation test case, take for example src/spec/test/semantics/PowerAssertTest.groovy

gradlew testSinglePowerAssertTest

(Note the omission of package name: class is semantics.PowerAssertTest but only PowerAssertTest is added to testSingle.)

InvokeDynamic support

The Groovy build supports the JVM instruction invokedynamic. If you want to build Groovy with invokedynamic, you can use the project property indy:

gradlew -Pindy=true clean test

Please note that the following Gradle tasks generate both indy and non indy variants of the jars, so you don’t need to use the system property:

  • dist

  • install

  • uploadArchives

Continuous Integration Server

The official CI server runs here and is sponsored by JetBrains.

Java Profiler

Groovy core team tunes performance through YourKit Java Profiler, which is sponsored by YourKit.

License

Groovy is licensed under the terms of the Apache License, Version 2.0