Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

First pass at the new Gradle build for Groovy, courtesy of Hans Dokter

git-svn-id: http://svn.codehaus.org/groovy/trunk/groovy/groovy-core@19858 a5544e8c-8a19-0410-ba12-f9af4593a198
  • Loading branch information...
commit 527c8a44cd32efa8e8c856c6bf9ebdced69ebaad 1 parent b899619
@glaforge glaforge authored
View
341 build.gradle
@@ -1,113 +1,250 @@
-// -*- mode: groovy; coding: utf-8; -*-
-
-// Gradle build script for Groovy.
-//
-// 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.
-//
-// This work is copyright by the author(s) and is part of a greater work collectively copyright by Codehaus on
-// behalf of the Groovy community. See the NOTICE.txt file distributed with this work for additional information.
-//
-// Author : Russel Winder <russel.winder@concertant.com>
-
-// Assumes Gradle 0.9 is being used.
-
-usePlugin ( 'groovy' )
-
-version = '1.8.0-beta-1-SNAPSHOT'
-sourceCompatibility = 5
-targetCompatibility = 5
-
-//usePlugin ( 'maven' )
-//group = 'org.codehaus.groovy'
+apply plugin: 'groovy'
+
+group = 'org.codehaus.groovy'
+version = groovyVersion
+
+sourceCompatibility = 1.5
+targetCompatibility = 1.5
+
+buildDirName = 'target'
repositories {
- mavenCentral ( )
- mavenRepo ( urls : 'http://jansi.fusesource.org/repo/release' )
+ // todo Some repos are needed only for some configs. Declare them just for the configuration once Gradle allows this.
+ mavenRepo urls: ["http://repo1.maven.org/maven2"] // default, tools
+ mavenRepo urls: ["http://www.aQute.biz/repo"] // examples
+ mavenRepo urls: ["http://repository.jboss.org/maven2"] // examples, tools
+}
+
+// todo do we need compile and runtime scope for examples?
+configurations {
+ tools
+ examplesCompile.extendsFrom compile
+ examplesRuntime.extendsFrom examplesCompile
+ antlr
}
dependencies {
- groovy ( files ( compileJava.destinationDir ) )
- compile ( [
- // Core dependencies.
- 'antlr:antlr:2.7.7' ,
- 'asm:asm:3.2' ,
- 'junit:junit:4.7' ,
- // For CliBuilder
- 'commons-cli:commons-cli:1.2' ,
- // For AntBuilder
- 'org.apache.ant:ant:1.7.1' ,
- // For testing helper classes
- 'asm:asm-commons:3.2' ,
- 'asm:asm-util:3.2' ,
- 'asm:asm-analysis:3.2' ,
- 'asm:asm-tree:3.2' ,
- // For the BSF adaptor
- 'bsf:bsf:2.4.0' ,
- // For servelet / GSP
- 'javax.servlet:servlet-api:2.4' ,
- 'javax.servlet:jsp-api:2.0' ,
- // Used for dumping out the AST.
- 'com.thoughtworks.xstream:xstream:1.3.1' ,
- // For Groovysh
- 'jline:jline:0.9.94' ,
- // For Grapes (@Grabe, etc.)
- 'org.apache.ivy:ivy:2.1.0' ,
- // For the Windwos command line prettification.
- 'org.fusesource.jansi:jansi:1.1' ,
- ] )
- testRuntime ( [
- //'asm:asm-attrs:3.2' ,
- // For testing helper classes
- 'jmock:jmock:1.2.0' ,
- 'jmock:jmock-clib:1.2.0' ,
- // For the BSF adaptor
- 'xmlunit:xmlunit:1.3' ,
- // For the SQL library
- 'hsqldb:hsqldb:1.8.0.10' ,
- ] )
- runtime ( [
- // Used by optional features.
- // For AntBuilder
- 'org.apache.ant:ant-junit:1.7.1' ,
- 'org.apache.ant:ant-launcher:1.7.1' ,
- // For BSF adaptor
- 'commons-logging:commons-logging:1.1.1' ,
- ] )
-
- // How to specify the provided dependency of org.livetribe:livetribe-jsr223:2.0.6
+// groovy files('/home/hd/tmp/groovy-all.jar') // files(sourceSets.main.classesDir)
+ groovy files("$buildDir/classes")
+ groovy "asm:asm:3.2"
+ groovy "antlr:antlr:2.7.7"
+ groovy "asm:asm-commons:3.2"
+ groovy "asm:asm-util:3.2"
+ groovy "asm:asm-analysis:3.2"
+ groovy "asm:asm-tree:3.2"
+
+ compile("bsf:bsf:2.4.0") {
+ exclude(group: 'commons-logging', module: 'commons-logging')
+ }
+ compile "junit:junit:4.8.1"
+ compile "commons-cli:commons-cli:1.2"
+ compile "org.apache.ant:ant:1.8.0"
+ compile "javax.servlet:servlet-api:2.4"
+ compile "javax.servlet:jsp-api:2.0"
+ compile("com.thoughtworks.xstream:xstream:1.3.1") {
+ exclude(group: 'xpp3', module: 'xpp3_min')
+ }
+ compile("jline:jline:0.9.94") {
+ exclude(group: 'junit', module: 'junit')
+ }
+ compile "org.fusesource.jansi:jansi:1.2.1"
+ compile("org.apache.ivy:ivy:2.1.0") {
+ transitive = false
+ }
+ runtime "org.apache.ant:ant-junit:1.8.0"
+ runtime "org.apache.ant:ant-launcher:1.8.0"
+ runtime("org.apache.ant:ant-trax:1.8.0") {
+ exclude(group: 'xerces', module: 'xercesImpl')
+ exclude(group: 'xml-apis', module: 'xml-apis')
+ exclude(group: 'xalan', module: 'xalan')
+ exclude(group: 'org.apache.ant', module: 'ant-nodeps')
+ }
+ runtime "org.apache.ant:ant-antlr:1.8.0"
+ runtime("commons-logging:commons-logging:1.1.1") {
+ exclude(group: 'log4j', module: 'log4j')
+ exclude(group: 'logkit', module: 'logkit')
+ exclude(group: 'avalon-framework', module: 'avalon-framework')
+ }
+ testCompile "jmock:jmock:1.2.0"
+ testCompile "jmock:jmock-cglib:1.2.0"
+ testCompile "xmlunit:xmlunit:1.3"
+ testCompile "hsqldb:hsqldb:1.8.0.10"
+
+ // todo this was provided
+ compile "org.livetribe:livetribe-jsr223:2.0.6"
+
+ tools "com.google.code:jarjar:1.0"
+ tools("checkstyle:checkstyle:4.4") {
+ exclude(module: 'junit')
+ }
+ tools "redhill:simian:2.2.4"
+ tools("net.sourceforge.cobertura:cobertura:1.9.3") {
+ exclude(module: 'asm')
+ exclude(module: 'asm')
+ exclude(module: 'ant')
+ }
+ tools "asm:asm:3.2"
+ tools "com.thoughtworks.qdox:qdox:1.10"
+ tools "biz.aQute:bnd:0.0.388"
+
+ examplesCompile "lucene:lucene:1.4.3"
+ examplesCompile "org.eclipse:osgi:3.4.3.R34x_v20081215-1030"
+ examplesRuntime("commons-httpclient:commons-httpclient:3.0.1") {
+ exclude(module: 'junit')
+ exclude(module: 'commons-logging')
+ exclude(module: 'commons-codec')
+ }
+ examplesRuntime("openejb:openejb-loader:1.0") {
+ 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')
+ }
+
+ antlr "org.apache.ant:ant-antlr:1.8.0"
}
sourceSets {
- main {
- java {
- srcDir ( 'src/main' )
- // These Java classes depend on Groovy classes and so cannot be compiled at this time.
- exclude ( [
- 'groovy/ui/ConsoleTextEditor.java' ,
- 'groovy/ui/text/TextEditor.java' ,
- ] )
- }
- groovy {
- srcDir ( 'src/main' )
- }
- }
- test {
- java {
- srcDir ( 'src/test' )
- }
- groovy {
- srcDir ( 'src/test' )
- }
- }
+ main {
+ java {
+ srcDirs = ["$projectDir/src/main"]
+ fileTree("$projectDir/src/main/groovy/ui").matching {
+ exclude 'GroovyMain.java', 'GroovySocketServer.java'
+ }.visit {details ->
+ exclude "groovy/ui/$details.path"
+ }
+ }
+ groovy {
+ srcDirs = ["$projectDir/src/main"]
+ }
+ resources {
+ srcDirs = ["$projectDir/src/main", "$projectDir/src/tools"]
+ include "META-INF/services/*", "META-INF/groovy-release-info.properties",
+ "groovy/grape/*.xml", "groovy/ui/*.properties", "groovy/ui/**/*.png",
+ "groovy/inspect/swingui/AstBrowserProperties.groovy",
+ "org/codehaus/groovy/tools/shell/**/*.properties",
+ "org/codehaus/groovy/tools/shell/**/*.xml",
+ "org/codehaus/groovy/antlib.xml",
+ "org/codehaus/groovy/tools/groovydoc/gstringTemplates/**/*.*",
+ "org/codehaus/groovy/tools/groovy.ico"
+ }
+ classesDir = "$buildDir/classes" as File
+ }
+ test {
+ groovy {
+ srcDirs = ["$projectDir/src/test"]
+ if (!isJava16()) {
+ exclude "groovy/**/vm6/*Test.groovy"
+ }
+ }
+ classesDir = "$buildDir/test-classes" as File
+ }
+ tools {
+ groovy {
+ srcDirs = ["$projectDir/src/tools"]
+ }
+ resources {
+ srcDirs = ["$projectDir/src/tools"]
+ }
+ compileClasspath = configurations.tools + sourceSets.main.runtimeClasspath
+ runtimeClasspath = classes + compileClasspath
+ classesDir = "$buildDir/tools-classes" as File
+ }
+ examples {
+ groovy {
+ srcDirs = ["$projectDir/src/examples"]
+ }
+ resources {
+ srcDirs = ["$projectDir/src/examples"]
+ }
+ compileClasspath = configurations.examplesRuntime + sourceSets.main.classes
+ classesDir = "$buildDir/examples-classes" as File
+ }
+}
+
+// remove this from config once GRADLE-854 is fixed.
+processResources.doLast {
+ copy {
+ from("$projectDir/src/main") {
+ include "groovy/inspect/swingui/AstBrowserProperties.groovy",
+ "org/codehaus/groovy/tools/groovydoc/gstringTemplates/GroovyDocTemplateInfo.java"
+ }
+ into sourceSets.main.classesDir
+ }
}
-test {
- include ( '**/*Test.class' )
+task ensureGrammars {
+ description = "Ensure all the Antlr generated files are up to date."
+ antlrDirectory = "$projectDir/src/main/org/codehaus/groovy/antlr"
+ groovyParserDirectory = "$antlrDirectory/parser"
+ javaParserDirectory = "$antlrDirectory/java"
+ doFirst {
+ ant {
+ taskdef(name: 'antlr',
+ classname: 'org.apache.tools.ant.taskdefs.optional.ANTLR',
+ classpath: configurations.antlr.asPath)
+
+ mkdir dir: groovyParserDirectory
+ antlr(target: "$antlrDirectory/groovy.g", outputdirectory: groovyParserDirectory) {
+ classpath path: configurations.compile.asPath
+ }
+ antlr(target: "$javaParserDirectory/java.g", outputdirectory: javaParserDirectory) {
+ classpath path: configurations.compile.asPath
+ }
+ }
+ }
+}
+
+compileJava {
+ dependsOn ensureGrammars
+ doLast {
+ mkdir "$sourceSets.main.classesDir/META-INF"
+ ant {
+ java(classname: "org.codehaus.groovy.tools.DgmConverter",
+ fork: "true",
+ failonerror: "true",
+ outputproperty: 'outy',
+ errorproperty: 'errr',
+ classpath: sourceSets.main.runtimeClasspath.asPath)
+ }
+// println "Out: " + ant.properties.outy
+// println "Err: " + ant.properties.errr
+ }
}
+
+
+compileGroovy {
+ groovyOptions.fork(memoryMaximumSize: groovycMain_mx)
+}
+
+compileTestGroovy {
+ groovyOptions.fork(memoryMaximumSize: groovycTest_mx)
+}
+
+compileExamplesGroovy {
+ groovyOptions.fork(memoryMaximumSize: groovycExamples_mx)
+}
+
+def isJava16() {
+ System.properties['java.version'].contains('1.6')
+}
+
+// provide to other build scripts
+isJava6 = this.&isJava16()
+
+apply from: "$projectDir/gradle/test.gradle"
+apply from: "$projectDir/gradle/docs.gradle"
+apply from: "$projectDir/gradle/assemble.gradle"
+apply from: "$projectDir/gradle/upload.gradle"
+
+task wrapper(type: Wrapper) {
+ jarPath = 'gradle/wrapper'
+ gradleVersion = '0.9-20100330132924+0200'
+}
+
+
+
+
+
View
20 gradle.properties
@@ -0,0 +1,20 @@
+groovyVersion = 1.8.0-beta-1-SNAPSHOT
+# bundle version format: major('.'minor('.'micro('.'qualifier)?)?)? (first 3 only digits)
+groovyBundleVersion = 1.8.0.beta-1-SNAPSHOT
+
+# Many people have reported problems testing UberTestCaseGroovySourceSubPackages, others have no difficulties with the default
+# values ant junit task uses. The decision has been taken to provide the values to try and cause the least
+# hassle to the most people.
+
+groovyJUnit_ms = 256m
+groovyJUnit_mx = 1000m
+groovyJUnit_permSize = 64m
+groovyJUnit_maxPermSize=128m
+
+groovycMain_mx = 384m
+groovycTest_mx = 640m
+groovycExamples_mx = 384m
+
+javaDoc_mx = 512m
+# This property seems not to make such sense as the Groovydoc Ant task does not allow for setting it.
+groovyDoc_mx = 600m
View
293 gradle/assemble.gradle
@@ -0,0 +1,293 @@
+import java.util.jar.Manifest
+import org.apache.commons.io.FileUtils
+import org.apache.tools.ant.filters.ReplaceTokens
+import org.apache.tools.ant.taskdefs.Replace
+import java.text.SimpleDateFormat
+
+apply plugin: 'osgi'
+
+group = 'org.codehaus.groovy'
+archivesBaseName = 'groovy'
+
+allManifest = manifest {
+ attributes("Built-By": System.properties['user.name'],
+ "Extension-Name": 'groovy',
+ "Specification-Title": 'Groovy: a powerful, dynamic language for the JVM',
+ "Specification-Version": project.version,
+ "Specification-Vendor": 'The Codehaus',
+ "Implementation-Title": 'Groovy: a powerful, dynamic language for the JVM',
+ "Implementation-Version": project.version,
+ "Implementation-Vendor": 'The Codehaus',
+ "Bundle-ManifestVersion": '2',
+ "Bundle-Name": 'Groovy Runtime',
+ "Bundle-Description": 'Groovy Runtime',
+ "Bundle-Version": groovyBundleVersion,
+ "Bundle-Vendor": 'The Codehaus',
+ "Bundle-ClassPath": '.',
+ "Bundle-RequiredExecutionEnvironment": 'J2SE-1.5',
+ "Eclipse-BuddyPolicy": 'dependent',
+ "Eclipse-LazyStart": 'true',
+ "DynamicImport-Package": '*')
+}
+
+licenseSpec = copySpec {
+ from "$projectDir/config/build"
+ from(zipTree(configurations.compile.fileCollection { it.name.startsWith 'commons-cli' }.singleFile).matching {
+ include 'META-INF/LICENSE.txt'
+ }) {
+ eachFile {details ->
+ details.path = details.path - 'META-INF'
+ details.name = "CLI-LICENSE.txt"
+ }
+ }
+}
+
+binaryJarsMetaInf = {
+ Date buildTime = new Date()
+ from "$projectDir/LICENSE.txt"
+ from("$projectDir/src/main/META-INF/groovy-release-info.properties") {
+ filter {String line ->
+ ['##ImplementationVersion##': project.version, '##BundleVersion##': project.groovyBundleVersion,
+ '##BuildDate##': new SimpleDateFormat('dd-MMM-yyyy').format(buildTime),
+ '##BuildTime##': new SimpleDateFormat('hh:mm aa').format(buildTime)].each {key, value ->
+ line = line.replace(key, value)
+ }
+ line
+ }
+ }
+}
+
+task copy(type: Copy) {
+ into "$buildDir/meta"
+ with licenseSpec
+}
+
+commonOsgiManifest = {
+ // We 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=${version}"
+ classpath = sourceSets.main.runtimeClasspath
+}
+
+jar {
+ metaInf binaryJarsMetaInf
+ manifest = osgiManifest {
+ symbolicName = 'groovy'
+ instruction 'Import-Package', "antlr", "org.objectweb.asm", "*;resolution:=optional"
+ classesDir = sourceSets.main.classesDir
+ }
+ manifest commonOsgiManifest
+}
+
+task jarAll(type: Jar, dependsOn: jar) {
+ metaInfDir = "$buildDir/tmp/groovy-all-metainf"
+ inputs.files jar.archivePath
+ inputs.dir metaInfDir
+ appendix = 'all'
+ doLast {
+ manifest.writeTo("$metaInfDir/MANIFEST.MF")
+ copy {
+ into "$buildDir/tmp/groovy-all-metainf"
+ with licenseSpec
+ }
+ project.ant {
+ taskdef name: "jarjar", classname: "com.tonicsystems.jarjar.JarJarTask", classpath: configurations.tools.asPath
+ jarjar(jarfile: archivePath, manifest: "$metaInfDir/MANIFEST.MF") {
+ zipfileset(dir: "$metaInfDir", prefix: 'META-INF')
+ zipfileset(src: jar.archivePath)
+ 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 ->
+ zipfileset(src: jarjarFile)
+ }
+ rule pattern: "antlr.**", result: "groovyjarjarantlr.@1"
+ rule pattern: "org.objectweb.**", result: "groovyjarjarasm.@1"
+ rule pattern: "org.apache.commons.cli.**", result: "groovyjarjarcommonscli.@1"
+ }
+ }
+ }
+ // We exclude the Bnd-LastModified attribute as it always triggers a rebuild without being really needed.
+ manifest = osgiManifest {
+ symbolicName = 'groovy-all'
+ instruction 'Import-Package', "*;resolution:=optional"
+ classesDir = jar.archivePath
+ }
+ manifest commonOsgiManifest
+}
+
+task sourceJar(type: Jar) {
+ classifier = 'sources'
+ // from sourceSets.main.allSource
+ from "$projectDir/src/main"
+}
+
+task sourceAllJar(type: Jar, dependsOn: sourceJar) {
+ appendix = 'all'
+ classifier = 'sources'
+ with sourceJar.rootSpec
+}
+
+task javadocJar(type: Jar, dependsOn: javadoc) {
+ classifier = 'javadoc'
+ from javadoc.destinationDir
+}
+
+task javadocAllJar(type: Jar, dependsOn: javadocJar) {
+ appendix = 'all'
+ classifier = 'javadoc'
+ with javadocJar.rootSpec
+}
+
+
+distSpec = copySpec {
+ from("$projectDir") {
+ include "LICENSE.txt", "NOTICE.txt"
+ }
+ into("lib") {
+ from configurations.runtime.fileCollection {dep ->
+ !(dep instanceof FileCollectionDependency) && !dep.name.startsWith('livetribe')
+ }, jar.archivePath
+ }
+ into("conf") {
+ from "src/conf"
+ }
+ into("bin") {
+ from("src/bin") {
+ filter(ReplaceTokens, tokens: [token: 'GROOVYJAR', value: jar.archiveName])
+ fileMode = 0755
+ }
+ from("src/tools/org/codehaus/groovy/tools/groovy.ico")
+ }
+ into("embeddable") {
+ from jarAll.archivePath
+ }
+}
+
+task installGroovy(type: Sync, dependsOn: [jar, jarAll]) {
+ from distSpec
+ into System.properties.installDirectory ?: "$buildDir/install"
+}
+
+//task jars(dependsOn: tasks.withType(Jar))
+//task dists(dependsOn: tasks.withType(Zip).matching {task -> !(task instanceof Jar)})
+
+task distBin(type: Zip, dependsOn: [jar, jarAll]) {
+ appendix = 'binary'
+ into("groovy-$version") {
+ with distSpec
+ with licenseSpec
+ }
+}
+
+task distDoc(type: Zip, dependsOn: doc) {
+ appendix = 'docs'
+ into("groovy-$version")
+ into("pdf") {
+ from 'src/wiki-snapshot.pdf'
+ }
+ into("html/api") {
+ from javadoc.destinationDir
+ }
+ into("html/gapi") {
+ from groovydoc.destinationDir
+ }
+ into("html/groovy-jdk") {
+ from docGDK.destinationDir
+ }
+}
+
+task distSrc(type: Zip, dependsOn: [javadoc, groovydoc, docGDK]) {
+ appendix = 'src'
+ into("groovy-$version")
+ from(projectDir) {
+ exclude 'target', buildDirName, 'classes/**', 'cruise/**', '.clover/*', 'local.build.properties',
+ 'cobertura.ser', 'junitvmwatcher*.properties'
+ }
+}
+
+task compareArchives << {
+ jarTasks = tasks.withType(Zip)
+ jarTasks.each {jar ->
+ File antJar = "$projectDir/target/dist/${jar.archivePath.name}" as File
+ println "Comparing $jar.name with ant jar $antJar. Ant jar exists=${antJar.isFile()}"
+ if (antJar.isFile()) {
+ compare(jar.archiveName, jar.archivePath, antJar, true)
+ }
+ }
+}
+
+def compare(String name, File gradleJar, File antJar, boolean checkManifest) {
+ def File diffDir = new File(buildDir, "diff/$name")
+ ant.delete(dir: diffDir)
+ def unzipGradle = new File(diffDir, "gradle")
+ def unzipAnt = new File(diffDir, "ant")
+ ant.unzip(src: gradleJar, dest: unzipGradle)
+ ant.unzip(src: antJar, dest: unzipAnt)
+
+ def antFiles = [:]
+ def gradleFiles = [:]
+
+ FileUtils.listFiles(unzipAnt, null, true).each {File file ->
+ antFiles[file.absolutePath - unzipAnt.absolutePath] = file
+ }
+ FileUtils.listFiles(unzipGradle, null, true).each {File file ->
+ gradleFiles[file.absolutePath - unzipGradle.absolutePath] = file
+ }
+
+ antFiles.each {key, value ->
+ if (!gradleFiles[key]) {
+ println "ant only: $key"
+ } else if (checkManifest && key == '/META-INF/MANIFEST.MF') {
+ Manifest manifestAnt = new Manifest(new FileInputStream(antFiles[key]))
+ Manifest manifestGradle = new Manifest(new FileInputStream(gradleFiles[key]))
+ if (!manifestAnt.equals(manifestGradle)) {
+ def ant = manifestAnt.mainAttributes
+ def gradle = manifestGradle.mainAttributes
+ compareMap(ant, gradle)
+ }
+ }
+ gradleFiles.remove(key)
+ }
+
+ gradleFiles.keySet().each {file ->
+ println "gradle only: $file"
+ }
+}
+
+def compareMap(Map ant, Map gradle) {
+ (ant.keySet() + gradle.keySet()).each {attribute ->
+ antValue = ant[attribute]
+ gradleValue = gradle[attribute]
+ if (!(['Ant-Version', 'Created-By', 'Bnd-LastModified', 'Tool', 'Originally-Created-By'].contains(attribute as String))) {
+ if (antValue) {
+ if (!gradleValue) {
+ println "$attribute: ant only"
+ } else if (antValue != gradleValue) {
+ if (attribute.toString() == 'Export-Package' || attribute.toString() == 'Import-Package') {
+ def antOnly = antValue.split(',') as LinkedHashSet
+ def gradleOnly = gradleValue.split(',') as LinkedHashSet
+ antOnly.removeAll(gradleOnly)
+ gradleOnly.removeAll(antValue.split(',') as LinkedHashSet)
+ println("""$attribute:
+ ant only: $antOnly
+ gradle only: $gradleOnly""")
+ } else {
+ println("""$attribute:
+ ant value: ${antValue}
+ gradle value: ${gradleValue}""")
+ }
+ }
+ } else {
+ println "$attribute: gradle only"
+ }
+ }
+ }
+}
View
64 gradle/docs.gradle
@@ -0,0 +1,64 @@
+task doc(dependsOn: [javadoc, groovydoc, 'docGDK']) {
+ footer = "Copyright &amp;copy; 2003-2010 The Codehaus. All rights reserved."
+ title = "Groovy ${groovyVersion}"
+}
+
+javadoc {
+ maxMemory = javaDoc_mx
+ project.configure(options) {
+ windowTitle = doc.title
+ docTitle = doc.title
+ encoding = "ISO-8859-1"
+ author = true
+ version = true
+ overview = "src/main/overview.html"
+ footer = doc.footer
+ source = "1.5"
+ links("http://java.sun.com/j2se/1.5.0/docs/api", "http://www.dpml.net/api/ant/1.7.0",
+ "http://junit.sourceforge.net/junit3.8.1/javadoc/", "http://java.sun.com/j2se/1.4/docs/api", "http://www.antlr2.org/javadoc")
+ }
+}
+
+groovydoc {
+ dependsOn classes
+ use = true
+ windowtitle = doc.title
+ doctitle = doc.title
+ header = doc.title
+ footer = doc.footer
+ overview = file("src/main/overview.html")
+ includePrivate = false
+ link "http://java.sun.com/j2ee/1.4/docs/api", "javax.servlet.", "javax.management."
+ link "http://java.sun.com/javase/6/docs/api/", "java.", "org.xml.", "javax.", "org.xml."
+ link "http://www.dpml.net/api/ant/1.7.0", "org.apache.ant.", "org.apache.tools.ant."
+ link "http://junit.sourceforge.net/junit3.8.1/javadoc/", "org.junit.", "junit."
+ link "http://www.antlr2.org/javadoc/", "antlr."
+}
+
+task docGDK {
+ destinationDir = "$buildDir/html/groovy-jdk"
+ inputs.files sourceSets.tools.runtimeClasspath
+ outputs.dir destinationDir
+ doFirst {task ->
+ ant {
+ java(classname: "org.codehaus.groovy.tools.DocGenerator", fork: "yes", failonerror: "true",
+ classpath: sourceSets.tools.runtimeClasspath.asPath,
+ errorproperty: 'edr',
+ outputproperty: 'odr') {
+ arg(value: "org.codehaus.groovy.runtime.DefaultGroovyMethods")
+ arg(value: "org.codehaus.groovy.runtime.SqlGroovyMethods")
+ arg(value: "org.codehaus.groovy.runtime.SwingGroovyMethods")
+ arg(value: "org.codehaus.groovy.runtime.XmlGroovyMethods")
+ arg(value: "org.codehaus.groovy.runtime.DefaultGroovyStaticMethods")
+ arg(value: "org.codehaus.groovy.vmplugin.v5.PluginDefaultGroovyMethods")
+ }
+// println "Out: " + ant.properties.edr
+// println "Err: " + ant.properties.odr
+ }
+ copy {
+ into task.destinationDir
+ from "src/tools/org/codehaus/groovy/tools/groovy.ico", "src/tools/org/codehaus/groovy/tools/stylesheet.css"
+ }
+ }
+}
+
View
528 gradle/pomconfigurer.gradle
@@ -0,0 +1,528 @@
+project.pomConfigureClosure = {
+ // todo The maven pom builder is not fully compatible with the 2.x Maven model shipped with Gradle. As soon as we update
+ // to Maven 3 we can also add the distribution management in builder notation
+ model.distributionManagement = configure(new org.apache.maven.model.DistributionManagement()) {
+ repository = configure(new org.apache.maven.model.DeploymentRepository()) {
+ id = 'codehaus.org'
+ name = 'Groovy Central Repository'
+ url = 'dav:https://dav.codehaus.org/repository/groovy/'
+ }
+ snapshotRepository = configure(new org.apache.maven.model.DeploymentRepository()) {
+ id = 'codehaus.org'
+ name = 'Groovy Central Development Repository'
+ url = 'dav:https://dav.codehaus.org/snapshots.repository/groovy/'
+ }
+ site = configure(new org.apache.maven.model.Site()) {
+ id = 'codehaus.org'
+ name = 'Groovy Web Site'
+ url = 'dav:https://dav.codehaus.org/groovy'
+ }
+ }
+
+ project {
+ modelVersion '4.0.0'
+ groupId 'org.codehaus.groovy'
+ artifactId 'groovy'
+ version '1.8.0-beta-1-SNAPSHOT'
+ name 'Groovy'
+ description 'Groovy: A powerful, dynamic language for the JVM'
+ url 'http://groovy.codehaus.org/'
+ inceptionYear '2003'
+ organization {
+ name 'The Codehaus'
+ url 'http://codehaus.org'
+ }
+ developers {
+ developer {
+ id 'glaforge'
+ name 'Guillaume Laforge'
+ organization 'SpringSource'
+ roles {
+ role 'Project Manager'
+ role 'Developer'
+ }
+ }
+ developer {
+ id 'bob'
+ name 'bob mcwhirter'
+ email 'bob@werken.com'
+ organization 'The Werken Company'
+ roles {
+ role 'Founder'
+ }
+ }
+ developer {
+ id 'jstrachan'
+ name 'James Strachan'
+ email 'james@coredevelopers.com'
+ organization 'Core Developers Network'
+ roles {
+ role 'Founder'
+ }
+ }
+ developer {
+ id 'joe'
+ name 'Joe Walnes'
+ organization 'ThoughtWorks'
+ roles {
+ role 'Developer Emeritus'
+ }
+ }
+ developer {
+ id 'skizz'
+ name 'Chris Stevenson'
+ organization 'ThoughtWorks'
+ roles {
+ role 'Developer Emeritus'
+ }
+ }
+ developer {
+ id 'jamiemc'
+ name 'Jamie McCrindle'
+ organization 'Three'
+ roles {
+ role 'Developer Emeritus'
+ }
+ }
+ developer {
+ id 'mattf'
+ name 'Matt Foemmel'
+ organization 'ThoughtWorks'
+ roles {
+ role 'Developer Emeritus'
+ }
+ }
+ developer {
+ id 'spullara'
+ name 'Sam Pullara'
+ email 'sam@sampullara.com'
+ roles {
+ role 'Developer Emeritus'
+ }
+ }
+ developer {
+ id 'kasper'
+ name 'Kasper Nielsen'
+ roles {
+ role 'Developer Emeritus'
+ }
+ }
+ developer {
+ id 'travis'
+ name 'Travis Kay'
+ roles {
+ role 'Developer Emeritus'
+ }
+ }
+ developer {
+ id 'zohar'
+ name 'Zohar Melamed'
+ roles {
+ role 'Developer Emeritus'
+ }
+ }
+ developer {
+ id 'jwilson'
+ name 'John Wilson'
+ email 'tug@wilson.co.uk'
+ organization 'The Wilson Partnership'
+ roles {
+ role 'Developer Emeritus'
+ }
+ }
+ developer {
+ id 'cpoirier'
+ name 'Chris Poirier'
+ email 'cpoirier@dreaming.org'
+ roles {
+ role 'Developer Emeritus'
+ }
+ }
+ developer {
+ id 'ckl'
+ name 'Christiaan ten Klooster'
+ email 'ckl@dacelo.nl'
+ organization 'Dacelo WebDevelopment'
+ roles {
+ role 'Developer Emeritus'
+ }
+ }
+ developer {
+ id 'goetze'
+ name 'Steve Goetze'
+ email 'goetze@dovetail.com'
+ organization 'Dovetailed Technologies, LLC'
+ roles {
+ role 'Developer Emeritus'
+ }
+ }
+ developer {
+ id 'bran'
+ name 'Bing Ran'
+ email 'b55r@sina.com'
+ organization 'Leadingcare'
+ roles {
+ role 'Developer Emeritus'
+ }
+ }
+ developer {
+ id 'jez'
+ name 'Jeremy Rayner'
+ email 'jeremy.rayner@gmail.com'
+ organization 'javanicus'
+ roles {
+ role 'Developer'
+ }
+ }
+ developer {
+ id 'jstump'
+ name 'John Stump'
+ email 'johnstump2@yahoo.com'
+ roles {
+ role 'Developer Emeritus'
+ }
+ }
+ developer {
+ id 'blackdrag'
+ name 'Jochen Theodorou'
+ email 'blackdrag@gmx.org'
+ roles {
+ role 'Developer'
+ }
+ }
+ developer {
+ id 'russel'
+ name 'Russel Winder'
+ email 'russel@russel.org.uk'
+ organization 'Concertant LLP & It\'z Interactive Ltd'
+ roles {
+ role 'Developer'
+ role 'Founder of Gant'
+ }
+ }
+ developer {
+ id 'phk'
+ name 'Pilho Kim'
+ email 'phkim@cluecom.co.kr'
+ roles {
+ role 'Developer Emeritus'
+ }
+ }
+ developer {
+ id 'cstein'
+ name 'Christian Stein'
+ email 'sormuras@gmx.de'
+ organization 'CTSR.de'
+ roles {
+ role 'Developer Emeritus'
+ }
+ }
+ developer {
+ id 'mittie'
+ name 'Dierk Koenig'
+ email 'dierk.koenig@canoo.com'
+ organization 'Canoo Engineering AG'
+ roles {
+ role 'Developer'
+ }
+ }
+ developer {
+ id 'paulk'
+ name 'Paul King'
+ email 'paulk@asert.com.au'
+ organization 'ASERT, Australia'
+ roles {
+ role 'Developer'
+ }
+ }
+ developer {
+ id 'galleon'
+ name 'Guillaume Alleon'
+ email 'guillaume.alleon@gmail.com'
+ roles {
+ role 'Developer'
+ }
+ }
+ developer {
+ id 'user57'
+ name 'Jason Dillon'
+ email 'jason@planet57.com'
+ roles {
+ role 'Developer'
+ }
+ }
+ developer {
+ id 'shemnon'
+ name 'Danno Ferrin'
+ roles {
+ role 'Developer'
+ }
+ }
+ developer {
+ id 'jwill'
+ name 'James Williams'
+ roles {
+ role 'Developer'
+ }
+ }
+ developer {
+ id 'aalmiray'
+ name 'Andres Almiray'
+ email 'aalmiray@users.sourceforge.net'
+ roles {
+ role 'Developer'
+ }
+ }
+ developer {
+ id 'mguillem'
+ name 'Marc Guillemot'
+ email 'mguillemot@yahoo.fr'
+ roles {
+ role 'Developer'
+ }
+ }
+ developer {
+ id 'jimwhite'
+ name 'Jim White'
+ email 'jim@pagesmiths.com'
+ organization 'IFCX.org'
+ roles {
+ role 'Developer'
+ }
+ }
+ developer {
+ id 'pniederw'
+ name 'Peter Niederwieser'
+ email 'pniederw@gmail.com'
+ roles {
+ role 'Developer'
+ }
+ }
+ developer {
+ id 'hamletdrc'
+ name 'Hamlet D\'Arcy'
+ email 'hamletdrc@gmail.com'
+ roles {
+ role 'Developer'
+ }
+ }
+ }
+ contributors {
+ contributor {
+ name 'Joern Eyrich'
+ }
+ contributor {
+ name 'Robert Kuzelj'
+ }
+ contributor {
+ name 'Rod Cope'
+ }
+ contributor {
+ name 'Yuri Schimke'
+ }
+ contributor {
+ name 'James Birchfield'
+ }
+ contributor {
+ name 'Robert Fuller'
+ }
+ contributor {
+ name 'Sergey Udovenko'
+ }
+ contributor {
+ name 'Hallvard Traetteberg'
+ }
+ contributor {
+ name 'Peter Reilly'
+ }
+ contributor {
+ name 'Brian McCallister'
+ }
+ contributor {
+ name 'Richard Monson-Haefel'
+ }
+ contributor {
+ name 'Brian Larson'
+ }
+ contributor {
+ name 'Artur Biesiadowski'
+ email 'abies@pg.gda.pl'
+ }
+ contributor {
+ name 'Ivan Z. Ganza'
+ }
+ contributor {
+ name 'Arjun Nayyar'
+ }
+ contributor {
+ name 'Mark Chu-Carroll'
+ }
+ contributor {
+ name 'Mark Turansky'
+ }
+ contributor {
+ name 'Jean-Louis Berliet'
+ }
+ contributor {
+ name 'Graham Miller'
+ }
+ contributor {
+ name 'Marc Palmer'
+ }
+ contributor {
+ name 'Tugdual Grall'
+ }
+ contributor {
+ name 'Edwin Tellman'
+ }
+ contributor {
+ name 'Evan A Slatis'
+ }
+ contributor {
+ name 'Mike Dillon'
+ }
+ contributor {
+ name 'Bernhard Huber'
+ }
+ contributor {
+ name 'Marc DeXeT'
+ }
+ contributor {
+ name 'Dejan Bosanac'
+ email 'dejan@nighttale.net'
+ }
+ contributor {
+ name 'Denver Dino'
+ }
+ contributor {
+ name 'Ted Naleid'
+ }
+ contributor {
+ name 'Chanwit Kaewkasi'
+ }
+ contributor {
+ name 'Brad Long'
+ }
+ contributor {
+ name 'John Bito'
+ }
+ contributor {
+ name 'Jim Jagielski'
+ }
+ contributor {
+ name 'John Hurst'
+ }
+ contributor {
+ name 'Merlyn Albery-Speyer'
+ }
+ contributor {
+ name 'jeremi Joslin'
+ }
+ }
+ mailingLists {
+ mailingList {
+ name 'Groovy JSR Discussion List'
+ archive 'http://dir.gmane.org/gmane.comp.lang.groovy.jsr'
+ }
+ mailingList {
+ name 'Groovy Developer List'
+ archive 'http://dir.gmane.org/gmane.comp.lang.groovy.devel'
+ }
+ mailingList {
+ name 'Groovy User List'
+ archive 'http://dir.gmane.org/gmane.comp.lang.groovy.user'
+ }
+ }
+ scm {
+ connection 'scm:svn:http://svn.groovy.codehaus.org/browse/groovy/trunk/groovy/groovy-core'
+ developerConnection 'scm:svn:https://${maven.username}@svn.groovy.codehaus.org/browse/groovy/trunk/groovy/groovy-core'
+ url 'http://svn.groovy.codehaus.org/browse/groovy/trunk/groovy/groovy-core'
+ }
+ build {
+ sourceDirectory 'src/main'
+ testSourceDirectory 'src/test'
+ defaultGoal 'install'
+ pluginManagement {
+ plugins {
+ plugin {
+ artifactId 'maven-antrun-plugin'
+ version '1.1'
+ }
+ plugin {
+ artifactId 'maven-idea-plugin'
+ version '2.1'
+ configuration {
+ jdkName '1.4'
+ jdkLevel '1.4'
+ linkModules 'true'
+ }
+ }
+ plugin {
+ artifactId 'maven-compiler-plugin'
+ version '2.0.2'
+ configuration {
+ excludes {
+ exclude '**'
+ }
+ skip 'true'
+ }
+ }
+ plugin {
+ artifactId 'maven-surefire-plugin'
+ version '2.3'
+ configuration {
+ skip 'true'
+ }
+ }
+ }
+ }
+ plugins {
+ plugin {
+ artifactId 'maven-antrun-plugin'
+ executions {
+ execution {
+ phase 'install'
+ goals {
+ goal 'run'
+ }
+ configuration {
+ tasks {
+ exec(dir: '${pom.basedir}', executable: 'ant') {
+ arg(value: 'installRepo')
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ profiles {
+ profile {
+ id 'idea'
+ build {
+ defaultGoal 'validate'
+ plugins {
+ plugin {
+ artifactId 'maven-idea-plugin'
+ executions {
+ execution {
+ phase 'validate'
+ goals {
+ goal 'clean'
+ goal 'idea'
+ }
+ }
+ }
+ configuration {
+ overwrite 'true'
+ downloadSources 'true'
+ downloadJavadocs 'true'
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
View
87 gradle/test.gradle
@@ -0,0 +1,87 @@
+test {
+ jvmArgs "-ea", "-Xms${groovyJUnit_ms}", "-Xmx${groovyJUnit_mx}", "-XX:PermSize=${groovyJUnit_permSize}", "-XX:MaxPermSize=${groovyJUnit_maxPermSize}"
+ def headless = System.properties['java.awt.headless']
+ if (headless == 'true') {
+ systemProperties 'java.awt.headless': "true"
+ }
+ def testdb = System.properties['groovy.testdb.props']
+ if (testdb) {
+ systemProperties 'groovy.testdb.props': testdb
+ }
+ systemProperties 'apple.awt.UIElement': "true", "javadocAssertion.src.dir": './src/main'
+ systemProperties "gradle.home": gradle.gradleHomeDir // this is needed by the security.policy
+ doFirst {
+ // this is needed by the security.policy. We set it at execution time to avoid resolving a configuration when not needed.
+ systemProperties "gradle.junit": configurations.testCompile.fileCollection { dep -> dep.name == 'junit' }.singleFile.absolutePath
+ }
+ classpath = files('src/test') + classpath
+ forkEvery = 1
+ scanForTestClasses = false
+ ignoreFailures = false
+ resultText = ''
+ includes = includePattern
+}
+
+tasks.addRule("Pattern: testSingle<Name> will test **/<Name>.class") {String taskName ->
+ if (taskName.startsWith("testSingle")) {
+ tasks.add(taskName).dependsOn(test)
+ test.includes = ['**/' + taskName.substring(10) + '.class']
+ test.outputs.upToDateWhen { false }
+ }
+}
+
+def getIncludePattern() {
+ def baseInclude = ['UberTestCaseBugs.class',
+ 'UberTestCaseGroovySourceCodehausPackages.class',
+ 'UberTestCaseGroovySourceRootPackage.class',
+ "UberTestCaseGroovySourceSubPackages.class",
+ "UberTestCaseJavaSourceCodehausPackages.class",
+ "UberTestCaseJavaSourceGroovyPackagesNonSecurity.class",
+ "UberTestCaseTCK.class",
+ "UberTestCaseJavaSourceGroovyPackagesSecurity.class"]
+ if (System.properties['junit.network']) {
+ baseInclude += ['groovy/grape/*Test.class']
+ }
+ if (isJava16()) {
+ baseInclude += ["UberTestCaseGroovySourceSubPackages_VM6.class"]
+ }
+ baseInclude
+}
+
+task compareTests << {
+ def uberTestCases = ['UberTestCaseBugs.xml',
+ 'UberTestCaseGroovySourceCodehausPackages.xml',
+ 'UberTestCaseGroovySourceRootPackage.xml',
+ "UberTestCaseGroovySourceSubPackages.xml",
+ "UberTestCaseJavaSourceCodehausPackages.xml",
+ "UberTestCaseJavaSourceGroovyPackagesNonSecurity.xml",
+ "UberTestCaseTCK.xml",
+ "UberTestCaseGroovySourceSubPackages_VM6.xml",
+ "UberTestCaseJavaSourceGroovyPackagesSecurity.xml"]
+ uberTestCases.each { testCaseName ->
+ compareAntWithGradle("target/test-reports/TEST-$testCaseName" as File, "target/test-results/TEST-$testCaseName" as File)
+ }
+}
+
+def compareAntWithGradle(File antResult, File gradleResult) {
+ Set antTests = testsRun(antResult)
+ Set gradleTests = testsRun(gradleResult)
+ Set commonTests = antTests.intersect(gradleTests)
+ Set antOnly = antTests - commonTests
+ Set gradleOnly = gradleTests - commonTests
+ if (antOnly) {
+ println "Tests only run by Ant: " + antOnly
+ }
+ if (gradleOnly) {
+ println "Tests only run by Gradle: " + gradleOnly
+ }
+}
+
+Set testsRun(File resultsXmlFile) {
+ def testsuite = new XmlParser().parse(resultsXmlFile)
+ Set tests = []
+ testsuite.testcase.each { testcase ->
+ tests.add("${testcase.'@classname'}:${testcase.'@name'}")
+ }
+ tests
+}
View
117 gradle/upload.gradle
@@ -0,0 +1,117 @@
+import org.custommonkey.xmlunit.Diff
+import org.custommonkey.xmlunit.DetailedDiff
+import org.custommonkey.xmlunit.ElementNameAndAttributeQualifier
+import org.custommonkey.xmlunit.XMLAssert
+
+buildscript {
+ repositories {
+ mavenCentral()
+ }
+ dependencies {
+ classpath 'xmlunit:xmlunit:1.3'
+ }
+}
+
+apply plugin: 'maven'
+apply from: 'gradle/pomconfigurer.gradle'
+
+configurations {
+ deployerJars
+}
+
+dependencies {
+ deployerJars "org.apache.maven.wagon:wagon-webdav:1.0-beta-2"
+}
+
+task generatePoms {
+ pom = pom()
+ pom.scopeMappings.addMapping(10, configurations.groovy, 'compile')
+ pomAll = pom()
+ [pomAll, pom]*.whenConfigured {pom ->
+ pom.dependencies.find {dep -> dep.artifactId == 'livetribe-jsr223' }.scope = 'provided'
+ pom.dependencies.find {dep -> dep.artifactId == 'ivy' }.addExclusion(new org.apache.maven.model.Exclusion(groupId: '*', artifactId: '*'))
+ pom.dependencies.each { dep -> dep.optional = dep.scope == 'test' ? false : true }
+ }
+ pomAll.whenConfigured {pom ->
+ pom.artifactId = 'groovy-all'
+ pom.dependencies.remove(pom.dependencies.find {dep -> dep.artifactId == 'commons-cli'})
+ }
+ def groovyConfDeps = configurations.groovy.dependencies.collect { dep -> dep.name }
+ pom.whenConfigured {pom ->
+ pom.dependencies.each { dep -> if (groovyConfDeps.contains(dep.artifactId)) { dep.optional = false }}
+ }
+ pomFile = "$buildDir/generatedPoms/groovy.pom" as File
+ pomAllFile = "$buildDir/generatedPoms/groovy-all.pom" as File
+ doFirst {
+ configure(pom, pomConfigureClosure)
+ configure(pomAll, pomConfigureClosure)
+ pom.writeTo(pomFile)
+ pomAll.writeTo(pomAllFile)
+ }
+}
+
+def artifact = groovy.xml.NamespaceBuilder.newInstance(ant, 'antlib:org.apache.maven.artifact.ant')
+task mavenInstall(dependsOn: [generatePoms, jar, jarAll]) {
+ inputs.files generatePoms.pomFile, generatePoms.pomAllFile, jar.archivePath, jarAll.archivePath
+ doFirst {
+ [(jar): generatePoms.pomFile, (jarAll):generatePoms.pomAllFile].each {jar, pomFile ->
+ println pomFile
+ artifact.install(file: jar.archivePath) {
+ pom(file: pomFile)
+ }
+ }
+ }
+}
+
+task mavenDeploy(dependsOn: [generatePoms, jar, jarAll]) << {
+ [(jar): generatePoms.pomFile, (jarAll):generatePoms.pomAllFile].each {jar, pomFile ->
+ // todo Once we have better classpath isolation and/or we have migrated to Maven 3 we don't need to execute the below with the IsolatedAntBuilder
+ def antBuilderClasspath = ["${gradle.gradleHomeDir}/lib/maven-ant-tasks-2.1.0.jar" as File] + services.get(org.gradle.api.internal.ClassPathRegistry).getClassPathFiles('ANT') +
+ services.get(org.gradle.api.internal.ClassPathRegistry).getClassPathFiles('LOCAL_GROOVY') + configurations.deployerJars.files
+ def isolatedAnt = services.get(org.gradle.api.internal.project.IsolatedAntBuilder)
+ isolatedAnt.execute(antBuilderClasspath) {
+ 'antlib:org.apache.maven.artifact.ant:deploy'(file: jar.archivePath) {
+ pom(file: pomFile)
+ }
+ }
+ }
+}
+
+task comparePoms << {
+ println 'Compare groovy.pom:'
+ comparePoms("pom.xml", "target/generatedPoms/groovy.pom")
+ println 'Compare groovy-all.pom:'
+ comparePoms("target/groovy-all.pom", "target/generatedPoms/groovy-all.pom")
+// Diff diff = new Diff(file("target/groovy-all.pom").text, file("target/generatedPom/groovy-all.pom").text)
+// diff.overrideElementQualifier(new ElementNameAndAttributeQualifier())
+// DetailedDiff ddiff = new DetailedDiff(diff)
+// XMLAssert.assertXMLEqual(ddiff, true);
+}
+
+def comparePoms(def antPom, def gradlePom) {
+ Set antDependencies = getDependencies(antPom)
+ Set gradleDependencies = getDependencies(gradlePom)
+ Set commonDependencies = antDependencies.intersect(gradleDependencies)
+ Set antOnly = antDependencies - commonDependencies
+ Set gradleOnly = gradleDependencies - commonDependencies
+ if (antOnly) {
+ println "Dependency only in Ant Pom: " + antOnly
+ }
+ if (gradleOnly) {
+ println "Dependency only in Gradle Pom: " + gradleOnly
+ }
+}
+
+def getDependencies(def pomFile) {
+ def project = new XmlParser().parse(pomFile as File)
+ Set dependencies = []
+ project.dependencies.dependency.each {dependency ->
+ def optional = dependency.optional?.text() ? 'optional' : 'non-optional'
+ String exclusions = 'exclusions:'
+ dependency.exclusions?.exclusion.each { exclusion ->
+ exclusions += "${exclusion.groupId.text()}:${exclusion.artifactId.text()}"
+ }
+ dependencies.add("${dependency.groupId.text()}:${dependency.artifactId.text()}:${dependency.version.text()}:$optional:$exclusions:${dependency.scope.text()}")
+ }
+ return dependencies
+}
View
9 gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,9 @@
+#Tue Mar 30 13:33:26 CEST 2010
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+distributionVersion=0.9-20100412101339+0200
+zipStorePath=wrapper/dists
+urlRoot=http\://snapshots.dist.codehaus.org/gradle
+distributionName=gradle
+distributionClassifier=bin
View
142 gradlew
@@ -0,0 +1,142 @@
+#!/bin/bash
+
+##############################################################################
+## ##
+## Gradle wrapper script for UN*X ##
+## ##
+##############################################################################
+
+# Uncomment those lines to set JVM options. GRADLE_OPTS and JAVA_OPTS can be used together.
+# GRADLE_OPTS="$GRADLE_OPTS -Xmx512"
+# JAVA_OPTS="$JAVA_OPTS -Xmx512"
+
+GRADLE_APP_NAME=Gradle
+
+warn ( ) {
+ echo "${PROGNAME}: $*"
+}
+
+die ( ) {
+ warn "$*"
+ exit 1
+}
+
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+esac
+
+# Attempt to set JAVA_HOME if it's not already set.
+if [ -z "$JAVA_HOME" ] ; then
+ if $darwin ; then
+ [ -z "$JAVA_HOME" -a -d "/Library/Java/Home" ] && export JAVA_HOME="/Library/Java/Home"
+ [ -z "$JAVA_HOME" -a -d "/System/Library/Frameworks/JavaVM.framework/Home" ] && export JAVA_HOME="/System/Library/Frameworks/JavaVM.framework/Home"
+ else
+ javaExecutable="`which javac`"
+ [ -z "$javaExecutable" -o "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ] && die "JAVA_HOME not set and cannot find javac to deduce location, please set JAVA_HOME."
+ # readlink(1) is not available as standard on Solaris 10.
+ readLink=`which readlink`
+ [ `expr "$readLink" : '\([^ ]*\)'` = "no" ] && die "JAVA_HOME not set and readlink not available, please set JAVA_HOME."
+ javaExecutable="`readlink -f \"$javaExecutable\"`"
+ javaHome="`dirname \"$javaExecutable\"`"
+ javaHome=`expr "$javaHome" : '\(.*\)/bin'`
+ export JAVA_HOME="$javaHome"
+ fi
+fi
+
+# For Cygwin, ensure paths are in UNIX format before anything is touched.
+if $cygwin ; then
+ [ -n "$JAVACMD" ] && JAVACMD=`cygpath --unix "$JAVACMD"`
+ [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
+fi
+
+STARTER_MAIN_CLASS=org.gradle.wrapper.GradleWrapperMain
+CLASSPATH=`dirname "$0"`/gradle/wrapper/gradle-wrapper.jar
+WRAPPER_PROPERTIES=`dirname "$0"`/gradle/wrapper/gradle-wrapper.properties
+# Determine the Java command to use to start the JVM.
+if [ -z "$JAVACMD" ] ; then
+ if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ else
+ JAVACMD="java"
+ fi
+fi
+if [ ! -x "$JAVACMD" ] ; then
+ die "JAVA_HOME is not defined correctly, can not execute: $JAVACMD"
+fi
+if [ -z "$JAVA_HOME" ] ; then
+ warn "JAVA_HOME environment variable is not set"
+fi
+
+# For Darwin, add GRADLE_APP_NAME to the JAVA_OPTS as -Xdock:name
+if $darwin; then
+ JAVA_OPTS="$JAVA_OPTS -Xdock:name=$GRADLE_APP_NAME"
+# we may also want to set -Xdock:image
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ JAVA_HOME=`cygpath --path --mixed "$JAVA_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+"$JAVACMD" $JAVA_OPTS $GRADLE_OPTS \
+ -classpath "$CLASSPATH" \
+ -Dorg.gradle.wrapper.properties="$WRAPPER_PROPERTIES" \
+ $STARTER_MAIN_CLASS \
+ "$@"
View
126 gradlew.bat
@@ -0,0 +1,126 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem ##
+@rem Gradle startup script for Windows ##
+@rem ##
+@rem ##########################################################################
+
+@rem
+@rem $Revision: 10602 $ $Date: 2008-01-25 02:49:54 +0100 (ven., 25 janv. 2008) $
+@rem
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+@rem Uncomment those lines to set JVM options. GRADLE_OPTS and JAVA_OPTS can be used together.
+@rem set GRADLE_OPTS=%GRADLE_OPTS% -Xmx512
+@rem set JAVA_OPTS=%JAVA_OPTS% -Xmx512
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.\
+
+@rem Determine the command interpreter to execute the "CD" later
+set COMMAND_COM="cmd.exe"
+if exist "%SystemRoot%\system32\cmd.exe" set COMMAND_COM="%SystemRoot%\system32\cmd.exe"
+if exist "%SystemRoot%\command.com" set COMMAND_COM="%SystemRoot%\command.com"
+
+@rem Use explicit find.exe to prevent cygwin and others find.exe from being used
+set FIND_EXE="find.exe"
+if exist "%SystemRoot%\system32\find.exe" set FIND_EXE="%SystemRoot%\system32\find.exe"
+if exist "%SystemRoot%\command\find.exe" set FIND_EXE="%SystemRoot%\command\find.exe"
+
+:check_JAVA_HOME
+@rem Make sure we have a valid JAVA_HOME
+if not "%JAVA_HOME%" == "" goto have_JAVA_HOME
+
+echo.
+echo ERROR: Environment variable JAVA_HOME has not been set.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+echo.
+goto end
+
+:have_JAVA_HOME
+@rem Validate JAVA_HOME
+%COMMAND_COM% /C DIR "%JAVA_HOME%" 2>&1 | %FIND_EXE% /I /C "%JAVA_HOME%" >nul
+if not errorlevel 1 goto init
+
+echo.
+echo ERROR: JAVA_HOME might be set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation if there are problems.
+echo.
+
+:init
+@rem get name of script to launch with full path
+@rem Get command-line arguments, handling Windowz variants
+SET _marker=%JAVA_HOME: =%
+@rem IF NOT "%_marker%" == "%JAVA_HOME%" ECHO JAVA_HOME "%JAVA_HOME%" contains spaces. Please change to a location without spaces if this causes problems.
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+if "%eval[2+2]" == "4" goto 4NT_args
+
+IF "%_marker%" == "%JAVA_HOME%" goto :win9xME_args
+
+set _FIXPATH=
+call :fixpath "%JAVA_HOME%"
+set JAVA_HOME=%_FIXPATH:~1%
+
+goto win9xME_args
+
+:fixpath
+if not %1.==. (
+for /f "tokens=1* delims=;" %%a in (%1) do (
+call :shortfilename "%%a" & call :fixpath "%%b"
+)
+)
+goto :EOF
+:shortfilename
+for %%i in (%1) do set _FIXPATH=%_FIXPATH%;%%~fsi
+goto :EOF
+
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+goto execute
+
+:4NT_args
+@rem Get arguments from the 4NT Shell from JP Software
+set CMD_LINE_ARGS=%$
+
+:execute
+@rem Setup the command line
+
+set STARTER_MAIN_CLASS=org.gradle.wrapper.GradleWrapperMain
+set CLASSPATH=%DIRNAME%\gradle\wrapper\gradle-wrapper.jar
+set WRAPPER_PROPERTIES=%DIRNAME%\gradle\wrapper\gradle-wrapper.properties
+set JAVA_EXE=%JAVA_HOME%\bin\java.exe
+
+set GRADLE_OPTS=%JAVA_OPTS% %GRADLE_OPTS% -Dorg.gradle.wrapper.properties="%WRAPPER_PROPERTIES%"
+
+"%JAVA_EXE%" %GRADLE_OPTS% -classpath "%CLASSPATH%" %STARTER_MAIN_CLASS% %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+if not "%OS%"=="Windows_NT" echo 1 > nul | choice /n /c:1
+
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit "%ERRORLEVEL%"
+exit /b "%ERRORLEVEL%"
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
View
12 security/groovy.policy
@@ -60,6 +60,18 @@ grant codeBase "file:${maven.home}/-" {
};
/*
+ * When running from Gradle, this codebase is required.
+ * If not running from Gradle, the codesource will not be found, but will not cause an error.
+ */
+grant codeBase "file:${gradle.home}/-" {
+ permission java.security.AllPermission;
+};
+
+grant codeBase "file:${gradle.junit}" {
+ permission java.security.AllPermission;
+};
+
+/*
* When running from ant, this codebase is required.
* If not running from ant, the codesource will not be found, but will not cause an error.
* TODO: narrow this down to specific jars
Please sign in to comment.
Something went wrong with that request. Please try again.