You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by db...@apache.org on 2019/11/12 20:32:52 UTC

[tomee-site-generator] branch master updated (e249dde -> f472d29)

This is an automated email from the ASF dual-hosted git repository.

dblevins pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/tomee-site-generator.git.


    from e249dde  Remove warning
     new d6cb30b  Use github repos as Apache seems to rate-limit.
     new ed2abd6  Scrub the dates out of generated files to reduce commit noise by 26k files
     new f472d29  Merge branch 'master' of https://gitbox.apache.org/repos/asf/tomee-site-generator

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../org/apache/tomee/website/Configuration.java    |  9 +++--
 .../java/org/apache/tomee/website/Javadocs.java    | 45 +++++++++++++++++++++-
 src/main/jbake/content/community/culture.adoc      |  6 +++
 3 files changed, 54 insertions(+), 6 deletions(-)
 create mode 100644 src/main/jbake/content/community/culture.adoc


[tomee-site-generator] 02/03: Scrub the dates out of generated files to reduce commit noise by 26k files

Posted by db...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

dblevins pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomee-site-generator.git

commit ed2abd6b6c71659cf1ffd5f8933331abc655d17e
Author: David Blevins <da...@gmail.com>
AuthorDate: Sat May 4 16:01:37 2019 -0700

    Scrub the dates out of generated files to reduce commit noise by 26k files
---
 .../java/org/apache/tomee/website/Javadocs.java    | 45 +++++++++++++++++++++-
 src/main/jbake/content/community/culture.adoc      |  6 +++
 2 files changed, 49 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/apache/tomee/website/Javadocs.java b/src/main/java/org/apache/tomee/website/Javadocs.java
index 4818378..89a3846 100644
--- a/src/main/java/org/apache/tomee/website/Javadocs.java
+++ b/src/main/java/org/apache/tomee/website/Javadocs.java
@@ -18,12 +18,15 @@ package org.apache.tomee.website;
 
 import org.apache.openejb.loader.Files;
 import org.apache.openejb.loader.IO;
+import org.apache.openejb.util.Join;
 import org.apache.openejb.util.Pipe;
 
 import java.io.File;
 import java.io.IOException;
 import java.nio.file.Path;
+import java.util.List;
 import java.util.function.Supplier;
+import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
 import static org.apache.openejb.loader.Files.mkdirs;
@@ -81,12 +84,13 @@ public class Javadocs {
             copySource(related, javaSources);
         }
 
+        final File javadocOutput = sources.getGeneratedDestFor(source, "javadoc");
         final ProcessBuilder cmd = new ProcessBuilder(
                 getJavadocCommand().getAbsolutePath(),
                 "-sourcepath",
                 javaSources.getAbsolutePath(),
                 "-d",
-                sources.getGeneratedDestFor(source, "javadoc").getAbsolutePath()
+                javadocOutput.getAbsolutePath()
         );
 
         Stream.of(javaSources.listFiles())
@@ -97,9 +101,43 @@ public class Javadocs {
                 });
 
         try {
-            Pipe.pipe(cmd.start());
+            final Process process = cmd.start();
+            Pipe.pipe(process);
+            process.waitFor();
         } catch (IOException e) {
             throw new IllegalStateException("Command failed");
+        } catch (InterruptedException e) {
+            Thread.interrupted();
+            throw new IllegalStateException("Command failed");
+        }
+
+        // Scrub generated timestamps as it causes 26k needless file updates
+        // on the svn commit for every time the generator runs
+        try {
+            java.nio.file.Files.walk(javadocOutput.toPath())
+                    .map(Path::toFile)
+                    .filter(File::isFile)
+                    .filter(this::isHtml)
+                    .forEach(Javadocs::removeGeneratedDate);
+        } catch (IOException e) {
+            throw new IllegalStateException("Failed to remove timestamp from generated javadoc html");
+        }
+
+    }
+
+    public static void removeGeneratedDate(final File file) {
+        try {
+            final List<String> lines = Stream.of(IO.slurp(file).split("\n"))
+                    .filter(line -> !line.contains("<!-- Generated by javadoc"))
+                    .filter(line -> !line.contains("<meta name=\"date\" content=\""))
+                    .collect(Collectors.toList());
+            final String updated = Join.join("\n", lines) + "\n";
+
+            // Write the cleaned version to disk
+            IO.copy(IO.read(updated), file);
+
+        } catch (IOException e) {
+            throw new IllegalStateException(e);
         }
     }
 
