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/03/16 15:19:25 UTC
commons-release-plugin git commit: COMMONSSITE-107: fix release notes
SCM addition
Repository: commons-release-plugin
Updated Branches:
refs/heads/master d209f1ea3 -> 9e2ebcd71
COMMONSSITE-107: fix release notes SCM addition
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/9e2ebcd7
Tree: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/tree/9e2ebcd7
Diff: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/diff/9e2ebcd7
Branch: refs/heads/master
Commit: 9e2ebcd71da40965171fae82a4adef393a369b95
Parents: d209f1e
Author: Rob Tompkins <ch...@gmail.com>
Authored: Fri Mar 16 11:19:17 2018 -0400
Committer: Rob Tompkins <ch...@gmail.com>
Committed: Fri Mar 16 11:19:17 2018 -0400
----------------------------------------------------------------------
src/changes/changes.xml | 3 ++-
.../mojos/CommonsDistributionStagingMojo.java | 16 +++++++++++-----
2 files changed, 13 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/9e2ebcd7/src/changes/changes.xml
----------------------------------------------------------------------
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 4fc9dc9..6f6ff3d 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -25,7 +25,8 @@
</properties>
<body>
- <release version="1.2" date="YYYY-MM-DD" description="tbd">
+ <release version="1.2" date="YYYY-MM-DD" description="Version 1.2">
+ <action issue="COMMONSSITE-107" type="fix" dev="chtompki">Adding ./target/commons-release-plugin/scm/RELEASE-NOTES.txt to svn as opposed to ./RELEASE-NOTES.txt</action>
</release>
<release version="1.1" date="2018-02-28" description="1.1">
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/9e2ebcd7/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 2965f1e..8b7c7f1 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
@@ -156,8 +156,8 @@ public class CommonsDistributionStagingMojo extends AbstractMojo {
ScmFileSet scmFileSet = new ScmFileSet(distCheckoutDirectory);
getLog().info("Checking out dist from: " + distSvnStagingUrl);
provider.checkOut(repository, scmFileSet);
- copyReleaseNotesToWorkingDirectory();
- List<File> filesToCommit = copyDistributionsIntoScmDirectoryStructure();
+ File copiedReleaseNotes = copyReleaseNotesToWorkingDirectory();
+ List<File> filesToCommit = copyDistributionsIntoScmDirectoryStructure(copiedReleaseNotes);
if (!dryRun) {
ScmFileSet scmFileSetToCommit = new ScmFileSet(distCheckoutDirectory, filesToCommit);
AddScmResult addResult = provider.add(
@@ -196,10 +196,13 @@ public class CommonsDistributionStagingMojo extends AbstractMojo {
* A utility method that takes the <code>RELEASE-NOTES.txt</code> file from the base directory of the
* project and copies it into {@link CommonsDistributionStagingMojo#workingDirectory}.
*
+ * @return the RELEASE-NOTES.txt file that exists in the <code>target/commons-release-notes/scm</code>
+ * directory for the purpose of adding it to the scm change set in the method
+ * {@link CommonsDistributionStagingMojo#copyDistributionsIntoScmDirectoryStructure(File)}.
* @throws MojoExecutionException if an {@link IOException} occurrs as a wrapper so that maven
* can properly handle the exception.
*/
- private void copyReleaseNotesToWorkingDirectory() throws MojoExecutionException {
+ private File copyReleaseNotesToWorkingDirectory() throws MojoExecutionException {
StringBuffer copiedReleaseNotesAbsolutePath;
getLog().info("Copying RELEASE-NOTES.txt to working directory.");
copiedReleaseNotesAbsolutePath = new StringBuffer(workingDirectory.getAbsolutePath());
@@ -207,6 +210,7 @@ public class CommonsDistributionStagingMojo extends AbstractMojo {
copiedReleaseNotesAbsolutePath.append(releaseNotesFile.getName());
File copiedReleaseNotes = new File(copiedReleaseNotesAbsolutePath.toString());
SharedFunctions.copyFile(getLog(), releaseNotesFile, copiedReleaseNotes);
+ return copiedReleaseNotes;
}
/**
@@ -228,11 +232,13 @@ public class CommonsDistributionStagingMojo extends AbstractMojo {
* </ul></li>
* </ul>
*
+ * @param copiedReleaseNotes is the RELEASE-NOTES.txt file that exists in the
+ * <code>target/commons-release-plugin/scm</code> directory.
* @return a {@link List} of {@link File}'s in the directory for the purpose of adding them to the maven
* {@link ScmFileSet}.
* @throws MojoExecutionException if an {@link IOException} occurrs so that Maven can handle it properly.
*/
- private List<File> copyDistributionsIntoScmDirectoryStructure() throws MojoExecutionException {
+ private List<File> copyDistributionsIntoScmDirectoryStructure(File copiedReleaseNotes) throws MojoExecutionException {
List<File> workingDirectoryFiles = Arrays.asList(workingDirectory.listFiles());
String scmBinariesRoot = buildDistBinariesRoot();
String scmSourceRoot = buildDistSourceRoot();
@@ -258,7 +264,7 @@ public class CommonsDistributionStagingMojo extends AbstractMojo {
filesForMavenScmFileSet.add(copy);
}
}
- filesForMavenScmFileSet.add(releaseNotesFile);
+ filesForMavenScmFileSet.add(copiedReleaseNotes);
return filesForMavenScmFileSet;
}