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/06/14 18:26:31 UTC

[1/4] commons-release-plugin git commit: temp

Repository: commons-release-plugin
Updated Branches:
  refs/heads/master fc71aa2ef -> a5bfc15a4


temp


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/b96fa913
Tree: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/tree/b96fa913
Diff: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/diff/b96fa913

Branch: refs/heads/master
Commit: b96fa91313cae6ebe11e799c94ec1115f93e1b33
Parents: 0692a61
Author: Rob Tompkins <ch...@apache.org>
Authored: Wed Jun 13 14:49:56 2018 -0400
Committer: Rob Tompkins <ch...@apache.org>
Committed: Wed Jun 13 14:49:56 2018 -0400

----------------------------------------------------------------------
 .../mojos/CommonsDistributionStagingMojo.java   | 127 +++++++++++++++----
 1 file changed, 100 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/b96fa913/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 e86f56d..0da4c16 100755
--- a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java
+++ b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java
@@ -47,7 +47,10 @@ import java.io.OutputStreamWriter;
 import java.io.Writer;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashSet;
 import java.util.List;
+import java.util.Set;
 
 /**
  * This class checks out the dev distribution location, copies the distributions into that directory
@@ -194,39 +197,109 @@ public class CommonsDistributionStagingMojo extends AbstractMojo {
             provider.checkOut(repository, scmFileSet);
             File copiedReleaseNotes = copyReleaseNotesToWorkingDirectory();
             List<File> filesToCommit = copyDistributionsIntoScmDirectoryStructure(copiedReleaseNotes);
+            filesToCommit.addAll(copySiteToScmDirectory());
             if (!dryRun) {
-                ScmFileSet scmFileSetToCommit = new ScmFileSet(distCheckoutDirectory, filesToCommit);
+                commitDirectories(filesToCommit, provider, repository);
+                commitFiles(filesToCommit, provider, repository);
+            } else {
+                getLog().info("[Dry run] Would have committed to: " + distSvnStagingUrl);
+                getLog().info(
+                        "[Dry run] Staging release: " + project.getArtifactId() + ", version: " + project.getVersion());
+            }
+        } catch (ScmException e) {
+            getLog().error("Could not commit files to dist: " + distSvnStagingUrl, e);
+            throw new MojoExecutionException("Could not commit files to dist: " + distSvnStagingUrl, e);
+        }
+    }
+
+    /**
+     * Commits all the directories to SVN from the fileset.
+     *
+     * @param filesToCommit the {@link List} of {@link File} that we find the directories to which we must commit.
+     * @param provider the maven {@link ScmProvider}.
+     * @param repository the maven {@link ScmRepository}.
+     * @throws ScmException if the maven SCM api fails.
+     * @throws MojoExecutionException if we get a failure that does not throw an exception.
+     */
+    private void commitDirectories(List<File> filesToCommit, ScmProvider provider, ScmRepository repository)
+            throws ScmException, MojoExecutionException {
+        Collections.sort(filesToCommit);
+        Set<File> committedDirectories = new HashSet<>();
+        for (File file : filesToCommit) {
+            if (file.getAbsolutePath().contains(commonsReleaseVersion + "-" + commonsRcVersion)
+                    && !committedDirectories.contains(file.getParentFile())
+                    && !file.getParentFile().getAbsolutePath().equals(distCheckoutDirectory)) {
+                File parentFile = file.getParentFile();
+                commitParentsIfNotCommitted(parentFile, committedDirectories);
+                ScmFileSet scmFileSetToCommit = new ScmFileSet(distCheckoutDirectory, parentFile);
                 AddScmResult addResult = provider.add(
                         repository,
-                        scmFileSetToCommit,
-                        "Staging release: " + project.getArtifactId() + ", version: " + project.getVersion()
+                        scmFileSetToCommit
                 );
                 if (addResult.isSuccess()) {
-                    getLog().info("Staging release: " + project.getArtifactId() + ", version: " + project.getVersion());
+                    getLog().info("Adding release directories: "
+                            + project.getArtifactId() + ", version: " + project.getVersion());
                     CheckInScmResult checkInResult = provider.checkIn(
                             repository,
                             scmFileSetToCommit,
-                            "Staging release: " + project.getArtifactId() + ", version: " + project.getVersion()
+                            "Adding release directories: "
+                                    + project.getArtifactId() + ", version: " + project.getVersion()
                     );
                     if (!checkInResult.isSuccess()) {
-                        getLog().error("Committing dist files failed: " + checkInResult.getCommandOutput());
+                        getLog().error("Committing directories  failed: " + checkInResult.getCommandOutput());
                         throw new MojoExecutionException(
-                                "Committing dist files failed: " + checkInResult.getCommandOutput()
+                                "Committing directories files failed: " + checkInResult.getCommandOutput()
                         );
                     }
-                    getLog().info("Committed revision " + checkInResult.getScmRevision());
+                    committedDirectories.add(parentFile);
                 } else {
-                    getLog().error("Adding dist files failed: " + addResult.getCommandOutput());
-                    throw new MojoExecutionException("Adding dist files failed: " + addResult.getCommandOutput());
+                    getLog().error("Adding directory failed: " + addResult.getCommandOutput());
+                    throw new MojoExecutionException("Adding directory failed: "
+                            + addResult.getCommandOutput());
                 }
-            } else {
-                getLog().info("[Dry run] Would have committed to: " + distSvnStagingUrl);
-                getLog().info(
-                        "[Dry run] Staging release: " + project.getArtifactId() + ", version: " + project.getVersion());
             }
-        } catch (ScmException e) {
-            getLog().error("Could not commit files to dist: " + distSvnStagingUrl, e);
-            throw new MojoExecutionException("Could not commit files to dist: " + distSvnStagingUrl, e);
+        }
+    }
+
+    private void commitParentsIfNotCommitted(File file, Set<File> committedDirectories) {
+        if (committedDirectories.contains(file.getParentFile())) {
+            return;
+        }
+    }
+
+    /**
+     * Commits files to SVN from the fileset.
+     *
+     * @param filesToCommit the {@link List} of {@link File} we must commit.
+     * @param provider the maven {@link ScmProvider}.
+     * @param repository the maven {@link ScmRepository}.
+     * @throws ScmException if the maven SCM api fails.
+     * @throws MojoExecutionException if we get a failure that does not throw an exception.
+     */
+    private void commitFiles(List<File> filesToCommit, ScmProvider provider, ScmRepository repository)
+            throws ScmException, MojoExecutionException {
+        ScmFileSet scmFileSetToCommit = new ScmFileSet(distCheckoutDirectory, filesToCommit);
+        AddScmResult addResult = provider.add(
+                repository,
+                scmFileSetToCommit
+        );
+        if (addResult.isSuccess()) {
+            getLog().info("Staging release: " + project.getArtifactId() + ", version: " + project.getVersion());
+            CheckInScmResult checkInResult = provider.checkIn(
+                    repository,
+                    scmFileSetToCommit,
+                    "Staging release: " + project.getArtifactId() + ", version: " + project.getVersion()
+            );
+            if (!checkInResult.isSuccess()) {
+                getLog().error("Committing dist files failed: " + checkInResult.getCommandOutput());
+                throw new MojoExecutionException(
+                        "Committing dist files failed: " + checkInResult.getCommandOutput()
+                );
+            }
+            getLog().info("Committed revision " + checkInResult.getScmRevision());
+        } else {
+            getLog().error("Adding dist files failed: " + addResult.getCommandOutput());
+            throw new MojoExecutionException("Adding dist files failed: " + addResult.getCommandOutput());
         }
     }
 
