From f7ebcb0de9e7a3a25d2ca65f81ddf37fee8de47a Mon Sep 17 00:00:00 2001 From: Dennis Hendriks Date: Sun, 10 Apr 2022 12:23:56 +0200 Subject: [PATCH 01/15] #332 Make org.eclipse.escet.common.asciidoc a Maven project. --- .../.classpath | 22 ++++++- .../.project | 9 +-- .../org.eclipse.core.resources.prefs | 3 + .../.settings/org.eclipse.m2e.core.prefs | 4 ++ .../META-INF/MANIFEST.MF | 16 ----- .../build.properties | 16 ----- .../org.eclipse.escet.common.asciidoc/pom.xml | 60 +++++++++++++++++++ ...ultipage-htmlsplit-eclipse-help-chi.launch | 2 + ...ultipage-htmlsplit-eclipse-help-cif.launch | 2 + ...ge-htmlsplit-eclipse-help-escet-dev.launch | 2 + ...tmlsplit-eclipse-help-escet-project.launch | 2 + ...page-htmlsplit-eclipse-help-tooldef.launch | 2 + ...doc-multipage-htmlsplit-website-chi.launch | 2 + ...doc-multipage-htmlsplit-website-cif.launch | 2 + ...ltipage-htmlsplit-website-escet-dev.launch | 2 + ...age-htmlsplit-website-escet-project.launch | 2 + ...multipage-htmlsplit-website-tooldef.launch | 2 + 17 files changed, 108 insertions(+), 42 deletions(-) create mode 100644 common/org.eclipse.escet.common.asciidoc/.settings/org.eclipse.core.resources.prefs create mode 100644 common/org.eclipse.escet.common.asciidoc/.settings/org.eclipse.m2e.core.prefs delete mode 100644 common/org.eclipse.escet.common.asciidoc/META-INF/MANIFEST.MF delete mode 100644 common/org.eclipse.escet.common.asciidoc/build.properties create mode 100644 common/org.eclipse.escet.common.asciidoc/pom.xml diff --git a/common/org.eclipse.escet.common.asciidoc/.classpath b/common/org.eclipse.escet.common.asciidoc/.classpath index 685a6999c..3721ade03 100644 --- a/common/org.eclipse.escet.common.asciidoc/.classpath +++ b/common/org.eclipse.escet.common.asciidoc/.classpath @@ -1,11 +1,27 @@ + + + + + + - + + + + + + + + + + + + + - - diff --git a/common/org.eclipse.escet.common.asciidoc/.project b/common/org.eclipse.escet.common.asciidoc/.project index cd4adef0a..d6f24a72d 100644 --- a/common/org.eclipse.escet.common.asciidoc/.project +++ b/common/org.eclipse.escet.common.asciidoc/.project @@ -11,12 +11,7 @@ - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder + org.eclipse.m2e.core.maven2Builder @@ -27,8 +22,8 @@ - org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature net.sf.eclipsecs.core.CheckstyleNature diff --git a/common/org.eclipse.escet.common.asciidoc/.settings/org.eclipse.core.resources.prefs b/common/org.eclipse.escet.common.asciidoc/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 000000000..e9441bb12 --- /dev/null +++ b/common/org.eclipse.escet.common.asciidoc/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,3 @@ +eclipse.preferences.version=1 +encoding//src/main/java=UTF-8 +encoding/=UTF-8 diff --git a/common/org.eclipse.escet.common.asciidoc/.settings/org.eclipse.m2e.core.prefs b/common/org.eclipse.escet.common.asciidoc/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 000000000..f897a7f1c --- /dev/null +++ b/common/org.eclipse.escet.common.asciidoc/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/common/org.eclipse.escet.common.asciidoc/META-INF/MANIFEST.MF b/common/org.eclipse.escet.common.asciidoc/META-INF/MANIFEST.MF deleted file mode 100644 index 3845de419..000000000 --- a/common/org.eclipse.escet.common.asciidoc/META-INF/MANIFEST.MF +++ /dev/null @@ -1,16 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: ESCET Common AsciiDoc (Incubation) -Bundle-SymbolicName: org.eclipse.escet.common.asciidoc;singleton:=true -Bundle-Version: 0.6.0.qualifier -Bundle-Vendor: Eclipse ESCET -Bundle-RequiredExecutionEnvironment: JavaSE-11 -Bundle-ActivationPolicy: lazy -Automatic-Module-Name: org.eclipse.escet.common.asciidoc -Export-Package: org.eclipse.escet.common.asciidoc.html.multipage -Require-Bundle: org.eclipse.escet.common.java;bundle-version="0.6.0", - org.apache.commons.io;bundle-version="2.8.0", - org.jsoup;bundle-version="1.8.3", - org.eclipse.escet.common.app.framework;bundle-version="0.6.0", - org.apache.commons.lang3;bundle-version="3.1.0", - com.google.guava;bundle-version="30.1.0" diff --git a/common/org.eclipse.escet.common.asciidoc/build.properties b/common/org.eclipse.escet.common.asciidoc/build.properties deleted file mode 100644 index 4ac126944..000000000 --- a/common/org.eclipse.escet.common.asciidoc/build.properties +++ /dev/null @@ -1,16 +0,0 @@ -############################################################################### -# Copyright (c) 2010, 2022 Contributors to the Eclipse Foundation -# -# See the NOTICE file(s) distributed with this work for additional -# information regarding copyright ownership. -# -# This program and the accompanying materials are made available under the terms -# of the MIT License which is available at https://opensource.org/licenses/MIT -# -# SPDX-License-Identifier: MIT -############################################################################### - -source.. = src/ -output.. = target/classes -bin.includes = META-INF/,\ - . diff --git a/common/org.eclipse.escet.common.asciidoc/pom.xml b/common/org.eclipse.escet.common.asciidoc/pom.xml new file mode 100644 index 000000000..b73ff8e19 --- /dev/null +++ b/common/org.eclipse.escet.common.asciidoc/pom.xml @@ -0,0 +1,60 @@ + + + + 4.0.0 + + org.eclipse.escet + org.eclipse.escet.root + 0.6.0-SNAPSHOT + ../../ + + + org.eclipse.escet.common.asciidoc + maven-plugin + + + + com.google.guava + guava + 30.1-jre + + + commons-io + commons-io + 2.8.0 + + + org.apache.commons + commons-lang3 + 3.1 + + + org.apache.maven + maven-plugin-api + 3.8.5 + provided + + + org.apache.maven.plugin-tools + maven-plugin-annotations + 3.6.4 + provided + + + org.jsoup + jsoup + 1.8.3 + + + diff --git a/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-eclipse-help-chi.launch b/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-eclipse-help-chi.launch index 56b7617ed..6d45c9eb7 100644 --- a/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-eclipse-help-chi.launch +++ b/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-eclipse-help-chi.launch @@ -9,8 +9,10 @@ + + diff --git a/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-eclipse-help-cif.launch b/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-eclipse-help-cif.launch index b7d1fac1e..20ae72e59 100644 --- a/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-eclipse-help-cif.launch +++ b/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-eclipse-help-cif.launch @@ -9,8 +9,10 @@ + + diff --git a/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-eclipse-help-escet-dev.launch b/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-eclipse-help-escet-dev.launch index 171b91661..3affe8fb0 100644 --- a/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-eclipse-help-escet-dev.launch +++ b/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-eclipse-help-escet-dev.launch @@ -9,8 +9,10 @@ + + diff --git a/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-eclipse-help-escet-project.launch b/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-eclipse-help-escet-project.launch index f96765265..293bd9ddb 100644 --- a/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-eclipse-help-escet-project.launch +++ b/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-eclipse-help-escet-project.launch @@ -9,8 +9,10 @@ + + diff --git a/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-eclipse-help-tooldef.launch b/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-eclipse-help-tooldef.launch index 65a3d8741..b83710a4b 100644 --- a/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-eclipse-help-tooldef.launch +++ b/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-eclipse-help-tooldef.launch @@ -9,8 +9,10 @@ + + diff --git a/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-website-chi.launch b/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-website-chi.launch index 381604f08..d0c1d5c3e 100644 --- a/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-website-chi.launch +++ b/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-website-chi.launch @@ -9,8 +9,10 @@ + + diff --git a/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-website-cif.launch b/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-website-cif.launch index 976a31202..a1cc1d886 100644 --- a/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-website-cif.launch +++ b/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-website-cif.launch @@ -9,8 +9,10 @@ + + diff --git a/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-website-escet-dev.launch b/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-website-escet-dev.launch index 2256b2e8d..5bd848e5f 100644 --- a/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-website-escet-dev.launch +++ b/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-website-escet-dev.launch @@ -9,8 +9,10 @@ + + diff --git a/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-website-escet-project.launch b/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-website-escet-project.launch index cd90ca676..0ab2f6934 100644 --- a/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-website-escet-project.launch +++ b/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-website-escet-project.launch @@ -9,8 +9,10 @@ + + diff --git a/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-website-tooldef.launch b/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-website-tooldef.launch index 457bb59de..5b6fc0c6e 100644 --- a/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-website-tooldef.launch +++ b/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-website-tooldef.launch @@ -9,8 +9,10 @@ + + -- GitLab From c73a6ea3be3c578a4c1c39234ee23ac63721ab5e Mon Sep 17 00:00:00 2001 From: Dennis Hendriks Date: Sun, 10 Apr 2022 12:25:02 +0200 Subject: [PATCH 02/15] #332 Moved sources to Maven expected location. --- .../asciidoc/html/multipage/AsciiDocEclipseHelpTocUtil.java | 0 .../common/asciidoc/html/multipage/AsciiDocHtmlAnalyzer.java | 0 .../common/asciidoc/html/multipage/AsciiDocHtmlModifier.java | 0 .../escet/common/asciidoc/html/multipage/AsciiDocHtmlPage.java | 0 .../escet/common/asciidoc/html/multipage/AsciiDocHtmlPages.java | 0 .../escet/common/asciidoc/html/multipage/AsciiDocHtmlUtil.java | 0 .../asciidoc/html/multipage/AsciiDocMultiPageHtmlSplitter.java | 0 .../escet/common/asciidoc/html/multipage/AsciiDocSourceFile.java | 0 .../asciidoc/html/multipage/AsciiDocSourceFileAnalyzer.java | 0 .../escet/common/asciidoc/html/multipage/AsciiDocTocEntry.java | 0 .../eclipse/escet/common/asciidoc/html/multipage/HtmlType.java | 0 11 files changed, 0 insertions(+), 0 deletions(-) rename common/org.eclipse.escet.common.asciidoc/src/{ => main/java}/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocEclipseHelpTocUtil.java (100%) rename common/org.eclipse.escet.common.asciidoc/src/{ => main/java}/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocHtmlAnalyzer.java (100%) rename common/org.eclipse.escet.common.asciidoc/src/{ => main/java}/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocHtmlModifier.java (100%) rename common/org.eclipse.escet.common.asciidoc/src/{ => main/java}/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocHtmlPage.java (100%) rename common/org.eclipse.escet.common.asciidoc/src/{ => main/java}/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocHtmlPages.java (100%) rename common/org.eclipse.escet.common.asciidoc/src/{ => main/java}/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocHtmlUtil.java (100%) rename common/org.eclipse.escet.common.asciidoc/src/{ => main/java}/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocMultiPageHtmlSplitter.java (100%) rename common/org.eclipse.escet.common.asciidoc/src/{ => main/java}/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocSourceFile.java (100%) rename common/org.eclipse.escet.common.asciidoc/src/{ => main/java}/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocSourceFileAnalyzer.java (100%) rename common/org.eclipse.escet.common.asciidoc/src/{ => main/java}/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocTocEntry.java (100%) rename common/org.eclipse.escet.common.asciidoc/src/{ => main/java}/org/eclipse/escet/common/asciidoc/html/multipage/HtmlType.java (100%) diff --git a/common/org.eclipse.escet.common.asciidoc/src/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocEclipseHelpTocUtil.java b/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocEclipseHelpTocUtil.java similarity index 100% rename from common/org.eclipse.escet.common.asciidoc/src/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocEclipseHelpTocUtil.java rename to common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocEclipseHelpTocUtil.java diff --git a/common/org.eclipse.escet.common.asciidoc/src/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocHtmlAnalyzer.java b/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocHtmlAnalyzer.java similarity index 100% rename from common/org.eclipse.escet.common.asciidoc/src/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocHtmlAnalyzer.java rename to common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocHtmlAnalyzer.java diff --git a/common/org.eclipse.escet.common.asciidoc/src/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocHtmlModifier.java b/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocHtmlModifier.java similarity index 100% rename from common/org.eclipse.escet.common.asciidoc/src/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocHtmlModifier.java rename to common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocHtmlModifier.java diff --git a/common/org.eclipse.escet.common.asciidoc/src/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocHtmlPage.java b/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocHtmlPage.java similarity index 100% rename from common/org.eclipse.escet.common.asciidoc/src/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocHtmlPage.java rename to common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocHtmlPage.java diff --git a/common/org.eclipse.escet.common.asciidoc/src/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocHtmlPages.java b/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocHtmlPages.java similarity index 100% rename from common/org.eclipse.escet.common.asciidoc/src/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocHtmlPages.java rename to common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocHtmlPages.java diff --git a/common/org.eclipse.escet.common.asciidoc/src/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocHtmlUtil.java b/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocHtmlUtil.java similarity index 100% rename from common/org.eclipse.escet.common.asciidoc/src/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocHtmlUtil.java rename to common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocHtmlUtil.java diff --git a/common/org.eclipse.escet.common.asciidoc/src/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocMultiPageHtmlSplitter.java b/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocMultiPageHtmlSplitter.java similarity index 100% rename from common/org.eclipse.escet.common.asciidoc/src/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocMultiPageHtmlSplitter.java rename to common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocMultiPageHtmlSplitter.java diff --git a/common/org.eclipse.escet.common.asciidoc/src/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocSourceFile.java b/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocSourceFile.java similarity index 100% rename from common/org.eclipse.escet.common.asciidoc/src/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocSourceFile.java rename to common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocSourceFile.java diff --git a/common/org.eclipse.escet.common.asciidoc/src/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocSourceFileAnalyzer.java b/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocSourceFileAnalyzer.java similarity index 100% rename from common/org.eclipse.escet.common.asciidoc/src/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocSourceFileAnalyzer.java rename to common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocSourceFileAnalyzer.java diff --git a/common/org.eclipse.escet.common.asciidoc/src/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocTocEntry.java b/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocTocEntry.java similarity index 100% rename from common/org.eclipse.escet.common.asciidoc/src/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocTocEntry.java rename to common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocTocEntry.java diff --git a/common/org.eclipse.escet.common.asciidoc/src/org/eclipse/escet/common/asciidoc/html/multipage/HtmlType.java b/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/HtmlType.java similarity index 100% rename from common/org.eclipse.escet.common.asciidoc/src/org/eclipse/escet/common/asciidoc/html/multipage/HtmlType.java rename to common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/HtmlType.java -- GitLab From b21e903fe31c09bbedd30c04a6855c5e1d758642 Mon Sep 17 00:00:00 2001 From: Dennis Hendriks Date: Sun, 10 Apr 2022 12:29:15 +0200 Subject: [PATCH 03/15] #332 Add multi-page HTML splitter Maven mojo. --- .../html/multipage/AsciiDocHtmlModifier.java | 7 +- .../AsciiDocMultiPageHtmlSplitter.java | 25 +++--- .../AsciiDocMultiPageHtmlSplitterMojo.java | 80 +++++++++++++++++++ 3 files changed, 99 insertions(+), 13 deletions(-) create mode 100644 common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocMultiPageHtmlSplitterMojo.java diff --git a/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocHtmlModifier.java b/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocHtmlModifier.java index 6a55cee93..879fdffa7 100644 --- a/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocHtmlModifier.java +++ b/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocHtmlModifier.java @@ -35,6 +35,7 @@ import java.util.Locale; import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.function.Consumer; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; @@ -75,9 +76,11 @@ class AsciiDocHtmlModifier { * {@link HtmlType#WEBSITE}, {@code null} otherwise. * @param parentWebsiteLink The relative path of the parent website to link to, if {@code htmlType} is * {@link HtmlType#WEBSITE}, {@code null} otherwise. + * @param logger The logger to use. */ static void generateAndWriteModifiedPages(Document singlePageDoc, AsciiDocHtmlPages htmlPages, Path sourceRootPath, - Path outputRootPath, HtmlType htmlType, String parentWebsiteName, String parentWebsiteLink) + Path outputRootPath, HtmlType htmlType, String parentWebsiteName, String parentWebsiteLink, + Consumer logger) { // Determine new section ids. determineNewSectionIds(htmlPages); @@ -87,7 +90,7 @@ class AsciiDocHtmlModifier { try { // Debug output. if (DEBUG) { - System.out.println("Modifying page: " + page.sourceFile.relPath); + logger.accept("Modifying page: " + page.sourceFile.relPath); } // Clone the original single-page HTML file for this page. diff --git a/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocMultiPageHtmlSplitter.java b/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocMultiPageHtmlSplitter.java index 439f0abeb..09fbd8d8f 100644 --- a/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocMultiPageHtmlSplitter.java +++ b/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocMultiPageHtmlSplitter.java @@ -26,6 +26,7 @@ import java.util.Arrays; import java.util.List; import java.util.Locale; import java.util.function.BiPredicate; +import java.util.function.Consumer; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -103,7 +104,7 @@ public class AsciiDocMultiPageHtmlSplitter { rootBaseName = Strings.slice(rootBaseName, null, -".html".length()); splitHtml(sourceRootPath, singleHtmlPagePath, outputRootPath, htmlType, parentWebsiteName, parentWebsiteLink, - rootBaseName); + rootBaseName, System.out::println); } /** @@ -120,10 +121,12 @@ public class AsciiDocMultiPageHtmlSplitter { * @param parentWebsiteLink The relative path of the parent website to link to, if {@code htmlType} is * {@link HtmlType#WEBSITE}, {@code null} otherwise. * @param rootBaseName The base name (file name excluding file extension) of the root AsciiDoc file. + * @param logger The logger to use. * @throws IOException In case of an I/O error. */ public static void splitHtml(Path sourceRootPath, Path singleHtmlPagePath, Path outputRootPath, HtmlType htmlType, - String parentWebsiteName, String parentWebsiteLink, String rootBaseName) throws IOException + String parentWebsiteName, String parentWebsiteLink, String rootBaseName, Consumer logger) + throws IOException { // Check arguments. Assert.areEqual(parentWebsiteName != null, htmlType == HtmlType.WEBSITE); @@ -140,12 +143,12 @@ public class AsciiDocMultiPageHtmlSplitter { Files.createDirectories(outputRootPath); // Read and parse AsciiDoc-generated single-page HTML file. - System.out.println("Reading AsciiDoc-generated single-page HTML file: " + singleHtmlPagePath.toString()); + logger.accept("Reading AsciiDoc-generated single-page HTML file: " + singleHtmlPagePath.toString()); String generatedHtmlContent = Files.readString(singleHtmlPagePath, StandardCharsets.UTF_8); Document singlePageDoc = Jsoup.parse(generatedHtmlContent); // Find AsciiDoc source files. - System.out.println("Finding and analyzing AsciiDoc source files located in: " + sourceRootPath.toString()); + logger.accept("Finding and analyzing AsciiDoc source files located in: " + sourceRootPath.toString()); sourceRootPath = sourceRootPath.toAbsolutePath().normalize(); List sourcePaths = getSourcePaths(sourceRootPath); @@ -162,22 +165,22 @@ public class AsciiDocMultiPageHtmlSplitter { sourceFiles.add(sourceFile); } } - System.out.println(fmt("%d AsciiDoc source files found, %d analyzed.", sourcePaths.size(), sourceFiles.size())); + logger.accept(fmt("%d AsciiDoc source files found, %d analyzed.", sourcePaths.size(), sourceFiles.size())); // Analyze AsciiDoc-generated single-page HTML file. - System.out.println("Analyzing AsciiDoc-generated single-page HTML file: " + singleHtmlPagePath.toString()); + logger.accept("Analyzing AsciiDoc-generated single-page HTML file: " + singleHtmlPagePath.toString()); AsciiDocHtmlPages htmlPages = new AsciiDocHtmlPages(sourceFiles); Assert.areEqual(htmlPages.homePage.sourceFile.getBaseName(), rootBaseName); AsciiDocHtmlAnalyzer.analyze(singlePageDoc, htmlPages); // Generate and write multiple HTML files, one per page. - System.out.println("Generating multi-page HTML files at: " + outputRootPath.toString()); + logger.accept("Generating multi-page HTML files at: " + outputRootPath.toString()); AsciiDocHtmlModifier.generateAndWriteModifiedPages(singlePageDoc, htmlPages, sourceRootPath, outputRootPath, - htmlType, parentWebsiteName, parentWebsiteLink); + htmlType, parentWebsiteName, parentWebsiteLink, logger); // Copy single AsciiDoc-generated HTML file to output directory, with different name. if (htmlType == HtmlType.WEBSITE) { - System.out.println("Copying single-page HTML file to: " + outputRootPath.toString()); + logger.accept("Copying single-page HTML file to: " + outputRootPath.toString()); Path singlePathOutputPath = outputRootPath.resolve(rootBaseName + "-single-page.html"); Assert.check(!Files.exists(singlePathOutputPath), singlePathOutputPath); Files.copy(singleHtmlPagePath, singlePathOutputPath); @@ -186,13 +189,13 @@ public class AsciiDocMultiPageHtmlSplitter { // Generate Eclipse help 'toc.xml' file. if (htmlType == HtmlType.ECLIPSE_HELP) { Path tocXmlPath = outputRootPath.resolve("toc.xml"); - System.out.println("Generating Eclipse help TOC at: " + tocXmlPath.toString()); + logger.accept("Generating Eclipse help TOC at: " + tocXmlPath.toString()); org.w3c.dom.Document tocXmlDoc = AsciiDocEclipseHelpTocUtil.tocToEclipseHelpXml(htmlPages.toc); XmlSupport.writeFile(tocXmlDoc, "TOC", tocXmlPath.toString()); } // Done. - System.out.println("DONE: AsciiDoc multi-page HTML split completed."); + logger.accept("DONE: AsciiDoc multi-page HTML split completed."); } /** diff --git a/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocMultiPageHtmlSplitterMojo.java b/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocMultiPageHtmlSplitterMojo.java new file mode 100644 index 000000000..7af3753b7 --- /dev/null +++ b/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocMultiPageHtmlSplitterMojo.java @@ -0,0 +1,80 @@ +////////////////////////////////////////////////////////////////////////////// +// Copyright (c) 2022 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available +// under the terms of the MIT License which is available at +// https://opensource.org/licenses/MIT +// +// SPDX-License-Identifier: MIT +////////////////////////////////////////////////////////////////////////////// + +package org.eclipse.escet.common.asciidoc.html.multipage; + +import java.io.File; + +import org.apache.maven.plugin.AbstractMojo; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; +import org.apache.maven.plugin.logging.Log; +import org.apache.maven.plugins.annotations.Mojo; +import org.apache.maven.plugins.annotations.Parameter; + +/** + * AsciiDoc multi-page HTML splitter Maven mojo. + * + * @see AsciiDocMultiPageHtmlSplitter + */ +@Mojo(name = "multi-page-html-split") +public class AsciiDocMultiPageHtmlSplitterMojo extends AbstractMojo { + /** The path to the root directory that contains the AsciiDoc source files. */ + @Parameter(required = true) + private File sourceRootPath; + + /** The base name (file name excluding file extension) of the root AsciiDoc file. */ + @Parameter(required = true) + private String rootBaseName; + + /** The path to the single AsciiDoc-generated HTML file. */ + @Parameter(required = true) + private File singleHtmlPagePath; + + /** + * The path to the directory in which to write output. Is removed if it already exists. Is created if it does not + * yet exist. + */ + @Parameter(required = true) + private File outputRootPath; + + /** The HTML type. */ + @Parameter(required = true) + private HtmlType htmlType; + + /** + * The name of the parent website to link to, if {@code htmlType} is {@link HtmlType#WEBSITE}, {@code null} + * otherwise. + */ + @Parameter + private String parentWebsiteName; + + /** + * The relative path of the parent website to link to, if {@code htmlType} is {@link HtmlType#WEBSITE}, {@code null} + * otherwise. + */ + @Parameter + private String parentWebsiteLink; + + @Override + public void execute() throws MojoExecutionException, MojoFailureException { + Log log = getLog(); + try { + AsciiDocMultiPageHtmlSplitter.splitHtml(sourceRootPath.toPath(), singleHtmlPagePath.toPath(), + outputRootPath.toPath(), htmlType, parentWebsiteName, parentWebsiteLink, rootBaseName, log::info); + } catch (Throwable e) { + log.error(e); + throw new MojoExecutionException("Error while executing Maven plugin.", e); + } + } +} -- GitLab From 73daca316268224a4ca6af68b4618aafce2fd765 Mon Sep 17 00:00:00 2001 From: Dennis Hendriks Date: Sun, 10 Apr 2022 12:32:44 +0200 Subject: [PATCH 04/15] #332 Maven plugin can't depend on Eclipse/OSGi plugins. --- .../multipage/AsciiDocEclipseHelpTocUtil.java | 59 +++++++++- .../html/multipage/AsciiDocHtmlAnalyzer.java | 76 ++++++------ .../html/multipage/AsciiDocHtmlModifier.java | 108 +++++++++--------- .../html/multipage/AsciiDocHtmlPages.java | 10 +- .../html/multipage/AsciiDocHtmlUtil.java | 24 +++- .../AsciiDocMultiPageHtmlSplitter.java | 40 +++---- .../html/multipage/AsciiDocSourceFile.java | 7 +- .../multipage/AsciiDocSourceFileAnalyzer.java | 31 +++-- .../html/multipage/AsciiDocTocEntry.java | 5 +- 9 files changed, 211 insertions(+), 149 deletions(-) diff --git a/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocEclipseHelpTocUtil.java b/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocEclipseHelpTocUtil.java index e3dd7bf54..3b55561ee 100644 --- a/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocEclipseHelpTocUtil.java +++ b/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocEclipseHelpTocUtil.java @@ -13,15 +13,29 @@ package org.eclipse.escet.common.asciidoc.html.multipage; +import java.io.BufferedOutputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStream; + import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.OutputKeys; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerConfigurationException; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; -import org.eclipse.escet.common.java.Assert; import org.w3c.dom.Document; +import org.w3c.dom.DocumentType; import org.w3c.dom.Element; import org.w3c.dom.Node; +import com.google.common.base.Verify; + /** AsciiDoc Eclipse help TOC generator. */ class AsciiDocEclipseHelpTocUtil { /** Constructor for the {@link AsciiDocEclipseHelpTocUtil} class. */ @@ -73,8 +87,8 @@ class AsciiDocEclipseHelpTocUtil { String refAttrName = (node instanceof Document) ? "topic" : "href"; String refTxt = AsciiDocHtmlUtil.getFileOrSectionHref(rootEntry.page, entry.page, entry.refId); if (node instanceof Document) { - Assert.check(entry == rootEntry); - Assert.check(refTxt.equals("#")); + Verify.verify(entry == rootEntry); + Verify.verify(refTxt.equals("#")); refTxt = rootEntry.page.sourceFile.getBaseName() + ".html"; } elem.setAttribute(refAttrName, refTxt); @@ -84,4 +98,43 @@ class AsciiDocEclipseHelpTocUtil { addEntries(elem, childEntry, rootEntry); } } + + /** + * Writes TOC XML file. + * + * @param doc The TOC XML document. + * @param absPath The absolute local file system path of the TOC XML file to write. + */ + static void writeTocXmlFile(Document doc, String absPath) { + // Construct transformer. + TransformerFactory xmlTransFactory = TransformerFactory.newInstance(); + Transformer xmlTrans; + try { + xmlTrans = xmlTransFactory.newTransformer(); + } catch (TransformerConfigurationException e) { + throw new RuntimeException(e); + } + xmlTrans.setOutputProperty(OutputKeys.INDENT, "yes"); + xmlTrans.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2"); + + // Set document type. + DocumentType docType = doc.getDoctype(); + if (docType != null) { + xmlTrans.setOutputProperty(OutputKeys.DOCTYPE_PUBLIC, docType.getPublicId()); + xmlTrans.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM, docType.getSystemId()); + } + + // Transform in-memory tree to the XML file. + DOMSource source = new DOMSource(doc); + try (OutputStream xmlStream = new BufferedOutputStream(new FileOutputStream(absPath))) { + StreamResult result = new StreamResult(xmlStream); + try { + xmlTrans.transform(source, result); + } catch (TransformerException e) { + throw new RuntimeException(e); + } + } catch (IOException e) { + throw new RuntimeException(String.format("Failed to write the TOC XML file to \"%s\".", absPath), e); + } + } } diff --git a/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocHtmlAnalyzer.java b/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocHtmlAnalyzer.java index e1cf06255..9f8e2840e 100644 --- a/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocHtmlAnalyzer.java +++ b/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocHtmlAnalyzer.java @@ -13,26 +13,26 @@ package org.eclipse.escet.common.asciidoc.html.multipage; -import static org.eclipse.escet.common.java.Lists.list; -import static org.eclipse.escet.common.java.Lists.reverse; -import static org.eclipse.escet.common.java.Lists.single; -import static org.eclipse.escet.common.java.Maps.mapc; -import static org.eclipse.escet.common.java.Pair.pair; -import static org.eclipse.escet.common.java.Sets.set; -import static org.eclipse.escet.common.java.Strings.fmt; +import static org.eclipse.escet.common.asciidoc.html.multipage.AsciiDocHtmlUtil.single; +import java.util.ArrayList; +import java.util.Collections; import java.util.Deque; +import java.util.HashMap; +import java.util.LinkedHashSet; import java.util.LinkedList; import java.util.Map; import java.util.stream.Collectors; -import org.eclipse.escet.common.java.Assert; -import org.eclipse.escet.common.java.Pair; +import org.apache.commons.lang3.tuple.ImmutablePair; +import org.apache.commons.lang3.tuple.Pair; import org.jsoup.nodes.Document; import org.jsoup.nodes.Element; import org.jsoup.nodes.Node; import org.jsoup.select.NodeVisitor; +import com.google.common.base.Verify; + /** AsciiDoc HTML analyzer. */ class AsciiDocHtmlAnalyzer { /** Constructor for the {@link AsciiDocHtmlAnalyzer} class. */ @@ -53,32 +53,32 @@ class AsciiDocHtmlAnalyzer { static void analyze(Document doc, AsciiDocHtmlPages htmlPages) { // Check that not yet partitioned, and initialize. for (AsciiDocHtmlPage htmlPage: htmlPages.pages) { - Assert.areEqual(htmlPage.breadcrumbs, null); - Assert.areEqual(htmlPage.singlePageIds, null); - Assert.areEqual(htmlPage.singlePageNodes, null); - htmlPage.singlePageIds = set(); - htmlPage.singlePageNodes = list(); + Verify.verify(htmlPage.breadcrumbs == null); + Verify.verify(htmlPage.singlePageIds == null); + Verify.verify(htmlPage.singlePageNodes == null); + htmlPage.singlePageIds = new LinkedHashSet<>(); + htmlPage.singlePageNodes = new ArrayList<>(); } // Map ids of non-home pages to their pages. - Map idToPages = mapc(htmlPages.pages.size()); + Map idToPages = new HashMap<>(htmlPages.pages.size()); for (AsciiDocHtmlPage htmlPage: htmlPages.pages) { if (!htmlPage.sourceFile.isRootAsciiDocFile) { AsciiDocHtmlPage prev = idToPages.put(htmlPage.sourceFile.sourceId, htmlPage); if (prev != null) { - Assert.fail(fmt("Duplicate source id: %s, for sources: %s and %s", htmlPage.sourceFile.sourceId, - prev.sourceFile.relPath, htmlPage.sourceFile.relPath)); + throw new RuntimeException(String.format("Duplicate source id: %s, for sources: %s and %s", + htmlPage.sourceFile.sourceId, prev.sourceFile.relPath, htmlPage.sourceFile.relPath)); } } } - Assert.areEqual(idToPages.size() + 1, htmlPages.pages.size()); + Verify.verify(idToPages.size() + 1 == htmlPages.pages.size()); // Walk over HTML 'content' and assign all nodes to a single page. Also create the TOC. Deque> pageStack = new LinkedList<>(); - pageStack.push(pair(htmlPages.homePage, 0)); + pageStack.push(ImmutablePair.of(htmlPages.homePage, 0)); Deque> tocStack = new LinkedList<>(); - tocStack.push(pair(new AsciiDocTocEntry(htmlPages.homePage, doc.title(), null), 0)); + tocStack.push(ImmutablePair.of(new AsciiDocTocEntry(htmlPages.homePage, doc.title(), null), 0)); Element elemContent = single(doc.select("#content")); elemContent.children().traverse(new NodeVisitor() { @@ -91,26 +91,26 @@ class AsciiDocHtmlAnalyzer { AsciiDocHtmlPage elemPage = idToPages.get(id); if (elemPage != null) { // New page. - Assert.check(elemPage.sourceFile.sourceId.equals(id)); - pageStack.push(pair(elemPage, depth)); + Verify.verify(elemPage.sourceFile.sourceId.equals(id)); + pageStack.push(ImmutablePair.of(elemPage, depth)); - AsciiDocTocEntry curTocEntry = tocStack.peek().left; + AsciiDocTocEntry curTocEntry = tocStack.peek().getLeft(); AsciiDocTocEntry newTocEntry = new AsciiDocTocEntry(elemPage, elemPage.sourceFile.title, elemPage.sourceFile.sourceId); curTocEntry.children.add(newTocEntry); - tocStack.push(pair(newTocEntry, depth)); + tocStack.push(ImmutablePair.of(newTocEntry, depth)); // Store reversed stack as breadcrumbs. - elemPage.breadcrumbs = reverse( - pageStack.stream().map(e -> e.left).collect(Collectors.toList())); + elemPage.breadcrumbs = pageStack.stream().map(e -> e.getLeft()).collect(Collectors.toList()); + Collections.reverse(elemPage.breadcrumbs); } else { // Same page. if (elem.tagName().matches("h\\d+")) { String entryTitle = elem.text(); - AsciiDocTocEntry curTocEntry = tocStack.peek().left; + AsciiDocTocEntry curTocEntry = tocStack.peek().getLeft(); AsciiDocTocEntry newTocEntry = new AsciiDocTocEntry(curTocEntry.page, entryTitle, id); curTocEntry.children.add(newTocEntry); - tocStack.push(pair(newTocEntry, depth)); + tocStack.push(ImmutablePair.of(newTocEntry, depth)); } } } @@ -119,40 +119,40 @@ class AsciiDocHtmlAnalyzer { if (node instanceof Element) { String id = ((Element)node).id(); if (!id.isBlank()) { - pageStack.peek().left.singlePageIds.add(id); + pageStack.peek().getLeft().singlePageIds.add(id); } } // Detect sibling node of other nodes of current page. This ensures we don't collect all nodes, but // only 'root' ones, not all descendants of 'root' nodes. - if (depth == pageStack.peek().right) { - pageStack.peek().left.singlePageNodes.add(node); + if (depth == pageStack.peek().getRight()) { + pageStack.peek().getLeft().singlePageNodes.add(node); } } @Override public void tail(Node node, int depth) { // Detect end of page. - if (depth < pageStack.peek().right) { + if (depth < pageStack.peek().getRight()) { pageStack.pop(); } // Detect end of TOC entry. - if (depth < tocStack.peek().right) { + if (depth < tocStack.peek().getRight()) { tocStack.pop(); } } }); - Assert.areEqual(pageStack.size(), 1); - Assert.areEqual(tocStack.size(), 1); + Verify.verify(pageStack.size() == 1); + Verify.verify(tocStack.size() == 1); // Ensure content for each page. for (AsciiDocHtmlPage page: htmlPages.pages) { - Assert.check(!page.singlePageNodes.isEmpty(), "No nodes for page: " + page.sourceFile.relPath.toString()); + Verify.verify(!page.singlePageNodes.isEmpty(), "No nodes for page: " + page.sourceFile.relPath.toString()); } // Return the TOC. - Assert.areEqual(tocStack.peek().right, 0); - htmlPages.toc = tocStack.pop().left; + Verify.verify(tocStack.peek().getRight() == 0); + htmlPages.toc = tocStack.pop().getLeft(); } } diff --git a/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocHtmlModifier.java b/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocHtmlModifier.java index 879fdffa7..214e72a12 100644 --- a/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocHtmlModifier.java +++ b/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocHtmlModifier.java @@ -13,21 +13,16 @@ package org.eclipse.escet.common.asciidoc.html.multipage; -import static org.eclipse.escet.common.java.Lists.copy; -import static org.eclipse.escet.common.java.Lists.listc; -import static org.eclipse.escet.common.java.Lists.single; -import static org.eclipse.escet.common.java.Maps.copy; -import static org.eclipse.escet.common.java.Maps.map; -import static org.eclipse.escet.common.java.Sets.difference; -import static org.eclipse.escet.common.java.Sets.intersection; -import static org.eclipse.escet.common.java.Sets.list2set; -import static org.eclipse.escet.common.java.Strings.fmt; +import static org.eclipse.escet.common.asciidoc.html.multipage.AsciiDocHtmlUtil.single; import java.net.URI; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; +import java.util.ArrayList; import java.util.Collection; +import java.util.Collections; +import java.util.LinkedHashMap; import java.util.LinkedHashSet; import java.util.LinkedList; import java.util.List; @@ -40,17 +35,17 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; -import org.eclipse.escet.common.java.Assert; -import org.eclipse.escet.common.java.Lists; import org.jsoup.nodes.Document; import org.jsoup.nodes.Element; import org.jsoup.nodes.Node; import org.jsoup.nodes.TextNode; import org.jsoup.select.Elements; +import com.google.common.base.Verify; import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ListMultimap; import com.google.common.collect.Multimaps; +import com.google.common.collect.Sets; /** AsciiDoc-generated single-page HTML modifier. */ class AsciiDocHtmlModifier { @@ -191,10 +186,10 @@ class AsciiDocHtmlModifier { List singlePageNodes) { // Sanity check. - Assert.check(singlePageDoc != multiPageDoc); + Verify.verify(singlePageDoc != multiPageDoc); // Determine the cloned nodes, per node. - List multiPageNodes = listc(singlePageNodes.size()); + List multiPageNodes = new ArrayList<>(singlePageNodes.size()); for (Node singlePageNode: singlePageNodes) { // Get path. LinkedList path = new LinkedList<>(); @@ -216,13 +211,13 @@ class AsciiDocHtmlModifier { // Sanity checks. if (singlePageNode.getClass() != curNode.getClass()) { - Assert.fail(singlePageNode.getClass() + " / " + curNode.getClass()); + throw new RuntimeException(singlePageNode.getClass() + " / " + curNode.getClass()); } if (singlePageNode instanceof Element) { Element singlePageElem = (Element)singlePageNode; Element curElem = (Element)curNode; if (!singlePageElem.tagName().equals(curElem.tagName())) { - Assert.fail(singlePageElem.tagName() + " / " + curElem.tagName()); + throw new RuntimeException(singlePageElem.tagName() + " / " + curElem.tagName()); } } @@ -250,13 +245,13 @@ class AsciiDocHtmlModifier { */ private static void determineNewSectionIds(AsciiDocHtmlPages htmlPages) { // Determine section id renames, for the entire TOC (all pages). - Map renames = map(); + Map renames = new LinkedHashMap<>(); fillSectionIdRenameMap(htmlPages.toc, renames); // We need unique ids, per page. for (AsciiDocHtmlPage htmlPage: htmlPages.pages) { // Get page renames. - Map pageRenames = copy(renames); + Map pageRenames = new LinkedHashMap<>(renames); pageRenames.keySet().retainAll(htmlPage.singlePageIds); // Ensure no duplicate new ids for this page. @@ -282,10 +277,11 @@ class AsciiDocHtmlModifier { } while (duplicateFound); // Check no overlap between remaining existing ids and new ids for this page. - Set remainingExistingIds = difference(htmlPage.singlePageIds, pageRenames.keySet()); - Set pageNewIds = list2set(pageRenames.values().stream().collect(Collectors.toList())); - Set overlapRemainingVsNewIds = intersection(remainingExistingIds, pageNewIds); - Assert.check(overlapRemainingVsNewIds.isEmpty(), + Set remainingExistingIds = Sets.difference(htmlPage.singlePageIds, pageRenames.keySet()); + Set pageNewIds = pageRenames.values().stream() + .collect(Collectors.toCollection(() -> new LinkedHashSet<>())); + Set overlapRemainingVsNewIds = Sets.intersection(remainingExistingIds, pageNewIds); + Verify.verify(overlapRemainingVsNewIds.isEmpty(), "Overlap between new section IDs and remaining non-section IDs: " + overlapRemainingVsNewIds + " on page: " + htmlPage.sourceFile.relPath); @@ -317,11 +313,11 @@ class AsciiDocHtmlModifier { while (newId.endsWith("-")) { newId = newId.substring(0, newId.length() - 1); } - Assert.check(!newId.isEmpty()); + Verify.verify(!newId.isEmpty()); // Store new id. String previous = renames.put(tocEntry.refId, newId); - Assert.areEqual(previous, null); + Verify.verify(previous == null); // Process children. for (AsciiDocTocEntry childEntry: tocEntry.children) { @@ -382,19 +378,21 @@ class AsciiDocHtmlModifier { // Move copyright/version. Element elemBodyCopyrightVersion = single(doc.select("#header div.details")); elemBodyCopyrightVersion.remove(); - Assert.areEqual(elemBodyCopyrightVersion.children().size(), 3, elemBodyCopyrightVersion); + Verify.verify(elemBodyCopyrightVersion.children().size() == 3, elemBodyCopyrightVersion.toString()); Elements elemBodyCopyrightVersionSpans = elemBodyCopyrightVersion.children().select("span"); - Assert.areEqual(elemBodyCopyrightVersionSpans.size(), 2, elemBodyCopyrightVersionSpans); + Verify.verify(elemBodyCopyrightVersionSpans.size() == 2, elemBodyCopyrightVersionSpans.toString()); elemBodyCopyrightVersionSpans.removeAttr("id"); elemBodyCopyrightVersionSpans.removeAttr("class"); - for (Element elem: Lists.reverse(elemBodyCopyrightVersionSpans)) { + List elemBodyCopyrightVersionSpansReversed = new ArrayList<>(elemBodyCopyrightVersionSpans); + Collections.reverse(elemBodyCopyrightVersionSpansReversed); + for (Element elem: elemBodyCopyrightVersionSpansReversed) { elemBodyFooterText.prependChild(elem); elemBodyFooterText.prepend(" | "); } // Move title. Element elemBodyTitle = single(doc.select("#header h1")); - Assert.check(elemBodyTitle.children().isEmpty(), elemBodyTitle); + Verify.verify(elemBodyTitle.children().isEmpty(), elemBodyTitle.toString()); elemBodyTitle.tagName("span"); elemBodyFooterText.prependChild(elemBodyTitle); } @@ -472,7 +470,7 @@ class AsciiDocHtmlModifier { modified = true; } else if (sectElem.children().size() == 1) { Element sectChildElem = sectElem.child(0); - List sectChildNodes = copy(sectElem.childNodes()); + List sectChildNodes = new ArrayList<>(sectElem.childNodes()); sectChildNodes.remove(sectChildElem); if (sectChildElem.tagName().matches("h\\d+") && haveNoContent(sectChildNodes)) { // Section with only a wrapper header name (all actual content is on other pages). @@ -500,7 +498,7 @@ class AsciiDocHtmlModifier { return false; } } else { - Assert.fail("Unexpected node: " + node.getClass().getName()); + throw new RuntimeException("Unexpected node: " + node.getClass().getName()); } } return true; @@ -523,8 +521,8 @@ class AsciiDocHtmlModifier { minHeaderNr = Math.min(headerNr, minHeaderNr); } } - Assert.check(minHeaderNr > 0, minHeaderNr); - Assert.check(minHeaderNr < Integer.MAX_VALUE, minHeaderNr); + Verify.verify(minHeaderNr > 0, Integer.toString(minHeaderNr)); + Verify.verify(minHeaderNr < Integer.MAX_VALUE, Integer.toString(minHeaderNr)); // Normalize header numbers to ensure minimum header number is '2'. for (Element elem: elemContent.getAllElements()) { @@ -532,7 +530,7 @@ class AsciiDocHtmlModifier { if (matcher.matches()) { int headerNr = Integer.parseInt(matcher.group(1), 10); int newHeaderNr = headerNr - minHeaderNr + 2; - Assert.check(newHeaderNr <= 6, newHeaderNr); // Only h1-h6 are defined in HTML. + Verify.verify(newHeaderNr <= 6, Integer.toString(newHeaderNr)); // Only h1-h6 are defined in HTML. elem.tagName("h" + newHeaderNr); } } @@ -558,11 +556,11 @@ class AsciiDocHtmlModifier { // Sanity checks. if (htmlPages.homePage == page) { - Assert.areEqual(tocLinkCurPageCount, 0); + Verify.verify(tocLinkCurPageCount == 0); } else { // If the TOC level setting used to generate the single page HTML file is too limited, the page will not be // in the TOC, and this will fail (count is zero). - Assert.areEqual(tocLinkCurPageCount, 1); + Verify.verify(tocLinkCurPageCount == 1); } } @@ -578,11 +576,11 @@ class AsciiDocHtmlModifier { for (Element elem: sectionHeaderElements) { // Get current section id. String elemId = elem.attr("id"); - Assert.notNull(elemId, elem.tagName()); + Verify.verifyNotNull(elemId, elem.tagName()); // Get new section id. String newId = page.sectionIdRenames.get(elemId); - Assert.notNull(newId, elemId); + Verify.verifyNotNull(newId, elemId); // Rename. elem.attr("id", newId); @@ -604,9 +602,9 @@ class AsciiDocHtmlModifier { // Rename this TOC entry. if (tocEntry.page == page && tocEntry.refId != null) { String newRefId = page.sectionIdRenames.get(tocEntry.refId); - Assert.notNull(newRefId, tocEntry.refId); + Verify.verifyNotNull(newRefId, tocEntry.refId); tocEntry.refId = newRefId; - Assert.check(tocEntry.page.multiPageIds.contains(newRefId), newRefId); + Verify.verify(tocEntry.page.multiPageIds.contains(newRefId), newRefId); } // Rename children. @@ -654,11 +652,11 @@ class AsciiDocHtmlModifier { if (allowEmptyRefIfNoChildren) { // Occurs for 'a.href' for bibliography entries. // But then they have no child nodes, and are thus not clickable. - Assert.areEqual(elem.childNodeSize(), 0); + Verify.verify(elem.childNodeSize() == 0); continue; } else { throw new RuntimeException( - fmt("Undefined '%s.%s' for %s", tagName, attrName, page.sourceFile.relPath)); + String.format("Undefined '%s.%s' for %s", tagName, attrName, page.sourceFile.relPath)); } } @@ -672,7 +670,8 @@ class AsciiDocHtmlModifier { continue ELEMS_LOOP; } } - Assert.fail(fmt("No page found that defines '%s.%s' id: %s", tagName, attrName, id)); + throw new RuntimeException( + String.format("No page found that defines '%s.%s' id: %s", tagName, attrName, id)); } // Get referenced URI. Skip 'http', 'https' and 'mailto' references. @@ -683,20 +682,19 @@ class AsciiDocHtmlModifier { } // Handle relative paths. - Assert.areEqual(uriScheme, null); - Assert.areEqual(uri.getUserInfo(), null); - Assert.areEqual(uri.getHost(), null); - Assert.areEqual(uri.getPort(), -1); - Assert.areEqual(uri.getAuthority(), null); - Assert.areEqual(uri.getQuery(), null); - Assert.areEqual(uri.getFragment(), null); - Assert.notNull(uri.getPath()); - Assert.areEqual(ref, uri.getPath()); - String hrefAbsTarget = org.eclipse.escet.common.app.framework.Paths.resolve(ref, sourceRootPath.toString()); - String rootPathForNewRelHref = page.sourceFile.absPath.getParent().toString(); - String newRelHref = org.eclipse.escet.common.app.framework.Paths.getRelativePath(hrefAbsTarget, - rootPathForNewRelHref); - Assert.check(!newRelHref.contains("\\"), newRelHref); + Verify.verify(uriScheme == null); + Verify.verify(uri.getUserInfo() == null); + Verify.verify(uri.getHost() == null); + Verify.verify(uri.getPort() == -1); + Verify.verify(uri.getAuthority() == null); + Verify.verify(uri.getQuery() == null); + Verify.verify(uri.getFragment() == null); + Verify.verifyNotNull(uri.getPath()); + Verify.verify(ref.equals(uri.getPath())); + Path hrefAbsTarget = sourceRootPath.resolve(ref); + Path rootPathForNewRelHref = page.sourceFile.absPath.getParent(); + String newRelHref = rootPathForNewRelHref.relativize(hrefAbsTarget).toString(); + Verify.verify(!newRelHref.contains("\\"), newRelHref); elem.attr(attrName, newRelHref); } } diff --git a/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocHtmlPages.java b/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocHtmlPages.java index e54c93bb1..084c12b19 100644 --- a/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocHtmlPages.java +++ b/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocHtmlPages.java @@ -13,12 +13,12 @@ package org.eclipse.escet.common.asciidoc.html.multipage; -import static org.eclipse.escet.common.java.Lists.single; - import java.util.Collections; import java.util.List; import java.util.stream.Collectors; +import com.google.common.base.Verify; + /** Information about all HTML page of a set of multi-page HTML files. */ public class AsciiDocHtmlPages { /** All pages, including the home page. */ @@ -41,7 +41,9 @@ public class AsciiDocHtmlPages { .unmodifiableList(sourceFiles.stream().map(f -> new AsciiDocHtmlPage(f)).collect(Collectors.toList())); // Find the home page. - this.homePage = single( - pages.stream().filter(p -> p.sourceFile.isRootAsciiDocFile).collect(Collectors.toList())); + List homePages = pages.stream().filter(p -> p.sourceFile.isRootAsciiDocFile) + .collect(Collectors.toList()); + Verify.verify(homePages.size() == 1); + this.homePage = homePages.get(0); } } diff --git a/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocHtmlUtil.java b/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocHtmlUtil.java index 13d564427..e34c70708 100644 --- a/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocHtmlUtil.java +++ b/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocHtmlUtil.java @@ -16,8 +16,10 @@ package org.eclipse.escet.common.asciidoc.html.multipage; import java.nio.file.Path; import java.util.Objects; -import org.eclipse.escet.common.java.Assert; -import org.eclipse.escet.common.java.Strings; +import org.jsoup.nodes.Element; +import org.jsoup.select.Elements; + +import com.google.common.base.Verify; /** AsciiDoc multi-page HTML utility methods. */ class AsciiDocHtmlUtil { @@ -59,7 +61,7 @@ class AsciiDocHtmlUtil { // Add section reference. if (singlePageId != null) { String multiPageId = toPage.sectionIdRenames.getOrDefault(singlePageId, singlePageId); - Assert.check(toPage.multiPageIds.contains(multiPageId), multiPageId); + Verify.verify(toPage.multiPageIds.contains(multiPageId), multiPageId); String firstId = toPage.multiPageIds.isEmpty() ? null : toPage.multiPageIds.iterator().next(); if (!Objects.equals(multiPageId, firstId)) { // Add section id if not the page title id. href += "#" + multiPageId; @@ -81,9 +83,21 @@ class AsciiDocHtmlUtil { */ static Path sourcePathToOutputPath(Path sourcePath) { String fileName = sourcePath.getFileName().toString(); - Assert.check(fileName.endsWith(".asciidoc"), fileName); - fileName = Strings.slice(fileName, 0, -".asciidoc".length()); + Verify.verify(fileName.endsWith(".asciidoc"), fileName); + fileName = fileName.substring(0, fileName.length() - ".asciidoc".length()); fileName += ".html"; return sourcePath.resolveSibling(fileName); } + + /** + * Returns the single element from the given elements. + * + * @param elements The list for which to get the single element. + * @return The single element. + * @throws IllegalArgumentException If the list does not have exactly one element. + */ + static Element single(Elements elements) { + Verify.verify(elements.size() == 1, elements.toString()); + return elements.get(0); + } } diff --git a/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocMultiPageHtmlSplitter.java b/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocMultiPageHtmlSplitter.java index 09fbd8d8f..770f0ea1f 100644 --- a/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocMultiPageHtmlSplitter.java +++ b/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocMultiPageHtmlSplitter.java @@ -13,15 +13,13 @@ package org.eclipse.escet.common.asciidoc.html.multipage; -import static org.eclipse.escet.common.java.Lists.listc; -import static org.eclipse.escet.common.java.Strings.fmt; - import java.io.IOException; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.nio.file.attribute.BasicFileAttributes; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Locale; @@ -31,12 +29,11 @@ import java.util.stream.Collectors; import java.util.stream.Stream; import org.apache.commons.io.FileUtils; -import org.eclipse.escet.common.app.framework.XmlSupport; -import org.eclipse.escet.common.java.Assert; -import org.eclipse.escet.common.java.Strings; import org.jsoup.Jsoup; import org.jsoup.nodes.Document; +import com.google.common.base.Verify; + /** * AsciiDoc multi-page HTML splitter. * @@ -73,14 +70,14 @@ public class AsciiDocMultiPageHtmlSplitter { */ public static void main(String[] args) throws IOException { System.out.println("Command line arguments: " + Arrays.toString(args)); - Assert.check(args.length == 4 || args.length == 6, args); + Verify.verify(args.length == 4 || args.length == 6, Arrays.toString(args)); Path sourceRootPath = Paths.get(args[0]); Path singleHtmlPagePath = Paths.get(args[1]); Path outputRootPath = Paths.get(args[2]); String htmlTypeText = args[3]; - Assert.check(htmlTypeText.startsWith("--")); + Verify.verify(htmlTypeText.startsWith("--")); htmlTypeText = htmlTypeText.substring(2).replace("-", "_").toUpperCase(Locale.US); HtmlType htmlType = HtmlType.valueOf(htmlTypeText); @@ -88,10 +85,10 @@ public class AsciiDocMultiPageHtmlSplitter { String parentWebsiteLink = null; switch (htmlType) { case ECLIPSE_HELP: - Assert.check(args.length == 4, args); + Verify.verify(args.length == 4, Arrays.toString(args)); break; case WEBSITE: - Assert.check(args.length == 6, args); + Verify.verify(args.length == 6, Arrays.toString(args)); parentWebsiteName = args[4]; parentWebsiteLink = args[5]; break; @@ -100,8 +97,8 @@ public class AsciiDocMultiPageHtmlSplitter { } String rootBaseName = singleHtmlPagePath.getFileName().toString(); - Assert.check(rootBaseName.endsWith(".html")); - rootBaseName = Strings.slice(rootBaseName, null, -".html".length()); + Verify.verify(rootBaseName.endsWith(".html")); + rootBaseName = rootBaseName.substring(0, rootBaseName.length() - ".html".length()); splitHtml(sourceRootPath, singleHtmlPagePath, outputRootPath, htmlType, parentWebsiteName, parentWebsiteLink, rootBaseName, System.out::println); @@ -129,12 +126,12 @@ public class AsciiDocMultiPageHtmlSplitter { throws IOException { // Check arguments. - Assert.areEqual(parentWebsiteName != null, htmlType == HtmlType.WEBSITE); - Assert.areEqual(parentWebsiteLink != null, htmlType == HtmlType.WEBSITE); + Verify.verify((parentWebsiteName != null) == (htmlType == HtmlType.WEBSITE)); + Verify.verify((parentWebsiteLink != null) == (htmlType == HtmlType.WEBSITE)); // Check inputs exist. - Assert.check(Files.isDirectory(sourceRootPath), sourceRootPath); - Assert.check(Files.isRegularFile(singleHtmlPagePath), singleHtmlPagePath); + Verify.verify(Files.isDirectory(sourceRootPath), sourceRootPath.toString()); + Verify.verify(Files.isRegularFile(singleHtmlPagePath), singleHtmlPagePath.toString()); // Ensure empty directory for output. if (Files.isDirectory(outputRootPath)) { @@ -153,7 +150,7 @@ public class AsciiDocMultiPageHtmlSplitter { List sourcePaths = getSourcePaths(sourceRootPath); // Analyze AsciiDoc source files. - List sourceFiles = listc(sourcePaths.size()); + List sourceFiles = new ArrayList<>(sourcePaths.size()); for (Path sourcePath: sourcePaths) { AsciiDocSourceFile sourceFile; try { @@ -165,12 +162,13 @@ public class AsciiDocMultiPageHtmlSplitter { sourceFiles.add(sourceFile); } } - logger.accept(fmt("%d AsciiDoc source files found, %d analyzed.", sourcePaths.size(), sourceFiles.size())); + logger.accept(String.format(Locale.US, "%d AsciiDoc source files found, %d analyzed.", sourcePaths.size(), + sourceFiles.size())); // Analyze AsciiDoc-generated single-page HTML file. logger.accept("Analyzing AsciiDoc-generated single-page HTML file: " + singleHtmlPagePath.toString()); AsciiDocHtmlPages htmlPages = new AsciiDocHtmlPages(sourceFiles); - Assert.areEqual(htmlPages.homePage.sourceFile.getBaseName(), rootBaseName); + Verify.verify(htmlPages.homePage.sourceFile.getBaseName().equals(rootBaseName)); AsciiDocHtmlAnalyzer.analyze(singlePageDoc, htmlPages); // Generate and write multiple HTML files, one per page. @@ -182,7 +180,7 @@ public class AsciiDocMultiPageHtmlSplitter { if (htmlType == HtmlType.WEBSITE) { logger.accept("Copying single-page HTML file to: " + outputRootPath.toString()); Path singlePathOutputPath = outputRootPath.resolve(rootBaseName + "-single-page.html"); - Assert.check(!Files.exists(singlePathOutputPath), singlePathOutputPath); + Verify.verify(!Files.exists(singlePathOutputPath), singlePathOutputPath.toString()); Files.copy(singleHtmlPagePath, singlePathOutputPath); } @@ -191,7 +189,7 @@ public class AsciiDocMultiPageHtmlSplitter { Path tocXmlPath = outputRootPath.resolve("toc.xml"); logger.accept("Generating Eclipse help TOC at: " + tocXmlPath.toString()); org.w3c.dom.Document tocXmlDoc = AsciiDocEclipseHelpTocUtil.tocToEclipseHelpXml(htmlPages.toc); - XmlSupport.writeFile(tocXmlDoc, "TOC", tocXmlPath.toString()); + AsciiDocEclipseHelpTocUtil.writeTocXmlFile(tocXmlDoc, tocXmlPath.toString()); } // Done. diff --git a/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocSourceFile.java b/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocSourceFile.java index f3de2defd..5490b4bb4 100644 --- a/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocSourceFile.java +++ b/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocSourceFile.java @@ -15,8 +15,7 @@ package org.eclipse.escet.common.asciidoc.html.multipage; import java.nio.file.Path; -import org.eclipse.escet.common.java.Assert; -import org.eclipse.escet.common.java.Strings; +import com.google.common.base.Verify; /** Information about an AsciiDoc source file. */ class AsciiDocSourceFile { @@ -67,8 +66,8 @@ class AsciiDocSourceFile { */ String getBaseName() { String fileName = relPath.getFileName().toString(); - Assert.check(fileName.endsWith(".asciidoc")); - String baseName = Strings.slice(fileName, null, -".asciidoc".length()); + Verify.verify(fileName.endsWith(".asciidoc")); + String baseName = fileName.substring(0, fileName.length() - ".asciidoc".length()); return baseName; } } diff --git a/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocSourceFileAnalyzer.java b/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocSourceFileAnalyzer.java index ae8c3d704..1c8fd75a1 100644 --- a/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocSourceFileAnalyzer.java +++ b/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocSourceFileAnalyzer.java @@ -13,8 +13,6 @@ package org.eclipse.escet.common.asciidoc.html.multipage; -import static org.eclipse.escet.common.java.Strings.fmt; - import java.io.IOException; import java.nio.charset.StandardCharsets; import java.nio.file.Files; @@ -23,8 +21,8 @@ import java.util.List; import java.util.stream.IntStream; import org.apache.commons.lang3.StringUtils; -import org.eclipse.escet.common.java.Assert; -import org.eclipse.escet.common.java.Strings; + +import com.google.common.base.Verify; /** AsciiDoc source file analyzer. */ class AsciiDocSourceFileAnalyzer { @@ -46,7 +44,7 @@ class AsciiDocSourceFileAnalyzer { // Skip special files. String fileName = sourcePath.getFileName().toString(); if (fileName.toString().startsWith("_")) { - Assert.check(fileName.equals("_root_attributes.asciidoc") || fileName.equals("_part_attributes.asciidoc") + Verify.verify(fileName.equals("_root_attributes.asciidoc") || fileName.equals("_part_attributes.asciidoc") || fileName.equals("_local_attributes.asciidoc"), fileName); return null; } @@ -71,37 +69,38 @@ class AsciiDocSourceFileAnalyzer { int idIndex = IntStream.range(0, sourceContent.size()).filter(i -> sourceContent.get(i).startsWith("[[")) .findFirst().getAsInt(); String idLine = sourceContent.get(idIndex); - Assert.check(idLine.endsWith("]]"), idLine); - sourceId = Strings.slice(idLine, 2, -2); // [[id]] + Verify.verify(idLine.endsWith("]]"), idLine); + sourceId = idLine.substring(2, idLine.length() - 2); // [[id]] // Sanity check: no markup in id. - Assert.check(sourceId.matches("[a-z0-9-]+"), sourceId); + Verify.verify(sourceId.matches("[a-z0-9-]+"), sourceId); // Get title. int titleIndex = IntStream.range(0, sourceContent.size()).filter(i -> sourceContent.get(i).startsWith("=")) .findFirst().getAsInt(); String titleLine = sourceContent.get(titleIndex); - Assert.check(titleLine.startsWith("== "), titleLine); + Verify.verify(titleLine.startsWith("== "), titleLine); title = titleLine.substring(3); // == Title // Sanity check: source id is the id for the page title header. - Assert.areEqual(idIndex + 1, titleIndex); + Verify.verify(idIndex + 1 == titleIndex); // Sanitize title. // - Check for balanced backticks and remove backticks. - Assert.check(StringUtils.countMatches(title, "`") % 2 == 0, title); + Verify.verify(StringUtils.countMatches(title, "`") % 2 == 0, title); title = title.replace("`", ""); // Sanity check: stripped title. - Assert.areEqual(title, title.strip()); + Verify.verify(title.equals(title.strip())); // Sanity check: no markup in title. String patternTitleWordNormalChars = "[a-zA-Z0-9, ]"; String patternTitleWordWithSpecialChar = "[a-zA-Z0-9][\\-/'][a-zA-Z0-9]"; - String patternTitleWord = fmt("%s|%s", patternTitleWordNormalChars, patternTitleWordWithSpecialChar); - String patternTitleWordWithParentheses = fmt("\\((%s)+\\)", patternTitleWord); - String patternTitle = fmt("(%s|%s)+", patternTitleWord, patternTitleWordWithParentheses); - Assert.check(title.matches(patternTitle), title); + String patternTitleWord = String.format("%s|%s", patternTitleWordNormalChars, + patternTitleWordWithSpecialChar); + String patternTitleWordWithParentheses = String.format("\\((%s)+\\)", patternTitleWord); + String patternTitle = String.format("(%s|%s)+", patternTitleWord, patternTitleWordWithParentheses); + Verify.verify(title.matches(patternTitle), title); } // Return the information. diff --git a/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocTocEntry.java b/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocTocEntry.java index 571717260..bff148092 100644 --- a/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocTocEntry.java +++ b/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocTocEntry.java @@ -13,8 +13,7 @@ package org.eclipse.escet.common.asciidoc.html.multipage; -import static org.eclipse.escet.common.java.Lists.list; - +import java.util.ArrayList; import java.util.List; /** AsciiDoc Table of Contents (TOC) entry, corresponding to a section in an AsciiDoc document. */ @@ -29,7 +28,7 @@ class AsciiDocTocEntry { String refId; /** The child TOC entries. */ - final List children = list(); + final List children = new ArrayList<>(); /** * Constructor for the {@link AsciiDocTocEntry} class. -- GitLab From 302120fba4ac1664f103c17711c2ea5f4aab4f2c Mon Sep 17 00:00:00 2001 From: Dennis Hendriks Date: Sun, 10 Apr 2022 12:42:29 +0200 Subject: [PATCH 05/15] #332 Update build/configuration for building/using Maven plugin. --- .../META-INF/MANIFEST.MF | 3 +- .../pom.xml | 71 ++++++------------ .../META-INF/MANIFEST.MF | 3 +- .../pom.xml | 71 ++++++------------ .../.project | 4 +- org.eclipse.escet.setup | 12 +++ .../pom.xml | 42 +++++++++++ .../META-INF/MANIFEST.MF | 3 +- .../pom.xml | 75 +++++++------------ .../META-INF/MANIFEST.MF | 3 +- .../pom.xml | 71 ++++++------------ .../META-INF/MANIFEST.MF | 3 +- .../pom.xml | 71 ++++++------------ 13 files changed, 179 insertions(+), 253 deletions(-) diff --git a/chi/org.eclipse.escet.chi.documentation/META-INF/MANIFEST.MF b/chi/org.eclipse.escet.chi.documentation/META-INF/MANIFEST.MF index 98145cfb8..bab4bf18a 100644 --- a/chi/org.eclipse.escet.chi.documentation/META-INF/MANIFEST.MF +++ b/chi/org.eclipse.escet.chi.documentation/META-INF/MANIFEST.MF @@ -4,5 +4,4 @@ Bundle-Name: ESCET Chi Documentation (Incubation) Bundle-SymbolicName: org.eclipse.escet.chi.documentation;singleton:=true Bundle-Version: 0.6.0.qualifier Bundle-Vendor: Eclipse ESCET -Require-Bundle: org.eclipse.help, - org.eclipse.escet.common.asciidoc;bundle-version="0.6.0" +Require-Bundle: org.eclipse.help diff --git a/chi/org.eclipse.escet.chi.documentation/pom.xml b/chi/org.eclipse.escet.chi.documentation/pom.xml index 260d479e5..15ddfc133 100644 --- a/chi/org.eclipse.escet.chi.documentation/pom.xml +++ b/chi/org.eclipse.escet.chi.documentation/pom.xml @@ -128,70 +128,45 @@ - org.codehaus.mojo - exec-maven-plugin - 3.0.0 - - - org.eclipse.escet.common.asciidoc.html.multipage.AsciiDocMultiPageHtmlSplitter - - true - true - + org.eclipse.escet + org.eclipse.escet.common.asciidoc + ${project.version} - eclipse-help-multi-html-split + eclipse-help-multi-page-html-split generate-resources - java + multi-page-html-split - - ${project.basedir}/asciidoc - ${project.build.directory}/eclipse-help-intermediate/documentation.html - ${project.build.directory}/eclipse-help - --eclipse-help - + ${project.basedir}/asciidoc + documentation + + ${project.build.directory}/eclipse-help-intermediate/documentation.html + + ${project.build.directory}/eclipse-help + ECLIPSE_HELP - website-multi-html-split + website-multi-page-html-split generate-resources - java + multi-page-html-split - - ${project.basedir}/asciidoc - ${project.build.directory}/website-intermediate/documentation.html - ${project.build.directory}/website - --website - Chi website - . - + ${project.basedir}/asciidoc + documentation + + ${project.build.directory}/website-intermediate/documentation.html + + ${project.build.directory}/website + WEBSITE + Chi website + . - - - org.eclipse.escet - org.eclipse.escet.common.asciidoc - ${project.version} - eclipse-plugin - - - org.eclipse.escet - org.eclipse.escet.common.java - ${project.version} - eclipse-plugin - - - org.eclipse.escet - org.eclipse.escet.common.app.framework - ${project.version} - eclipse-plugin - - diff --git a/cif/org.eclipse.escet.cif.documentation/META-INF/MANIFEST.MF b/cif/org.eclipse.escet.cif.documentation/META-INF/MANIFEST.MF index d75f7e1de..72f027764 100644 --- a/cif/org.eclipse.escet.cif.documentation/META-INF/MANIFEST.MF +++ b/cif/org.eclipse.escet.cif.documentation/META-INF/MANIFEST.MF @@ -4,5 +4,4 @@ Bundle-Name: ESCET CIF Documentation (Incubation) Bundle-SymbolicName: org.eclipse.escet.cif.documentation;singleton:=true Bundle-Version: 0.6.0.qualifier Bundle-Vendor: Eclipse ESCET -Require-Bundle: org.eclipse.help, - org.eclipse.escet.common.asciidoc;bundle-version="0.6.0" +Require-Bundle: org.eclipse.help diff --git a/cif/org.eclipse.escet.cif.documentation/pom.xml b/cif/org.eclipse.escet.cif.documentation/pom.xml index 77a2b9c6a..494439584 100644 --- a/cif/org.eclipse.escet.cif.documentation/pom.xml +++ b/cif/org.eclipse.escet.cif.documentation/pom.xml @@ -128,70 +128,45 @@ - org.codehaus.mojo - exec-maven-plugin - 3.0.0 - - - org.eclipse.escet.common.asciidoc.html.multipage.AsciiDocMultiPageHtmlSplitter - - true - true - + org.eclipse.escet + org.eclipse.escet.common.asciidoc + ${project.version} - eclipse-help-multi-html-split + eclipse-help-multi-page-html-split generate-resources - java + multi-page-html-split - - ${project.basedir}/asciidoc - ${project.build.directory}/eclipse-help-intermediate/documentation.html - ${project.build.directory}/eclipse-help - --eclipse-help - + ${project.basedir}/asciidoc + documentation + + ${project.build.directory}/eclipse-help-intermediate/documentation.html + + ${project.build.directory}/eclipse-help + ECLIPSE_HELP - website-multi-html-split + website-multi-page-html-split generate-resources - java + multi-page-html-split - - ${project.basedir}/asciidoc - ${project.build.directory}/website-intermediate/documentation.html - ${project.build.directory}/website - --website - CIF website - . - + ${project.basedir}/asciidoc + documentation + + ${project.build.directory}/website-intermediate/documentation.html + + ${project.build.directory}/website + WEBSITE + CIF website + . - - - org.eclipse.escet - org.eclipse.escet.common.asciidoc - ${project.version} - eclipse-plugin - - - org.eclipse.escet - org.eclipse.escet.common.java - ${project.version} - eclipse-plugin - - - org.eclipse.escet - org.eclipse.escet.common.app.framework - ${project.version} - eclipse-plugin - - diff --git a/common/org.eclipse.escet.common.asciidoc/.project b/common/org.eclipse.escet.common.asciidoc/.project index d6f24a72d..4fe820cd2 100644 --- a/common/org.eclipse.escet.common.asciidoc/.project +++ b/common/org.eclipse.escet.common.asciidoc/.project @@ -11,12 +11,12 @@ - org.eclipse.m2e.core.maven2Builder + net.sf.eclipsecs.core.CheckstyleBuilder - net.sf.eclipsecs.core.CheckstyleBuilder + org.eclipse.m2e.core.maven2Builder diff --git a/org.eclipse.escet.setup b/org.eclipse.escet.setup index ad78517e4..e7d215e1b 100644 --- a/org.eclipse.escet.setup +++ b/org.eclipse.escet.setup @@ -141,6 +141,18 @@ key="/instance/org.eclipse.jdt.ui/org.eclipse.jdt.ui.text.custom_code_templates" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?><templates><template autoinsert="false" context="gettercomment_context" deleted="false" description="Comment for getter method" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name="gettercomment">/** * @return The $${bare_field_name}. */</template><template autoinsert="false" context="settercomment_context" deleted="false" description="Comment for setter method" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.settercomment" name="settercomment">/** * @param $${param} The $${bare_field_name} to set. */</template><template autoinsert="false" context="filecomment_context" deleted="false" description="Comment for created Java files" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.filecomment" name="filecomment">////////////////////////////////////////////////////////////////////////////// // Copyright (c) $${year} Contributors to the Eclipse Foundation // // See the NOTICE file(s) distributed with this work for additional // information regarding copyright ownership. // // This program and the accompanying materials are made available // under the terms of the MIT License which is available at // https://opensource.org/licenses/MIT // // SPDX-License-Identifier: MIT ////////////////////////////////////////////////////////////////////////////// </template><template autoinsert="false" context="typecomment_context" deleted="false" description="Comment for created types" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.typecomment" name="typecomment">/** * $${tags} */</template><template autoinsert="false" context="modulecomment_context" deleted="false" description="Comment for modules" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.modulecomment" name="modulecomment">/** * $${tags} */</template></templates>"/> + + + + diff --git a/releng/org.eclipse.escet.releng.configuration/pom.xml b/releng/org.eclipse.escet.releng.configuration/pom.xml index 8cb2e3223..c5ae7564d 100644 --- a/releng/org.eclipse.escet.releng.configuration/pom.xml +++ b/releng/org.eclipse.escet.releng.configuration/pom.xml @@ -34,6 +34,11 @@ SPDX-License-Identifier: MIT UTF-8 UTF-8 + + + 11 + 11 + 2.7.1 ${tycho.version} @@ -161,6 +166,9 @@ SPDX-License-Identifier: MIT cocoa x86_64 + + + consider @@ -256,6 +264,7 @@ SPDX-License-Identifier: MIT + org.eclipse.m2e lifecycle-mapping @@ -276,6 +285,32 @@ SPDX-License-Identifier: MIT + + + org.apache.maven.plugins + maven-plugin-plugin + [3.2,) + + descriptor + + + + + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + [3.1.2,) + + check + + + + + + @@ -336,6 +371,13 @@ SPDX-License-Identifier: MIT technology.escet + + + + org.apache.maven.plugins + maven-plugin-plugin + 3.6.4 + diff --git a/releng/org.eclipse.escet.releng.dev.documentation/META-INF/MANIFEST.MF b/releng/org.eclipse.escet.releng.dev.documentation/META-INF/MANIFEST.MF index 12818e9d6..49487e87f 100644 --- a/releng/org.eclipse.escet.releng.dev.documentation/META-INF/MANIFEST.MF +++ b/releng/org.eclipse.escet.releng.dev.documentation/META-INF/MANIFEST.MF @@ -4,5 +4,4 @@ Bundle-Name: ESCET Development Documentation (Incubation) Bundle-SymbolicName: org.eclipse.escet.releng.dev.documentation;singleton:=true Bundle-Version: 0.6.0.qualifier Bundle-Vendor: Eclipse ESCET -Require-Bundle: org.eclipse.help, - org.eclipse.escet.common.asciidoc;bundle-version="0.6.0" +Require-Bundle: org.eclipse.help diff --git a/releng/org.eclipse.escet.releng.dev.documentation/pom.xml b/releng/org.eclipse.escet.releng.dev.documentation/pom.xml index 4f218406a..a71c3e6e4 100644 --- a/releng/org.eclipse.escet.releng.dev.documentation/pom.xml +++ b/releng/org.eclipse.escet.releng.dev.documentation/pom.xml @@ -44,7 +44,9 @@ process-asciidoc - ${project.build.directory}/eclipse-help-intermediate/index.html + + ${project.build.directory}/eclipse-help-intermediate/index.html + html5 coderay @@ -126,70 +128,45 @@ - org.codehaus.mojo - exec-maven-plugin - 3.0.0 - - - org.eclipse.escet.common.asciidoc.html.multipage.AsciiDocMultiPageHtmlSplitter - - true - true - + org.eclipse.escet + org.eclipse.escet.common.asciidoc + ${project.version} - eclipse-help-multi-html-split + eclipse-help-multi-page-html-split generate-resources - java + multi-page-html-split - - ${project.basedir}/asciidoc - ${project.build.directory}/eclipse-help-intermediate/index.html - ${project.build.directory}/eclipse-help - --eclipse-help - + ${project.basedir}/asciidoc + index + + ${project.build.directory}/eclipse-help-intermediate/index.html + + ${project.build.directory}/eclipse-help + ECLIPSE_HELP - website-multi-html-split + website-multi-page-html-split generate-resources - java + multi-page-html-split - - ${project.basedir}/asciidoc - ${project.build.directory}/website-intermediate/index.html - ${project.build.directory}/website - --website - Eclipse ESCETâ„¢ website - .. - + ${project.basedir}/asciidoc + index + + ${project.build.directory}/website-intermediate/index.html + + ${project.build.directory}/website + WEBSITE + Eclipse ESCETâ„¢ website + .. - - - org.eclipse.escet - org.eclipse.escet.common.asciidoc - ${project.version} - eclipse-plugin - - - org.eclipse.escet - org.eclipse.escet.common.java - ${project.version} - eclipse-plugin - - - org.eclipse.escet - org.eclipse.escet.common.app.framework - ${project.version} - eclipse-plugin - - diff --git a/releng/org.eclipse.escet.releng.project.documentation/META-INF/MANIFEST.MF b/releng/org.eclipse.escet.releng.project.documentation/META-INF/MANIFEST.MF index d4fa1d020..57102341e 100644 --- a/releng/org.eclipse.escet.releng.project.documentation/META-INF/MANIFEST.MF +++ b/releng/org.eclipse.escet.releng.project.documentation/META-INF/MANIFEST.MF @@ -4,5 +4,4 @@ Bundle-Name: ESCET Project Documentation (Incubation) Bundle-SymbolicName: org.eclipse.escet.releng.project.documentation;singleton:=true Bundle-Version: 0.6.0.qualifier Bundle-Vendor: Eclipse ESCET -Require-Bundle: org.eclipse.help, - org.eclipse.escet.common.asciidoc;bundle-version="0.6.0" +Require-Bundle: org.eclipse.help diff --git a/releng/org.eclipse.escet.releng.project.documentation/pom.xml b/releng/org.eclipse.escet.releng.project.documentation/pom.xml index fd35c6aec..b03323a62 100644 --- a/releng/org.eclipse.escet.releng.project.documentation/pom.xml +++ b/releng/org.eclipse.escet.releng.project.documentation/pom.xml @@ -128,70 +128,45 @@ - org.codehaus.mojo - exec-maven-plugin - 3.0.0 - - - org.eclipse.escet.common.asciidoc.html.multipage.AsciiDocMultiPageHtmlSplitter - - true - true - + org.eclipse.escet + org.eclipse.escet.common.asciidoc + ${project.version} - eclipse-help-multi-html-split + eclipse-help-multi-page-html-split generate-resources - java + multi-page-html-split - - ${project.basedir}/asciidoc - ${project.build.directory}/eclipse-help-intermediate/documentation.html - ${project.build.directory}/eclipse-help - --eclipse-help - + ${project.basedir}/asciidoc + documentation + + ${project.build.directory}/eclipse-help-intermediate/documentation.html + + ${project.build.directory}/eclipse-help + ECLIPSE_HELP - website-multi-html-split + website-multi-page-html-split generate-resources - java + multi-page-html-split - - ${project.basedir}/asciidoc - ${project.build.directory}/website-intermediate/documentation.html - ${project.build.directory}/website - --website - Eclipse ESCETâ„¢ website - . - + ${project.basedir}/asciidoc + documentation + + ${project.build.directory}/website-intermediate/documentation.html + + ${project.build.directory}/website + WEBSITE + Eclipse ESCETâ„¢ website + . - - - org.eclipse.escet - org.eclipse.escet.common.asciidoc - ${project.version} - eclipse-plugin - - - org.eclipse.escet - org.eclipse.escet.common.java - ${project.version} - eclipse-plugin - - - org.eclipse.escet - org.eclipse.escet.common.app.framework - ${project.version} - eclipse-plugin - - diff --git a/tooldef/org.eclipse.escet.tooldef.documentation/META-INF/MANIFEST.MF b/tooldef/org.eclipse.escet.tooldef.documentation/META-INF/MANIFEST.MF index ec6182073..9d780caed 100644 --- a/tooldef/org.eclipse.escet.tooldef.documentation/META-INF/MANIFEST.MF +++ b/tooldef/org.eclipse.escet.tooldef.documentation/META-INF/MANIFEST.MF @@ -4,5 +4,4 @@ Bundle-Name: ESCET ToolDef Documentation (Incubation) Bundle-SymbolicName: org.eclipse.escet.tooldef.documentation;singleton:=true Bundle-Version: 0.6.0.qualifier Bundle-Vendor: Eclipse ESCET -Require-Bundle: org.eclipse.help, - org.eclipse.escet.common.asciidoc;bundle-version="0.6.0" +Require-Bundle: org.eclipse.help diff --git a/tooldef/org.eclipse.escet.tooldef.documentation/pom.xml b/tooldef/org.eclipse.escet.tooldef.documentation/pom.xml index 8b1cc4b6b..f7c1a0835 100644 --- a/tooldef/org.eclipse.escet.tooldef.documentation/pom.xml +++ b/tooldef/org.eclipse.escet.tooldef.documentation/pom.xml @@ -128,70 +128,45 @@ - org.codehaus.mojo - exec-maven-plugin - 3.0.0 - - - org.eclipse.escet.common.asciidoc.html.multipage.AsciiDocMultiPageHtmlSplitter - - true - true - + org.eclipse.escet + org.eclipse.escet.common.asciidoc + ${project.version} - eclipse-help-multi-html-split + eclipse-help-multi-page-html-split generate-resources - java + multi-page-html-split - - ${project.basedir}/asciidoc - ${project.build.directory}/eclipse-help-intermediate/documentation.html - ${project.build.directory}/eclipse-help - --eclipse-help - + ${project.basedir}/asciidoc + documentation + + ${project.build.directory}/eclipse-help-intermediate/documentation.html + + ${project.build.directory}/eclipse-help + ECLIPSE_HELP - website-multi-html-split + website-multi-page-html-split generate-resources - java + multi-page-html-split - - ${project.basedir}/asciidoc - ${project.build.directory}/website-intermediate/documentation.html - ${project.build.directory}/website - --website - ToolDef website - . - + ${project.basedir}/asciidoc + documentation + + ${project.build.directory}/website-intermediate/documentation.html + + ${project.build.directory}/website + WEBSITE + ToolDef website + . - - - org.eclipse.escet - org.eclipse.escet.common.asciidoc - ${project.version} - eclipse-plugin - - - org.eclipse.escet - org.eclipse.escet.common.java - ${project.version} - eclipse-plugin - - - org.eclipse.escet - org.eclipse.escet.common.app.framework - ${project.version} - eclipse-plugin - - -- GitLab From a0b1a9eb2ecc8e238238a8b8a250b765a0fe8cd7 Mon Sep 17 00:00:00 2001 From: Dennis Hendriks Date: Sun, 10 Apr 2022 13:38:21 +0200 Subject: [PATCH 06/15] #332 Fix Checkstyle only checking in source folders. --- chi/org.eclipse.escet.chi.codegen/.checkstyle | 16 +++++++++++++--- .../.checkstyle | 16 +++++++++++++--- .../.checkstyle | 16 +++++++++++++--- .../.checkstyle | 16 +++++++++++++--- chi/org.eclipse.escet.chi.parser/.checkstyle | 16 +++++++++++++--- chi/org.eclipse.escet.chi.runtime/.checkstyle | 16 +++++++++++++--- .../.checkstyle | 16 +++++++++++++--- chi/org.eclipse.escet.chi.simulator/.checkstyle | 16 +++++++++++++--- chi/org.eclipse.escet.chi.tests/.checkstyle | 16 +++++++++++++--- chi/org.eclipse.escet.chi.texteditor/.checkstyle | 16 +++++++++++++--- chi/org.eclipse.escet.chi.tooldefs/.checkstyle | 16 +++++++++++++--- chi/org.eclipse.escet.chi.typecheck/.checkstyle | 16 +++++++++++++--- .../.checkstyle | 16 +++++++++++++--- cif/org.eclipse.escet.cif.cif2cif/.checkstyle | 16 +++++++++++++--- cif/org.eclipse.escet.cif.cif2mcrl2/.checkstyle | 16 +++++++++++++--- cif/org.eclipse.escet.cif.cif2plc/.checkstyle | 16 +++++++++++++--- .../.checkstyle | 16 +++++++++++++--- cif/org.eclipse.escet.cif.cif2uppaal/.checkstyle | 16 +++++++++++++--- cif/org.eclipse.escet.cif.cif2yed/.checkstyle | 16 +++++++++++++--- cif/org.eclipse.escet.cif.codegen/.checkstyle | 16 +++++++++++++--- cif/org.eclipse.escet.cif.common/.checkstyle | 16 +++++++++++++--- .../.checkstyle | 16 +++++++++++++--- cif/org.eclipse.escet.cif.datasynth/.checkstyle | 16 +++++++++++++--- .../.checkstyle | 16 +++++++++++++--- .../.checkstyle | 16 +++++++++++++--- cif/org.eclipse.escet.cif.eventbased/.checkstyle | 16 +++++++++++++--- .../.checkstyle | 16 +++++++++++++--- cif/org.eclipse.escet.cif.examples/.checkstyle | 16 +++++++++++++--- cif/org.eclipse.escet.cif.explorer/.checkstyle | 16 +++++++++++++--- cif/org.eclipse.escet.cif.io/.checkstyle | 16 +++++++++++++--- cif/org.eclipse.escet.cif.merger/.checkstyle | 16 +++++++++++++--- .../.checkstyle | 16 +++++++++++++--- cif/org.eclipse.escet.cif.parser/.checkstyle | 16 +++++++++++++--- .../.checkstyle | 16 +++++++++++++--- cif/org.eclipse.escet.cif.simulator/.checkstyle | 16 +++++++++++++--- .../.checkstyle | 16 +++++++++++++--- cif/org.eclipse.escet.cif.tests/.checkstyle | 16 +++++++++++++--- cif/org.eclipse.escet.cif.texteditor/.checkstyle | 16 +++++++++++++--- cif/org.eclipse.escet.cif.tooldefs/.checkstyle | 16 +++++++++++++--- .../.checkstyle | 16 +++++++++++++--- .../.checkstyle | 16 +++++++++++++--- .../.checkstyle | 16 +++++++++++++--- .../.checkstyle | 16 +++++++++++++--- common/org.eclipse.escet.common.box/.checkstyle | 16 +++++++++++++--- .../.checkstyle | 16 +++++++++++++--- .../.checkstyle | 16 +++++++++++++--- .../.checkstyle | 16 +++++++++++++--- .../.checkstyle | 16 +++++++++++++--- .../.checkstyle | 16 +++++++++++++--- common/org.eclipse.escet.common.emf/.checkstyle | 16 +++++++++++++--- common/org.eclipse.escet.common.java/.checkstyle | 16 +++++++++++++--- .../.checkstyle | 16 +++++++++++++--- .../.checkstyle | 16 +++++++++++++--- .../.checkstyle | 16 +++++++++++++--- common/org.eclipse.escet.common.svg/.checkstyle | 16 +++++++++++++--- .../.checkstyle | 16 +++++++++++++--- misc/java-code-style/.checkstyle | 16 +++++++++++++--- .../.checkstyle | 16 +++++++++++++--- .../.checkstyle | 16 +++++++++++++--- .../.checkstyle | 16 +++++++++++++--- .../.checkstyle | 16 +++++++++++++--- setext/org.eclipse.escet.setext.io/.checkstyle | 16 +++++++++++++--- .../org.eclipse.escet.setext.parser/.checkstyle | 16 +++++++++++++--- .../org.eclipse.escet.setext.runtime/.checkstyle | 16 +++++++++++++--- .../org.eclipse.escet.setext.tests/.checkstyle | 16 +++++++++++++--- .../.checkstyle | 16 +++++++++++++--- .../.checkstyle | 16 +++++++++++++--- .../.checkstyle | 16 +++++++++++++--- .../org.eclipse.escet.tooldef.common/.checkstyle | 16 +++++++++++++--- .../.checkstyle | 16 +++++++++++++--- .../.checkstyle | 16 +++++++++++++--- tooldef/org.eclipse.escet.tooldef.io/.checkstyle | 16 +++++++++++++--- .../.checkstyle | 16 +++++++++++++--- .../org.eclipse.escet.tooldef.parser/.checkstyle | 16 +++++++++++++--- .../.checkstyle | 16 +++++++++++++--- .../org.eclipse.escet.tooldef.tests/.checkstyle | 16 +++++++++++++--- .../.checkstyle | 16 +++++++++++++--- .../.checkstyle | 16 +++++++++++++--- 78 files changed, 1014 insertions(+), 234 deletions(-) diff --git a/chi/org.eclipse.escet.chi.codegen/.checkstyle b/chi/org.eclipse.escet.chi.codegen/.checkstyle index b32669f65..182fbba60 100644 --- a/chi/org.eclipse.escet.chi.codegen/.checkstyle +++ b/chi/org.eclipse.escet.chi.codegen/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/chi/org.eclipse.escet.chi.documentation.utils/.checkstyle b/chi/org.eclipse.escet.chi.documentation.utils/.checkstyle index b32669f65..182fbba60 100644 --- a/chi/org.eclipse.escet.chi.documentation.utils/.checkstyle +++ b/chi/org.eclipse.escet.chi.documentation.utils/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/chi/org.eclipse.escet.chi.documentation/.checkstyle b/chi/org.eclipse.escet.chi.documentation/.checkstyle index b32669f65..182fbba60 100644 --- a/chi/org.eclipse.escet.chi.documentation/.checkstyle +++ b/chi/org.eclipse.escet.chi.documentation/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/chi/org.eclipse.escet.chi.metamodel.java/.checkstyle b/chi/org.eclipse.escet.chi.metamodel.java/.checkstyle index b32669f65..182fbba60 100644 --- a/chi/org.eclipse.escet.chi.metamodel.java/.checkstyle +++ b/chi/org.eclipse.escet.chi.metamodel.java/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/chi/org.eclipse.escet.chi.parser/.checkstyle b/chi/org.eclipse.escet.chi.parser/.checkstyle index b32669f65..182fbba60 100644 --- a/chi/org.eclipse.escet.chi.parser/.checkstyle +++ b/chi/org.eclipse.escet.chi.parser/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/chi/org.eclipse.escet.chi.runtime/.checkstyle b/chi/org.eclipse.escet.chi.runtime/.checkstyle index b32669f65..182fbba60 100644 --- a/chi/org.eclipse.escet.chi.runtime/.checkstyle +++ b/chi/org.eclipse.escet.chi.runtime/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/chi/org.eclipse.escet.chi.simulator.ui/.checkstyle b/chi/org.eclipse.escet.chi.simulator.ui/.checkstyle index b32669f65..182fbba60 100644 --- a/chi/org.eclipse.escet.chi.simulator.ui/.checkstyle +++ b/chi/org.eclipse.escet.chi.simulator.ui/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/chi/org.eclipse.escet.chi.simulator/.checkstyle b/chi/org.eclipse.escet.chi.simulator/.checkstyle index b32669f65..182fbba60 100644 --- a/chi/org.eclipse.escet.chi.simulator/.checkstyle +++ b/chi/org.eclipse.escet.chi.simulator/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/chi/org.eclipse.escet.chi.tests/.checkstyle b/chi/org.eclipse.escet.chi.tests/.checkstyle index b32669f65..182fbba60 100644 --- a/chi/org.eclipse.escet.chi.tests/.checkstyle +++ b/chi/org.eclipse.escet.chi.tests/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/chi/org.eclipse.escet.chi.texteditor/.checkstyle b/chi/org.eclipse.escet.chi.texteditor/.checkstyle index b32669f65..182fbba60 100644 --- a/chi/org.eclipse.escet.chi.texteditor/.checkstyle +++ b/chi/org.eclipse.escet.chi.texteditor/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/chi/org.eclipse.escet.chi.tooldefs/.checkstyle b/chi/org.eclipse.escet.chi.tooldefs/.checkstyle index b32669f65..182fbba60 100644 --- a/chi/org.eclipse.escet.chi.tooldefs/.checkstyle +++ b/chi/org.eclipse.escet.chi.tooldefs/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/chi/org.eclipse.escet.chi.typecheck/.checkstyle b/chi/org.eclipse.escet.chi.typecheck/.checkstyle index b32669f65..182fbba60 100644 --- a/chi/org.eclipse.escet.chi.typecheck/.checkstyle +++ b/chi/org.eclipse.escet.chi.typecheck/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/cif/org.eclipse.escet.cif.cif2cif.app/.checkstyle b/cif/org.eclipse.escet.cif.cif2cif.app/.checkstyle index b32669f65..182fbba60 100644 --- a/cif/org.eclipse.escet.cif.cif2cif.app/.checkstyle +++ b/cif/org.eclipse.escet.cif.cif2cif.app/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/cif/org.eclipse.escet.cif.cif2cif/.checkstyle b/cif/org.eclipse.escet.cif.cif2cif/.checkstyle index b32669f65..182fbba60 100644 --- a/cif/org.eclipse.escet.cif.cif2cif/.checkstyle +++ b/cif/org.eclipse.escet.cif.cif2cif/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/cif/org.eclipse.escet.cif.cif2mcrl2/.checkstyle b/cif/org.eclipse.escet.cif.cif2mcrl2/.checkstyle index b32669f65..182fbba60 100644 --- a/cif/org.eclipse.escet.cif.cif2mcrl2/.checkstyle +++ b/cif/org.eclipse.escet.cif.cif2mcrl2/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/cif/org.eclipse.escet.cif.cif2plc/.checkstyle b/cif/org.eclipse.escet.cif.cif2plc/.checkstyle index b32669f65..182fbba60 100644 --- a/cif/org.eclipse.escet.cif.cif2plc/.checkstyle +++ b/cif/org.eclipse.escet.cif.cif2plc/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/cif/org.eclipse.escet.cif.cif2supremica/.checkstyle b/cif/org.eclipse.escet.cif.cif2supremica/.checkstyle index b32669f65..182fbba60 100644 --- a/cif/org.eclipse.escet.cif.cif2supremica/.checkstyle +++ b/cif/org.eclipse.escet.cif.cif2supremica/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/cif/org.eclipse.escet.cif.cif2uppaal/.checkstyle b/cif/org.eclipse.escet.cif.cif2uppaal/.checkstyle index b32669f65..182fbba60 100644 --- a/cif/org.eclipse.escet.cif.cif2uppaal/.checkstyle +++ b/cif/org.eclipse.escet.cif.cif2uppaal/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/cif/org.eclipse.escet.cif.cif2yed/.checkstyle b/cif/org.eclipse.escet.cif.cif2yed/.checkstyle index b32669f65..182fbba60 100644 --- a/cif/org.eclipse.escet.cif.cif2yed/.checkstyle +++ b/cif/org.eclipse.escet.cif.cif2yed/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/cif/org.eclipse.escet.cif.codegen/.checkstyle b/cif/org.eclipse.escet.cif.codegen/.checkstyle index b32669f65..182fbba60 100644 --- a/cif/org.eclipse.escet.cif.codegen/.checkstyle +++ b/cif/org.eclipse.escet.cif.codegen/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/cif/org.eclipse.escet.cif.common/.checkstyle b/cif/org.eclipse.escet.cif.common/.checkstyle index b32669f65..182fbba60 100644 --- a/cif/org.eclipse.escet.cif.common/.checkstyle +++ b/cif/org.eclipse.escet.cif.common/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/cif/org.eclipse.escet.cif.controllercheck/.checkstyle b/cif/org.eclipse.escet.cif.controllercheck/.checkstyle index b32669f65..182fbba60 100644 --- a/cif/org.eclipse.escet.cif.controllercheck/.checkstyle +++ b/cif/org.eclipse.escet.cif.controllercheck/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/cif/org.eclipse.escet.cif.datasynth/.checkstyle b/cif/org.eclipse.escet.cif.datasynth/.checkstyle index b32669f65..182fbba60 100644 --- a/cif/org.eclipse.escet.cif.datasynth/.checkstyle +++ b/cif/org.eclipse.escet.cif.datasynth/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/cif/org.eclipse.escet.cif.documentation.utils/.checkstyle b/cif/org.eclipse.escet.cif.documentation.utils/.checkstyle index b32669f65..182fbba60 100644 --- a/cif/org.eclipse.escet.cif.documentation.utils/.checkstyle +++ b/cif/org.eclipse.escet.cif.documentation.utils/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/cif/org.eclipse.escet.cif.documentation/.checkstyle b/cif/org.eclipse.escet.cif.documentation/.checkstyle index b32669f65..182fbba60 100644 --- a/cif/org.eclipse.escet.cif.documentation/.checkstyle +++ b/cif/org.eclipse.escet.cif.documentation/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/cif/org.eclipse.escet.cif.eventbased/.checkstyle b/cif/org.eclipse.escet.cif.eventbased/.checkstyle index b32669f65..182fbba60 100644 --- a/cif/org.eclipse.escet.cif.eventbased/.checkstyle +++ b/cif/org.eclipse.escet.cif.eventbased/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/cif/org.eclipse.escet.cif.eventdisabler/.checkstyle b/cif/org.eclipse.escet.cif.eventdisabler/.checkstyle index b32669f65..182fbba60 100644 --- a/cif/org.eclipse.escet.cif.eventdisabler/.checkstyle +++ b/cif/org.eclipse.escet.cif.eventdisabler/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/cif/org.eclipse.escet.cif.examples/.checkstyle b/cif/org.eclipse.escet.cif.examples/.checkstyle index b32669f65..182fbba60 100644 --- a/cif/org.eclipse.escet.cif.examples/.checkstyle +++ b/cif/org.eclipse.escet.cif.examples/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/cif/org.eclipse.escet.cif.explorer/.checkstyle b/cif/org.eclipse.escet.cif.explorer/.checkstyle index b32669f65..182fbba60 100644 --- a/cif/org.eclipse.escet.cif.explorer/.checkstyle +++ b/cif/org.eclipse.escet.cif.explorer/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/cif/org.eclipse.escet.cif.io/.checkstyle b/cif/org.eclipse.escet.cif.io/.checkstyle index b32669f65..182fbba60 100644 --- a/cif/org.eclipse.escet.cif.io/.checkstyle +++ b/cif/org.eclipse.escet.cif.io/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/cif/org.eclipse.escet.cif.merger/.checkstyle b/cif/org.eclipse.escet.cif.merger/.checkstyle index b32669f65..182fbba60 100644 --- a/cif/org.eclipse.escet.cif.merger/.checkstyle +++ b/cif/org.eclipse.escet.cif.merger/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/cif/org.eclipse.escet.cif.metamodel.java/.checkstyle b/cif/org.eclipse.escet.cif.metamodel.java/.checkstyle index b32669f65..182fbba60 100644 --- a/cif/org.eclipse.escet.cif.metamodel.java/.checkstyle +++ b/cif/org.eclipse.escet.cif.metamodel.java/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/cif/org.eclipse.escet.cif.parser/.checkstyle b/cif/org.eclipse.escet.cif.parser/.checkstyle index b32669f65..182fbba60 100644 --- a/cif/org.eclipse.escet.cif.parser/.checkstyle +++ b/cif/org.eclipse.escet.cif.parser/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/cif/org.eclipse.escet.cif.prettyprinter/.checkstyle b/cif/org.eclipse.escet.cif.prettyprinter/.checkstyle index b32669f65..182fbba60 100644 --- a/cif/org.eclipse.escet.cif.prettyprinter/.checkstyle +++ b/cif/org.eclipse.escet.cif.prettyprinter/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/cif/org.eclipse.escet.cif.simulator/.checkstyle b/cif/org.eclipse.escet.cif.simulator/.checkstyle index b32669f65..182fbba60 100644 --- a/cif/org.eclipse.escet.cif.simulator/.checkstyle +++ b/cif/org.eclipse.escet.cif.simulator/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/cif/org.eclipse.escet.cif.tests.utils/.checkstyle b/cif/org.eclipse.escet.cif.tests.utils/.checkstyle index b32669f65..182fbba60 100644 --- a/cif/org.eclipse.escet.cif.tests.utils/.checkstyle +++ b/cif/org.eclipse.escet.cif.tests.utils/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/cif/org.eclipse.escet.cif.tests/.checkstyle b/cif/org.eclipse.escet.cif.tests/.checkstyle index b32669f65..182fbba60 100644 --- a/cif/org.eclipse.escet.cif.tests/.checkstyle +++ b/cif/org.eclipse.escet.cif.tests/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/cif/org.eclipse.escet.cif.texteditor/.checkstyle b/cif/org.eclipse.escet.cif.texteditor/.checkstyle index b32669f65..182fbba60 100644 --- a/cif/org.eclipse.escet.cif.texteditor/.checkstyle +++ b/cif/org.eclipse.escet.cif.texteditor/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/cif/org.eclipse.escet.cif.tooldefs/.checkstyle b/cif/org.eclipse.escet.cif.tooldefs/.checkstyle index b32669f65..182fbba60 100644 --- a/cif/org.eclipse.escet.cif.tooldefs/.checkstyle +++ b/cif/org.eclipse.escet.cif.tooldefs/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/cif/org.eclipse.escet.cif.typechecker/.checkstyle b/cif/org.eclipse.escet.cif.typechecker/.checkstyle index b32669f65..182fbba60 100644 --- a/cif/org.eclipse.escet.cif.typechecker/.checkstyle +++ b/cif/org.eclipse.escet.cif.typechecker/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/common/org.eclipse.escet.common.app.framework.appsview.ui/.checkstyle b/common/org.eclipse.escet.common.app.framework.appsview.ui/.checkstyle index b32669f65..182fbba60 100644 --- a/common/org.eclipse.escet.common.app.framework.appsview.ui/.checkstyle +++ b/common/org.eclipse.escet.common.app.framework.appsview.ui/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/common/org.eclipse.escet.common.app.framework/.checkstyle b/common/org.eclipse.escet.common.app.framework/.checkstyle index b32669f65..182fbba60 100644 --- a/common/org.eclipse.escet.common.app.framework/.checkstyle +++ b/common/org.eclipse.escet.common.app.framework/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/common/org.eclipse.escet.common.asciidoc/.checkstyle b/common/org.eclipse.escet.common.asciidoc/.checkstyle index b32669f65..182fbba60 100644 --- a/common/org.eclipse.escet.common.asciidoc/.checkstyle +++ b/common/org.eclipse.escet.common.asciidoc/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/common/org.eclipse.escet.common.box/.checkstyle b/common/org.eclipse.escet.common.box/.checkstyle index b32669f65..182fbba60 100644 --- a/common/org.eclipse.escet.common.box/.checkstyle +++ b/common/org.eclipse.escet.common.box/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/common/org.eclipse.escet.common.eclipse.ui/.checkstyle b/common/org.eclipse.escet.common.eclipse.ui/.checkstyle index b32669f65..182fbba60 100644 --- a/common/org.eclipse.escet.common.eclipse.ui/.checkstyle +++ b/common/org.eclipse.escet.common.eclipse.ui/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/common/org.eclipse.escet.common.emf.ecore.codegen/.checkstyle b/common/org.eclipse.escet.common.emf.ecore.codegen/.checkstyle index b32669f65..182fbba60 100644 --- a/common/org.eclipse.escet.common.emf.ecore.codegen/.checkstyle +++ b/common/org.eclipse.escet.common.emf.ecore.codegen/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/common/org.eclipse.escet.common.emf.ecore.validation/.checkstyle b/common/org.eclipse.escet.common.emf.ecore.validation/.checkstyle index b32669f65..182fbba60 100644 --- a/common/org.eclipse.escet.common.emf.ecore.validation/.checkstyle +++ b/common/org.eclipse.escet.common.emf.ecore.validation/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/common/org.eclipse.escet.common.emf.ecore.xmi/.checkstyle b/common/org.eclipse.escet.common.emf.ecore.xmi/.checkstyle index b32669f65..182fbba60 100644 --- a/common/org.eclipse.escet.common.emf.ecore.xmi/.checkstyle +++ b/common/org.eclipse.escet.common.emf.ecore.xmi/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/common/org.eclipse.escet.common.emf.tests/.checkstyle b/common/org.eclipse.escet.common.emf.tests/.checkstyle index b32669f65..182fbba60 100644 --- a/common/org.eclipse.escet.common.emf.tests/.checkstyle +++ b/common/org.eclipse.escet.common.emf.tests/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/common/org.eclipse.escet.common.emf/.checkstyle b/common/org.eclipse.escet.common.emf/.checkstyle index b32669f65..182fbba60 100644 --- a/common/org.eclipse.escet.common.emf/.checkstyle +++ b/common/org.eclipse.escet.common.emf/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/common/org.eclipse.escet.common.java/.checkstyle b/common/org.eclipse.escet.common.java/.checkstyle index b32669f65..182fbba60 100644 --- a/common/org.eclipse.escet.common.java/.checkstyle +++ b/common/org.eclipse.escet.common.java/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/common/org.eclipse.escet.common.multivaluetrees/.checkstyle b/common/org.eclipse.escet.common.multivaluetrees/.checkstyle index b32669f65..182fbba60 100644 --- a/common/org.eclipse.escet.common.multivaluetrees/.checkstyle +++ b/common/org.eclipse.escet.common.multivaluetrees/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/common/org.eclipse.escet.common.position.common/.checkstyle b/common/org.eclipse.escet.common.position.common/.checkstyle index b32669f65..182fbba60 100644 --- a/common/org.eclipse.escet.common.position.common/.checkstyle +++ b/common/org.eclipse.escet.common.position.common/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/common/org.eclipse.escet.common.raildiagrams/.checkstyle b/common/org.eclipse.escet.common.raildiagrams/.checkstyle index b32669f65..182fbba60 100644 --- a/common/org.eclipse.escet.common.raildiagrams/.checkstyle +++ b/common/org.eclipse.escet.common.raildiagrams/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/common/org.eclipse.escet.common.svg/.checkstyle b/common/org.eclipse.escet.common.svg/.checkstyle index b32669f65..182fbba60 100644 --- a/common/org.eclipse.escet.common.svg/.checkstyle +++ b/common/org.eclipse.escet.common.svg/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/common/org.eclipse.escet.common.typechecker/.checkstyle b/common/org.eclipse.escet.common.typechecker/.checkstyle index b32669f65..182fbba60 100644 --- a/common/org.eclipse.escet.common.typechecker/.checkstyle +++ b/common/org.eclipse.escet.common.typechecker/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/misc/java-code-style/.checkstyle b/misc/java-code-style/.checkstyle index b32669f65..182fbba60 100644 --- a/misc/java-code-style/.checkstyle +++ b/misc/java-code-style/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/product/org.eclipse.escet.product.perspective/.checkstyle b/product/org.eclipse.escet.product.perspective/.checkstyle index b32669f65..182fbba60 100644 --- a/product/org.eclipse.escet.product.perspective/.checkstyle +++ b/product/org.eclipse.escet.product.perspective/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/releng/org.eclipse.escet.releng.dev.documentation/.checkstyle b/releng/org.eclipse.escet.releng.dev.documentation/.checkstyle index b32669f65..182fbba60 100644 --- a/releng/org.eclipse.escet.releng.dev.documentation/.checkstyle +++ b/releng/org.eclipse.escet.releng.dev.documentation/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/releng/org.eclipse.escet.releng.project.documentation/.checkstyle b/releng/org.eclipse.escet.releng.project.documentation/.checkstyle index b32669f65..182fbba60 100644 --- a/releng/org.eclipse.escet.releng.project.documentation/.checkstyle +++ b/releng/org.eclipse.escet.releng.project.documentation/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/setext/org.eclipse.escet.setext.generator/.checkstyle b/setext/org.eclipse.escet.setext.generator/.checkstyle index b32669f65..182fbba60 100644 --- a/setext/org.eclipse.escet.setext.generator/.checkstyle +++ b/setext/org.eclipse.escet.setext.generator/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/setext/org.eclipse.escet.setext.io/.checkstyle b/setext/org.eclipse.escet.setext.io/.checkstyle index b32669f65..182fbba60 100644 --- a/setext/org.eclipse.escet.setext.io/.checkstyle +++ b/setext/org.eclipse.escet.setext.io/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/setext/org.eclipse.escet.setext.parser/.checkstyle b/setext/org.eclipse.escet.setext.parser/.checkstyle index b32669f65..182fbba60 100644 --- a/setext/org.eclipse.escet.setext.parser/.checkstyle +++ b/setext/org.eclipse.escet.setext.parser/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/setext/org.eclipse.escet.setext.runtime/.checkstyle b/setext/org.eclipse.escet.setext.runtime/.checkstyle index b32669f65..182fbba60 100644 --- a/setext/org.eclipse.escet.setext.runtime/.checkstyle +++ b/setext/org.eclipse.escet.setext.runtime/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/setext/org.eclipse.escet.setext.tests/.checkstyle b/setext/org.eclipse.escet.setext.tests/.checkstyle index b32669f65..182fbba60 100644 --- a/setext/org.eclipse.escet.setext.tests/.checkstyle +++ b/setext/org.eclipse.escet.setext.tests/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/setext/org.eclipse.escet.setext.texteditor/.checkstyle b/setext/org.eclipse.escet.setext.texteditor/.checkstyle index b32669f65..182fbba60 100644 --- a/setext/org.eclipse.escet.setext.texteditor/.checkstyle +++ b/setext/org.eclipse.escet.setext.texteditor/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/setext/org.eclipse.escet.setext.texteditorbase/.checkstyle b/setext/org.eclipse.escet.setext.texteditorbase/.checkstyle index b32669f65..182fbba60 100644 --- a/setext/org.eclipse.escet.setext.texteditorbase/.checkstyle +++ b/setext/org.eclipse.escet.setext.texteditorbase/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/setext/org.eclipse.escet.setext.typechecker/.checkstyle b/setext/org.eclipse.escet.setext.typechecker/.checkstyle index b32669f65..182fbba60 100644 --- a/setext/org.eclipse.escet.setext.typechecker/.checkstyle +++ b/setext/org.eclipse.escet.setext.typechecker/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/tooldef/org.eclipse.escet.tooldef.common/.checkstyle b/tooldef/org.eclipse.escet.tooldef.common/.checkstyle index b32669f65..182fbba60 100644 --- a/tooldef/org.eclipse.escet.tooldef.common/.checkstyle +++ b/tooldef/org.eclipse.escet.tooldef.common/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/tooldef/org.eclipse.escet.tooldef.documentation/.checkstyle b/tooldef/org.eclipse.escet.tooldef.documentation/.checkstyle index b32669f65..182fbba60 100644 --- a/tooldef/org.eclipse.escet.tooldef.documentation/.checkstyle +++ b/tooldef/org.eclipse.escet.tooldef.documentation/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/tooldef/org.eclipse.escet.tooldef.interpreter/.checkstyle b/tooldef/org.eclipse.escet.tooldef.interpreter/.checkstyle index b32669f65..182fbba60 100644 --- a/tooldef/org.eclipse.escet.tooldef.interpreter/.checkstyle +++ b/tooldef/org.eclipse.escet.tooldef.interpreter/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/tooldef/org.eclipse.escet.tooldef.io/.checkstyle b/tooldef/org.eclipse.escet.tooldef.io/.checkstyle index b32669f65..182fbba60 100644 --- a/tooldef/org.eclipse.escet.tooldef.io/.checkstyle +++ b/tooldef/org.eclipse.escet.tooldef.io/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/tooldef/org.eclipse.escet.tooldef.metamodel.java/.checkstyle b/tooldef/org.eclipse.escet.tooldef.metamodel.java/.checkstyle index b32669f65..182fbba60 100644 --- a/tooldef/org.eclipse.escet.tooldef.metamodel.java/.checkstyle +++ b/tooldef/org.eclipse.escet.tooldef.metamodel.java/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/tooldef/org.eclipse.escet.tooldef.parser/.checkstyle b/tooldef/org.eclipse.escet.tooldef.parser/.checkstyle index b32669f65..182fbba60 100644 --- a/tooldef/org.eclipse.escet.tooldef.parser/.checkstyle +++ b/tooldef/org.eclipse.escet.tooldef.parser/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/tooldef/org.eclipse.escet.tooldef.runtime/.checkstyle b/tooldef/org.eclipse.escet.tooldef.runtime/.checkstyle index b32669f65..182fbba60 100644 --- a/tooldef/org.eclipse.escet.tooldef.runtime/.checkstyle +++ b/tooldef/org.eclipse.escet.tooldef.runtime/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/tooldef/org.eclipse.escet.tooldef.tests/.checkstyle b/tooldef/org.eclipse.escet.tooldef.tests/.checkstyle index b32669f65..182fbba60 100644 --- a/tooldef/org.eclipse.escet.tooldef.tests/.checkstyle +++ b/tooldef/org.eclipse.escet.tooldef.tests/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/tooldef/org.eclipse.escet.tooldef.texteditor/.checkstyle b/tooldef/org.eclipse.escet.tooldef.texteditor/.checkstyle index b32669f65..182fbba60 100644 --- a/tooldef/org.eclipse.escet.tooldef.texteditor/.checkstyle +++ b/tooldef/org.eclipse.escet.tooldef.texteditor/.checkstyle @@ -1,11 +1,21 @@ - - + + - + diff --git a/tooldef/org.eclipse.escet.tooldef.typechecker/.checkstyle b/tooldef/org.eclipse.escet.tooldef.typechecker/.checkstyle index b32669f65..182fbba60 100644 --- a/tooldef/org.eclipse.escet.tooldef.typechecker/.checkstyle +++ b/tooldef/org.eclipse.escet.tooldef.typechecker/.checkstyle @@ -1,11 +1,21 @@ - - + + - + -- GitLab From f76cfdbceb4960b53b1cb9eca0dc80913f8f3d7d Mon Sep 17 00:00:00 2001 From: Dennis Hendriks Date: Sun, 10 Apr 2022 13:49:22 +0200 Subject: [PATCH 07/15] #332 Exception for application framework JDT settings no longer needed. --- .../.settings/org.eclipse.jdt.core.prefs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/org.eclipse.escet.common.app.framework/.settings/org.eclipse.jdt.core.prefs b/common/org.eclipse.escet.common.app.framework/.settings/org.eclipse.jdt.core.prefs index e2740fbf8..d3f38fcff 100644 --- a/common/org.eclipse.escet.common.app.framework/.settings/org.eclipse.jdt.core.prefs +++ b/common/org.eclipse.escet.common.app.framework/.settings/org.eclipse.jdt.core.prefs @@ -48,7 +48,7 @@ org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled org.eclipse.jdt.core.compiler.problem.fieldHiding=warning org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning -org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.problem.forbiddenReference=error org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning -- GitLab From 56c2cf2c1f5dd2c9853f32c7513025d2af3bbc4c Mon Sep 17 00:00:00 2001 From: Dennis Hendriks Date: Sun, 10 Apr 2022 14:49:49 +0200 Subject: [PATCH 08/15] #332 Build fix for Maven launch configurations. --- build-docs.launch | 3 +++ build.launch | 3 +++ chi/org.eclipse.escet.chi.documentation/build-docs-chi.launch | 3 +++ cif/org.eclipse.escet.cif.documentation/build-docs-cif.launch | 3 +++ .../build-docs-escet-dev.launch | 3 +++ .../build-docs-escet-project.launch | 3 +++ .../build-docs-tooldef.launch | 3 +++ 7 files changed, 21 insertions(+) diff --git a/build-docs.launch b/build-docs.launch index 21dbcc858..e968d2173 100644 --- a/build-docs.launch +++ b/build-docs.launch @@ -16,6 +16,9 @@ + + + diff --git a/build.launch b/build.launch index e41d8f57b..faeb10f95 100644 --- a/build.launch +++ b/build.launch @@ -15,6 +15,9 @@ + + + diff --git a/chi/org.eclipse.escet.chi.documentation/build-docs-chi.launch b/chi/org.eclipse.escet.chi.documentation/build-docs-chi.launch index 71910ef33..a2318ea11 100644 --- a/chi/org.eclipse.escet.chi.documentation/build-docs-chi.launch +++ b/chi/org.eclipse.escet.chi.documentation/build-docs-chi.launch @@ -16,6 +16,9 @@ + + + diff --git a/cif/org.eclipse.escet.cif.documentation/build-docs-cif.launch b/cif/org.eclipse.escet.cif.documentation/build-docs-cif.launch index ba1f7be4a..4fc0f8162 100644 --- a/cif/org.eclipse.escet.cif.documentation/build-docs-cif.launch +++ b/cif/org.eclipse.escet.cif.documentation/build-docs-cif.launch @@ -16,6 +16,9 @@ + + + diff --git a/releng/org.eclipse.escet.releng.dev.documentation/build-docs-escet-dev.launch b/releng/org.eclipse.escet.releng.dev.documentation/build-docs-escet-dev.launch index a4e42f2bd..fc618eeae 100644 --- a/releng/org.eclipse.escet.releng.dev.documentation/build-docs-escet-dev.launch +++ b/releng/org.eclipse.escet.releng.dev.documentation/build-docs-escet-dev.launch @@ -16,6 +16,9 @@ + + + diff --git a/releng/org.eclipse.escet.releng.project.documentation/build-docs-escet-project.launch b/releng/org.eclipse.escet.releng.project.documentation/build-docs-escet-project.launch index e376a5194..a890f9f1a 100644 --- a/releng/org.eclipse.escet.releng.project.documentation/build-docs-escet-project.launch +++ b/releng/org.eclipse.escet.releng.project.documentation/build-docs-escet-project.launch @@ -16,6 +16,9 @@ + + + diff --git a/tooldef/org.eclipse.escet.tooldef.documentation/build-docs-tooldef.launch b/tooldef/org.eclipse.escet.tooldef.documentation/build-docs-tooldef.launch index fe3c3df99..e9b541a1c 100644 --- a/tooldef/org.eclipse.escet.tooldef.documentation/build-docs-tooldef.launch +++ b/tooldef/org.eclipse.escet.tooldef.documentation/build-docs-tooldef.launch @@ -16,6 +16,9 @@ + + + -- GitLab From 0fc9af1dd273536bfa1bb9b74f501a2fdb3c3571 Mon Sep 17 00:00:00 2001 From: Dennis Hendriks Date: Sun, 10 Apr 2022 14:51:02 +0200 Subject: [PATCH 09/15] #332 Eclipse/Java upgrade instruction additions. --- .../asciidoc/development/dependency-upgrades.asciidoc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/releng/org.eclipse.escet.releng.dev.documentation/asciidoc/development/dependency-upgrades.asciidoc b/releng/org.eclipse.escet.releng.dev.documentation/asciidoc/development/dependency-upgrades.asciidoc index 230b71056..6d5de20bf 100644 --- a/releng/org.eclipse.escet.releng.dev.documentation/asciidoc/development/dependency-upgrades.asciidoc +++ b/releng/org.eclipse.escet.releng.dev.documentation/asciidoc/development/dependency-upgrades.asciidoc @@ -48,6 +48,7 @@ To upgrade to a new Eclipse Platform/IDE version: ** Update `org.eclipse.platform` version for the product feature (`org.eclipse.escet.product.feature/feature.xml`). ** Update Eclipse and Orbit update site URLs in product (`org.eclipse.escet.product/escet.product`). ** Update Eclipse and Orbit update site URLs in update site (`org.eclipse.escet.product/category.xml`). +** Update Maven plugin third party dependency versions to match Orbit versions (`org.eclipse.escet.common.asciidoc/pom.xml`). * Update target platform and address any issues ** Let Oomph regenerate the target platform, and commit any changes. @@ -87,6 +88,8 @@ To upgrade to a new Eclipse Platform/IDE version: ** Check the embedded Maven version, by navigating to menu:Run[Run Configurations...], selecting the _build_ launch configuration under _Maven Build_, and observing the _Maven Runtime_ version. ** Ensure the Maven version in `Jenkinsfile` matches the embedded Maven version. ** Ensure the Maven version in `misc/license-check-dependencies/Jenkinsfile` matches the embedded Maven version. +** Update versions of Maven plugins (`maven-plugin-*`) to match new Maven version (`org.eclipse.escet.common.asciidoc/pom.xml`). +** Update version of the `maven-plugin-plugin` if needed (`org.eclipse.escet.releng.configuration/pom.xml`). * Validation ** Run a <>. @@ -137,6 +140,7 @@ To upgrade to a new Java version: ** Update `JRE_CONTAINER` in all launch configurations (`.launch` files). ** Update Java versions in `org.eclipse.jdt.core.prefs` files. ** Update `osgi.requiredJavaVersion` in the product (`org.eclipse.escet.product/escet.product`). +** Update Java version for `maven.compiler.source` and `maven.compiler.target` in `org.eclipse.escet.releng.configuration/pom.xml`. ** Update Java version for `executionEnvironment` in `org.eclipse.escet.releng.configuration/pom.xml`. ** Update Java version in `Jenkinsfile`. ** Update Java version in `misc/license-check-dependencies/Jenkinsfile`. -- GitLab From 0ca511407bf9bf0bf28f04ed00adbc4516ef0d2f Mon Sep 17 00:00:00 2001 From: Dennis Hendriks Date: Sun, 10 Apr 2022 14:52:38 +0200 Subject: [PATCH 10/15] #332 Multi-page HTML splitter regression fix + info about skipped files. --- .../html/multipage/AsciiDocHtmlModifier.java | 15 ++++++++++++++- .../multipage/AsciiDocMultiPageHtmlSplitter.java | 5 +++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocHtmlModifier.java b/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocHtmlModifier.java index 214e72a12..4bee19673 100644 --- a/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocHtmlModifier.java +++ b/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocHtmlModifier.java @@ -681,7 +681,7 @@ class AsciiDocHtmlModifier { continue; } - // Handle relative paths. + // Ensure it is a relative path to an entire file. Verify.verify(uriScheme == null); Verify.verify(uri.getUserInfo() == null); Verify.verify(uri.getHost() == null); @@ -691,10 +691,23 @@ class AsciiDocHtmlModifier { Verify.verify(uri.getFragment() == null); Verify.verifyNotNull(uri.getPath()); Verify.verify(ref.equals(uri.getPath())); + + // Get absolute path of file referred to by href. Path hrefAbsTarget = sourceRootPath.resolve(ref); + + // Relativize it against the source file. Path rootPathForNewRelHref = page.sourceFile.absPath.getParent(); String newRelHref = rootPathForNewRelHref.relativize(hrefAbsTarget).toString(); + if (newRelHref.isEmpty()) { + newRelHref = "."; + } + + // Ensure the correct path separators. + Verify.verify(!ref.contains("\\"), ref); + newRelHref = newRelHref.replace("\\", "/"); Verify.verify(!newRelHref.contains("\\"), newRelHref); + + // Set new href attribute value. elem.attr(attrName, newRelHref); } } diff --git a/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocMultiPageHtmlSplitter.java b/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocMultiPageHtmlSplitter.java index 770f0ea1f..53801ec52 100644 --- a/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocMultiPageHtmlSplitter.java +++ b/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocMultiPageHtmlSplitter.java @@ -162,8 +162,9 @@ public class AsciiDocMultiPageHtmlSplitter { sourceFiles.add(sourceFile); } } - logger.accept(String.format(Locale.US, "%d AsciiDoc source files found, %d analyzed.", sourcePaths.size(), - sourceFiles.size())); + int ignoreCount = sourcePaths.size() - sourceFiles.size(); + logger.accept(String.format(Locale.US, "%d AsciiDoc source files found, %d analyzed, %d ignored.", + sourcePaths.size(), sourceFiles.size(), ignoreCount)); // Analyze AsciiDoc-generated single-page HTML file. logger.accept("Analyzing AsciiDoc-generated single-page HTML file: " + singleHtmlPagePath.toString()); -- GitLab From 0ec5978b4a2d2aa32a003afa66c7e316058efbd5 Mon Sep 17 00:00:00 2001 From: Dennis Hendriks Date: Sun, 10 Apr 2022 15:17:19 +0200 Subject: [PATCH 11/15] #332 Update DEPENDENCIES.txt. --- DEPENDENCIES.txt | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/DEPENDENCIES.txt b/DEPENDENCIES.txt index 1259c8cd9..17e7e1834 100644 --- a/DEPENDENCIES.txt +++ b/DEPENDENCIES.txt @@ -1,8 +1,27 @@ +maven/mavencentral/com.google.code.findbugs/jsr305/3.0.2, Apache-2.0, approved, #20 +maven/mavencentral/com.google.errorprone/error_prone_annotations/2.3.4, Apache-2.0, approved, #807 +maven/mavencentral/com.google.guava/failureaccess/1.0.1, Apache-2.0, approved, CQ22654 +maven/mavencentral/com.google.guava/guava/30.1-jre, Apache-2.0 AND CC0-1.0 AND LicenseRef-Public-Domain, approved, CQ23244 +maven/mavencentral/com.google.guava/listenablefuture/9999.0-empty-to-avoid-conflict-with-guava, LicenseRef-NONE, approved, #803 +maven/mavencentral/com.google.j2objc/j2objc-annotations/1.3, Apache-2.0, approved, CQ21195 +maven/mavencentral/commons-io/commons-io/2.8.0, Apache-2.0, approved, CQ23182 +maven/mavencentral/javax.annotation/javax.annotation-api/1.2, CDDL-1.1 OR GPL-2.0-only WITH Classpath-exception-2.0, approved, CQ15728 maven/mavencentral/org.apache.ant/ant/1.10.9, Apache-2.0 AND W3C AND LicenseRef-Public-Domain, approved, CQ15560 +maven/mavencentral/org.apache.commons/commons-lang3/3.1, Apache-2.0, approved, CQ5902 +maven/mavencentral/org.apache.maven.plugin-tools/maven-plugin-annotations/3.6.4, Apache-2.0, approved, #808 +maven/mavencentral/org.apache.maven/maven-artifact/3.8.5, Apache-2.0, approved, clearlydefined +maven/mavencentral/org.apache.maven/maven-model/3.8.5, Apache-2.0, approved, clearlydefined +maven/mavencentral/org.apache.maven/maven-plugin-api/3.8.5, Apache-2.0, approved, #1662 +maven/mavencentral/org.checkerframework/checker-qual/3.5.0, MIT, approved, clearlydefined maven/mavencentral/org.codehaus.groovy/groovy-ant/3.0.8, Apache-2.0, approved, clearlydefined maven/mavencentral/org.codehaus.groovy/groovy-json/3.0.8, Apache-2.0, approved, clearlydefined maven/mavencentral/org.codehaus.groovy/groovy/3.0.8, Apache-2.0, approved, #818 -p2/orbit/p2.eclipse.plugin/com.google.guava/30.1.0.v20210127-2300, Apache-2.0 AND LicenseRef-Public-Domain, approved, CQ23002 +maven/mavencentral/org.codehaus.plexus/plexus-classworlds/2.6.0, Apache-2.0 AND Plexus, approved, CQ22821 +maven/mavencentral/org.codehaus.plexus/plexus-component-annotations/1.5.5, Apache-2.0, approved, CQ4581 +maven/mavencentral/org.codehaus.plexus/plexus-utils/3.3.0, , approved, CQ21066 +maven/mavencentral/org.eclipse.sisu/org.eclipse.sisu.inject/0.3.5, EPL-1.0, approved, technology.sisu +maven/mavencentral/org.eclipse.sisu/org.eclipse.sisu.plexus/0.3.5, EPL-1.0, approved, technology.sisu +maven/mavencentral/org.jsoup/jsoup/1.8.3, MIT, approved, CQ12749 p2/orbit/p2.eclipse.plugin/com.ibm.icu/67.1.0.v20200706-1749, ICU AND Unicode-TOU AND BSD-3-Clause AND BSD-2-Clause AND LicenseRef-ipadic-license AND LicenseRef-Public-Domain, approved, CQ22320 p2/orbit/p2.eclipse.plugin/com.sun.jna.platform/5.8.0.v20210406-1004, Apache-2.0 OR LGPL-2.1-or-later, approved, CQ23218 p2/orbit/p2.eclipse.plugin/com.sun.jna/5.8.0.v20210503-0343, Apache-2.0 OR LGPL-2.1-or-later, approved, CQ23217 @@ -147,7 +166,6 @@ p2/orbit/p2.eclipse.plugin/org.eclipse.ui.workbench/3.122.200.v20210506-1640, EP p2/orbit/p2.eclipse.plugin/org.eclipse.ui/3.119.0.v20210111-1350, EPL-2.0, approved, eclipse.platform p2/orbit/p2.eclipse.plugin/org.eclipse.urischeme/1.1.400.v20210407-1558, EPL-2.0, approved, eclipse.platform p2/orbit/p2.eclipse.plugin/org.hamcrest.core/1.3.0.v20180420-1519, BSD-2-Clause, approved, CQ7063 -p2/orbit/p2.eclipse.plugin/org.jsoup/1.8.3.v20181012-1713, MIT, approved, CQ12749 p2/orbit/p2.eclipse.plugin/org.junit/4.13.0.v20200204-1500, EPL-1.0, approved, CQ21439 p2/orbit/p2.eclipse.plugin/org.knowm.xchart/3.6.5.v20201023-2252, Apache-2.0, approved, CQ22695 p2/orbit/p2.eclipse.plugin/org.sat4j.core/2.3.5.v201308161310, EPL-1.0, approved, CQ7311 -- GitLab From 6eb716f39b2eb0d57846e2426927eb5cb248ed9f Mon Sep 17 00:00:00 2001 From: Dennis Hendriks Date: Sun, 10 Apr 2022 21:59:25 +0200 Subject: [PATCH 12/15] #332 Updated AsciiDoc multi-page HTML split launch configurations. --- .../test-asciidoc-multipage-htmlsplit-eclipse-help-chi.launch | 2 +- .../test-asciidoc-multipage-htmlsplit-eclipse-help-cif.launch | 2 +- ...t-asciidoc-multipage-htmlsplit-eclipse-help-escet-dev.launch | 2 +- ...ciidoc-multipage-htmlsplit-eclipse-help-escet-project.launch | 2 +- ...est-asciidoc-multipage-htmlsplit-eclipse-help-tooldef.launch | 2 +- .../test/test-asciidoc-multipage-htmlsplit-website-chi.launch | 2 +- .../test/test-asciidoc-multipage-htmlsplit-website-cif.launch | 2 +- .../test-asciidoc-multipage-htmlsplit-website-escet-dev.launch | 2 +- ...st-asciidoc-multipage-htmlsplit-website-escet-project.launch | 2 +- .../test-asciidoc-multipage-htmlsplit-website-tooldef.launch | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-eclipse-help-chi.launch b/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-eclipse-help-chi.launch index 6d45c9eb7..0ac770db8 100644 --- a/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-eclipse-help-chi.launch +++ b/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-eclipse-help-chi.launch @@ -1,7 +1,7 @@ - + diff --git a/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-eclipse-help-cif.launch b/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-eclipse-help-cif.launch index 20ae72e59..fea1a61c0 100644 --- a/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-eclipse-help-cif.launch +++ b/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-eclipse-help-cif.launch @@ -1,7 +1,7 @@ - + diff --git a/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-eclipse-help-escet-dev.launch b/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-eclipse-help-escet-dev.launch index 3affe8fb0..a927daa8f 100644 --- a/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-eclipse-help-escet-dev.launch +++ b/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-eclipse-help-escet-dev.launch @@ -1,7 +1,7 @@ - + diff --git a/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-eclipse-help-escet-project.launch b/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-eclipse-help-escet-project.launch index 293bd9ddb..78190fc51 100644 --- a/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-eclipse-help-escet-project.launch +++ b/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-eclipse-help-escet-project.launch @@ -1,7 +1,7 @@ - + diff --git a/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-eclipse-help-tooldef.launch b/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-eclipse-help-tooldef.launch index b83710a4b..70dab4f9b 100644 --- a/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-eclipse-help-tooldef.launch +++ b/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-eclipse-help-tooldef.launch @@ -1,7 +1,7 @@ - + diff --git a/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-website-chi.launch b/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-website-chi.launch index d0c1d5c3e..a9431003c 100644 --- a/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-website-chi.launch +++ b/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-website-chi.launch @@ -1,7 +1,7 @@ - + diff --git a/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-website-cif.launch b/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-website-cif.launch index a1cc1d886..1025afe5c 100644 --- a/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-website-cif.launch +++ b/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-website-cif.launch @@ -1,7 +1,7 @@ - + diff --git a/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-website-escet-dev.launch b/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-website-escet-dev.launch index 5bd848e5f..a038c8a26 100644 --- a/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-website-escet-dev.launch +++ b/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-website-escet-dev.launch @@ -1,7 +1,7 @@ - + diff --git a/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-website-escet-project.launch b/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-website-escet-project.launch index 0ab2f6934..f4ccb198f 100644 --- a/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-website-escet-project.launch +++ b/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-website-escet-project.launch @@ -1,7 +1,7 @@ - + diff --git a/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-website-tooldef.launch b/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-website-tooldef.launch index 5b6fc0c6e..f6718e283 100644 --- a/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-website-tooldef.launch +++ b/common/org.eclipse.escet.common.asciidoc/test/test-asciidoc-multipage-htmlsplit-website-tooldef.launch @@ -1,7 +1,7 @@ - + -- GitLab From 513620e06a88f962c8c191b30d8f1c0c3e20af25 Mon Sep 17 00:00:00 2001 From: Dennis Hendriks Date: Sun, 10 Apr 2022 22:12:56 +0200 Subject: [PATCH 13/15] #332 Prevent JDT warning for Maven plugin project. --- .../org.eclipse.core.resources.prefs | 1 + .../src/test/java/.git_keep_empty_dir | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 common/org.eclipse.escet.common.asciidoc/src/test/java/.git_keep_empty_dir diff --git a/common/org.eclipse.escet.common.asciidoc/.settings/org.eclipse.core.resources.prefs b/common/org.eclipse.escet.common.asciidoc/.settings/org.eclipse.core.resources.prefs index e9441bb12..f9fe34593 100644 --- a/common/org.eclipse.escet.common.asciidoc/.settings/org.eclipse.core.resources.prefs +++ b/common/org.eclipse.escet.common.asciidoc/.settings/org.eclipse.core.resources.prefs @@ -1,3 +1,4 @@ eclipse.preferences.version=1 encoding//src/main/java=UTF-8 +encoding//src/test/java=UTF-8 encoding/=UTF-8 diff --git a/common/org.eclipse.escet.common.asciidoc/src/test/java/.git_keep_empty_dir b/common/org.eclipse.escet.common.asciidoc/src/test/java/.git_keep_empty_dir new file mode 100644 index 000000000..dd0c227a6 --- /dev/null +++ b/common/org.eclipse.escet.common.asciidoc/src/test/java/.git_keep_empty_dir @@ -0,0 +1,19 @@ +################################################################################ +# Copyright (c) 2022 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the terms +# of the MIT License which is available at https://opensource.org/licenses/MIT +# +# SPDX-License-Identifier: MIT +################################################################################# + +# We automatically configure the JDT settings, such as '.classpath' using m2eclipse, via: +# Maven -> Update Project ... -> enable 'Update project configuration from pom.xml' -> OK. +# m2eclipes then automatically configures the test sources directory 'src/test/java' in '.classpath'. +# If the directory is not present, Eclipse on the 'Java Build Path' tab of the project's properties +# dialog indicates: 'Build path entry is missing: /src/test/java'. +# This despite that in the '.classpath' file this directory is configured with 'optional' set to 'true'. +# We thus add an empty directory with only this file, to prevent that warning. -- GitLab From 48513c02454433ce782ea43c0c558a27222453a2 Mon Sep 17 00:00:00 2001 From: Dennis Hendriks Date: Mon, 11 Apr 2022 17:32:22 +0200 Subject: [PATCH 14/15] #332 Some improvements addressing review comments. --- .../html/multipage/AsciiDocMultiPageHtmlSplitter.java | 5 +++-- .../html/multipage/AsciiDocSourceFileAnalyzer.java | 7 +++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocMultiPageHtmlSplitter.java b/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocMultiPageHtmlSplitter.java index 53801ec52..156d65d0d 100644 --- a/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocMultiPageHtmlSplitter.java +++ b/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocMultiPageHtmlSplitter.java @@ -96,9 +96,10 @@ public class AsciiDocMultiPageHtmlSplitter { throw new RuntimeException("Unknown HTML type: " + htmlType); } + String htmlFileExt = ".html"; String rootBaseName = singleHtmlPagePath.getFileName().toString(); - Verify.verify(rootBaseName.endsWith(".html")); - rootBaseName = rootBaseName.substring(0, rootBaseName.length() - ".html".length()); + Verify.verify(rootBaseName.endsWith(htmlFileExt)); + rootBaseName = rootBaseName.substring(0, rootBaseName.length() - htmlFileExt.length()); splitHtml(sourceRootPath, singleHtmlPagePath, outputRootPath, htmlType, parentWebsiteName, parentWebsiteLink, rootBaseName, System.out::println); diff --git a/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocSourceFileAnalyzer.java b/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocSourceFileAnalyzer.java index 1c8fd75a1..1db0a5ed9 100644 --- a/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocSourceFileAnalyzer.java +++ b/common/org.eclipse.escet.common.asciidoc/src/main/java/org/eclipse/escet/common/asciidoc/html/multipage/AsciiDocSourceFileAnalyzer.java @@ -18,6 +18,8 @@ import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import java.util.stream.IntStream; import org.apache.commons.lang3.StringUtils; @@ -69,8 +71,9 @@ class AsciiDocSourceFileAnalyzer { int idIndex = IntStream.range(0, sourceContent.size()).filter(i -> sourceContent.get(i).startsWith("[[")) .findFirst().getAsInt(); String idLine = sourceContent.get(idIndex); - Verify.verify(idLine.endsWith("]]"), idLine); - sourceId = idLine.substring(2, idLine.length() - 2); // [[id]] + Matcher matcher = Pattern.compile("\\[\\[(.*)\\]\\]").matcher(idLine); // [[id]] + Verify.verify(matcher.matches(), idLine); + sourceId = matcher.group(1); // Sanity check: no markup in id. Verify.verify(sourceId.matches("[a-z0-9-]+"), sourceId); -- GitLab From a44f5a835b5824c79c10873785a43ecd94fc922a Mon Sep 17 00:00:00 2001 From: Dennis Hendriks Date: Tue, 12 Apr 2022 17:03:29 +0200 Subject: [PATCH 15/15] #332 POM-first for Maven projects. Reverts earlier change. - 'src/test/java' has 'optional=true', so no workspace warning/error. - JDT 'Java Build Path' tab shows warning, but is not leading. --- .../org.eclipse.core.resources.prefs | 1 - .../src/test/java/.git_keep_empty_dir | 19 ------------------- 2 files changed, 20 deletions(-) delete mode 100644 common/org.eclipse.escet.common.asciidoc/src/test/java/.git_keep_empty_dir diff --git a/common/org.eclipse.escet.common.asciidoc/.settings/org.eclipse.core.resources.prefs b/common/org.eclipse.escet.common.asciidoc/.settings/org.eclipse.core.resources.prefs index f9fe34593..e9441bb12 100644 --- a/common/org.eclipse.escet.common.asciidoc/.settings/org.eclipse.core.resources.prefs +++ b/common/org.eclipse.escet.common.asciidoc/.settings/org.eclipse.core.resources.prefs @@ -1,4 +1,3 @@ eclipse.preferences.version=1 encoding//src/main/java=UTF-8 -encoding//src/test/java=UTF-8 encoding/=UTF-8 diff --git a/common/org.eclipse.escet.common.asciidoc/src/test/java/.git_keep_empty_dir b/common/org.eclipse.escet.common.asciidoc/src/test/java/.git_keep_empty_dir deleted file mode 100644 index dd0c227a6..000000000 --- a/common/org.eclipse.escet.common.asciidoc/src/test/java/.git_keep_empty_dir +++ /dev/null @@ -1,19 +0,0 @@ -################################################################################ -# Copyright (c) 2022 Contributors to the Eclipse Foundation -# -# See the NOTICE file(s) distributed with this work for additional -# information regarding copyright ownership. -# -# This program and the accompanying materials are made available under the terms -# of the MIT License which is available at https://opensource.org/licenses/MIT -# -# SPDX-License-Identifier: MIT -################################################################################# - -# We automatically configure the JDT settings, such as '.classpath' using m2eclipse, via: -# Maven -> Update Project ... -> enable 'Update project configuration from pom.xml' -> OK. -# m2eclipes then automatically configures the test sources directory 'src/test/java' in '.classpath'. -# If the directory is not present, Eclipse on the 'Java Build Path' tab of the project's properties -# dialog indicates: 'Build path entry is missing: /src/test/java'. -# This despite that in the '.classpath' file this directory is configured with 'optional' set to 'true'. -# We thus add an empty directory with only this file, to prevent that warning. -- GitLab