@@ -158,4 +196,7 @@ public class Javadocs {
     private boolean isJava(final File file) {
         return file.getName().endsWith(".java");
     }
+    private boolean isHtml(final File file) {
+        return file.getName().endsWith(".html");
+    }
 }
diff --git a/src/main/jbake/content/community/culture.adoc b/src/main/jbake/content/community/culture.adoc
new file mode 100644
index 0000000..dcaa8a5
--- /dev/null
+++ b/src/main/jbake/content/community/culture.adoc
@@ -0,0 +1,6 @@
+= Apache TomEE Community Culture
+:jbake-date: 2019-05-02
+:jbake-type: page
+:jbake-status: published
+
+==
\ No newline at end of file


[tomee-site-generator] 01/03: Use github repos as Apache seems to rate-limit.

Posted by db...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

dblevins pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomee-site-generator.git

commit d6cb30b5555babe47a3d5f066b20aa503b3de607
Author: David Blevins <da...@gmail.com>
AuthorDate: Sat May 4 16:00:52 2019 -0700

    Use github repos as Apache seems to rate-limit.
---
 src/main/java/org/apache/tomee/website/Configuration.java | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/main/java/org/apache/tomee/website/Configuration.java b/src/main/java/org/apache/tomee/website/Configuration.java
index 8b09b52..2716530 100644
--- a/src/main/java/org/apache/tomee/website/Configuration.java
+++ b/src/main/java/org/apache/tomee/website/Configuration.java
@@ -55,10 +55,11 @@ public class Configuration {
         };
 
         return new Source[]{
-                new Source("https://gitbox.apache.org/repos/asf/tomee.git", "master", "tomee-8.0", true).related(microProfile2).related(jakartaEE8),
-                new Source("https://gitbox.apache.org/repos/asf/tomee.git", "tomee-7.1.0", "tomee-7.1"),
-                new Source("https://gitbox.apache.org/repos/asf/tomee.git", "tomee-7.0.5", "tomee-7.0"),
-                new Source("https://gitbox.apache.org/repos/asf/tomee.git", "master", "master"),
+//                new Source("https://github.com/apache/tomee.git", "master", "tomee-8.0"),
+                new Source("https://github.com/apache/tomee.git", "master", "tomee-8.0", true).related(microProfile2).related(jakartaEE8),
+                new Source("https://github.com/apache/tomee.git", "tomee-7.1.0", "tomee-7.1"),
+                new Source("https://github.com/apache/tomee.git", "tomee-7.0.5", "tomee-7.0"),
+                new Source("https://github.com/apache/tomee.git", "master", "master"),
                 new Source("https://github.com/eclipse/microprofile-bom.git", "master", "microprofile-2.0").related(microProfile2),
                 new Source("https://github.com/eclipse-ee4j/jakartaee-platform.git", "master", "jakartaee-8.0").related(jakartaEE8)
         };


[tomee-site-generator] 03/03: Merge branch 'master' of https://gitbox.apache.org/repos/asf/tomee-site-generator

Posted by db...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

dblevins pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomee-site-generator.git

commit f472d29a79899f45b35e752832378f8fa9596c6e
Merge: ed2abd6 e249dde
Author: David Blevins <da...@gmail.com>
AuthorDate: Tue Nov 12 12:32:42 2019 -0800

    Merge branch 'master' of https://gitbox.apache.org/repos/asf/tomee-site-generator

 src/main/jbake/content/download-archive.adoc | 65 +++++++++++++++++++++-
 src/main/jbake/content/download-ng.adoc      | 80 +++++++++++++---------------
 2 files changed, 99 insertions(+), 46 deletions(-)