You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by jk...@apache.org on 2023/11/30 06:22:12 UTC

(xalan-java) branch xalan-java-mvn-refactored updated: XALANJ-2708 Move docs and distros generation into own profiles

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

jkesselm pushed a commit to branch xalan-java-mvn-refactored
in repository https://gitbox.apache.org/repos/asf/xalan-java.git


The following commit(s) were added to refs/heads/xalan-java-mvn-refactored by this push:
     new d8743ae4 XALANJ-2708 Move docs and distros generation into own profiles
     new dddd36d8 Merge pull request #132 from kriegaex/maven-profiles
d8743ae4 is described below

commit d8743ae4155d9c517ffde7de7f8c4ae341835e86
Author: Alexander Kriegisch <Al...@Kriegisch.name>
AuthorDate: Tue Nov 28 11:18:19 2023 +0700

    XALANJ-2708 Move docs and distros generation into own profiles
    
    The new profiles
      - 'create-docs' for Stylebook docs and
      - 'create-distros' for source and binary assemblies
    are both active by default, but can be deactivated on the Maven command
    line or from an IDE to achieve faster development builds, e.g. if in the
    future a developer just wants to change some source code, compile and
    test it. He does not need any documentation or distros for that, so he
    can just build with something like:
    
      mvn [goal|phase] -P !create-docs,!create-distros
    
    Relates to https://issues.apache.org/jira/browse/XALANJ-2708.
---
 distribution/pom.xml | 100 ++++++++++++++++-------------
 pom.xml              | 175 +++++++++++++++++++++++++++------------------------
 2 files changed, 150 insertions(+), 125 deletions(-)

diff --git a/distribution/pom.xml b/distribution/pom.xml
index 43185c74..acc2a577 100644
--- a/distribution/pom.xml
+++ b/distribution/pom.xml
@@ -1,6 +1,6 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" 
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>
   <parent>
     <groupId>xalan</groupId>
@@ -11,7 +11,7 @@
   <artifactId>distribution</artifactId>
   <name>distribution</name>
   <packaging>pom</packaging>
-  
+
   <!-- Depend on modules containing source code that needs to be compiled
        before being able to create a binary distribution
   -->
@@ -29,45 +29,57 @@
       <artifactId>samples</artifactId>
     </dependency>
   </dependencies>
- 
-  <build>
-    <plugins>
-      <plugin>
-        <artifactId>maven-assembly-plugin</artifactId>
-        <version>3.6.0</version>
-        <executions>
-          <execution>
-            <id>distro-assembly</id>
-            <phase>package</phase>
-            <goals>
-              <goal>single</goal>
-            </goals>
-            <configuration>
-              <finalName>${project.parent.build.finalName}</finalName>
-              <outputDirectory>../build</outputDirectory>
-              <descriptors>
-                <descriptor>src/assembly/bin.xml</descriptor>
-              </descriptors>
-            </configuration>
-          </execution>
-          <execution>
-            <id>source-release-assembly</id>
-            <phase>package</phase>
-            <goals>
-              <goal>single</goal>
-            </goals>
-            <configuration>
-              <finalName>${project.parent.build.finalName}</finalName>
-              <outputDirectory>../build</outputDirectory>
-              <descriptors>
-                <descriptor>src/assembly/src.xml</descriptor>
-              </descriptors>
-              <tarLongFileMode>gnu</tarLongFileMode>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
 
-    </plugins>
-  </build>
+  <profiles>
+    <profile>
+      <id>create-distros</id>
+      <activation>
+        <!--
+          Activate by default. Workaround for 'activeByDefault', which is broken
+          by design, see https://issues.apache.org/jira/browse/MNG-4917.
+        -->
+        <jdk>[1.)</jdk>
+      </activation>
+      <build>
+        <plugins>
+          <plugin>
+            <artifactId>maven-assembly-plugin</artifactId>
+            <version>3.6.0</version>
+            <executions>
+              <execution>
+                <id>distro-assembly</id>
+                <phase>package</phase>
+                <goals>
+                  <goal>single</goal>
+                </goals>
+                <configuration>
+                  <finalName>${project.parent.build.finalName}</finalName>
+                  <outputDirectory>../build</outputDirectory>
+                  <descriptors>
+                    <descriptor>src/assembly/bin.xml</descriptor>
+                  </descriptors>
+                </configuration>
+              </execution>
+              <execution>
+                <id>source-release-assembly</id>
+                <phase>package</phase>
+                <goals>
+                  <goal>single</goal>
+                </goals>
+                <configuration>
+                  <finalName>${project.parent.build.finalName}</finalName>
+                  <outputDirectory>../build</outputDirectory>
+                  <descriptors>
+                    <descriptor>src/assembly/src.xml</descriptor>
+                  </descriptors>
+                  <tarLongFileMode>gnu</tarLongFileMode>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+  </profiles>
+
 </project>
