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/01/06 21:05:23 UTC

[tomee-site-generator] branch master updated (1d3954a -> e870306)

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 1d3954a  Simplify SvnPub logic.
     new db604d2  Add MicroProfile javadoc
     new e870306  Add Jakarta EE javadoc.  Move git repo list to Configuration class.

The 2 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    | 66 ++++++++++++++++++++++
 src/main/java/org/apache/tomee/website/JBake.java  | 13 +----
 .../java/org/apache/tomee/website/Javadocs.java    | 53 +++++++++--------
 src/main/java/org/apache/tomee/website/Source.java | 53 ++++++++++++++++-
 .../java/org/apache/tomee/website/Sources.java     |  6 ++
 5 files changed, 151 insertions(+), 40 deletions(-)
 create mode 100644 src/main/java/org/apache/tomee/website/Configuration.java


[tomee-site-generator] 02/02: Add Jakarta EE javadoc. Move git repo list to Configuration class.

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 e870306ff0334d0e4b770ebd0a0f905e5adf97c2
Author: David Blevins <da...@gmail.com>
AuthorDate: Sun Jan 6 13:05:13 2019 -0800

    Add Jakarta EE javadoc.  Move git repo list to Configuration class.
---
 .../org/apache/tomee/website/Configuration.java    | 66 ++++++++++++++++++++++
 src/main/java/org/apache/tomee/website/JBake.java  | 22 +-------
 2 files changed, 68 insertions(+), 20 deletions(-)

