Note that there are some explanatory texts on larger screens.

plurals
  1. POGradle Release System Task - Calling uploadArchives on subprojects
    primarykey
    data
    text
    <p>In order to release my system, I am creating a releaser project that calls uploadArchives for a number of other projects.</p> <p>In my project I have the following files:</p> <p><strong>settings.gradle</strong></p> <pre><code>include '../proj-a', '../proj-b' </code></pre> <p><strong>build.gradle</strong></p> <pre><code>task releaseSystem() { // what goes here? } </code></pre> <p>What should the contents of the releaseSystem task be such that I can call <code>gradle releaseSystem</code> and have it run uploadArchives for each of my sub projects?</p> <p>I've tried a number of options, but none have been successful thus far.</p> <p>Thank you for any insights you can provide.</p> <p><strong>ANSWER</strong></p> <p>I'm continually impressed with the graceful solutions gradle provides to my problems. Here's my final solution (as Peter pointed out below):</p> <p><strong>settings.gradle</strong></p> <pre><code>include 'proj-a', 'proj-b' project (':proj-a').projectDir = new File(settingsDir, '../proj-a') project (':proj-b').projectDir = new File(settingsDir, '../proj-b') </code></pre> <p><strong>build.gradle</strong></p> <pre><code>task releaseSystem() { dependsOn { [ subprojects.build, subprojects.uploadArchives ] } } </code></pre> <p>Note, that since my repository is a maven repository, when I originally included '../proj-a' in my settings.gradle, it produced poms with artifactId ../proj-a which was invalid. I had to change my settings.gradle to the format above for the system to put the poms together correctly and for the uploadArchives task to complete successfully.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload