pax_global_header 0000666 0000000 0000000 00000000064 13513043216 0014510 g ustar 00root root 0000000 0000000 52 comment=55bd2a07b6a8bf1c81258abfa8a0b1f29ba9e8e3
groovy-2.4.17/ 0000775 0000000 0000000 00000000000 13513043216 0013130 5 ustar 00root root 0000000 0000000 groovy-2.4.17/.travis.yml 0000664 0000000 0000000 00000005062 13513043216 0015244 0 ustar 00root root 0000000 0000000 # 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.
language: groovy
sudo: required
matrix:
include:
- jdk: oraclejdk8
- jdk: openjdk7
- jdk: openjdk6
addons:
apt:
packages:
- openjdk-6-jdk
dist: trusty
# use bouncycastle security provider to avoid:
# javax.net.ssl.SSLException: ... java.security.InvalidKeyException: EC parameters error
before_install:
- |
if [ $TRAVIS_JDK_VERSION == "openjdk7" ]; then
JAVA_ETC=java-7-openjdk
elif [ $TRAVIS_JDK_VERSION == "openjdk6" ]; then
JAVA_ETC=java-6-openjdk
fi
if [ $TRAVIS_JDK_VERSION == "openjdk6" ] || [ $TRAVIS_JDK_VERSION == "openjdk7" ]; then
BCPROV_FILENAME=bcprov-ext-jdk15on-158.jar
wget "https://bouncycastle.org/download/${BCPROV_FILENAME}"
sudo mv $BCPROV_FILENAME ${JAVA_HOME}/jre/lib/ext
sudo perl -pi.bak -e 's/^(security\.provider\.)([0-9]+)/$1.($2+1)/ge' /etc/${JAVA_ETC}/security/java.security
echo "security.provider.1=org.bouncycastle.jce.provider.BouncyCastleProvider" | sudo tee -a /etc/${JAVA_ETC}/security/java.security
fi
install: true
# use default mem settings for java 8 only
# avoid getting gradle zip and plugins using openjdk6
before_script:
- |
if [ $TRAVIS_JDK_VERSION == "openjdk6" ] || [ $TRAVIS_JDK_VERSION == "openjdk7" ]; then
export _JAVA_OPTIONS=-Xms1024m\ -Xmx2048m
else
unset _JAVA_OPTIONS
fi
if [ $TRAVIS_JDK_VERSION == "openjdk6" ]; then
jdk_switcher use oraclejdk8
./gradlew assemble
jdk_switcher use openjdk6
fi
script: travis_wait 60 ./gradlew clean test
# As recommended in:
# https://docs.travis-ci.com/user/languages/java/#Caching
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
groovy-2.4.17/LICENSE 0000664 0000000 0000000 00000031522 13513043216 0014140 0 ustar 00root root 0000000 0000000
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed 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.
------------------------------------------------------------------------
Asciidoc License
This product uses the style.css from asciidoctor.org within
documentation. The file is available under the MIT License.
For details, see licenses/asciidoc-style-license.txt.
------------------------------------------------------------------------
JLine2 Patch License
The following class within this product:
org.codehaus.groovy.tools.shell.completion.FileNameCompleter
was derived from JLine 2.12, and the following patch:
https://github.com/jline/jline2/issues/90
JLine2 is made available under a BSD License.
For details, see licenses/jline2-license.
------------------------------------------------------------------------
JQuery License
The following file is used within documentation:
src/spec/assets/css/jquery-2.1.1.min.js
This file is made available under the following MIT license:
licenses/jquery-js-license.txt
------------------------------------------------------------------------
JSR223 License
The following classes within this product:
org.codehaus.groovy.jsr223.GroovyCompiledScript
org.codehaus.groovy.jsr223.GroovyScriptEngineFactory
org.codehaus.groovy.jsr223.GroovyScriptEngineImpl
were derived from reference implementation files developed by Sun in
collaboration with the Groovy community. The reference implementation
has a BSD-style license. Details can be found in: licenses/jsr223-license.txt
------------------------------------------------------------------------
normalize.css License
The stylesheet.css file (originally normalize.css) is used by the
groovydoc and docgenerator components for groovy-jdk/gapi documentation.
It is made available under a MIT License. Details: licenses/normalize-stylesheet-license.txt
groovy-2.4.17/NOTICE 0000664 0000000 0000000 00000000572 13513043216 0014040 0 ustar 00root root 0000000 0000000 Apache Groovy
Copyright 2003-2019 The Apache Software Foundation
This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
This product bundles icons from the famfamfam.com silk icons set
http://www.famfamfam.com/lab/icons/silk/
Licensed under the Creative Commons Attribution Licence v2.5
http://creativecommons.org/licenses/by/2.5/ groovy-2.4.17/README.adoc 0000664 0000000 0000000 00000017765 13513043216 0014735 0 ustar 00root root 0000000 0000000 //////////////////////////////////////////
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. is like `groovy.GroovyMethodsTest`.
gradlew :test --tests
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]
groovy-2.4.17/build.gradle 0000664 0000000 0000000 00000041005 13513043216 0015407 0 ustar 00root root 0000000 0000000 /*
* 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.
*/
buildscript {
repositories {
jcenter()
maven {
name 'Bintray Asciidoctor repo'
url 'http://dl.bintray.com/content/aalmiray/asciidoctor'
}
maven{
name 'Bintray Javadoc Hotfix repo'
url 'http://dl.bintray.com/melix/gradle-javadoc-hotfix-plugin'
}
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'org.asciidoctor:asciidoctor-gradle-plugin:1.5.7'
classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:3.0.3'
classpath 'me.champeau.gradle:gradle-javadoc-hotfix-plugin:0.1'
classpath 'me.champeau.gradle:japicmp-gradle-plugin:0.1.1'
//classpath 'nl.javadude.gradle.plugins:license-gradle-plugin:0.11.0'
classpath "gradle.plugin.org.nosphere.apache:creadur-rat-gradle:0.1.3"
classpath 'com.gradle:build-scan-plugin:1.8'
classpath 'me.champeau.gradle:buildscan-recipes-plugin:0.2.0'
}
}
if (JavaVersion.current().java7Compatible) {
apply plugin: 'com.gradle.build-scan'
apply plugin: 'me.champeau.buildscan-recipes'
buildScan {
licenseAgreementUrl = 'https://gradle.com/terms-of-service'
licenseAgree = 'yes'
publishAlways()
}
buildScanRecipes {
recipe 'git-commit', baseUrl: 'https://github.com/apache/groovy/tree'
recipe 'teamcity', baseUrl: 'https://ci.groovy-lang.org', guest: 'true'
recipes 'git-status', 'teamcity', 'travis-ci'
}
}
ext.modules = {
subprojects.findAll{ !['performance', 'tests-vm8'].contains(it.name) }
}
apply from: 'gradle/filter.gradle'
apply from: 'gradle/indy.gradle'
apply from: 'gradle/publish.gradle'
apply plugin: 'javadocHotfix'
File javaHome = new File(System.getProperty('java.home'))
logger.lifecycle "Using Java from $javaHome (version ${System.getProperty('java.version')})"
indyBanner()
// TODO use antlr plugin
//apply plugin: 'antlr'
allprojects {
apply plugin: 'java'
buildDir = 'target'
sourceCompatibility = 1.6
targetCompatibility = 1.6
group = 'org.codehaus.groovy'
version = groovyVersion
repositories {
jcenter()
maven { url 'http://dl.bintray.com/melix/thirdparty-apache' } // openbeans
}
apply plugin: 'groovy'
apply from: "${rootProject.projectDir}/gradle/indy.gradle"
if (JavaVersion.current().java7Compatible) {
apply from: "${rootProject.projectDir}/gradle/asciidoctor.gradle"
}
}
// todo: use the conventional "resources" directory for classpath resources
task(copyResources, type: Copy) {
destinationDir = file("$buildDir/classes")
// text files requiring filtering
into('main') {
from('src/main')
include('**/*.txt', '**/*.xml', '**/*.properties', '**/*.html')
filter(rootProject.propertiesFilter, org.apache.tools.ant.filters.ReplaceTokens)
}
// other resources
into('main') {
from 'src/main'
include('**/*.png', '**/*.gif', '**/*.ico', '**/*.css')
}
}
compileJava.dependsOn(copyResources)
task(copyTestResources, type: Copy)
.from('src/test')
.into("$buildDir/classes/test")
.include('**/*.txt', '**/*.xml', '**/*.properties', '**/*.png', '**/*.html', '**/*.gif', '**/*.ico', '**/*.css')
compileTestJava.dependsOn(copyTestResources)
task sourceJar(type: Jar) {
classifier = 'sources'
from 'src/main'
}
subprojects {
task sourceJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
}
repositories {
// todo Some repos are needed only for some configs. Declare them just for the configuration once Gradle allows this.
maven { url 'http://repository.jboss.org/nexus/content/groups/m2-release-proxy' } // examples, tools
}
// todo do we need compile and runtime scope for examples?
configurations {
compilerCompile
tools
examplesCompile.extendsFrom compile
examplesRuntime.extendsFrom examplesCompile
antlr
spec
}
ext {
antVersion = '1.9.4'
asmVersion = '6.1.1'
antlrVersion = '2.7.7'
coberturaVersion = '1.9.4.1'
commonsCliVersion = '1.2'
commonsHttpClientVersion = '3.1'
eclipseOsgiVersion = '3.9.1-v20140110-1610'
gparsVersion = '1.2.1'
ivyVersion = '2.4.0'
jansiVersion = '1.11'
jarjarVersion = '1.3'
jlineVersion = '2.12'
jmockVersion = '1.2.0'
logbackVersion = '1.1.2'
log4jVersion = '1.2.17'
log4j2Version = '2.1'
luceneVersion = '4.7.2'
openbeansVersion = '1.0'
openejbVersion = '1.0'
qdoxVersion = '1.12.1'
slf4jVersion = '1.7.6'
xmlunitVersion = '1.5'
xstreamVersion = '1.4.10'
isReleaseVersion = !groovyVersion.toLowerCase().endsWith("snapshot")
}
dependencies {
compile "antlr:antlr:$antlrVersion"
compile "org.ow2.asm:asm:$asmVersion"
compile "org.ow2.asm:asm-analysis:$asmVersion"
compile "org.ow2.asm:asm-commons:$asmVersion"
compile "org.ow2.asm:asm-tree:$asmVersion"
compile "org.ow2.asm:asm-util:$asmVersion"
compile "commons-cli:commons-cli:$commonsCliVersion"
compile "org.apache.ant:ant:$antVersion"
compile("com.thoughtworks.xstream:xstream:$xstreamVersion") {
exclude(group: 'xpp3', module: 'xpp3_min')
exclude(group: 'junit', module: 'junit')
exclude(group: 'jmock', module: 'jmock')
}
compile "com.googlecode:openbeans:$openbeansVersion"
compile "org.fusesource.jansi:jansi:$jansiVersion"
compile("org.apache.ivy:ivy:$ivyVersion") {
transitive = false
}
compile files("${buildDir}/generated-classes")
runtime("org.codehaus.gpars:gpars:$gparsVersion") {
exclude(group: 'org.codehaus.groovy', module: 'groovy-all')
}
testCompile "jmock:jmock:$jmockVersion"
testCompile "jmock:jmock-cglib:$jmockVersion"
testCompile "xmlunit:xmlunit:$xmlunitVersion"
testCompile "ch.qos.logback:logback-classic:$logbackVersion"
testCompile "log4j:log4j:$log4jVersion"
testCompile "org.apache.logging.log4j:log4j-core:$log4j2Version"
testCompile "org.slf4j:jcl-over-slf4j:$slf4jVersion"
testCompile "com.thoughtworks.qdox:qdox:$qdoxVersion"
tools "com.googlecode.jarjar:jarjar:$jarjarVersion"
tools("net.sourceforge.cobertura:cobertura:$coberturaVersion") {
exclude(module: 'asm')
exclude(module: 'asm')
exclude(module: 'ant')
}
tools "org.ow2.asm:asm:$asmVersion"
tools "com.thoughtworks.qdox:qdox:$qdoxVersion"
examplesCompile project(':groovy-test')
examplesCompile project(':groovy-swing')
examplesCompile "org.apache.lucene:lucene-core:$luceneVersion"
examplesCompile "org.apache.lucene:lucene-analyzers-common:$luceneVersion"
examplesCompile "org.apache.lucene:lucene-queryparser:$luceneVersion"
examplesCompile "org.eclipse:osgi:$eclipseOsgiVersion"
examplesRuntime("commons-httpclient:commons-httpclient:$commonsHttpClientVersion") {
exclude(module: 'junit')
exclude(module: 'commons-logging')
exclude(module: 'commons-codec')
}
examplesRuntime("openejb:openejb-loader:$openejbVersion") {
exclude(module: 'log4j')
exclude(module: 'openejb-core')
exclude(module: 'geronimo-jta_1.0.1B_spec')
exclude(module: 'geronimo-servlet_2.4_spec')
exclude(module: 'geronimo-ejb_2.1_spec')
exclude(module: 'geronimo-j2ee-connector_1.5_spec')
}
// TODO use antlr plugin
// antlr "antlr:antlr:$antlrVersion"
antlr "org.apache.ant:ant-antlr:$antVersion"
testCompile project(':groovy-ant')
testCompile project(':groovy-test')
}
ext.generatedDirectory = "${buildDir}/generated-sources"
sourceSets {
main {
java {
srcDirs = [
'src/main',
"$generatedDirectory/src/main"
]
fileTree('src/main/groovy/ui').matching {
exclude 'GroovyMain.java', 'GroovySocketServer.java'
}.visit { details ->
exclude "groovy/ui/$details.path"
}
if (!JavaVersion.current().isJava7Compatible()) {
exclude '**/indy/*'
exclude '**/v7/*'
exclude '**/v8/*'
exclude '**/vm7/*'
}
}
groovy {
srcDirs = [
'src/main',
"$generatedDirectory/src/main"
]
if (!JavaVersion.current().isJava7Compatible()) {
exclude '**/indy/*'
exclude '**/v7/*'
exclude '**/v8/*'
exclude '**/vm7/*'
}
}
resources {
srcDirs = ['src/main', 'src/resources']
include 'META-INF/services/*',
'META-INF/groovy-release-info.properties',
'groovy/grape/*.xml'
}
}
test {
groovy {
srcDirs = ['src/test']
}
resources {
srcDirs = ['src/test-resources']
}
}
tools {
compileClasspath = sourceSets.main.runtimeClasspath + configurations.tools
runtimeClasspath = output + compileClasspath
}
examples {
groovy {
srcDirs = ['src/examples']
}
resources {
srcDirs = ['src/examples']
}
compileClasspath = configurations.examplesRuntime + sourceSets.main.output + project(':groovy-xml').sourceSets.main.output
}
}
// make sure examples can be compiled, even if we don't run them
// todo: reorganize examples so that we can run them too
check {
dependsOn examplesClasses
}
// remove this from config once GRADLE-854 is fixed.
processResources.doLast {
copy {
from('src/main') {
include 'groovy/inspect/swingui/AstBrowserProperties.groovy',
'org/codehaus/groovy/tools/groovydoc/gstringTemplates/GroovyDocTemplateInfo.java'
}
into sourceSets.main.output.classesDir
}
}
task ensureGrammars {
description = 'Ensure all the Antlr generated files are up to date.'
ext.antlrDirectory = "$projectDir/src/main/org/codehaus/groovy/antlr"
ext.groovyParserDirectory = "$ext.antlrDirectory/parser"
ext.javaParserDirectory = "$ext.antlrDirectory/java"
ext.genPath = "$generatedDirectory/src/main/org/codehaus/groovy/antlr"
ext.groovyOutDir = "$ext.genPath/parser"
ext.javaOutDir = "$ext.genPath/java"
inputs.dir(antlrDirectory)
outputs.dir(groovyOutDir)
outputs.dir(javaOutDir)
doFirst {
new File(groovyOutDir).mkdirs()
new File(javaOutDir).mkdirs()
ant {
taskdef(name: 'antlr',
classname: 'org.apache.tools.ant.taskdefs.optional.ANTLR',
classpath: configurations.antlr.asPath)
mkdir dir: ext.groovyParserDirectory
antlr(target: "$ext.antlrDirectory/groovy.g", outputdirectory: ext.groovyOutDir) {
classpath path: configurations.compile.asPath
}
antlr(target: "$ext.javaParserDirectory/java.g", outputdirectory: ext.javaOutDir) {
classpath path: configurations.compile.asPath
}
}
}
}
apply from: 'gradle/utils.gradle'
apply from: 'wrapper.gradle'
task dgmConverter(dependsOn:compileJava) {
description = 'Generates DGM info file required for faster startup.'
def classesDir = sourceSets.main.output.classesDir
def classpath = files(classesDir, configurations.compile).asPath
//main = 'org.codehaus.groovy.tools.DgmConverter'
//args = ['--info', classesDir.absolutePath]
doFirst {
file("$classesDir/META-INF").mkdirs()
// we use ant.java because Gradle is a bit "too smart" with JavaExec
// as it will invalidate the task if classpath changes, which will
// happen once Groovy files are compiled
ant.java(classname:'org.codehaus.groovy.tools.DgmConverter', classpath: classpath) {
arg(value: '--info')
arg(value: classesDir.absolutePath)
}
}
inputs.files fileTree('src').include('**/*GroovyMethods.java')
outputs.file file("${classesDir}/META-INF/dgminfo")
}
compileJava {
dependsOn ensureGrammars, exceptionUtils
options.fork(memoryMaximumSize: javacMain_mx)
}
// Gradle classloading magic with Groovy will only work if it finds a *jar*
// on classpath. This "bootstrap jar" contains the minimal compiler, without .groovy compiled files
task bootstrapJar {
dependsOn compileJava, dgmConverter
def destinationDir = file("$buildDir/bootstrap")
def archiveName = "groovy-${version}-bootstrap.jar"
ext.archivePath = file("$destinationDir/$archiveName")
doLast {
// we use ant.jar because Gradle is a bit "too smart" with JavaExec
// as it will invalidate the task if classpath changes, which will
// happen once Groovy files are compiled
destinationDir.mkdirs()
ant.jar(
destfile: archivePath,
basedir: file(sourceSets.main.output.classesDir)
)
}
inputs.property('indy', useIndy())
inputs.files sourceSets.main.allJava
outputs.file archivePath
}
compileGroovy.dependsOn bootstrapJar
allprojects {
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
tasks.withType(GroovyCompile) {
groovyOptions.fork(memoryMaximumSize: groovycMain_mx)
groovyOptions.encoding = 'UTF-8'
groovyClasspath = files(
rootProject.compileJava.classpath,
rootProject.bootstrapJar.archivePath
)
classpath = classpath + groovyClasspath
}
if (useIndy()) {
tasks.withType(GroovyCompile) {
logger.info("Building ${project.name}:${name} with InvokeDynamic support activated")
groovyOptions.optimizationOptions.indy = true
sourceCompatibility = 1.7
targetCompatibility = 1.7
}
tasks.withType(JavaCompile) {
sourceCompatibility = 1.7
targetCompatibility = 1.7
}
jar {
classifier = 'indy'
}
}
}
compileTestGroovy {
groovyOptions.fork(memoryMaximumSize: groovycTest_mx)
}
// TODO superfluous to check for JDK7 for Gradle version 3.2+ but leave for future?
task checkCompatibility {
doLast {
assert JavaVersion.current().java7Compatible
}
}
if (!JavaVersion.current().java7Compatible) {
logger.lifecycle '''
**************************************** WARNING ********************************************
****** You are running the build with an older JDK. NEVER try to release with 1.6. ******
****** You must use a JDK 1.7+ in order to compile all features of the language. ******
*********************************************************************************************
'''
}
apply from: 'gradle/test.gradle'
apply from: 'gradle/groovydoc.gradle'
apply from: 'gradle/docs.gradle'
apply from: 'gradle/assemble.gradle'
apply from: 'gradle/upload.gradle'
apply from: 'gradle/idea.gradle'
apply from: 'gradle/eclipse.gradle'
apply from: 'gradle/codehaus.gradle'
apply from: 'gradle/quality.gradle'
// If a local configuration file for tweaking the build is present, apply it
if (file('user.gradle').exists()) {
apply from: 'user.gradle'
}
apply from: 'gradle/signing.gradle'
// UNCOMMENT THE FOLLOWING TASKS IF YOU WANT TO RUN LICENSE CHECKING
//task licenseFormatCustom(type:nl.javadude.gradle.plugins.license.License) {
// source = fileTree(dir:"src").include ("**/*.java",'**/*.groovy','**.html','**.css','**.xml','**/*.properties','**/*.properties')
//}
//
//task licenseFormatGradle(type:nl.javadude.gradle.plugins.license.License) {
// source = files(fileTree(dir:'.').include('**/*.gradle'),fileTree('buildSrc').include('**/*.groovy'))
// mapping('gradle','JAVADOC_STYLE')
//}
//
//licenseFormat.dependsOn licenseFormatCustom
//licenseFormat.dependsOn licenseFormatGradle
groovy-2.4.17/buildSrc/ 0000775 0000000 0000000 00000000000 13513043216 0014677 5 ustar 00root root 0000000 0000000 groovy-2.4.17/buildSrc/build.gradle 0000664 0000000 0000000 00000001511 13513043216 0017154 0 ustar 00root root 0000000 0000000 /*
* 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.
*/
buildDir = 'target' groovy-2.4.17/buildSrc/src/ 0000775 0000000 0000000 00000000000 13513043216 0015466 5 ustar 00root root 0000000 0000000 groovy-2.4.17/buildSrc/src/main/ 0000775 0000000 0000000 00000000000 13513043216 0016412 5 ustar 00root root 0000000 0000000 groovy-2.4.17/buildSrc/src/main/groovy/ 0000775 0000000 0000000 00000000000 13513043216 0017737 5 ustar 00root root 0000000 0000000 groovy-2.4.17/buildSrc/src/main/groovy/org/ 0000775 0000000 0000000 00000000000 13513043216 0020526 5 ustar 00root root 0000000 0000000 groovy-2.4.17/buildSrc/src/main/groovy/org/codehaus/ 0000775 0000000 0000000 00000000000 13513043216 0022321 5 ustar 00root root 0000000 0000000 groovy-2.4.17/buildSrc/src/main/groovy/org/codehaus/groovy/ 0000775 0000000 0000000 00000000000 13513043216 0023646 5 ustar 00root root 0000000 0000000 groovy-2.4.17/buildSrc/src/main/groovy/org/codehaus/groovy/gradle/ 0000775 0000000 0000000 00000000000 13513043216 0025104 5 ustar 00root root 0000000 0000000 WriteExtensionDescriptorTask.groovy 0000664 0000000 0000000 00000003660 13513043216 0034152 0 ustar 00root root 0000000 0000000 groovy-2.4.17/buildSrc/src/main/groovy/org/codehaus/groovy/gradle /*
* 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.
*/
package org.codehaus.groovy.gradle
import org.gradle.api.DefaultTask
import org.gradle.api.tasks.TaskAction
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.OutputFile
/**
* A Gradle task to generate module descriptor files for Groovy extension modules.
*
* @author Cedric Champeau
*/
class WriteExtensionDescriptorTask extends DefaultTask {
String description = 'Generates the org.codehaus.groovy.runtime.ExtensionModule descriptor file of a module'
@Input String extensionClasses = ''
@Input String staticExtensionClasses = ''
@OutputFile File descriptor = computeDescriptorFile()
private File computeDescriptorFile() {
def metaInfDir = new File("${project.buildDir}/classes/main/META-INF/services")
return new File(metaInfDir, "org.codehaus.groovy.runtime.ExtensionModule")
}
@TaskAction
def writeDescriptor() {
descriptor.parentFile.mkdirs()
descriptor.withWriter {
it << """moduleName=${project.name}
moduleVersion=${project.version}
extensionClasses=${extensionClasses}
staticExtensionClasses=${staticExtensionClasses}"""
}
}
}
groovy-2.4.17/config/ 0000775 0000000 0000000 00000000000 13513043216 0014375 5 ustar 00root root 0000000 0000000 groovy-2.4.17/config/binarycompatibility/ 0000775 0000000 0000000 00000000000 13513043216 0020453 5 ustar 00root root 0000000 0000000 groovy-2.4.17/config/binarycompatibility/binarycompat-report.groovy 0000664 0000000 0000000 00000014665 13513043216 0025737 0 ustar 00root root 0000000 0000000 /*
* 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.
*/
/**
* A template which generates an HTML report from the bincompat XML report
*/
modelTypes = {
String title
String baseline
String archive
Map>> violations
}
def severityMapping = [
error : 'danger',
warning: 'warning',
info : 'info',
ignore : 'success'
]
yieldUnescaped ''
html {
head {
meta 'charset': "utf-8"
meta 'http-equiv': "content-type", content: "text/html; charset=utf-8"
meta 'http-equiv': "X-UA-Compatible", content: "IE=edge"
meta name: "viewport", content: "width=device-width, initial-scale=1"
title(title)
link href: "http://maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css", rel: "stylesheet"
link href: "http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css", rel: "stylesheet"
link href: "http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css", rel: "stylesheet"
}
body {
div(class:'navbar navbar-inverse navbar-fixed-top', role:'navigation') {
div(class:'container') {
div(class:'navbar-header') {
button(type:'button', class:'navbar-toggle', 'data-toggle':'collapse', 'data-target':'navbar-collaspe') {
span(class:'sr-only', 'Toggle navigation')
span(class:'icon-bar'){}
span(class:'icon-bar'){}
span(class:'icon-bar'){}
}
a(class:'navbar-brand',href:'#', 'Binary compatibility report')
}
div(class:'navbar-collapse collapse') {
ul(class:"nav navbar-nav") {
li(class: 'dropdown') {
a(id: 'severityDropdown', href: '#', class: 'dropdown-toggle', 'data-toggle': 'dropdown', 'Severity ')
ul(class: "dropdown-menu dropdown-severity", role: "menu") {
li(role: 'presentation', class: 'active') {
a(role: 'menuitem', tabindex: '-1', href: '#', 'All levels')
}
li(role: 'presentation') { a(role: 'menuitem', tabindex: '-1', href: '#', 'Error') }
li(role: 'presentation') { a(role: 'menuitem', tabindex: '-1', href: '#', 'Warning') }
li(role: 'presentation') { a(role: 'menuitem', tabindex: '-1', href: '#', 'Info') }
}
}
}
}
}
}
div(class: 'container') {
div(class:'jumbotron') {
div(class:'container') {
div(class: 'page-header') {
h1 'Binary compatibility'
p "Comparing ${archive} to reference ${baseline}"
p {
yield "Be warned that this report is not perfect and depends on what "
a(href: 'https://github.com/siom79/japicmp', 'JApicmp')
yield " is capable to detect."
}
}
}
}
violations.each { fqcn, classViolations ->
def errors = classViolations.keySet()
def severities = errors.collect { "severity-${it}" }
div(class: "panel panel-default ${severities.join(' ')}") {
div(class: "panel-heading") {
h3(class: 'panel-title', "Class $fqcn")
}
div(class: 'panel-body') {
table(class: "table table-striped table-bordered") {
tbody {
classViolations.each { err, list ->
list.each { item ->
tr(class: "bincompat-error severity-${err}") {
td {
h4 {
span(class: "label label-${severityMapping[err]}", err.capitalize())
}
}
td { span(item) }
}
}
}
}
}
}
}
}
script(src: "http://code.jquery.com/jquery-1.11.0.min.js") {}
script(src: "http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js") {}
script {
yieldUnescaped '''
$(document).ready(function () {
var severity = null;
doFilter();
function doFilter() {
var severityClass = "severity-" + severity;
$('.panel').hide();
$('.bincompat-error').hide();
$('.bincompat-error').filter(function () {
return (severity==null || $(this).hasClass(severityClass));
}).show();
$('.panel').filter(function () {
return (severity==null || $(this).hasClass(severityClass));
}).show();
}
$(".dropdown-severity li a").click(function() {
severity = $(this).text().toLowerCase();
if (severity==="all levels") {
severity = null;
}
doFilter();
});
});'''
}
}
}
} groovy-2.4.17/config/bnd/ 0000775 0000000 0000000 00000000000 13513043216 0015140 5 ustar 00root root 0000000 0000000 groovy-2.4.17/config/bnd/groovy-all.bnd 0000664 0000000 0000000 00000001634 13513043216 0017724 0 ustar 00root root 0000000 0000000 # 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.
version= @GROOVY_BUNDLE_VERSION@
-nouses= true
Export-Package= *;version=${version}
Import-Package= *;resolution:=optional
groovy-2.4.17/config/bnd/groovy.bnd 0000664 0000000 0000000 00000001666 13513043216 0017163 0 ustar 00root root 0000000 0000000 # 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.
version= @GROOVY_BUNDLE_VERSION@
-nouses= true
Export-Package= *;version=${version}
Import-Package= antlr, org.objectweb.asm, *;resolution:=optional
groovy-2.4.17/config/checkstyle/ 0000775 0000000 0000000 00000000000 13513043216 0016533 5 ustar 00root root 0000000 0000000 groovy-2.4.17/config/checkstyle/checkstyle-report.groovy 0000664 0000000 0000000 00000017151 13513043216 0023456 0 ustar 00root root 0000000 0000000 /*
* 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.
*/
/**
* A template which generates an HTML report from the checkstyle XML report
*/
yieldUnescaped ''
def severityMapping = [
error : 'danger',
warning: 'warning',
info : 'info',
ignore : 'success'
]
def github = { path, line=null ->
def localPath = (path - project.rootDir).replaceAll('\\\\','/')
def link = """https://github.com/apache/groovy/blob/master$localPath${line?"#L$line":""}"""
if (line) {
"$line"
} else {
" $link"
}
}
html {
head {
meta 'charset': "utf-8"
meta 'http-equiv': "content-type", content: "text/html; charset=utf-8"
meta 'http-equiv': "X-UA-Compatible", content: "IE=edge"
meta name: "viewport", content: "width=device-width, initial-scale=1"
title "Checkstyle report for ${project.name}"
link href: "http://maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css", rel: "stylesheet"
link href: "http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css", rel: "stylesheet"
link href: "http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css", rel: "stylesheet"
}
body {
div(class:'navbar navbar-inverse navbar-fixed-top', role:'navigation') {
div(class:'container') {
div(class:'navbar-header') {
button(type:'button', class:'navbar-toggle', 'data-toggle':'collapse', 'data-target':'navbar-collaspe') {
span(class:'sr-only', 'Toggle navigation')
span(class:'icon-bar'){}
span(class:'icon-bar'){}
span(class:'icon-bar'){}
}
a(class:'navbar-brand',href:'#', 'Checkstyle report')
}
div(class:'navbar-collapse collapse') {
ul(class:"nav navbar-nav") {
li(class: 'dropdown') {
a(id: 'severityDropdown', href: '#', class: 'dropdown-toggle', 'data-toggle': 'dropdown', 'Severity ')
ul(class: "dropdown-menu dropdown-severity", role: "menu") {
li(role: 'presentation', class: 'active') {
a(role: 'menuitem', tabindex: '-1', href: '#', 'All levels')
}
li(role: 'presentation') { a(role: 'menuitem', tabindex: '-1', href: '#', 'Error') }
li(role: 'presentation') { a(role: 'menuitem', tabindex: '-1', href: '#', 'Warning') }
li(role: 'presentation') { a(role: 'menuitem', tabindex: '-1', href: '#', 'Info') }
li(role: 'presentation') { a(role: 'menuitem', tabindex: '-1', href: '#', 'Ignore') }
}
}
Set rules = files.collect { it.errors.collect { it.source } }.flatten()
li(class: 'dropdown') {
a(id: 'rulesDropdown', href: '#', class: 'dropdown-toggle', 'data-toggle': 'dropdown', 'Rules ')
ul(class: "dropdown-menu dropdown-rule", role: "menu") {
li(role: 'presentation', class: 'active') {
a(role: 'menuitem', tabindex: '-1', href: '#', 'All rules')
}
rules.each { rule ->
li(role: 'presentation') { a(role: 'menuitem', tabindex: '-1', href: '#', rule) }
}
}
}
}
}
}
}
div(class: 'container') {
div(class:'page-header') {
h1("Checkstyle report for project ${project.name}")
}
files.each { file ->
def errors = file.errors
Set severities = errors.collect { "severity-${it.severity}" }
Set panelRules = errors.collect { "rule-${it.source.toLowerCase()}" }
div(class: "panel panel-default ${severities.join(' ')} ${panelRules.join(' ')}") {
div(class: "panel-heading") {
h3(class: 'panel-title', github(file.name))
}
div(class: 'panel-body') {
table(class: "table table-striped table-bordered") {
tbody {
errors.each { err ->
tr(class:"checkstyle-error severity-${err.severity} rule-${err.source.toLowerCase()}") {
td {
h4 {
span(class: "label label-${severityMapping[err.severity]}", err.severity.capitalize())
}
}
td { span "At line ${github(file.name, err.line)}, $err.message" }
}
}
}
}
}
}
}
script(src: "http://code.jquery.com/jquery-1.11.0.min.js") {}
script(src: "http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js") {}
script {
yieldUnescaped '''$(document).ready(function () {
var severity = null;
var rule = null;
doFilter();
function doFilter() {
var severityClass = "severity-" + severity;
var ruleClass = "rule-" + rule;
$('.panel').hide();
$('.checkstyle-error').hide();
$('.checkstyle-error').filter(function () {
return (severity==null || $(this).hasClass(severityClass)) && (rule==null || $(this).hasClass(ruleClass));
}).show();
$('.panel').filter(function () {
return (severity==null || $(this).hasClass(severityClass)) && (rule==null || $(this).hasClass(ruleClass));
}).show();
}
$(".dropdown-severity li a").click(function() {
rule = null;
severity = $(this).text().toLowerCase();
if (severity==="all levels") {
severity = null;
}
doFilter();
});
$(".dropdown-rule li a").click(function() {
severity = null;
rule = $(this).text().toLowerCase();
if (rule==="all rules") {
rule = null;
}
doFilter();
});
});'''
}
}
}
}
groovy-2.4.17/config/checkstyle/checkstyle.xml 0000664 0000000 0000000 00000020220 13513043216 0021407 0 ustar 00root root 0000000 0000000
groovy-2.4.17/config/checkstyle/codeHeader.txt 0000664 0000000 0000000 00000001611 13513043216 0021316 0 ustar 00root root 0000000 0000000 ^/\*$
^ \* 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-2.4.17/config/codenarc/ 0000775 0000000 0000000 00000000000 13513043216 0016153 5 ustar 00root root 0000000 0000000 groovy-2.4.17/config/codenarc/codenarc.groovy 0000664 0000000 0000000 00000037042 13513043216 0021206 0 ustar 00root root 0000000 0000000 /*
* 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.
*/
ruleset {
ruleset('rulesets/naming.xml') {
exclude 'PackageName' {
regex = '^[a-z]([a-zA-Z\\.0-9])*\\b'
}
'ClassName' {
regex = '^[A-Z]([a-zA-Z0-9$_])*\\b'
doNotApplyToClassNames='$Temp,fileNameFinderTest,rayMain'
}
'FieldName' {
regex = '^[a-z]([a-zA-Z0-9$])*\\b'
finalRegex = '^[a-z]([a-zA-Z0-9$])*\\b'
staticFinalRegex = '^[A-Z]([A-Z0-9$_])*\\b|^serialVersionUID\\b'
staticRegex = '^[A-Z]([A-Z0-9$_])*\\b'
doNotApplyToClassNames='Entity,AstNodeToScriptVisitor,LookAndFeelHelper,SwingBuilder,Console,' +
'JavadocAssertionTestBuilder,JavadocAssertionTestSuite,Main,Groovysh,Parser,' +
'AliasTargetProxyCommand,WorkerThread,Cheddar,CategoryTestPropertyCategory,' +
'GroovyClosureMethodsTest,SingletonBugPrivate,SingletonBugProtected,' +
'GroovyInnerEnumBug$MyEnum,GroovyInnerEnumBug,' +
'CategoryTestHelperPropertyReplacer,PrimitiveTypeFieldTest,I3830,Cheese,' +
'SingletonBugTest,ClosureWithStaticVariablesBug,Groovy1018_Bug,Groovy3830Bug,Groovy4386_Bug,' +
'GroovyInnerEnumBug,GroovySwingTestCase,GpathSyntaxTestSupport,MixedMarkupTestSupport,' +
'TraversalTestSupport,CallClosureFieldAsMethodTest'
}
'PropertyName' {
regex = '^[a-z]([a-zA-Z0-9$])*\\b'
finalRegex = '^[a-z]([a-zA-Z0-9$])*\\b'
staticFinalRegex = '^[A-Z]([A-Z0-9$_])*\\b|^serialVersionUID\\b'
staticRegex = '^[A-Z]([A-Z0-9$_])*\\b'
doNotApplyToClassNames='groovy.inspect.swingui.AstNodeToScriptVisitor,groovy.inspect.swingui.ScriptToTreeNodeAdapter,' +
'groovy.swing.factory.TitledBorderFactory,groovy.ui.Console,groovy.ui.OutputTransforms,' +
'org.codehaus.groovy.tools.shell.commands.HistoryCommand,org.codehaus.groovy.tools.shell.commands.PurgeCommand,' +
'org.codehaus.groovy.tools.shell.commands.RecordCommand,org.codehaus.groovy.tools.shell.commands.ShadowCommand,' +
'org.codehaus.groovy.tools.shell.commands.ShowCommand,org.codehaus.groovy.tools.shell.ComplexCommandSupport,' +
'groovy.bugs.StaticPropertyFoo,groovy.bugs.Groovy3135Bug,groovy.util.XmlParserTest,' +
'org.codehaus.groovy.runtime.PerInstanceMetaClassTest,groovy.StaticImportChild,' +
'gls.scope.VariablePrecedenceTest,groovy.bugs.Groovy3069Bug,groovy.StaticImportTarget,' +
'gls.scope.VariablePrecedenceTest,groovy.bugs.Groovy3069Bug,groovy.mock.interceptor.Baz,' +
'groovy.bugs.Groovy2706Bug,groovy.sql.TestHelper,org.codehaus.groovy.runtime.WriterAppendTest,' +
'groovy.bugs.Groovy3135Bug,groovy.mock.interceptor.Baz,groovy.ReadLineTest,' +
'groovy.bugs.TedsClosureBug,groovy.tree.ClosureClassLoaderBug,groovy.tree.NestedClosureBugTest,' +
'groovy.tree.SmallTreeTest,groovy.ReadLineTest,groovy.bugs.Groovy3135Bug,' +
'org.codehaus.groovy.runtime.DateGDKTest,groovy.sql.PersonDTO,groovy.bugs.One,' +
'groovy.bugs.Two,org.codehaus.groovy.runtime.FileAppendTest,org.codehaus.groovy.runtime.WriterAppendTest,' +
'org.codehaus.groovy.runtime.FileAppendTest,org.codehaus.groovy.runtime.WriterAppendTest,groovy.sql.PersonDTO,' +
'groovy.bugs.Groovy3135Bug,Sphere,groovy.sql.PersonDTO,groovy.bugs.Groovy3135Bug,' +
'gls.enums.GrooyColors3693,groovy.sql.PersonDTO,groovy.bugs.HasStaticFieldSomeClass,groovy.PrintTest,' +
'groovy.bugs.StaticClosurePropertyBug,groovy.bugs.Groovy3311Bug,groovy.StaticImportParent,' +
'org.codehaus.groovy.transform.TestTransform,org.codehaus.groovy.classgen.asm.InstructionSequenceHelperClassTest,' +
'groovy.bugs.Groovy3511Bug,groovy.bugs.Groovy3135Bug,groovy.bugs.Groovy2556Bug,' +
'groovy.mock.interceptor.Baz,org.codehaus.groovy.ast.builder.AstBuilderFromCodeTest,' +
'groovy.bugs.UseStaticInClosureBug,groovy.bugs.Groovy2556Bug,' +
'groovy.ReadLineTest,org.codehaus.groovy.runtime.FileAppendTest,org.codehaus.groovy.runtime.WriterAppendTest,' +
'org.codehaus.groovy.transform.TestTransform,groovy.bugs.ClosureWithStaticVariablesBug'
}
'VariableName' {
regex = '^[a-z]([a-zA-Z0-9$])*\\b'
finalRegex = '^[a-z]([a-zA-Z0-9$])*\\b'
doNotApplyToClassNames='groovy.GroovyClosureMethodsTest,groovy.RegularExpressionsTest,groovy.NumberMathTest,' +
'groovy.NumberMathTest,groovy.NumberMathTest,groovy.NumberMathTest,groovy.NumberMathTest,' +
'groovy.NumberMathTest,groovy.NumberMathTest,groovy.NumberMathTest,groovy.NumberMathTest,' +
'groovy.NumberMathTest,groovy.RegularExpressionsTest,' +
'groovy.NumberMathTest,groovy.NumberMathTest,groovy.NumberMathTest,groovy.NumberMathTest,' +
'groovy.RegularExpressionsTest,groovy.NumberMathTest,groovy.NumberMathTest,' +
'groovy.NumberMathTest,groovy.ValidNameTest,groovy.ValidNameTest,' +
'org.codehaus.groovy.runtime.PerInstanceMetaClassTest,' +
'groovy.NumberMathTest,groovy.NumberMathTest,groovy.NumberMathTest,groovy.NumberMathTest,' +
'groovy.NumberMathTest,groovy.NumberMathTest,groovy.NumberMathTest,groovy.NumberMathTest,' +
'gls.scope.NameResolvingTest,groovy.util.AntTest,groovy.sql.SqlCacheTest,' +
'groovy.operator.NegateListsTest,org.codehaus.groovy.reflection.WeakMapTest,' +
'groovy.RegularExpressionsTest,gls.scope.NameResolvingTest'
}
'MethodName' {
doNotApplyToClassNames='groovy.swing.SwingBuilder,groovy.$Temp,groovy.bugs.Groovy4119Bug,' +
'groovy.lang.MetaClassRegistryTest,groovy.lang.MixinTest,' +
'groovy.swing.TitledBorderFactoryJustificationTest'
doNotApplyToFilesMatching='.*spectralnorm\\.groovy'
}
'ParameterName' {
doNotApplyToClassNames='groovy.bugs.MyDelegatingMetaClass'
doNotApplyToFilesMatching='.*spectralnorm\\.groovy'
}
'ConfusingMethodName' {
doNotApplyToClassNames='Groovy1059Foo'
}
exclude 'FactoryMethodName' // many violations
}
ruleset('rulesets/unused.xml') {
'UnusedVariable' {
doNotApplyToClassNames = 'SourceBaseTestCase,SAXTest,groovy.ForLoopTest,groovy.bugs.Groovy3894Bug,' +
'ExpandoMetaClassTest,ExceptionTest,JSR223Test,' +
'groovy.util.GroovyShellTestCase,org.codehaus.groovy.tools.shell.ShellRunner,' +
'groovy.bugs.Bytecode7Bug,groovy.mock.interceptor.HalfMockTest,' +
'groovy.mock.interceptor.MockSingleCallTest,groovy.mock.interceptor.StubSingleCallTest,' +
'groovy.operator.TernaryOperatorsTest,groovy.swing.SwingBuilderTableTest,' +
'groovy.swing.SwingBuilderTest,groovy.util.BuilderSupportTest,' +
'groovy.util.GroovyScriptEngineTest,groovy.util.ObservableMapTest,' +
'groovy.xml.NamespaceNodeGPathTest,groovy.bugs.ClassGeneratorFixesTest,' +
'groovy.bugs.ClosureWithBitwiseDefaultParamTest,groovy.bugs.ConstructorThisCallBug,' +
'groovy.bugs.InconsistentStackHeightBug,groovy.bugs.InterfaceImplBug,' +
'groovy.bugs.TedsClosureBug,org.codehaus.groovy.ast.builder.AstBuilderFromCodeTest,' +
'SubscriptTest,UnsafeNavigationTest,' +
'GStringTest,GeneratorTest,GroovyClosureMethodsTest,' +
'GroovyMethodsTest,ImmutableModificationTest,LittleClosureTest,' +
'NumberMathTest,OptionalReturnTest,OverridePropertyGetterTest,' +
'PrivateVariableAccessFromAnotherInstanceTest,PropertyTest,' +
'gls.annotations.closures.CallOnOwner,gls.annotations.closures.JavaCompatibility,' +
'gls.annotations.closures.CallOnThisObject,gls.annotations.closures.JavaCompatibilityParameterized,' +
'gls.annotations.closures.UnqualifiedCall,groovy.CompileOrderTest,' +
'gls.annotations.closures.ClosureWithParameters,EscapedUnicodeTest,' +
'groovy.bugs.Groovy2365Base,groovy.bugs.Groovy249_Bug,' +
'groovy.bugs.Groovy3139Bug,groovy.bugs.Get2,groovy.bugs.Groovy3511Bug,' +
'org.codehaus.groovy.tools.LoaderConfigurationTest'
}
'UnusedPrivateField' {
doNotApplyToClassNames='gls.annotations.closures.CallOnOwner,gls.annotations.closures.CallOnThisObject,' +
'gls.annotations.closures.UnqualifiedCall,gls.annotations.closures.ClosureWithParameters,' +
'gls.annotations.closures.JavaCompatibility,gls.annotations.closures.JavaCompatibilityParameterized,' +
'groovy.Foo,groovy.Singlet'
}
'UnusedPrivateMethod' {
doNotApplyToClassNames='org.codehaus.groovy.ast.builder.AstBuilder,org.codehaus.groovy.ast.builder.AstSpecificationCompiler,' +
'StringMethodName,Foo'
}
'UnusedPrivateMethodParameter' {
doNotApplyToClassNames='CurryFoo4170,AssertionRenderingTest'
}
'UnusedObject' {
doNotApplyToClassNames='groovy.ui.OutputTransforms,org.codehaus.groovy.ast.builder.AstSpecificationCompiler,groovy.lang.GroovyCodeSourceTest'
}
}
ruleset('rulesets/imports.xml') {
'UnnecessaryGroovyImport' {
doNotApplyToFileNames='JListProperties.groovy,GridBagFactory.groovy,Groovy558_616_Bug.groovy'
}
'DuplicateImport' {
doNotApplyToFileNames='StaticImportTest.groovy,'
}
exclude 'ImportFromSamePackage' // too many to worry about, review later
exclude 'MisorderedStaticImports' // too many to worry about, opposite to IDEA default
}
ruleset('rulesets/logging.xml') {
exclude 'SystemOutPrint' // too many to worry about, review later
exclude 'SystemErrPrint' // too many to worry about, review later
}
ruleset('rulesets/braces.xml') {
exclude 'ForStatementBraces' // for statements without braces seems acceptable in our coding standards
exclude 'IfStatementBraces' // if statements without braces seems acceptable in our coding standards
exclude 'WhileStatementBraces' // while statements without braces seems acceptable in our coding standards
exclude 'ElseBlockBraces' // else statements without braces seems acceptable in our coding standards
}
ruleset('rulesets/basic.xml') {
'DeadCode' {
doNotApplyToClassNames='ThrowTest'
}
}
ruleset('rulesets/size.xml') {
exclude 'CyclomaticComplexity' // too many to worry about, review later
exclude 'AbcMetric' // too many to worry about, review later
exclude 'MethodSize' // too many to worry about, review later
exclude 'MethodCount' // too many to worry about, review later
exclude 'ClassSize' // too many to worry about, review later
exclude 'MethodSizeCount' // too many to worry about, review later
exclude 'NestedBlockDepth' // too many to worry about, review later
}
ruleset('rulesets/junit.xml') {
exclude 'JUnitStyleAssertions' // too many to worry about, review later
exclude 'JUnitTestMethodWithoutAssert' // too many to worry about, review later
exclude 'JUnitLostTest' //we do not use the @Test annotation, so it is o.k. to use JUnit 4 classes and have test* Methods without this annotation
}
ruleset('rulesets/concurrency.xml') {
exclude 'SynchronizedMethod' // OK within Groovy
exclude 'WaitOutsideOfWhileLoop' // too many to worry about, review later
exclude 'SynchronizedOnThis' // too many to worry about, review later
}
ruleset('rulesets/unnecessary.xml') {
'UnnecessaryInstantiationToGetClass' {
doNotApplyToClassNames='SpreadDotTest'
}
'ConsecutiveStringConcatenation' {
doNotApplyToClassNames='groovy.DynamicMemberTest,groovy.StaticImportTest,groovy.bugs.Groovy675_Bug,groovy.bugs.MorgansBug,' +
'groovy.bugs.WriteOnlyPropertyBug,groovy.operator.StringOperatorsTest,groovy.swing.SwingBuilderTest,' +
'org.codehaus.groovy.runtime.powerassert.EvaluationTest,groovy.json.JsonLexerTest'
}
'ConsecutiveLiteralAppends' {
doNotApplyToClassNames='groovy.bugs.ByteIndexBug'
}
exclude 'UnnecessaryPackageReference' // failing for all scripts
}
ruleset('rulesets/dry.xml') {
exclude 'DuplicateNumberLiteral' // too many to worry about, review later
exclude 'DuplicateStringLiteralRule' // too many to worry about, review later
exclude 'DuplicateStringLiteral' // too many to worry about, review later
}
ruleset('rulesets/design.xml') {
'CloseWithoutCloseable' {
doNotApplyToClassNames='Log4jInterceptingAppender'
}
exclude 'EmptyMethodInAbstractClass' // too many to worry about, review later
exclude 'ImplementationAsType' // too many to worry about, review later
exclude 'AbstractClassWithoutAbstractMethod' // too many to worry about, review later
exclude 'ConstantsOnlyInterface' // too many to worry about, review later
exclude 'FinalClassWithProtectedMember' // too many to worry about, review later
}
ruleset('rulesets/exceptions.xml') {
exclude 'ThrowRuntimeException' // too many to worry about, review later
exclude 'ThrowException' // too many to worry about, review later
exclude 'CatchThrowable' // too many to worry about, review later
exclude 'CatchException' // too many to worry about, review later
exclude 'CatchRuntimeException' // too many to worry about, review later
exclude 'CatchNullPointerException' // too many to worry about, review later
exclude 'ReturnNullFromCatchBlock' // too many to worry about, review later
exclude 'ThrowNullPointerException' // too many to worry about, review later
exclude 'CatchIllegalMonitorStateException' // too many to worry about, review later
exclude 'CatchError' // too many to worry about, review later
exclude 'ExceptionExtendsError' // too many to worry about, review later
exclude 'ThrowError' // too many to worry about, review later
}
}
groovy-2.4.17/config/licensing/ 0000775 0000000 0000000 00000000000 13513043216 0016350 5 ustar 00root root 0000000 0000000 groovy-2.4.17/config/licensing/HEADER.txt 0000664 0000000 0000000 00000001401 13513043216 0020035 0 ustar 00root root 0000000 0000000 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-2.4.17/gradle.properties 0000664 0000000 0000000 00000002357 13513043216 0016513 0 ustar 00root root 0000000 0000000 # 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.
groovyVersion = 2.4.17
# bundle version format: major('.'minor('.'micro('.'qualifier)?)?)? (first 3 only digits)
groovyBundleVersion = 2.4.17
gradle_version=2.14.1
groovyJUnit_ms=512m
groovyJUnit_mx=1g
groovyJUnit_permSize=64m
groovyJUnit_maxPermSize=256m
javacMain_mx=512m
groovycMain_mx=1g
groovycTest_mx=1g
javaDoc_mx=1g
org.gradle.jvmargs=-Xms800m -Xmx1500m -XX:MaxPermSize=512m -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled -XX:+IgnoreUnrecognizedVMOptions
groovy-2.4.17/gradle/ 0000775 0000000 0000000 00000000000 13513043216 0014366 5 ustar 00root root 0000000 0000000 groovy-2.4.17/gradle/asciidoctor.gradle 0000664 0000000 0000000 00000012624 13513043216 0020056 0 ustar 00root root 0000000 0000000 /*
* 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.
*/
apply plugin: 'org.asciidoctor.gradle.asciidoctor'
asciidoctor {
def (full, major, minor, patch, flavor) = (groovyVersion =~ /(\d+)\.(\d++)\.(\d+)(?:-(.+))?/)[0]
logDocuments = true
sourceDir = project.file('src/spec/doc')
attributes([
'rootProjectDir': rootProject.projectDir,
'source-highlighter': 'prettify',
groovyversion: groovyVersion,
'groovy-major-version': major,
'groovy-minor-version': minor,
'groovy-patch-version': patch,
'groovy-full-version': groovyVersion,
'groovy-short-version': "${major}.${minor}",
doctype: 'book',
revnumber: groovyVersion,
icons: 'font',
toc2: '',
specfolder: 'src/spec/doc',
linkcss: '',
stylesheet: "assets/css/style.css",
encoding: 'utf-8',
toclevels: 10,
numbered: '',
sectanchors: ''
])
extensions {
def baseUrls = [
jdk: "http://docs.oracle.com/javase/8/docs/api/index.html",
gjdk: "http://docs.groovy-lang.org/${version}/html/groovy-jdk/index.html",
gapi: "http://docs.groovy-lang.org/${version}/html/gapi/index.html",
]
baseUrls.each { macroName, baseURL ->
inlinemacro(name: macroName) {
parent, target, attributes ->
def (className, anchor) = target.split('#') as List
options = [
"type" : ":link",
"target": calculateDocUrl(baseURL, className, anchor)
]
createInline(parent, "anchor", attributes.text?:target, attributes, options).render()
}
}
}
}
// skip the asciidoctor task if there's no directory with asciidoc files
asciidoctor.onlyIf { project.file('src/spec/doc').exists() }
task asciidoctorAssets(type:Copy) {
from project.fileTree('src/spec/assets')
into "${asciidoctor.outputDir}/html5/assets"
into "${rootProject.asciidoctor.outputDir}/html5/assets"
}
asciidoctor.finalizedBy asciidoctorAssets
def adocSanityCheck = { file, text, errors ->
Set localErrors = []
text.eachLine(1) { line,i ->
if (line =~ /tag:[a-zA-Z0-9]/) {
localErrors << "line $i misses semicolon. Should be tag::\n $line"
}
if (line =~ /end:[a-zA-Z0-9]/) {
localErrors << "line $i misses semicolon. Should be end::\n $line"
}
if (line =~ /(tag|end)::[^\[\]]$/) {
localErrors << "line $i contains incorrect tag definition (misses []):\n $line"
}
}
localErrors.collect(errors) { " $file, $it" }
}
def htmlOutputSanityCheck = { file, text, errors ->
Set localErrors = []
text.eachLine(1) { line,i ->
if (line =~ /^={1,5} /) {
localErrors << "line $i starting with asciidoctor raw markup:\n$line"
}
if (line =~ /<\/code>/) {
localErrors << "contains empty code block, probably incorrect import of a tag."
}
if (line =~ /(gapi|jdk|gjdk):(.+?)/) {
localErrors << "line $i starting with asciidoctor raw markup:\n$line"
}
}
localErrors.collect(errors) { " $file, $it" }
}
asciidoctor {
def errors = new LinkedHashSet()
doFirst {
def specTestDir = file('src/spec/test')
if (specTestDir.exists()) {
specTestDir.eachFileRecurse { file ->
if (file.isFile()) {
adocSanityCheck(file, file.getText('utf-8'), errors)
}
}
}
if (errors) {
throw new GradleException("Incorrect Asciidoctor input:\n${errors.join('\n')}")
}
}
doLast {
def scripts = '''
'''
// gapi macro expansion
outputDir.eachFileMatch(~'.*html') { File file ->
def text = file.getText('UTF-8')
text = text.replaceAll('', "$scripts")
htmlOutputSanityCheck(file, text, errors)
file.write(text, 'UTF-8')
}
if (errors) {
throw new GradleException("Incorrect Asciidoctor output:\n${errors.join('\n')}")
}
}
}
String calculateDocUrl(String baseUrl, String className, String anchor) {
if (className == "index") return baseUrl
return baseUrl + "?" + className.replace('.', '/') + '.html' + (anchor ? '#' + anchor : '')
}
groovy-2.4.17/gradle/assemble.gradle 0000664 0000000 0000000 00000067772 13513043216 0017364 0 ustar 00root root 0000000 0000000 /*
* 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.
*/
import org.apache.tools.ant.filters.ReplaceTokens
apply plugin: 'osgi'
group = 'org.codehaus.groovy'
archivesBaseName = 'groovy'
ext.srcSpec = copySpec {
from(projectDir) {
exclude 'target',
'benchmark',
'subprojects/*/target',
'buildSrc/target',
buildDir.path,
'classes/**',
'cruise/**',
'security/groovykeys',
'.clover/*',
'local.build.properties',
'gradle/wrapper',
'gradlew',
'gradlew.bat',
'cobertura.ser',
'junitvmwatcher*.properties',
'out',
'artifactory.properties', // generated by the CI server
'gradle.properties.gz', // generated by the CI server
'**/*.iml', // used by Intellij IDEA
'**/*.ipr', // used by Intellij IDEA
'**/*.iws', // used by Intellij IDEA
'.settings', // used by Eclipse
'.gradle', // used by Gradle
'buildSrc/.gradle' // used by Gradle
}
}
ext.docSpec = copySpec {
into('html/api') {
from javadocAll.destinationDir
}
into('html/gapi') {
from groovydocAll.destinationDir
}
into('html/documentation') {
from "$buildDir/asciidoc/html5"
}
into('html/groovy-jdk') {
from docGDK.destinationDir
}
into('licenses') {
from 'licenses'
include 'asciidoc-style-license.txt'
include 'jquery-js-license.txt'
include 'normalize-stylesheet-license.txt'
}
from "$projectDir/licenses/LICENSE-DOC"
from "$projectDir/notices/NOTICE-BASE"
rename 'LICENSE-DOC', 'LICENSE'
rename 'NOTICE-BASE', 'NOTICE'
}
task copy(type: Copy) {
into "$buildDir/meta"
}
ext.allManifest = manifest {
attributes('Built-By': System.properties['user.name'],
'Extension-Name': 'groovy',
'Specification-Title': 'Groovy: a powerful, dynamic language for the JVM',
'Specification-Version': groovyBundleVersion,
'Specification-Vendor': 'The Apache Software Foundation',
'Implementation-Title': 'Groovy: a powerful, dynamic language for the JVM',
'Implementation-Version': groovyBundleVersion,
'Implementation-Vendor': 'The Apache Software Foundation',
'Bundle-ManifestVersion': '2',
'Bundle-Name': 'Groovy Runtime',
'Bundle-Description': 'Groovy Runtime',
'Bundle-Version': groovyBundleVersion,
'Bundle-Vendor': 'The Apache Software Foundation',
'Bundle-ClassPath': '.',
'Eclipse-BuddyPolicy': 'dependent',
'DynamicImport-Package': '*',
'Main-class': 'groovy.ui.GroovyMain')
}
ext.groovyOsgiManifest = {
// Exclude the Bnd-LastModified attribute as it always triggers a rebuild without being really needed.
from(allManifest) {
eachEntry { details ->
if (details.key == 'Bnd-LastModified') {
details.exclude()
}
}
}
version = groovyBundleVersion
instruction '-nouses', 'true'
instruction 'Export-Package', "*;version=${groovyBundleVersion}"
classpath = sourceSets.main.runtimeClasspath
}
ext.subprojectOsgiManifest = {
// Exclude attributes not needed for subprojects.
from(allManifest) {
eachEntry { details ->
if (details.key in ['Bnd-LastModified', 'Extension-Name', 'Bundle-Name', 'Bundle-Description', 'Main-class']) {
details.exclude()
}
}
}
version = groovyBundleVersion
instruction '-nouses', 'true'
instruction 'Export-Package', "*;version=${groovyBundleVersion}"
classpath = sourceSets.main.runtimeClasspath
}
jar {
dependsOn('dgmConverter')
metaInf {
from("$projectDir/licenses/LICENSE-JARJAR")
from("$projectDir/licenses") {
into('licenses')
include('asm-license.txt')
include('antlr2-license.txt')
}
from("$projectDir/notices/NOTICE-JARJAR")
from('src/main/META-INF/groovy-release-info.properties') {
filter(rootProject.propertiesFilter, org.apache.tools.ant.filters.ReplaceTokens)
}
rename { String filename -> filename == 'LICENSE-JARJAR' ? 'LICENSE' : filename == 'NOTICE-JARJAR' ? 'NOTICE' : filename }
}
exclude '**/package-info.class', 'META-INF/groovy-release-info.properties'
}
allprojects {
task jarjar(type:Jar, dependsOn: jar) {
destinationDir = jar.destinationDir
baseName = jar.baseName
appendix = jar.appendix?"${jar.appendix}-jarjar":"jarjar"
classifier = jar.classifier
includeEmptyDirs = false
def target = new File("${archivePath}.tmp")
def targetTmp = new File("${archivePath}.tmp.1.tmp")
doFirst {
from zipTree(target)
def keepUntouched = [
'org/codehaus/groovy/cli/GroovyPosixParser*.class',
'groovy/util/CliBuilder*.class',
'groovy/util/OptionAccessor*.class',
'org/codehaus/groovy/tools/shell/util/HelpFormatter*.class'
].join(',')
boolean isRoot = project == rootProject
def gradleProject = project
ant {
taskdef name: 'jarjar', classname: 'com.tonicsystems.jarjar.JarJarTask', classpath: rootProject.configurations.tools.asPath
jarjar(jarfile: targetTmp) {
zipfileset(
src: jar.archivePath,
excludes: keepUntouched)
// only groovy core will include the dependencies repackaged
if (isRoot) {
configurations.runtime.files.findAll { file ->
['antlr', 'asm', 'commons-cli'].any {
file.name.startsWith(it)
} && ['asm-attr', 'asm-util', 'asm-analysis'].every { !file.name.startsWith(it) }
}.each { jarjarFile ->
// explanation of excludes:
// GROOVY-7386: stop copy of incorrect maven meta info
// GROOVY-8387: we don't want module-info.class from any dependencies
zipfileset(src: jarjarFile, excludes: 'META-INF/maven/commons-cli/commons-cli/*,META-INF/*,module-info.class')
}
zipfileset(src: configurations.runtime.files.find { file -> file.name.startsWith('asm-util') },
includes: 'org/objectweb/asm/util/Printer.class,org/objectweb/asm/util/Textifier.class,org/objectweb/asm/util/Trace*')
}
rule pattern: 'antlr.**', result: 'groovyjarjarantlr.@1'
rule pattern: 'org.objectweb.**', result: 'groovyjarjarasm.@1'
rule pattern: 'org.apache.commons.cli.**', result: 'groovyjarjarcommonscli.@1'
}
}
def manifestSpec = isRoot ? groovyOsgiManifest : subprojectOsgiManifest
manifest = osgiManifest {
symbolicName = gradleProject.name
instruction 'Import-Package', '*;resolution:=optional'
classesDir = targetTmp
}
manifest(manifestSpec)
def manifestPath = "${temporaryDir}/META-INF/MANIFEST.MF"
manifest.writeTo(manifestPath)
ant.copy(file: targetTmp, tofile: target)
ant.jar(destfile: target, update: true, manifest: manifestPath) {
zipfileset(
src: jar.archivePath,
includes: keepUntouched)
}
}
doLast {
target.delete()
ant.delete(file: targetTmp, quiet: true, deleteonexit: true)
}
}
if (project.name in ['groovy', 'groovy-test']) {
task grooidjar(type: Jar) {
onlyIf {
!rootProject.useIndy()
}
destinationDir = jar.destinationDir
baseName = jar.baseName
appendix = jar.appendix
classifier = jar.classifier ? "${jar.classifier}grooid" : 'grooid'
includeEmptyDirs = false
def target = new File("${archivePath}.tmp")
boolean isRootProject = project==rootProject
doFirst {
from zipTree(target)
ant {
taskdef name: 'jarjar', classname: 'com.tonicsystems.jarjar.JarJarTask', classpath: rootProject.configurations.tools.asPath
jarjar(jarfile: target) {
zipfileset(dir: "$rootProject.projectDir/notices/", includes: isRootProject ? 'NOTICE-GROOIDJARJAR' : 'NOTICE-GROOID', fullpath: 'META-INF/NOTICE')
zipfileset(src: jarjar.archivePath, excludes: 'META-INF/NOTICE')
if (isRootProject) {
zipfileset(src: rootProject.configurations.runtime.files.find { it.name.startsWith('openbeans') }, excludes: 'META-INF/*')
}
rule pattern: 'com.googlecode.openbeans.**', result: 'groovyjarjaropenbeans.@1'
rule pattern: 'org.apache.harmony.beans.**', result: 'groovyjarjarharmonybeans.@1'
rule pattern: 'java.beans.**', result: 'groovyjarjaropenbeans.@1'
}
}
}
doLast {
target.delete()
}
}
jarjar.finalizedBy(grooidjar)
}
}
subprojects { sp ->
jar {
metaInf {
if (file("${projectDir}/LICENSE").exists()) {
from "${projectDir}/LICENSE"
} else {
from "${rootProject.projectDir}/licenses/LICENSE-BASE"
}
if (file("${projectDir}/NOTICE").exists()) {
from "${projectDir}/NOTICE"
} else {
from "${rootProject.projectDir}/notices/NOTICE-BASE"
}
from("${rootProject.projectDir}/src/main/META-INF/groovy-release-info.properties") {
filter(rootProject.propertiesFilter, org.apache.tools.ant.filters.ReplaceTokens)
}
rename { String filename -> filename == 'LICENSE-BASE' ? 'LICENSE' : filename == 'NOTICE-BASE' ? 'NOTICE' : filename }
}
exclude '**/package-info.class', 'META-INF/groovy-release-info.properties'
}
}
def moduleJars() {
modules()*.jar.archivePath
}
def mergeModuleDescriptors() {
new File("$buildDir/tmp/").mkdirs()
def extensionClasses = []
def staticExtensionClasses = []
modules().collect {
new File("${it.buildDir}/classes/main/META-INF/services/org.codehaus.groovy.runtime.ExtensionModule")
}.findAll { it.exists() }.each {
def props = new Properties()
props.load(it.newInputStream())
extensionClasses += props.get('extensionClasses').split(',').findAll { it }
staticExtensionClasses += props.get('staticExtensionClasses').split(',').findAll { it }
}
def descriptor = new File("$buildDir/tmp/org.codehaus.groovy.runtime.ExtensionModule")
descriptor.withWriter('UTF-8') {
it << '# This is a generated file, do not edit\n'
it << 'moduleName=groovy-all\n'
it << "moduleVersion=${project.version}\n"
it << "extensionClasses=${extensionClasses.join(',')}\n"
it << "staticExtensionClasses=${staticExtensionClasses.join(',')}\n"
}
descriptor
}
task replaceJarWithJarJar(dependsOn: allprojects.jarjar ) {
description = "Overwrites normal JAR files with their JARJAR version"
doLast {
allprojects {
def jarjarFile = tasks.jarjar.archivePath
if (jarjarFile) {
file(jar.archivePath).delete()
ant.copy(file: jarjarFile, tofile: jar.archivePath)
jarjarFile.delete()
}
}
}
inputs.files(allprojects.jarjar.archivePath)
outputs.files(allprojects.jar.archivePath)
}
allprojects {
rootProject.replaceJarWithJarJar.mustRunAfter(test)
}
task jarAll(type: Jar, dependsOn: replaceJarWithJarJar) {
inputs.files(allprojects.jar.archivePath)
ext.metaInfDir = "$buildDir/tmp/groovy-all-metainf"
baseName = 'groovy-all'
includeEmptyDirs = false
if (rootProject.useIndy()) {
classifier = 'indy'
}
doLast {
def manifestPath = "$ext.metaInfDir/MANIFEST.MF"
manifest.writeTo(manifestPath)
copy {
from "$projectDir/notices/NOTICE-ALLJARJAR"
into owner.ext.metaInfDir
rename('NOTICE-ALLJARJAR', 'NOTICE')
}
copy {
from "$projectDir/licenses"
into "$owner.ext.metaInfDir/licenses"
include 'normalize-stylesheet-license.txt'
include 'jsr223-license.txt'
include 'jline2-license.txt'
}
copy {
from "$projectDir/licenses/LICENSE-ALLJARJAR"
into owner.ext.metaInfDir
rename('LICENSE-ALLJARJAR', 'LICENSE')
}
copy {
from(mergeModuleDescriptors())
into "$owner.ext.metaInfDir/services"
}
copy {
into "$owner.ext.metaInfDir"
}
logger.info 'Packaging with jarjar'
def archivePathTmp = new File("${archivePath}.1.tmp")
ant {
taskdef name: 'jarjar', classname: 'com.tonicsystems.jarjar.JarJarTask', classpath: configurations.tools.asPath
jarjar(jarfile: archivePathTmp, manifest: "$owner.ext.metaInfDir/MANIFEST.MF") {
zipfileset(dir: "$owner.ext.metaInfDir", prefix: 'META-INF')
zipfileset(src: jar.archivePath, excludes:'META-INF/NOTICE,META-INF/LICENSE')
moduleJars().each {
zipfileset(src: it, excludes:'META-INF/NOTICE,META-INF/LICENSE')
}
}
}
manifest = osgiManifest {
symbolicName = 'groovy-all'
instruction 'Import-Package', '*;resolution:=optional'
classesDir = archivePathTmp
}
manifest groovyOsgiManifest
manifestPath = "${temporaryDir}/META-INF/MANIFEST.MF"
manifest.writeTo(manifestPath)
ant {
copy(file: archivePathTmp, tofile: archivePath)
jar(destfile: archivePath, update: true, index: true, manifest: manifestPath) {
zipfileset(src: jar.archivePath, excludes:'META-INF')
}
delete(file: archivePathTmp, quiet: true, deleteonexit: true)
}
}
}
allprojects {
task jarWithIndy(type: GradleBuild) {
onlyIf rootProject.indyCapable
description = 'Triggers an external build generating the indy jar'
buildFile = 'build.gradle'
startParameter.projectProperties['indy'] = true
tasks = ['jar']
}
}
task jarAllWithIndy(type: GradleBuild) {
onlyIf rootProject.indyCapable
description = 'Triggers an external build generating the indy jarAll'
buildFile = 'build.gradle'
startParameter.projectProperties['indy'] = true
tasks = ['jarAll']
}
task jarAllAll(dependsOn: [jarAll, jarAllWithIndy]) {
description = 'Generates groovy-all and groovy-all-indy jars'
doFirst {
if (useIndy()) {
logger.lifecycle('InvokeDynamic support was activated but needs to be off for this pass. Disabling.')
ext.useIndy = false
}
}
}
allprojects {
tasks.withType(Test) { task ->
jarAll.mustRunAfter(task)
jarAllWithIndy.mustRunAfter(task)
}
}
task sourceAllJar(type: Jar, dependsOn: { modules()*.sourceJar + rootProject.sourceJar }) {
with sourceJar.rootSpec
modules()*.sourceJar.each {
with it.rootSpec
}
baseName = 'groovy-all'
classifier = rootProject.useIndy() ? 'indy-sources' : 'sources'
}
allprojects {
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = rootProject.useIndy() ? 'indy-javadoc' : 'javadoc'
from javadoc.destinationDir
}
task groovydocJar(type: Jar, dependsOn: groovydoc) {
classifier = rootProject.useIndy() ? 'indy-groovydoc' : 'groovydoc'
from groovydoc.destinationDir
}
}
task javadocAllJar(type: Jar, dependsOn: javadocAll) {
baseName = 'groovy-all'
classifier = rootProject.useIndy() ? 'indy-javadoc' : 'javadoc'
from javadocAll.destinationDir
}
task groovydocAllJar(type: Jar, dependsOn: groovydocAll) {
baseName = 'groovy-all'
classifier = rootProject.useIndy() ? 'indy-groovydoc' : 'groovydoc'
from groovydocAll.destinationDir
}
ext.distSpec = copySpec {
from("$projectDir/licenses/LICENSE-BINZIP")
from("$projectDir/notices/NOTICE-BINZIP")
rename { String filename -> filename == 'LICENSE-BINZIP' ? 'LICENSE' : filename == 'NOTICE-BINZIP' ? 'NOTICE' : filename }
into('lib') {
from jar.archivePath
from {
configurations.runtime.findAll {
it.name.endsWith('jar') && !it.name.startsWith('openbeans-') && !it.name.startsWith('asm-') && !it.name.startsWith('antlr-') } +
modules()*.jar.archivePath +
modules().configurations.runtime*.findAll {
it.name.endsWith('jar') && !it.name.contains('livetribe-jsr223') && !it.name.matches(/groovy-\d.*/) &&
!it.name.startsWith('asm-') && !it.name.startsWith('antlr-') && !it.name.startsWith('openbeans-')
}.flatten() as Set
}
from('src/bin/groovy.icns')
}
into('indy') {
from { new File(jar.archivePath.parent, "${jar.baseName}-${jar.version}-indy.jar") }
from {
modules()*.jar.collect { j ->
new File(j.archivePath.parent, "${j.baseName}-${j.version}-indy.jar")
}
}
}
into('grooid') {
from { new File(jar.archivePath.parent, "${jar.baseName}-${jar.version}-grooid.jar") }
from {
modules()*.jar.collect { j ->
new File(j.archivePath.parent, "${j.baseName}-${j.version}-grooid.jar")
}
}
}
into('conf') {
from 'src/conf'
}
into('bin') {
from('src/bin') {
filter(ReplaceTokens, tokens: [GROOVYJAR:jar.archiveName])
fileMode = 0755
exclude 'groovy.icns'
}
from('src/tools/org/codehaus/groovy/tools/groovy.ico')
}
into('licenses') {
from 'licenses'
include 'antlr2-license.txt'
include 'asm-license.txt'
include 'hamcrest-license.txt'
include 'jline2-license.txt'
include 'jsr166y-license.txt'
include 'jsr223-license.txt'
include 'junit-license.txt'
include 'xstream-license.txt'
}
into('embeddable') {
from jarAll.archivePath
from { new File(jarAll.destinationDir, "${jarAll.baseName}-${jarAll.version}-indy.jar") }
}
}
task distBin(type: Zip, dependsOn: [jar, jarAllAll, replaceJarWithJarJar]) {
baseName = 'apache-groovy'
appendix = 'binary'
into("groovy-$version") {
with distSpec
}
}
task distDoc(type: Zip, dependsOn: doc) {
baseName = 'apache-groovy'
appendix = 'docs'
into("groovy-$version") {
with docSpec
}
}
task syncDoc(type: Copy, dependsOn: doc) {
inputs.files javadoc.outputs.files
inputs.files groovydoc.outputs.files
destinationDir(file("$buildDir/html"))
into('api') {
from javadoc.destinationDir
}
into('gapi') {
from groovydoc.destinationDir
}
// groovy-jdk already at the correct place
}
task distSrc(type: Zip) {
baseName = 'apache-groovy'
appendix = 'src'
into("groovy-$version")
with srcSpec
}
def installDir = {
project.hasProperty('groovy_installPath')?project.groovy_installPath:
System.properties.installDirectory ?: "$buildDir/install"
}
task installGroovy(type: Sync, dependsOn: [checkCompatibility, distBin]) {
description 'Generates a groovy distribution into an install directory'
doLast {
logger.lifecycle "Groovy installed under ${installDir()}"
}
with distSpec
into installDir
}
import org.gradle.api.file.DuplicatesStrategy
task dist(type: Zip, dependsOn: [checkCompatibility, distBin, distSrc, distDoc, syncDoc]) {
description = 'Generates the binary, sources, documentation and full distributions'
baseName = 'apache-groovy'
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
appendix 'sdk'
into "groovy-$version"
from("$projectDir/licenses/LICENSE-SDK")
from("$projectDir/notices/NOTICE-SDK")
rename { String filename -> filename == 'LICENSE-SDK' ? 'LICENSE' : filename == 'NOTICE-SDK' ? 'NOTICE' : filename }
with distSpec
into('doc') {
with docSpec
}
into('src') {
with srcSpec
}
if ((version.endsWith('SNAPSHOT') && !groovyBundleVersion.endsWith('SNAPSHOT'))
|| (!version.endsWith('SNAPSHOT') && groovyBundleVersion.endsWith('SNAPSHOT'))) {
throw new GradleException("Incoherent versions. Found groovyVersion=$version and groovyBundleVersion=$groovyBundleVersion")
}
}
task updateLicenses {
description = 'Updates the various LICENSE files'
ext.licensesDir = "${projectDir}/licenses"
ext.licenseBaseFile = "${licensesDir}/LICENSE-BASE"
ext.licenseSrcFile = "${projectDir}/LICENSE"
ext.licenseDocGeneratorFile = "${projectDir}/subprojects/groovy-docgenerator/LICENSE"
ext.licenseGroovyDocFile = "${projectDir}/subprojects/groovy-groovydoc/LICENSE"
ext.licenseGroovyshFile = "${projectDir}/subprojects/groovy-groovysh/LICENSE"
ext.licenseJsr223File = "${projectDir}/subprojects/groovy-jsr223/LICENSE"
ext.licenseAllJarJarFile = "${licensesDir}/LICENSE-ALLJARJAR"
ext.licenseBinZipFile = "${licensesDir}/LICENSE-BINZIP"
ext.licenseDocFile = "${licensesDir}/LICENSE-DOC"
ext.licenseJarJarFile = "${licensesDir}/LICENSE-JARJAR"
ext.licenseSdkFile = "${licensesDir}/LICENSE-SDK"
inputs.files(licenseBaseFile, fileTree(licensesDir).include('*.txt'))
outputs.files(licenseAllJarJarFile, licenseBinZipFile, licenseDocFile, licenseJarJarFile, licenseSrcFile,
licenseDocGeneratorFile, licenseGroovyDocFile, licenseGroovyshFile, licenseJsr223File, licenseSdkFile)
doLast {
def srcFiles = fileTree(licensesDir).include('*-SRC*.txt').sort { it.name }
def docFiles = fileTree(licensesDir).include('*-DOC*.txt').sort { it.name }
def jarjarFiles = fileTree(licensesDir).include('*-JARJAR*.txt').sort { it.name }
def allJarjarFiles = fileTree(licensesDir) {
include '*-JARJAR*.txt'
include '*-ALLJARJAR*.txt'
}.sort { it.name }
def binzipFiles = fileTree(licensesDir) {
include '*-JARJAR*.txt'
include '*-ALLJARJAR*.txt'
include '*-BINZIP*.txt'
}.sort { it.name }
def docgeneratorFiles = fileTree(licensesDir).include('normalize-stylesheet-groovy-docgenerator.txt')
def groovydocFiles = fileTree(licensesDir).include('normalize-stylesheet-groovy-groovydoc.txt')
def groovyshFiles = fileTree(licensesDir).include('jline2-patch-ALLJARJAR-SRC.txt')
def jsr223Files = fileTree(licensesDir).include('jsr223-ALLJARJAR-SRC.txt')
def licenseHdr = '\n\n------------------------------------------------------------------------\n\n'
[
(licenseAllJarJarFile) : allJarjarFiles,
(licenseBinZipFile) : binzipFiles,
(licenseDocFile) : docFiles,
(licenseJarJarFile) : jarjarFiles,
(licenseSrcFile) : srcFiles,
(licenseDocGeneratorFile): docgeneratorFiles,
(licenseGroovyDocFile) : groovydocFiles,
(licenseGroovyshFile) : groovyshFiles,
(licenseJsr223File) : jsr223Files,
].each { outFile, inFiles ->
file(outFile).withWriter('utf-8') { writer ->
writer << ([file(licenseBaseFile)] + inFiles).collect { it.text.replaceAll(/[\n\r]*$/, '') }.join(licenseHdr) + '\n'
}
}
file(licenseSdkFile).withWriter { writer ->
writer << [
file(licenseBinZipFile).text,
"This convenience zip embeds Groovy's src and doc zips.\nSee also src/LICENSE " +
"and doc/LICENSE files for additional license information."
].join(licenseHdr) + '\n'
}
}
}
task updateNotices {
description = 'Updates the various NOTICE files'
ext.noticesDir = "${projectDir}/notices"
ext.noticeBaseFile = "${noticesDir}/NOTICE-BASE"
ext.noticeSrcFile = "${projectDir}/NOTICE"
ext.noticeGroovyConsoleFile = "${projectDir}/subprojects/groovy-console/NOTICE"
ext.noticeAllJarJarFile = "${noticesDir}/NOTICE-ALLJARJAR"
ext.noticeBinZipFile = "${noticesDir}/NOTICE-BINZIP"
ext.noticeGrooidFile = "${noticesDir}/NOTICE-GROOID"
ext.noticeGrooidJarJarFile = "${noticesDir}/NOTICE-GROOIDJARJAR"
ext.noticeJarJarFile = "${noticesDir}/NOTICE-JARJAR"
ext.noticeSdkFile = "${noticesDir}/NOTICE-SDK"
inputs.files(noticeBaseFile, fileTree(noticesDir).include('*.txt'))
outputs.files(noticeAllJarJarFile, noticeBinZipFile, noticeGrooidFile, noticeGrooidJarJarFile,
noticeJarJarFile, noticeSrcFile, noticeGroovyConsoleFile, noticeSdkFile)
doLast {
def srcFiles = fileTree(noticesDir).include('*-SRC*.txt').sort { it.name }
def grooidFiles = fileTree(noticesDir).include('*-GROOID*.txt').sort { it.name }
def jarjarFiles = fileTree(noticesDir).include('*-JARJAR*.txt').sort { it.name }
def grooidJarjarFiles = fileTree(noticesDir) {
include '*-JARJAR*.txt'
include '*-GROOID*.txt'
}.sort { it.name }
def allJarjarFiles = fileTree(noticesDir) {
include '*-JARJAR*.txt'
include '*-ALLJARJAR*.txt'
}.sort { it.name }
def binzipFiles = fileTree(noticesDir) {
include '*-JARJAR*.txt'
include '*-ALLJARJAR*.txt'
include '*-GROOID*.txt'
include '*-BINZIP*.txt'
}.sort { it.name }
def groovyconsoleFiles = fileTree(noticesDir).include('silkicons-ALLJARJAR-SRC.txt')
[
(noticeAllJarJarFile): allJarjarFiles,
(noticeBinZipFile): binzipFiles,
(noticeGrooidFile): grooidFiles,
(noticeGrooidJarJarFile): grooidJarjarFiles,
(noticeJarJarFile): jarjarFiles,
(noticeSrcFile): srcFiles,
(noticeGroovyConsoleFile): groovyconsoleFiles,
].each { outFile, inFiles ->
file(outFile).withWriter('utf-8') { writer ->
writer << ([file(noticeBaseFile)] + inFiles).collect {
it.text.replaceAll(/[\n\r]*$/, '')
}.join('\n\n')
}
}
file(noticeSdkFile).withWriter { writer ->
writer << [
file(noticeBinZipFile).text,
"This convenience zip embeds Groovy's src and doc zips.\nSee also src/NOTICE " +
"and doc/NOTICE files for additional notice information."
].join('\n\n')
}
}
}
groovy-2.4.17/gradle/backports.gradle 0000664 0000000 0000000 00000004360 13513043216 0017541 0 ustar 00root root 0000000 0000000 /*
* 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.
*/
/*
* This file describes artifacts which will be distributed in separate jars, intended to be used with
* older versions of Groovy for binary compatibility with classes compiled with newer versions of groovy
*/
ext.backports = [
compat23: ['org/codehaus/groovy/runtime/typehandling/ShortTypeHandling.class']
]
task backportJars {
group = 'Backports'
description = 'Generates backports jars'
}
dist.dependsOn backportJars
install.dependsOn backportJars
uploadArchives.dependsOn backportJars
backports.each { pkg, classList ->
def backportJar = task "backport${pkg}Jar"(type:Jar) {
group = 'Backports'
dependsOn jarAll
from zipTree(jar.archivePath)
include classList
baseName = "groovy-backports-$pkg"
classifier = ''
}
// the following two jars are empty. No wonder, Maven Central *requires* a javadoc and sources classifier
// it's stupid in our case, because we don't have such, but we have no choice
def javadocJar = task "backport${pkg}JavadocJar"(type:Jar) {
group = 'Backports'
dependsOn jarAll
baseName = "groovy-backports-$pkg"
classifier = 'javadoc'
}
def sourcesJar = task "backport${pkg}SourcesJar"(type:Jar) {
group = 'Backports'
dependsOn jarAll
baseName = "groovy-backports-$pkg"
classifier = 'sources'
}
backportJars.dependsOn([backportJar, javadocJar, sourcesJar])
}
groovy-2.4.17/gradle/binarycompatibility.gradle 0000664 0000000 0000000 00000017413 13513043216 0021632 0 ustar 00root root 0000000 0000000 /*
* 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.
*/
import groovy.text.markup.MarkupTemplateEngine
import groovy.text.markup.TemplateConfiguration
import java.lang.reflect.Modifier
buildscript {
// this block should not be necessary, but for some reason it fails without!
repositories {
jcenter()
}
dependencies {
classpath 'me.champeau.gradle:japicmp-gradle-plugin:0.1.1'
}
}
task checkBinaryCompatibility {
description = 'Generates binary compatibility reports'
}
check.dependsOn(checkBinaryCompatibility)
def excludeModules = ['performance', 'tests-vm8']
//def excludeModules = []
Set projectsToCheck = allprojects.findAll{ !(it.name in excludeModules) }
if (JavaVersion.current().isJava7Compatible()) {
allprojects {
if (project in projectsToCheck) {
apply plugin: 'me.champeau.gradle.japicmp'
}
}
def referenceMinorVersion = '2.4.15'
def prettyPrint = { classOrMethod ->
"${Modifier.toString(classOrMethod.get()?.modifiers)} ${classOrMethod.get()?.longName}"
}
def reportGenerator = { model ->
outputProcessor {
def skipClass = { c ->
c.fullyQualifiedName =~ /\$[0-9]+$/ || // skip AIC
c.fullyQualifiedName.startsWith('org.codehaus.groovy.runtime.dgm$') ||
c.fullyQualifiedName.contains('_closure')
}
def skipMethod = { c, m -> skipClass(c) || m.name =~ /access\$[0-9]+/ }
def violations = [:].withDefault {
// key = class name
// value = map of violations
[:].withDefault { [] }
}
removedConstructor { c, m ->
if (!skipMethod(c, m)) {
def level = Modifier.isPrivate(m.oldConstructor.get()?.modifiers) ? 'info' : 'error'
violations[c.fullyQualifiedName][level] << "Constructor ${prettyPrint(m.oldConstructor)} has been removed"
}
}
removedMethod { c, m ->
if (!skipMethod(c, m)) {
def level = m.name.startsWith('super$') ? 'warning' : 'error'
violations[c.fullyQualifiedName][level] << "Method ${m.name} has been removed"
}
}
removedClass { c ->
if (!skipClass(c)) {
violations[c.fullyQualifiedName].error << "Class has been removed"
}
}
modifiedMethod { c, m ->
if (!skipMethod(c, m)) {
violations[c.fullyQualifiedName].warning << """
Method ${m.name} has been modified
From
${prettyPrint(m.oldMethod)}
to
${prettyPrint(m.newMethod)}
"""
}
}
modifiedConstructor { c, m ->
if (!skipMethod(c, m)) {
violations[c.fullyQualifiedName].warning << """
Constructor ${m.name} has been modified
From
${prettyPrint(m.oldConstructor)}
to
${prettyPrint(m.newConstructor)}
"""
}
}
modifiedClass { c ->
if (!skipClass(c)) {
def level = c.binaryCompatible?'info':'error'
def message = "Class ${c.fullyQualifiedName} has been modified"
violations[c.fullyQualifiedName][level] << message
}
}
newClass { c ->
if (!skipClass(c)) {
violations[c.fullyQualifiedName].info << "Class has been added"
}
}
newMethod { c, m ->
if (!skipMethod(c, m)) {
violations[c.fullyQualifiedName].info << """