diff --git a/pom.xml b/pom.xml
index 25c378a3..bfb04211 100644
--- a/pom.xml
+++ b/pom.xml
@@ -61,6 +61,100 @@
         <module>xalan2jtaglet_jdk9</module>
       </modules>
     </profile>
+    <profile>
+      <id>create-docs</id>
+      <activation>
+        <!--
+          Activate by default. Workaround for 'activeByDefault', which is broken
+          by design, see https://issues.apache.org/jira/browse/MNG-4917.
+        -->
+        <jdk>[1.)</jdk>
+      </activation>
+      <build>
+        <plugins>
+          <!-- StyleBook processing.
+               NOTE: Stylebook as it has been calls System.exit() on its way out.
+               That means running exec:java will malfunction since it'll blow out
+               the entire Maven process. Workaround is to invoke Stylebook from
+               the command line with exec:exec. Proper fix is to remove that
+               behavior from Stylebook's code and have it exit more cleanly,
+               or to have exec optionally fork a process for java.
+               The latter is in development.
+               -->
+          <plugin>
+            <groupId>org.codehaus.mojo</groupId>
+            <artifactId>exec-maven-plugin</artifactId>
+            <version>3.1.0</version>
+            <inherited>false</inherited> <!-- Run only in xalan-project parent -->
+            <executions>
+              <execution>
+                <id>Xalan2 design documentation</id>
+                <phase>package</phase>
+                <goals>
+                  <goal>exec</goal>
+                </goals>
+                <configuration>
+                  <executable>java</executable>
+                  <commandlineArgs>-cp ${stylebook.classpath} org.apache.stylebook.StyleBook
+                  loaderConfig=sbk:/style/loaderdesign.xml targetDirectory=./target/site/design/
+                  ./stylebook/sources/xalandesign.xml ./stylebook/style</commandlineArgs>
+                </configuration>
+              </execution>
+
+              <execution>
+                <id>Xalan2 compiled (xsltc) documentation</id>
+                <phase>package</phase>
+                <goals>
+                  <goal>exec</goal>
+                </goals>
+                <configuration>
+                  <executable>java</executable>
+                  <commandlineArgs>-cp ${stylebook.classpath} org.apache.stylebook.StyleBook
+                  loaderConfig=sbk:/style/loaderdesign.xml targetDirectory=./target/site/xsltc/
+                  ./stylebook/sources/xsltc.xml ./stylebook/style</commandlineArgs>
+                </configuration>
+              </execution>
+              <execution>
+                <id>Xalan2 interpretive documentation</id>
+                <phase>package</phase>
+                <goals>
+                  <goal>exec</goal>
+                </goals>
+                <configuration>
+                  <executable>java</executable>
+                  <commandlineArgs>-cp ${stylebook.classpath} org.apache.stylebook.StyleBook
+                  loaderConfig=sbk:/style/loaderdesign.xml targetDirectory=./target/site/xalan
+                  ./stylebook/sources/xalan-jsite.xml ./stylebook/style</commandlineArgs>
+                </configuration>
+              </execution>
+
+              <!-- Diff tells me that the -jlocal output is almost
+                   identical to the -jsite output despite the slight
+                   difference in the .xml files used as their
+                   sources. (The only effective difference appears to be
+                   that -jlocal doesn't produce the index or charter
+                   documents.)  I'm not convinced that's enough difference
+                   to merit generating both, but until I better grok why
+                   this duplication was done in the first place I'm
+                   hesitant to remove it. (jkesselm, 20231105) -->
+              <execution>
+                <id>Xalan2 interpretive documentation, local</id>
+                <phase>package</phase>
+                <goals>
+                  <goal>exec</goal>
+                </goals>
+                <configuration>
+                  <executable>java</executable>
+                  <commandlineArgs>-cp ${stylebook.classpath} org.apache.stylebook.StyleBook
+                  loaderConfig=sbk:/style/loaderdesign.xml targetDirectory=./target/site/xalan/local
+                  ./stylebook/sources/xalan-jlocal.xml ./stylebook/style</commandlineArgs>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
   </profiles>
 
   <build>
