configuration of paths within gradle project -


i have gradle project formatted this

  • container/
    • dist/
    • mod1/
      • build.gradle
    • mod2/
      • build.gradle
    • mod3/
      • build.gradle
    • build.gradle

basically grade project lot of submodules. trying when run assembly on container/build.gradle runs builds on sub projects. part easy enough. im trying accomplish centralizing configuration settings , parameters across everything.

here snip container/build.gradle file

subprojects {     apply plugin: 'java'     apply plugin: 'scala'      jar {         manifest.attributes provider: 'onuspride'     }      property {         sourcecompatibility = 1.7         archivepath = file("dist")     }      ext {         springversion = "3.2.1.release"         springsecuritywebversion = "3.1.3.release"         springsecurityoauth2version = "1.0.1.release"         jacksoncoreversion = "2.1.2"     }      dependencies {         testcompile 'junit:junit:4.8.2'     } } 

i trying configure modules when finish doing various assemble task, javajar, scalajar, war, etc, put output in container/dist folder. how do that?

also, have example of complex, written, multi-module gradle project. little more substantial hello world stuff helpful. learning groovy , gradle @ same time bit tough.

i think have different options. 1 solution might introduce common task in subproject copy output of tasks of type abstractarchivetask dist folder. this:

subprojects{     task copytodists(type:copy){          project.rootproject.file("dists")          tasks.withtype(abstractarchivetask)     } } 

this solution has overhead , not considered best practice, start shuffeling stuff around within build. better approach reconfigure according task create jars, wars, zips per default in desired folder:

subprojects{     tasks.withtype(abstractarchivetask){         destinationdir = project.rootproject.file("dists")     } } 

hope helped.

cheers, rené


Comments

Popular posts from this blog

asp.net mvc 3 - Using mvc3, I need to add a username/password to the sql connection string at runtime -

kineticjs - draw multiple lines and delete individual line -

thumbnails - jQuery image rotate on hover -