package - Gradle multi project distribution -


i'm trying make dist of multi project build. root project looks this:

apply plugin: 'distribution' version 1.0 distributions {     main {         basename = 'somename'         contents {             'nodes'          'nodes'         }     } } 

it copies folder files dist.

i want each subproject inject stuff dist. want add each subprojects jar, dependecies, , possibly other files etc...

i have no idea how inject subproject root. should that? mean this:

subprojects {    apply java...    ...     // pseudocode    jack root project dist plugin    put produced jars , dependencies in folder name    ... } 

does have examples, or point me in right direction?

thanks!

i looking same thing. peeking @ api docs , gradle' own build files, came following:

apply plugin: 'distribution'  distributions {     main {         contents {             into('bin') {                 { project(':subproject1').startscripts.outputs.files }                 { project(':subproject2').startscripts.outputs.files }                 filemode = 0755             }             into('lib') {                 def libs = []                 libs << project(':subproject1').configurations.runtime - project(':runner').configurations.runtime                 libs << project(':subproject2').configurations.runtime                 libs                 project(':subproject1').jar                 project(':subproject2').jar             }         }     } } 

the contents {} closure copyspec, knowing makes using distribution plugin way simpler :)

check out gradle' own subprojects/distributions/distributions.gradle file great examples of using copyspec.

this works.

  • the substraction remove duplicated jars.
  • the ".jar" lines add jar of project configurations.runtime seem contain dependenceis.

sadly, i've no clue on how scale more 2 projects in clean way. atleast we're 1 step closer :)


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -