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

elharo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/xerces-j.git


The following commit(s) were added to refs/heads/main by this push:
     new b2f3b7d59 [XERCES-J-1789] Revert to Java 1.7 (#60)
b2f3b7d59 is described below

commit b2f3b7d59a0361b35611d1fb417c360bd1526426
Author: Elliotte Rusty Harold <[email protected]>
AuthorDate: Tue Nov 25 16:11:22 2025 -0600

    [XERCES-J-1789] Revert to Java 1.7 (#60)
    
    * Revert to 1.7
---
 .github/workflows/ant.yml | 25 +++++++++++++++++++++----
 build.xml                 |  4 ++--
 2 files changed, 23 insertions(+), 6 deletions(-)

diff --git a/.github/workflows/ant.yml b/.github/workflows/ant.yml
index 85de088fd..5b52dfcf0 100644
--- a/.github/workflows/ant.yml
+++ b/.github/workflows/ant.yml
@@ -32,21 +32,33 @@ jobs:
         distribution: 'temurin'
         java-version: ${{ matrix.jdk }}
 
+    # Conditional override for javac properties
+    - name: Set Javac Override Version
+      id: set_javac_version
+      run: |
+          # If jdk is 21 or later, set the override property to 1.8
+          if [[ ${{ matrix.jdk }} -ge 21 ]]; then
+            echo "JAVAC_OVERRIDE=1.8" >> $GITHUB_ENV
+          else
+            # For 8, 11, and 17, 1.7 will be used.
+            echo "JAVAC_OVERRIDE=1.7" >> $GITHUB_ENV
+          fi
+
     # check ant version
     - name: Ant Version
       run: ant -version
 
     - name: Ant Build (target jars)
-      run: ant -noinput -buildfile build.xml jars
+      run: ant -noinput -buildfile build.xml -Djavac.source=${{ 
env.JAVAC_OVERRIDE }} -Djavac.target=${{ env.JAVAC_OVERRIDE }} jars
 
     - name: Ant Build (target dtdjars)
-      run: ant -noinput -buildfile build.xml dtdjars
+      run: ant -noinput -buildfile build.xml -Djavac.source=${{ 
env.JAVAC_OVERRIDE }} -Djavac.target=${{ env.JAVAC_OVERRIDE }} dtdjars
 
     - name: Ant Test (target ci-test)
-      run: ant -noinput -buildfile build.xml clean ci-test
+      run: ant -noinput -buildfile build.xml -Djavac.source=${{ 
env.JAVAC_OVERRIDE }} -Djavac.target=${{ env.JAVAC_OVERRIDE }} clean ci-test
 
     - name: Ant Build (target all)
-      run: ant -noinput -buildfile build.xml all
+      run: ant -noinput -buildfile build.xml -Djavac.source=${{ 
env.JAVAC_OVERRIDE }} -Djavac.target=${{ env.JAVAC_OVERRIDE }} all
 
     # clean up before running via build script
     - name: Ant Clean
@@ -55,9 +67,11 @@ jobs:
     # The README suggests to use a build script to call ant
     # so we do this as well to make sure it also works this way
     - name: Run build script (target jars)
+      if: ${{ matrix.jdk <= 17 }}
       run: . ./build.sh jars
 
     - name: Run build script (target dtdjars)
+      if: ${{ matrix.jdk <= 17 }}
       run: . ./build.sh dtdjars
 
     # clean up before running via build script
@@ -65,7 +79,9 @@ jobs:
     - name: Ant Clean
       run: ant -noinput -buildfile build.xml clean
 
+    # TODO figure out how to push the Java version through build.sh
     - name: Run build script (target test)
+      if: ${{ matrix.jdk <= 17 }}
       run: . ./build.sh test
 
     # clean up before running via build script
@@ -73,4 +89,5 @@ jobs:
       run: ant -noinput -buildfile build.xml clean
 
     - name: Run build script (target all)
+      if: ${{ matrix.jdk <= 17 }}
       run: . ./build.sh all
diff --git a/build.xml b/build.xml
index a9fb5c618..e196cdd32 100644
--- a/build.xml
+++ b/build.xml
@@ -92,8 +92,8 @@ Authors:
     <property name="optimize" value="on"/>
     <property name="deprecation" value="off"/>
     
-    <property name="javac.source" value="1.8"/>
-    <property name="javac.target" value="1.8"/>
+    <property name="javac.source" value="1.7"/>
+    <property name="javac.target" value="1.7"/>
 
     <property name="build.src" value="${build.dir}/src"/>
     <property name="build.dest" value="${build.dir}/classes"/>


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to