@@ -301,7 +374,6 @@ public class CommonsDistributionStagingMojo extends AbstractMojo {
                 filesForMavenScmFileSet.add(copy);
             }
         }
-        filesForMavenScmFileSet.addAll(copySiteToScmDirectory());
         filesForMavenScmFileSet.addAll(buildReadmeAndHeaderHtmlFiles());
         filesForMavenScmFileSet.add(copiedReleaseNotes);
         return filesForMavenScmFileSet;
@@ -326,21 +398,22 @@ public class CommonsDistributionStagingMojo extends AbstractMojo {
         } catch (IOException e) {
             throw new MojoExecutionException("Site copying failed", e);
         }
-        return new ArrayList<>(FileUtils.listFiles(siteDirectory, null, true));
+        File siteInScm = new File(distVersionRcVersionDirectory, "site");
+        return new ArrayList<>(FileUtils.listFiles(siteInScm, null, true));
     }
 
     /**
      * Builds up <code>README.html</code> and <code>HEADER.html</code> that reside in following.
      * <ul>
      *     <li>distRoot
-         *     <ul>
-         *         <li>binaries/HEADER.html (symlink)</li>
-         *         <li>binaries/README.html (symlink)</li>
-         *         <li>source/HEADER.html (symlink)</li>
-         *         <li>source/README.html (symlink)</li>
-         *         <li>HEADER.html</li>
-         *         <li>README.html</li>
-         *     </ul>
+     *     <ul>
+     *         <li>binaries/HEADER.html (symlink)</li>
+     *         <li>binaries/README.html (symlink)</li>
+     *         <li>source/HEADER.html (symlink)</li>
+     *         <li>source/README.html (symlink)</li>
+     *         <li>HEADER.html</li>
+     *         <li>README.html</li>
+     *     </ul>
      *     </li>
      * </ul>
      * @return the {@link List} of created files above


[2/4] commons-release-plugin git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/commons-release-plugin into temp-6-13

Posted by ch...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/commons-release-plugin into temp-6-13


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/7f0dc647
Tree: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/tree/7f0dc647
Diff: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/diff/7f0dc647

Branch: refs/heads/master
Commit: 7f0dc647ccb0db2adc8e9ce6358c4dae8b369dbe
Parents: b96fa91 fc71aa2
Author: Rob Tompkins <ch...@apache.org>
Authored: Thu Jun 14 07:48:07 2018 -0400
Committer: Rob Tompkins <ch...@apache.org>
Committed: Thu Jun 14 07:48:07 2018 -0400

----------------------------------------------------------------------
 .gitignore                                            |  3 ++-
 .travis.yml                                           |  1 -
 pom.xml                                               | 14 +++++++-------
 src/changes/changes.xml                               |  1 +
 .../plugin/mojos/CommonsDistributionStagingMojo.java  | 14 +++++++-------
 .../apache/commons/release/plugin/velocity/README.vm  |  2 +-
 6 files changed, 18 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/7f0dc647/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java
----------------------------------------------------------------------


[3/4] commons-release-plugin git commit: COMMONSSITE-113: getting site checked in properly

Posted by ch...@apache.org.
COMMONSSITE-113: getting site checked in properly


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/041d0287
Tree: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/tree/041d0287
Diff: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/diff/041d0287

Branch: refs/heads/master
Commit: 041d0287331033bcbe2e749a95397fde26d0d426
Parents: 7f0dc64
Author: Rob Tompkins <ch...@apache.org>
Authored: Thu Jun 14 12:06:25 2018 -0400
Committer: Rob Tompkins <ch...@apache.org>
Committed: Thu Jun 14 12:06:25 2018 -0400

----------------------------------------------------------------------
 .../mojos/CommonsDistributionStagingMojo.java   | 148 ++++++-------------
 1 file changed, 49 insertions(+), 99 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/041d0287/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 99e95e2..f332c9d 100755
--- a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java
+++ b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java
@@ -47,10 +47,7 @@ import java.io.OutputStreamWriter;
 import java.io.Writer;
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashSet;
 import java.util.List;
-import java.util.Set;
 
 /**
  * This class checks out the dev distribution location, copies the distributions into that directory
@@ -196,11 +193,32 @@ public class CommonsDistributionStagingMojo extends AbstractMojo {
             getLog().info("Checking out dist from: " + distSvnStagingUrl);
             provider.checkOut(repository, scmFileSet);
             File copiedReleaseNotes = copyReleaseNotesToWorkingDirectory();
-            List<File> filesToCommit = copyDistributionsIntoScmDirectoryStructure(copiedReleaseNotes);
-            filesToCommit.addAll(copySiteToScmDirectory());
+            List<File> filesToCommit = copyDistributionsIntoScmDirectoryStructureAndAddToSvn(copiedReleaseNotes,
+                    provider, repository);
+            List<File> filesToAdd = new ArrayList<>();
+            listFilesAndDirectories(distCheckoutDirectory, filesToAdd);
             if (!dryRun) {
-                commitDirectories(filesToCommit, provider, repository);
-                commitFiles(filesToCommit, provider, repository);
+                ScmFileSet fileSet = new ScmFileSet(distCheckoutDirectory, filesToAdd);
+                AddScmResult addResult = provider.add(
+                        repository,
+                        fileSet
+                );
+                if (!addResult.isSuccess()) {
+                    throw new MojoExecutionException("Failed to add files to scm");
+                }
+                getLog().info("Staging release: " + project.getArtifactId() + ", version: " + project.getVersion());
+                CheckInScmResult checkInResult = provider.checkIn(
+                        repository,
+                        fileSet,
+                        "Staging release: " + project.getArtifactId() + ", version: " + project.getVersion()
+                );
+                if (!checkInResult.isSuccess()) {
+                    getLog().error("Committing dist files failed: " + checkInResult.getCommandOutput());
+                    throw new MojoExecutionException(
+                            "Committing dist files failed: " + checkInResult.getCommandOutput()
+                    );
+                }
+                getLog().info("Committed revision " + checkInResult.getScmRevision());
             } else {
                 getLog().info("[Dry run] Would have committed to: " + distSvnStagingUrl);
                 getLog().info(
@@ -213,103 +231,31 @@ public class CommonsDistributionStagingMojo extends AbstractMojo {
     }
 
     /**
-     * Commits all the directories to SVN from the fileset.
-     *
-     * @param filesToCommit the {@link List} of {@link File} that we find the directories to which we must commit.
-     * @param provider the maven {@link ScmProvider}.
-     * @param repository the maven {@link ScmRepository}.
-     * @throws ScmException if the maven SCM api fails.
-     * @throws MojoExecutionException if we get a failure that does not throw an exception.
+     * Lists all directories and files to a flat list.
+     * @param directory {@link File} containing directory to list
+     * @param files a {@link List} of {@link File} to which to append the files.
      */
