Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Add support for "invokedynamic" to "dist" Gradle task

   - "dist" now triggers "jarAllAll"
   - regular jars (as well as module jars) are bundled into the "lib" directory
   - indy jars (as well as module indy jars) are bundled into the "indy" directory
   - dist doesn't support sources and docs yet
  • Loading branch information...
commit 8b4012c5b1bcc1cf676fa6dba42e2bc86aea40a7 1 parent b494a09
Cédric Champeau melix authored
6 build.gradle
@@ -433,3 +433,9 @@ task wrapper(type: Wrapper) {
433 433
434 434 // Define a GroovyDoc task which depends on the generated groovydoc tool
435 435 apply from: "$projectDir/gradle/groovydoc.gradle"
  436 +
  437 +classes {
  438 + doFirst {
  439 + logger.lifecycle "InvokeDynamic support ${useIndy()?'on':'off'}"
  440 + }
  441 +}
42 gradle/assemble.gradle
@@ -178,6 +178,24 @@ task jarAll(type: Jar, dependsOn: { modules()*.jar }) {
178 178 }
179 179 }
180 180
  181 +task jarAllWithIndy(type: GradleBuild) {
  182 + description = 'Triggers an external build generating the indy jarAll'
  183 + buildFile = 'build.gradle'
  184 + startParameter.projectProperties['indy']=true
  185 + tasks = ['jarAll']
  186 +}
  187 +
  188 +task jarAllAll(dependsOn: [jarAll, jarAllWithIndy]) {
  189 + description = 'Generates groovy-all and groovy-all-indy jars'
  190 + doFirst {
  191 + if (useIndy()) {
  192 + logger.lifecycle('InvokeDynamic support was activated but needs to be off for this pass. Disabling.')
  193 + ext.useIndy = false
  194 + }
  195 + }
  196 +
  197 +}
  198 +
181 199 task sourceAllJar(type: Jar, dependsOn: { modules()*.sourceJar }) {
182 200 with sourceJar.rootSpec
183 201 modules()*.sourceJar.each {
@@ -205,11 +223,20 @@ ext.distSpec = copySpec {
205 223 include "LICENSE.txt", "NOTICE.txt"
206 224 }
207 225 into("lib") {
208   - from configurations.runtime.fileCollection {dep ->
209   - System.err.println dep.dump()
210   -// !(dep instanceof FileCollectionDependency) && !dep.name.startsWith('livetribe')
211   - }, jar.archivePath
  226 + from configurations.runtime.findAll { it.name.endsWith 'jar' }
  227 + from jar.archivePath
  228 + from modules()*.jar.archivePath
212 229 }
  230 +
  231 + into("indy") {
  232 + from { new File(jar.archivePath.parent, "${jar.baseName}-${jar.version}-indy.jar") }
  233 + from {
  234 + modules()*.jar.each { j ->
  235 + new File(j.archivePath.parent, "${j.baseName}-${j.version}-indy.jar")
  236 + }
  237 + }
  238 + }
  239 +
213 240 into("conf") {
214 241 from "src/conf"
215 242 }
@@ -224,6 +251,7 @@ ext.distSpec = copySpec {
224 251 }
225 252 into("embeddable") {
226 253 from jarAll.archivePath
  254 + from { new File(jarAll.archivePath.parent, "${jarAll.baseName}-${jarAll.appendix}-${jarAll.version}-indy.jar") }
227 255 }
228 256 }
229 257
@@ -235,7 +263,7 @@ task installGroovy(type: Sync, dependsOn: [jar, jarAll]) {
235 263 //task jars(dependsOn: tasks.withType(Jar))
236 264 //task dists(dependsOn: tasks.withType(Zip).matching {task -> !(task instanceof Jar)})
237 265
238   -task distBin(type: Zip, dependsOn: [jar, jarAll]) {
  266 +task distBin(type: Zip, dependsOn: [jar, jarAllAll]) {
239 267 appendix = 'binary'
240 268 into("groovy-$version") {
241 269 with distSpec
@@ -269,4 +297,6 @@ task distSrc(type: Zip, dependsOn: [javadoc, groovydoc, docGDK]) {
269 297 }
270 298 }
271 299
272   -//task
  300 +task dist(dependsOn: [distBin, /*distSrc, distDoc*/]) {
  301 + description = 'Generates the binary, sources and documentation distributions'
  302 +}
2  src/conf/groovy-starter.conf
@@ -22,5 +22,3 @@
22 22 # tools.jar for ant tasks
23 23 load ${tools.jar}
24 24
25   - // TODO M12N test grab only - replace with gradle generated subprojects list
26   - grab commons-lang:commons-lang:2.6

0 comments on commit 8b4012c

Please sign in to comment.
Something went wrong with that request. Please try again.