Repository: groovy Updated Branches: refs/heads/master 0d1890c04 -> 6d0c66773
Avoid resolving dependencies at configuration time Project: http://git-wip-us.apache.org/repos/asf/groovy/repo Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/db85fc27 Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/db85fc27 Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/db85fc27 Branch: refs/heads/master Commit: db85fc27cc89ea9cee2917893f8bc35aeebbcc06 Parents: fe90fda Author: Cedric Champeau <cchamp...@apache.org> Authored: Mon Dec 11 19:06:50 2017 +0100 Committer: Cedric Champeau <cchamp...@apache.org> Committed: Mon Dec 11 19:17:11 2017 +0100 ---------------------------------------------------------------------- gradle/assemble.gradle | 67 ++++++++++++++++++++++++++++----------------- 1 file changed, 42 insertions(+), 25 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/groovy/blob/db85fc27/gradle/assemble.gradle ---------------------------------------------------------------------- diff --git a/gradle/assemble.gradle b/gradle/assemble.gradle index a7dd207..0e5cbae 100644 --- a/gradle/assemble.gradle +++ b/gradle/assemble.gradle @@ -165,7 +165,7 @@ allprojects { } arch.exclude '**/package-info.class' - task "jar${arch.name}"(type:Jar, dependsOn: arch) { + task "jar${arch.name}"(type: Jar, dependsOn: arch) { outputs.cacheIf { // caching JarJar because it's quite expensive to create true @@ -258,7 +258,7 @@ allprojects { classifier = jar.classifier ? "${jar.classifier}grooid" : 'grooid' includeEmptyDirs = false def target = new File("${archivePath}.tmp") - boolean isRootProject = project==rootProject + boolean isRootProject = project == rootProject doFirst { from zipTree(target) @@ -268,7 +268,9 @@ allprojects { 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/*') + 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' @@ -349,6 +351,7 @@ task groovydocAllJar(type: Jar, dependsOn: groovydocAll) { } ext.distSpec = copySpec { + duplicatesStrategy = DuplicatesStrategy.EXCLUDE from("$projectDir/licenses/LICENSE-BINZIP") from("$projectDir/notices/NOTICE-BINZIP") rename { String filename -> filename == 'LICENSE-BINZIP' ? 'LICENSE' : filename == 'NOTICE-BINZIP' ? 'NOTICE' : filename } @@ -356,17 +359,29 @@ ext.distSpec = copySpec { into('lib') { from jarjar from modules()*.jarjar - from { - configurations.runtime.findAll { - it.name.endsWith('jar') && !it.name.startsWith('openbeans-') && !it.name.startsWith('asm-') && !it.name.startsWith('antlr-') && !it.name.startsWith('antlr4-') } + - 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('antlr4-') && !it.name.startsWith('openbeans-') - }.flatten() as Set + from(configurations.runtime) { + exclude { it.file.name.startsWith('openbeans-') || + it.file.name.startsWith('asm-') || + it.file.name.startsWith('antlr-') || + it.file.name.startsWith('antlr4-') + } } from('src/bin/groovy.icns') } + modules().configurations.runtime.each { conf -> + into('lib') { + from(conf) { + exclude { + it.file.name.contains('livetribe-jsr223') || + it.file.name.matches(/groovy-\d.*/) || + it.file.name.startsWith('asm-') || + it.file.name.startsWith('antlr-') || + it.file.name.startsWith('antlr4-') || + it.file.name.startsWith('openbeans-') + } + } + } + } into('indy') { from jarjarWithIndy from modules()*.jarjarWithIndy @@ -384,7 +399,7 @@ ext.distSpec = copySpec { } into('bin') { from('src/bin') { - filter(ReplaceTokens, tokens: [GROOVYJAR:jarjar.archiveName]) + filter(ReplaceTokens, tokens: [GROOVYJAR: jarjar.archiveName]) fileMode = 0755 exclude 'groovy.icns' } @@ -442,8 +457,8 @@ task distSrc(type: Zip) { } def installDir = { - project.hasProperty('groovy_installPath')?project.groovy_installPath: - System.properties.installDirectory ?: "$buildDir/install" + project.hasProperty('groovy_installPath') ? project.groovy_installPath : + System.properties.installDirectory ?: "$buildDir/install" } task installGroovy(type: Sync, dependsOn: [checkCompatibility, distBin]) { @@ -491,7 +506,7 @@ task dist(type: Zip, dependsOn: [checkCompatibility, distBin, distSrc, distDoc, } if ((version.endsWith('SNAPSHOT') && !groovyBundleVersion.endsWith('SNAPSHOT')) - || (!version.endsWith('SNAPSHOT') && groovyBundleVersion.endsWith('SNAPSHOT'))) { + || (!version.endsWith('SNAPSHOT') && groovyBundleVersion.endsWith('SNAPSHOT'))) { throw new GradleException("Incoherent versions. Found groovyVersion=$version and groovyBundleVersion=$groovyBundleVersion") } } @@ -527,16 +542,18 @@ task updateLicenses { def jsr223Files = fileTree(licensesDir).include('jsr223-ALLJARJAR-SRC.txt') def licenseHdr = '\n\n------------------------------------------------------------------------\n\n' [ - (licenseBinZipFile) : binzipFiles, - (licenseDocFile) : docFiles, - (licenseJarJarFile) : jarjarFiles, - (licenseSrcFile) : srcFiles, + (licenseBinZipFile) : binzipFiles, + (licenseDocFile) : docFiles, + (licenseJarJarFile) : jarjarFiles, + (licenseSrcFile) : srcFiles, (licenseDocGeneratorFile): docgeneratorFiles, (licenseGroovyDocFile) : groovydocFiles, (licenseJsr223File) : jsr223Files, ].each { outFile, inFiles -> file(outFile).withWriter('utf-8') { writer -> - writer << ([file(licenseBaseFile)] + inFiles).collect { it.text.replaceAll(/[\n\r]*$/, '') }.join(licenseHdr) + '\n' + writer << ([file(licenseBaseFile)] + inFiles).collect { + it.text.replaceAll(/[\n\r]*$/, '') + }.join(licenseHdr) + '\n' } } file(licenseSdkFile).withWriter { writer -> @@ -582,11 +599,11 @@ task updateNotices { }.sort { it.name } def groovyconsoleFiles = fileTree(noticesDir) [ - (noticeBinZipFile): binzipFiles, - (noticeGrooidFile): grooidFiles, - (noticeGrooidJarJarFile): grooidJarjarFiles, - (noticeJarJarFile): jarjarFiles, - (noticeSrcFile): srcFiles, + (noticeBinZipFile) : binzipFiles, + (noticeGrooidFile) : grooidFiles, + (noticeGrooidJarJarFile) : grooidJarjarFiles, + (noticeJarJarFile) : jarjarFiles, + (noticeSrcFile) : srcFiles, (noticeGroovyConsoleFile): groovyconsoleFiles, ].each { outFile, inFiles -> file(outFile).withWriter('utf-8') { writer ->