Merge branch 'master' of https://gitbox.apache.org/repos/asf/tomee-site-generator
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 @@
};
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)
};
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 @@
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 @@
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 @@
});
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 @@
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