-    private void commitDirectories(List<File> filesToCommit, ScmProvider provider, ScmRepository repository)
-            throws ScmException, MojoExecutionException {
-        Collections.sort(filesToCommit);
-        Set<File> committedDirectories = new HashSet<>();
-        for (File file : filesToCommit) {
-            if (file.getAbsolutePath().contains(commonsReleaseVersion + "-" + commonsRcVersion)
-                    && !committedDirectories.contains(file.getParentFile())
-                    && !file.getParentFile().getAbsolutePath().equals(distCheckoutDirectory)) {
-                File parentFile = file.getParentFile();
-                commitParentsIfNotCommitted(parentFile, committedDirectories);
-                ScmFileSet scmFileSetToCommit = new ScmFileSet(distCheckoutDirectory, parentFile);
-                AddScmResult addResult = provider.add(
-                        repository,
-                        scmFileSetToCommit
-                );
-                if (addResult.isSuccess()) {
-                    getLog().info("Adding release directories: "
-                            + project.getArtifactId() + ", version: " + project.getVersion());
-                    CheckInScmResult checkInResult = provider.checkIn(
-                            repository,
-                            scmFileSetToCommit,
-                            "Adding release directories: "
-                                    + project.getArtifactId() + ", version: " + project.getVersion()
-                    );
-                    if (!checkInResult.isSuccess()) {
-                        getLog().error("Committing directories  failed: " + checkInResult.getCommandOutput());
-                        throw new MojoExecutionException(
-                                "Committing directories files failed: " + checkInResult.getCommandOutput()
-                        );
-                    }
-                    committedDirectories.add(parentFile);
-                } else {
-                    getLog().error("Adding directory failed: " + addResult.getCommandOutput());
-                    throw new MojoExecutionException("Adding directory failed: "
-                            + addResult.getCommandOutput());
-                }
+    private void listFilesAndDirectories(File directory, List<File> files) {
+        // Get all the files and directories from a directory.
+        File[] fList = directory.listFiles();
+        for (File file : fList) {
+            if (file.isFile() && !file.getAbsolutePath().contains(".svn")) {
+                files.add(file);
+            } else if (file.isDirectory() && !file.getAbsolutePath().contains(".svn")) {
+                files.add(file);
+                listFilesAndDirectories(file, files);
             }
         }
     }
 
-    private void commitParentsIfNotCommitted(File file, Set<File> committedDirectories) {
-        if (committedDirectories.contains(file.getParentFile())) {
-            return;
-        }
-    }
-
-    /**
-     * Commits files to SVN from the fileset.
-     *
-     * @param filesToCommit the {@link List} of {@link File} we must commit.
-     * @param provider the maven {@link ScmProvider}.
-     * @param repository the maven {@link ScmRepository}.
-     * @throws ScmException if the maven SCM api fails.
-     * @throws MojoExecutionException if we get a failure that does not throw an exception.
-     */
-    private void commitFiles(List<File> filesToCommit, ScmProvider provider, ScmRepository repository)
-            throws ScmException, MojoExecutionException {
-        ScmFileSet scmFileSetToCommit = new ScmFileSet(distCheckoutDirectory, filesToCommit);
-        AddScmResult addResult = provider.add(
-                repository,
-                scmFileSetToCommit
-        );
-        if (addResult.isSuccess()) {
-            getLog().info("Staging release: " + project.getArtifactId() + ", version: " + project.getVersion());
-            CheckInScmResult checkInResult = provider.checkIn(
-                    repository,
-                    scmFileSetToCommit,
-                    "Staging release: " + project.getArtifactId() + ", version: " + project.getVersion()
-            );
-            if (!checkInResult.isSuccess()) {
-                getLog().error("Committing dist files failed: " + checkInResult.getCommandOutput());
-                throw new MojoExecutionException(
-                        "Committing dist files failed: " + checkInResult.getCommandOutput()
-                );
-            }
-            getLog().info("Committed revision " + checkInResult.getScmRevision());
-        } else {
-            getLog().error("Adding dist files failed: " + addResult.getCommandOutput());
-            throw new MojoExecutionException("Adding dist files failed: " + addResult.getCommandOutput());
-        }
-    }
-
     /**
      * 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)}.
+     *         {@link CommonsDistributionStagingMojo#copyDistributionsIntoScmDirectoryStructureAndAddToSvn(File,
+     *         ScmProvider, ScmRepository)}.
      * @throws MojoExecutionException if an {@link IOException} occurs as a wrapper so that maven
      *                                can properly handle the exception.
      */
@@ -343,39 +289,43 @@ public class CommonsDistributionStagingMojo extends AbstractMojo {
      *
      * @param copiedReleaseNotes is the RELEASE-NOTES.txt file that exists in the
      *                           <code>target/commons-release-plugin/scm</code> directory.
+     * @param provider is the {@link ScmProvider} that we will use for adding the files we wish to commit.
+     * @param repository is the {@link ScmRepository} that we will use for adding the files that we wish to commit.
      * @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} occurs so that Maven can handle it properly.
      */
-    private List<File> copyDistributionsIntoScmDirectoryStructure(File copiedReleaseNotes)
+    private List<File> copyDistributionsIntoScmDirectoryStructureAndAddToSvn(File copiedReleaseNotes,
+                                                                             ScmProvider provider,
+                                                                             ScmRepository repository)
             throws MojoExecutionException {
         List<File> workingDirectoryFiles = Arrays.asList(workingDirectory.listFiles());
+        List<File> filesForMavenScmFileSet = new ArrayList<>();
         File scmBinariesRoot = new File(distVersionRcVersionDirectory, "binaries");
         File scmSourceRoot = new File(distVersionRcVersionDirectory, "source");
         SharedFunctions.initDirectory(getLog(), scmBinariesRoot);
         SharedFunctions.initDirectory(getLog(), scmSourceRoot);
-        List<File> filesForMavenScmFileSet = new ArrayList<>();
         File copy;
         for (File file : workingDirectoryFiles) {
             if (file.getName().contains("src")) {
                 copy = new File(scmSourceRoot,  file.getName());
                 SharedFunctions.copyFile(getLog(), file, copy);
-                filesForMavenScmFileSet.add(copy);
+                filesForMavenScmFileSet.add(file);
             } else if (file.getName().contains("bin")) {
                 copy = new File(scmBinariesRoot,  file.getName());
                 SharedFunctions.copyFile(getLog(), file, copy);
-                filesForMavenScmFileSet.add(copy);
+                filesForMavenScmFileSet.add(file);
             } else if (StringUtils.containsAny(file.getName(), "scm", "sha1.properties", "sha256.properties")) {
                 getLog().debug("Not copying scm directory over to the scm directory because it is the scm directory.");
                 //do nothing because we are copying into scm
             } else {
                 copy = new File(distCheckoutDirectory.getAbsolutePath(),  file.getName());
                 SharedFunctions.copyFile(getLog(), file, copy);
-                filesForMavenScmFileSet.add(copy);
+                filesForMavenScmFileSet.add(file);
             }
         }
         filesForMavenScmFileSet.addAll(buildReadmeAndHeaderHtmlFiles());
-        filesForMavenScmFileSet.add(copiedReleaseNotes);
+        filesForMavenScmFileSet.addAll(copySiteToScmDirectory());
         return filesForMavenScmFileSet;
     }
 


Re: [4/4] commons-release-plugin git commit: (fix) ingnore hidden files in staging

Posted by Rob Tompkins <ch...@apache.org>.
@Gary - should be able to stage from the plugin and have it commit again.

-Rob

> On Jun 14, 2018, at 2:26 PM, chtompki@apache.org wrote:
> 
> (fix) ingnore hidden files in staging
> 
> 
> 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/a5bfc15a
> Tree: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/tree/a5bfc15a
> Diff: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/diff/a5bfc15a
> 
> Branch: refs/heads/master
> Commit: a5bfc15a43a708a6eadac3b65e1745a1b122bc8e
> Parents: 041d028
> Author: Rob Tompkins <ch...@apache.org>
> Authored: Thu Jun 14 14:26:24 2018 -0400
> Committer: Rob Tompkins <ch...@apache.org>
> Committed: Thu Jun 14 14:26:24 2018 -0400
> 
> ----------------------------------------------------------------------
> .../plugin/mojos/CommonsDistributionStagingMojo.java      | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
> ----------------------------------------------------------------------
> 
> 
> http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/a5bfc15a/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 f332c9d..09d4def 100755
> --- a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java
> +++ b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java
> @@ -196,7 +196,7 @@ public class CommonsDistributionStagingMojo extends AbstractMojo {
>             List<File> filesToCommit = copyDistributionsIntoScmDirectoryStructureAndAddToSvn(copiedReleaseNotes,
>                     provider, repository);
>             List<File> filesToAdd = new ArrayList<>();
> -            listFilesAndDirectories(distCheckoutDirectory, filesToAdd);
> +            listNotHiddenFilesAndDirectories(distCheckoutDirectory, filesToAdd);
>             if (!dryRun) {
>                 ScmFileSet fileSet = new ScmFileSet(distCheckoutDirectory, filesToAdd);
>                 AddScmResult addResult = provider.add(
> @@ -235,15 +235,15 @@ public class CommonsDistributionStagingMojo extends AbstractMojo {
>      * @param directory {@link File} containing directory to list
>      * @param files a {@link List} of {@link File} to which to append the files.
>      */
> -    private void listFilesAndDirectories(File directory, List<File> files) {
> +    private void listNotHiddenFilesAndDirectories(File directory, List<File> files) {
>         // Get all the files and directories from a directory.
>         File[] fList = directory.listFiles();
>         for (File file : fList) {
> -            if (file.isFile() && !file.getAbsolutePath().contains(".svn")) {
> +            if (file.isFile() && !file.isHidden()) {
>                 files.add(file);
> -            } else if (file.isDirectory() && !file.getAbsolutePath().contains(".svn")) {
> +            } else if (file.isDirectory() && !file.isHidden()) {
>                 files.add(file);
> -                listFilesAndDirectories(file, files);
> +                listNotHiddenFilesAndDirectories(file, files);
>             }
>         }
>     }
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


[4/4] commons-release-plugin git commit: (fix) ingnore hidden files in staging

Posted by ch...@apache.org.
(fix) ingnore hidden files in staging


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/a5bfc15a
Tree: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/tree/a5bfc15a
Diff: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/diff/a5bfc15a

Branch: refs/heads/master
Commit: a5bfc15a43a708a6eadac3b65e1745a1b122bc8e
Parents: 041d028
Author: Rob Tompkins <ch...@apache.org>
Authored: Thu Jun 14 14:26:24 2018 -0400
Committer: Rob Tompkins <ch...@apache.org>
Committed: Thu Jun 14 14:26:24 2018 -0400

----------------------------------------------------------------------
 .../plugin/mojos/CommonsDistributionStagingMojo.java      | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/a5bfc15a/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 f332c9d..09d4def 100755
--- a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java
+++ b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java
@@ -196,7 +196,7 @@ public class CommonsDistributionStagingMojo extends AbstractMojo {
             List<File> filesToCommit = copyDistributionsIntoScmDirectoryStructureAndAddToSvn(copiedReleaseNotes,
                     provider, repository);
             List<File> filesToAdd = new ArrayList<>();
-            listFilesAndDirectories(distCheckoutDirectory, filesToAdd);
+            listNotHiddenFilesAndDirectories(distCheckoutDirectory, filesToAdd);
             if (!dryRun) {
                 ScmFileSet fileSet = new ScmFileSet(distCheckoutDirectory, filesToAdd);
                 AddScmResult addResult = provider.add(
@@ -235,15 +235,15 @@ public class CommonsDistributionStagingMojo extends AbstractMojo {
      * @param directory {@link File} containing directory to list
      * @param files a {@link List} of {@link File} to which to append the files.
      */
-    private void listFilesAndDirectories(File directory, List<File> files) {
+    private void listNotHiddenFilesAndDirectories(File directory, List<File> files) {
         // Get all the files and directories from a directory.
         File[] fList = directory.listFiles();
         for (File file : fList) {
-            if (file.isFile() && !file.getAbsolutePath().contains(".svn")) {
+            if (file.isFile() && !file.isHidden()) {
                 files.add(file);
-            } else if (file.isDirectory() && !file.getAbsolutePath().contains(".svn")) {
+            } else if (file.isDirectory() && !file.isHidden()) {
                 files.add(file);
-                listFilesAndDirectories(file, files);
+                listNotHiddenFilesAndDirectories(file, files);
             }
         }
     }