You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ch...@apache.org on 2018/02/21 14:07:15 UTC

commons-release-plugin git commit: COMMONSSITE-98: setting up for multimodule builds

Repository: commons-release-plugin
Updated Branches:
  refs/heads/1.1 d60d88dd9 -> a1cbc9dd9


COMMONSSITE-98: setting up for multimodule builds


Project: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/commit/a1cbc9dd
Tree: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/tree/a1cbc9dd
Diff: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/diff/a1cbc9dd

Branch: refs/heads/1.1
Commit: a1cbc9dd987aa1a599a8f7ba0547b30c02a8bdb1
Parents: d60d88d
Author: Rob Tompkins <ch...@gmail.com>
Authored: Wed Feb 21 09:05:04 2018 -0500
Committer: Rob Tompkins <ch...@gmail.com>
Committed: Wed Feb 21 09:07:04 2018 -0500

----------------------------------------------------------------------
 src/changes/changes.xml                                |  1 +
 .../plugin/mojos/CommonsDistributionStagingMojo.java   | 13 +++++++++----
 .../mojos/stage-distributions/stage-distributions.xml  |  1 +
 3 files changed, 11 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/a1cbc9dd/src/changes/changes.xml
----------------------------------------------------------------------
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index a344811..ef6bf7f 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -26,6 +26,7 @@
 
   <body>
     <release version="1.1" date="2018-02-15" description="1.1">
+      <action issue="COMMONSSITE-98"  type="add" dev="chtompki">Making the project more multi-module compatible</action>
       <action issue="COMMONSSITE-102" type="fix" dev="chtompki">Commons Release Plugin doesn't work with Commons Release Plugin</action>
       <action issue="COMMONSSITE-101" type="fix" dev="chtompki">Make -Dcommons.release.dryRun=true our commit toggle</action>
     </release>

http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/a1cbc9dd/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java
index 8e982ac..031b541 100644
--- a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java
+++ b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java
@@ -84,6 +84,12 @@ public class CommonsDistributionStagingMojo extends AbstractMojo {
     private File distCheckoutDirectory;
 
     /**
+     * The location of the RELEASE-NOTES.txt file such that multimodule builds can configure it.
+     */
+    @Parameter(defaultValue = "${basedir}/RELEASE-NOTES.txt", alias = "releaseNotesLocation")
+    private File releaseNotesFile;
+
+    /**
      * A boolean that determines whether or not we actually commit the files up to the subversion repository.
      * If this is set to <code>true</code>, we do all but make the commits. We do checkout the repository in question
      * though.
@@ -178,12 +184,11 @@ public class CommonsDistributionStagingMojo extends AbstractMojo {
     private void copyReleaseNotesToWorkingDirectory() throws MojoExecutionException {
         StringBuffer copiedReleaseNotesAbsolutePath;
         getLog().info("Copying RELEASE-NOTES.txt to working directory.");
-        File releaseNotes = new File(basedir + "/RELEASE-NOTES.txt");
         copiedReleaseNotesAbsolutePath = new StringBuffer(workingDirectory.getAbsolutePath());
         copiedReleaseNotesAbsolutePath.append("/scm/");
-        copiedReleaseNotesAbsolutePath.append(releaseNotes.getName());
+        copiedReleaseNotesAbsolutePath.append(releaseNotesFile.getName());
         File copiedReleaseNotes = new File(copiedReleaseNotesAbsolutePath.toString());
-        SharedFunctions.copyFile(getLog(), releaseNotes, copiedReleaseNotes);
+        SharedFunctions.copyFile(getLog(), releaseNotesFile, copiedReleaseNotes);
     }
 
     /**
@@ -233,7 +238,7 @@ public class CommonsDistributionStagingMojo extends AbstractMojo {
                 filesForMavenScmFileSet.add(copy);
             }
         }
-        filesForMavenScmFileSet.add(new File(distCheckoutDirectory + "/RELEASE-NOTES.txt"));
+        filesForMavenScmFileSet.add(releaseNotesFile);
         return filesForMavenScmFileSet;
     }
 

http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/a1cbc9dd/src/test/resources/mojos/stage-distributions/stage-distributions.xml
----------------------------------------------------------------------
diff --git a/src/test/resources/mojos/stage-distributions/stage-distributions.xml b/src/test/resources/mojos/stage-distributions/stage-distributions.xml
index 17a0bb3..75e038b 100644
--- a/src/test/resources/mojos/stage-distributions/stage-distributions.xml
+++ b/src/test/resources/mojos/stage-distributions/stage-distributions.xml
@@ -45,6 +45,7 @@
                     <project implementation="org.apache.commons.release.plugin.stubs.DistributionDetachmentProjectStub" />
                     <workingDirectory>target/testing-commons-release-plugin</workingDirectory>
                     <distCheckoutDirectory>target/testing-commons-release-plugin/scm</distCheckoutDirectory>
+                    <releaseNotesFile>src/test/resources/mojos/stage-distributions/RELEASE-NOTES.txt</releaseNotesFile>
                     <distSvnStagingUrl>scm:svn:https://dist.apache.org/repos/dist/dev/commons/release-plugin</distSvnStagingUrl>
                     <dryRun>true</dryRun>
                 </configuration>