diff --git a/src/main/java/org/apache/tomee/website/Configuration.java b/src/main/java/org/apache/tomee/website/Configuration.java
new file mode 100644
index 0000000..8b09b52
--- /dev/null
+++ b/src/main/java/org/apache/tomee/website/Configuration.java
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.tomee.website;
+
+public class Configuration {
+    public static Source[] getSources() {
+        final Source[] microProfile2 = new Source[]{
+                new Source("https://github.com/eclipse/microprofile-jwt-auth.git", "1.1.1", "microprofile-jwt-1.1").filterJavadoc(".*/api/src/main/java/.*", ""),
+                new Source("https://github.com/eclipse/microprofile-config.git", "1.3", "microprofile-config-1.3").filterJavadoc(".*/api/src/main/java/.*", ""),
+                new Source("https://github.com/eclipse/microprofile-fault-tolerance", "1.1.4", "microprofile-fault-tolerance-1.1").filterJavadoc(".*/api/src/main/java/.*", ""),
+                new Source("https://github.com/eclipse/microprofile-health", "1.0", "microprofile-health-1.0").filterJavadoc(".*/api/src/main/java/.*", ""),
+                new Source("https://github.com/eclipse/microprofile-metrics", "1.1.1", "microprofile-metrics-1.1").filterJavadoc(".*/api/src/main/java/.*", ""),
+                new Source("https://github.com/eclipse/microprofile-open-api", "1.0.2", "microprofile-open-api-1.0").filterJavadoc(".*/api/src/main/java/.*", ""),
+                new Source("https://github.com/eclipse/microprofile-opentracing", "1.1", "microprofile-opentracing-1.1").filterJavadoc(".*/api/src/main/java/.*", ""),
+                new Source("https://github.com/eclipse/microprofile-rest-client", "1.1", "microprofile-rest-client-1.1").filterJavadoc(".*/api/src/main/java/.*", ""),
+        };
+
+        final Source[] jakartaEE8 = {
+                new Source("https://github.com/eclipse-ee4j/common-annotations-api.git", "EE4J_8", "common-annotations-api-EE4J_81.0"),
+                new Source("https://github.com/eclipse-ee4j/concurrency-api.git", "EE4J_8", "concurrency-api-EE4J_81.0"),
+                new Source("https://github.com/eclipse-ee4j/ejb-api.git", "EE4J_8", "ejb-api-EE4J_81.0"),
+                new Source("https://github.com/eclipse-ee4j/interceptor-api.git", "EE4J_8", "interceptor-api-EE4J_81.0"),
+                new Source("https://github.com/eclipse-ee4j/jax-rpc-api.git", "EE4J_8", "jax-rpc-api-EE4J_81.0"),
+                new Source("https://github.com/eclipse-ee4j/jax-ws-api.git", "EE4J_8", "jax-ws-api-EE4J_81.0"),
+                new Source("https://github.com/eclipse-ee4j/jaxb-api.git", "EE4J_8", "jaxb-api-EE4J_81.0"),
+                new Source("https://github.com/eclipse-ee4j/jaxr-api.git", "EE4J_8", "jaxr-api-EE4J_81.0"),
+                new Source("https://github.com/eclipse-ee4j/jaxrs-api.git", "EE4J_8", "jaxrs-api-EE4J_81.0"),
+                new Source("https://github.com/eclipse-ee4j/jca-api.git", "EE4J_8", "jca-api-EE4J_81.0"),
+                new Source("https://github.com/eclipse-ee4j/jms-api.git", "EE4J_8", "jms-api-EE4J_81.0"),
+                new Source("https://github.com/eclipse-ee4j/jpa-api.git", "EE4J_8", "jpa-api-EE4J_81.0"),
+                new Source("https://github.com/eclipse-ee4j/jsonb-api.git", "EE4J_8", "jsonb-api-EE4J_81.0"),
+                new Source("https://github.com/eclipse-ee4j/jsp-api.git", "EE4J_8", "jsp-api-EE4J_81.0"),
+                new Source("https://github.com/eclipse-ee4j/jstl-api.git", "EE4J_8", "jstl-api-EE4J_81.0"),
+                new Source("https://github.com/eclipse-ee4j/jta-api.git", "EE4J_8", "jta-api-EE4J_81.0"),
+                new Source("https://github.com/eclipse-ee4j/jws-api.git", "EE4J_8", "jws-api-EE4J_81.0"),
+                new Source("https://github.com/eclipse-ee4j/management-api.git", "EE4J_8", "management-api-EE4J_81.0"),
+                new Source("https://github.com/eclipse-ee4j/saaj-api.git", "EE4J_8", "saaj-api-EE4J_81.0"),
+                new Source("https://github.com/eclipse-ee4j/security-api.git", "EE4J_8", "security-api-EE4J_81.0"),
+                new Source("https://github.com/eclipse-ee4j/servlet-api.git", "EE4J_8", "servlet-api-EE4J_81.0"),
+                new Source("https://github.com/eclipse-ee4j/websocket-api.git", "EE4J_8", "websocket-api-EE4J_81.0")
+        };
+
+        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/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)
+        };
+    }
+}
diff --git a/src/main/java/org/apache/tomee/website/JBake.java b/src/main/java/org/apache/tomee/website/JBake.java
index 15ef459..91b6c27 100755
--- a/src/main/java/org/apache/tomee/website/JBake.java
+++ b/src/main/java/org/apache/tomee/website/JBake.java
@@ -36,27 +36,9 @@ public class JBake {
         final File destination = args == null || args.length < 2 ? new File("target/site-tmp") : new File(args[1]);
         final boolean startHttp = args == null || args.length < 2 || Boolean.parseBoolean(args[2]); // by default we dev
 
-        final Source[] microProfile2 = new Source[]{
-                new Source("https://github.com/eclipse/microprofile-jwt-auth.git", "1.1.1", "microprofile-jwt-1.1").filterJavadoc(".*/api/src/main/java/.*", ""),
-                new Source("https://github.com/eclipse/microprofile-config.git", "1.3", "microprofile-config-1.3").filterJavadoc(".*/api/src/main/java/.*", ""),
-                new Source("https://github.com/eclipse/microprofile-fault-tolerance", "1.1.4", "microprofile-fault-tolerance-1.1").filterJavadoc(".*/api/src/main/java/.*", ""),
-                new Source("https://github.com/eclipse/microprofile-health", "1.0", "microprofile-health-1.0").filterJavadoc(".*/api/src/main/java/.*", ""),
-                new Source("https://github.com/eclipse/microprofile-metrics", "1.1.1", "microprofile-metrics-1.1").filterJavadoc(".*/api/src/main/java/.*", ""),
-                new Source("https://github.com/eclipse/microprofile-open-api", "1.0.2", "microprofile-open-api-1.0").filterJavadoc(".*/api/src/main/java/.*", ""),
-                new Source("https://github.com/eclipse/microprofile-opentracing", "1.1", "microprofile-opentracing-1.1").filterJavadoc(".*/api/src/main/java/.*", ""),
-                new Source("https://github.com/eclipse/microprofile-rest-client", "1.1", "microprofile-rest-client-1.1").filterJavadoc(".*/api/src/main/java/.*", ""),
-        };
+        final Source[] website = org.apache.tomee.website.Configuration.getSources();
 
-        final Sources sources = new Sources(
-                new File("target/jbake"),
-                new File("repos"),
-                new File("src/main/jbake"),
-                destination,
-                new Source("https://gitbox.apache.org/repos/asf/tomee.git", "master", "tomee-8.0", true).related(microProfile2),
-                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")
-        );
+        final Sources sources = new Sources(new File("target/jbake"), new File("repos"), new File("src/main/jbake"), destination, website);
 
         sources.prepare();
 


[tomee-site-generator] 01/02: Add MicroProfile javadoc

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 db604d2a46dd6cdf767618e8f3e5ae61eaa1cf50
Author: David Blevins <da...@gmail.com>
AuthorDate: Sun Jan 6 12:14:58 2019 -0800

    Add MicroProfile javadoc
---
 src/main/java/org/apache/tomee/website/JBake.java  | 13 +++++-
 .../java/org/apache/tomee/website/Javadocs.java    | 53 +++++++++++-----------
 src/main/java/org/apache/tomee/website/Source.java | 53 ++++++++++++++++++++--
 .../java/org/apache/tomee/website/Sources.java     |  6 +++
 4 files changed, 94 insertions(+), 31 deletions(-)

diff --git a/src/main/java/org/apache/tomee/website/JBake.java b/src/main/java/org/apache/tomee/website/JBake.java
index 3a2b44d..15ef459 100755
--- a/src/main/java/org/apache/tomee/website/JBake.java
+++ b/src/main/java/org/apache/tomee/website/JBake.java
@@ -36,12 +36,23 @@ public class JBake {
         final File destination = args == null || args.length < 2 ? new File("target/site-tmp") : new File(args[1]);
         final boolean startHttp = args == null || args.length < 2 || Boolean.parseBoolean(args[2]); // by default we dev
 
+        final Source[] microProfile2 = new Source[]{
+                new Source("https://github.com/eclipse/microprofile-jwt-auth.git", "1.1.1", "microprofile-jwt-1.1").filterJavadoc(".*/api/src/main/java/.*", ""),
+                new Source("https://github.com/eclipse/microprofile-config.git", "1.3", "microprofile-config-1.3").filterJavadoc(".*/api/src/main/java/.*", ""),
+                new Source("https://github.com/eclipse/microprofile-fault-tolerance", "1.1.4", "microprofile-fault-tolerance-1.1").filterJavadoc(".*/api/src/main/java/.*", ""),
+                new Source("https://github.com/eclipse/microprofile-health", "1.0", "microprofile-health-1.0").filterJavadoc(".*/api/src/main/java/.*", ""),
+                new Source("https://github.com/eclipse/microprofile-metrics", "1.1.1", "microprofile-metrics-1.1").filterJavadoc(".*/api/src/main/java/.*", ""),
+                new Source("https://github.com/eclipse/microprofile-open-api", "1.0.2", "microprofile-open-api-1.0").filterJavadoc(".*/api/src/main/java/.*", ""),
+                new Source("https://github.com/eclipse/microprofile-opentracing", "1.1", "microprofile-opentracing-1.1").filterJavadoc(".*/api/src/main/java/.*", ""),
+                new Source("https://github.com/eclipse/microprofile-rest-client", "1.1", "microprofile-rest-client-1.1").filterJavadoc(".*/api/src/main/java/.*", ""),
+        };
+
         final Sources sources = new Sources(
                 new File("target/jbake"),
                 new File("repos"),
                 new File("src/main/jbake"),
                 destination,
-                new Source("https://gitbox.apache.org/repos/asf/tomee.git", "master", "tomee-8.0", true),
+                new Source("https://gitbox.apache.org/repos/asf/tomee.git", "master", "tomee-8.0", true).related(microProfile2),
                 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")
diff --git a/src/main/java/org/apache/tomee/website/Javadocs.java b/src/main/java/org/apache/tomee/website/Javadocs.java
index 23f0324..4818378 100644
--- a/src/main/java/org/apache/tomee/website/Javadocs.java
+++ b/src/main/java/org/apache/tomee/website/Javadocs.java
@@ -76,29 +76,9 @@ public class Javadocs {
     public void prepare(final Source source) {
         final File javaSources = mkdirs(new File(String.format("target/javadocs/%s-src", source.getName())));
 
-        try {
-            java.nio.file.Files.walk(source.getDir().toPath())
-                    .map(Path::toFile)
-                    .filter(File::isFile)
-                    .filter(this::isJava)
-                    .filter(this::srcMainJava)
-                    .filter(file -> !file.getAbsolutePath().contains("/tck/"))
-                    .filter(file -> !file.getAbsolutePath().contains("/itests/"))
-                    .filter(file -> !file.getAbsolutePath().contains("/examples/"))
-                    .filter(file -> !file.getAbsolutePath().contains("-example/"))
-                    .filter(file -> !file.getAbsolutePath().contains("/archetype-resources/"))
-                    .forEach(file -> {
-                        try {
-                            final String relativePath = file.getAbsolutePath().replaceAll(".*/src/main/java/", "");
-                            final File dest = new File(javaSources, relativePath);
-                            Files.mkdirs(dest.getParentFile());
-                            IO.copy(file, dest);
-                        } catch (IOException e) {
-                            throw new IllegalStateException(e);
-                        }
-                    });
-        } catch (IOException e) {
-            throw new IllegalStateException("Failed to aggregate java sources");
+        copySource(source, javaSources);
+        for (final Source related : source.getRelated()) {
+            copySource(related, javaSources);
         }
 
         final ProcessBuilder cmd = new ProcessBuilder(
@@ -123,6 +103,29 @@ public class Javadocs {
         }
     }
 
+    private void copySource(final Source source, final File javaSources) {
+        try {
+            java.nio.file.Files.walk(source.getDir().toPath())
+                    .map(Path::toFile)
+                    .filter(File::isFile)
+                    .filter(this::isJava)
+                    .filter(source.getJavadocFilter()::include)
+                    .filter(source.getJavadocFilter()::exclude)
+                    .forEach(file -> {
+                        try {
+                            final String relativePath = file.getAbsolutePath().replaceAll(".*/src/main/java/", "");
+                            final File dest = new File(javaSources, relativePath);
+                            Files.mkdirs(dest.getParentFile());
+                            IO.copy(file, dest);
+                        } catch (IOException e) {
+                            throw new IllegalStateException(e);
+                        }
+                    });
+        } catch (IOException e) {
+            throw new IllegalStateException("Failed to aggregate java sources");
+        }
+    }
+
     public static File getJavadocCommand() {
 
         final File java_home = System.getenv("JAVA_HOME") != null ? new File(System.getenv("JAVA_HOME")) : new File("");
@@ -152,10 +155,6 @@ public class Javadocs {
     private static void copy(final File file, File javaSources) {
     }
 
-    private boolean srcMainJava(final File file) {
-        return file.getAbsolutePath().contains("src/main/java/");
-    }
-
     private boolean isJava(final File file) {
         return file.getName().endsWith(".java");
     }
diff --git a/src/main/java/org/apache/tomee/website/Source.java b/src/main/java/org/apache/tomee/website/Source.java
index af0afd6..70e0adf 100644
--- a/src/main/java/org/apache/tomee/website/Source.java
+++ b/src/main/java/org/apache/tomee/website/Source.java
@@ -16,17 +16,20 @@
  */
 package org.apache.tomee.website;
 
-import org.apache.openejb.loader.IO;
-
 import java.io.File;
-import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.regex.Pattern;
 
 public class Source {
     private final String name;
     private final String scmUrl;
     private final String branch;
     private final boolean latest;
+    private final List<Source> related = new ArrayList<>();
     private File dir;
+    private Filter javadocFilter = new Filter(".*/src/main/java/.*", ".*/(tck|itests|examples|archetype-resources|.*-example)/.*");
 
     public Source(final String scmUrl, final String branch, final String name) {
         this(scmUrl, branch, name, false);
@@ -63,6 +66,25 @@ public class Source {
         this.dir = dir;
     }
 
+    public List<Source> getRelated() {
+        return related;
+    }
+
+    public Source related(final Source... related) {
+        Collections.addAll(this.related, related);
+        return this;
+    }
+
+    public Filter getJavadocFilter() {
+        return javadocFilter;
+    }
+
+    public Source filterJavadoc(final String include, final String exclude) {
+        this.javadocFilter = new Filter(include, exclude);
+        return this;
+    }
+
+
     @Override
     public String toString() {
         return "Source{" +
@@ -72,4 +94,29 @@ public class Source {
                 '}';
     }
 
+    public static class Filter {
+        private final Pattern include;
+        private final Pattern exclude;
+
+        public Filter(final String include, final String exclude) {
+            this.include = Pattern.compile(include);
+            this.exclude = Pattern.compile(exclude);
+        }
+
+        public Pattern getInclude() {
+            return include;
+        }
+
+        public Pattern getExclude() {
+            return exclude;
+        }
+
+        public boolean include(final File file) {
+            return include.matcher(file.getAbsolutePath()).matches();
+        }
+
+        public boolean exclude(final File file) {
+            return !exclude.matcher(file.getAbsolutePath()).matches();
+        }
+    }
 }
diff --git a/src/main/java/org/apache/tomee/website/Sources.java b/src/main/java/org/apache/tomee/website/Sources.java
index be892da..599b9df 100644
--- a/src/main/java/org/apache/tomee/website/Sources.java
+++ b/src/main/java/org/apache/tomee/website/Sources.java
@@ -127,6 +127,11 @@ public class Sources {
         }
 
         sources.stream()
+                .flatMap(source -> source.getRelated().stream())
+                .peek(source -> source.setDir(new File(repos, source.getName())))
+                .forEach(Repos::download);
+
+        sources.stream()
                 .peek(source -> source.setDir(new File(repos, source.getName())))
                 .peek(Repos::download)
                 .peek(docs::prepare)
@@ -138,6 +143,7 @@ public class Sources {
 
         VersionsIndex.prepare(this);
     }
+
     /**
      * This is the heart of the code to merge several documentation
      * sources into one tree.