File: README.adoc

package info (click to toggle)
groovy 2.4.21-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 30,708 kB
  • sloc: java: 157,114; xml: 728; sh: 357; makefile: 64; javascript: 15
file content (185 lines) | stat: -rw-r--r-- 8,181 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
//////////////////////////////////////////

  Licensed to the Apache Software Foundation (ASF) under one
  or more contributor license agreements.  See the NOTICE file
  distributed with this work for additional information
  regarding copyright ownership.  The ASF licenses this file
  to you under the Apache License, Version 2.0 (the
  "License"); you may not use this file except in compliance
  with the License.  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an
  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  KIND, either express or implied.  See the License for the
  specific language governing permissions and limitations
  under the License.

//////////////////////////////////////////

= Groovy
The Groovy development team
:revdate: 24-02-2014
:build-icon: http://ci.groovy-lang.org:8111/app/rest/builds/buildType:(id:Groovy_Jdk7Build)/statusIcon
:noheader:
:groovy-www: http://groovy-lang.org/
:groovy-ci: http://ci.groovy-lang.org?guest=1
:jdk: http://www.oracle.com/technetwork/java/javase/downloads
:bintray-latest-version-image: https://api.bintray.com/packages/groovy/maven/groovy/images/download.png
:bintray-latest-version-link: https://bintray.com/groovy/maven/groovy/_latestVersion
:bintray-watch-image: https://www.bintray.com/docs/images/bintray_badge_color.png
:bintray-watch-link: https://bintray.com/groovy/maven/groovy/view?source=watch
:apache-license-icon: https://img.shields.io/badge/license-APL2-blue.svg
:apache-license-link: http://www.apache.org/licenses/LICENSE-2.0.txt
:apache-groovy-twitter-icon: https://img.shields.io/twitter/follow/ApacheGroovy.svg?style=social
:apache-groovy-twitter-link: https://twitter.com/intent/follow?screen_name=ApacheGroovy
:jdk-icon: https://img.shields.io/badge/java-6+-4c7e9f.svg
:bintray-download-icon: https://api.bintray.com/packages/groovy/maven/groovy/images/download.svg

[.left.text-left]
image::https://raw.githubusercontent.com/groovy/artwork/master/medium.png[]
image:{jdk-icon}[jdk, link={jdk}]
image:{apache-license-icon}[Apache License 2, link={apache-license-link}]
image:{build-icon}[build status, link={groovy-ci}]
image:{bintray-download-icon}[bintray download, link={bintray-latest-version-link}]
image:{apache-groovy-twitter-icon}[follow on Twitter, link={apache-groovy-twitter-link}]

{groovy-www}[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 image:{bintray-latest-version-image}[Bintray latest version, link={bintray-latest-version-link}]

Binary distribution links are on the package page.

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

image:{bintray-watch-image}[Get automatic notifications about new "groovy" versions link={bintray-watch-link}]

== 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 https://gradle.org/downloads/[download] and install http://gradle.org/[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 image:{build-icon}[build status, link={groovy-ci}].

To build you will need:

* {jdk}[JDK 7+]

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 jarAll idea

Then open the generated project in IDEA.

To build from Eclipse:

    gradlew jarAll 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 assembleAsciidoc

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 new Java 7 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 {groovy-ci}[here] and is sponsored by http://www.jetbrains.com[JetBrains].

== Java Profiler

Groovy core team tunes performance through YourKit Java Profiler, which is sponsored by https://www.yourkit.com[YourKit].

== License

Groovy is licensed under the terms of the http://www.apache.org/licenses/LICENSE-2.0.html[Apache License, Version 2.0]