@@ -204,87 +298,6 @@
         </configuration>
       </plugin>
 
-      <!-- StyleBook processing.
-           NOTE: Stylebook as it has been calls System.exit() on its way out.
-           That means running exec:java will malfunction since it'll blow out
-           the entire Maven process. Workaround is to invoke Stylebook from
-           the command line with exec:exec. Proper fix is to remove that
-           behavior from Stylebook's code and have it exit more cleanly,
-           or to have exec optionally fork a process for java.
-           The latter is in development.
-           -->
-      <plugin>
-        <groupId>org.codehaus.mojo</groupId>
-        <artifactId>exec-maven-plugin</artifactId>
-        <version>3.1.0</version>
-        <inherited>false</inherited> <!-- Run only in xalan-project parent -->
-        <executions>
-          <execution>
-            <id>Xalan2 design documentation</id>
-            <phase>package</phase>
-            <goals>
-              <goal>exec</goal>
-            </goals>
-            <configuration>
-              <executable>java</executable>
-              <commandlineArgs>-cp ${stylebook.classpath} org.apache.stylebook.StyleBook
-              loaderConfig=sbk:/style/loaderdesign.xml targetDirectory=./target/site/design/
-              ./stylebook/sources/xalandesign.xml ./stylebook/style</commandlineArgs>
-            </configuration>
-          </execution>
-
-          <execution>
-            <id>Xalan2 compiled (xsltc) documentation</id>
-            <phase>package</phase>
-            <goals>
-              <goal>exec</goal>
-            </goals>
-            <configuration>
-              <executable>java</executable>
-              <commandlineArgs>-cp ${stylebook.classpath} org.apache.stylebook.StyleBook
-              loaderConfig=sbk:/style/loaderdesign.xml targetDirectory=./target/site/xsltc/
-              ./stylebook/sources/xsltc.xml ./stylebook/style</commandlineArgs>
-            </configuration>
-          </execution>
-          <execution>
-            <id>Xalan2 interpretive documentation</id>
-            <phase>package</phase>
-            <goals>
-              <goal>exec</goal>
-            </goals>
-            <configuration>
-              <executable>java</executable>
-              <commandlineArgs>-cp ${stylebook.classpath} org.apache.stylebook.StyleBook
-              loaderConfig=sbk:/style/loaderdesign.xml targetDirectory=./target/site/xalan
-              ./stylebook/sources/xalan-jsite.xml ./stylebook/style</commandlineArgs>
-            </configuration>
-          </execution>
-
-          <!-- Diff tells me that the -jlocal output is almost
-               identical to the -jsite output despite the slight
-               difference in the .xml files used as their
-               sources. (The only effective difference appears to be
-               that -jlocal doesn't produce the index or charter
-               documents.)  I'm not convinced that's enough difference
-               to merit generating both, but until I better grok why
-               this duplication was done in the first place I'm
-               hesitant to remove it. (jkesselm, 20231105) -->
-          <execution>
-            <id>Xalan2 interpretive documentation, local</id>
-            <phase>package</phase>
-            <goals>
-              <goal>exec</goal>
-            </goals>
-            <configuration>
-              <executable>java</executable>
-              <commandlineArgs>-cp ${stylebook.classpath} org.apache.stylebook.StyleBook
-              loaderConfig=sbk:/style/loaderdesign.xml targetDirectory=./target/site/xalan/local
-              ./stylebook/sources/xalan-jlocal.xml ./stylebook/style</commandlineArgs>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-
       <!-- Two more files to copy to the site directory -->
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xalan.apache.org
For additional commands, e-mail: commits-help@xalan.apache.org