浏览代码

simplify jmod compatibility check

Sebastian Stenzel 2 年之前
父节点
当前提交
2cc01be236
共有 1 个文件被更改,包括 17 次插入14 次删除
  1. 17 14
      .github/workflows/debian.yml

+ 17 - 14
.github/workflows/debian.yml

@@ -63,23 +63,26 @@ jobs:
           mkdir -p jmods/aarch64
           unzip -j openjfx-aarch64.zip \*/javafx.base.jmod \*/javafx.controls.jmod \*/javafx.fxml.jmod \*/javafx.graphics.jmod -d jmods/aarch64
       - name: Ensure major jfx version in pom and in jmods is the same
-        shell: pwsh # TODO translate to bash
         run: |
-          mkdir jfxBaseJmodAmd64
-          jmod extract --dir jfxBaseJmodAmd64 jmods/amd64/javafx.base.jmod
-          $jfxJmodVersionAmd64 = ((Get-Content -Path "jfxBaseJmodAmd64/lib/javafx.properties" | Where-Object {$_ -like 'javafx.version=*' }) -replace '.*=','') -split "\."
-          mkdir jfxBaseJmodAarch64
-          jmod extract --dir jfxBaseJmodAarch64 jmods/aarch64/javafx.base.jmod
-          $jfxJmodVersionAarch64 = ((Get-Content -Path "jfxBaseJmodAarch64/lib/javafx.properties" | Where-Object {$_ -like 'javafx.version=*' }) -replace '.*=','') -split "\."
-          if ($jfxJmodVersionAmd64[0] -ne $jfxJmodVersionAarch64[0] ) {
-            Write-Error "JavaFX Jmods for aarch64 and amd64 are different major versions"
+          JMOD_VERSION_AMD64=$(jmod describe ${JAVA_HOME}/jmods/amd64/javafx.base.jmod | head -1)
+          JMOD_VERSION_AMD64=${JMOD_VERSION_AMD64#*@}
+          JMOD_VERSION_AMD64=${JMOD_VERSION_AMD64%%.*}
+          JMOD_VERSION_AARCH64=$(jmod describe ${JAVA_HOME}/jmods/aarch64/javafx.base.jmod | head -1)
+          JMOD_VERSION_AARCH64=${JMOD_VERSION_AARCH64#*@}
+          JMOD_VERSION_AARCH64=${JMOD_VERSION_AARCH64%%.*}
+          POM_JFX_VERSION=$(mvn help:evaluate "-Dexpression=javafx.version" -q -DforceStdout)
+          POM_JFX_VERSION=${POM_JFX_VERSION#*@}
+          POM_JFX_VERSION=${POM_JFX_VERSION%%.*}
+
+          if [ $POM_JFX_VERSION -ne $JMOD_VERSION_AMD64 ]; then
+            >&2 echo "Major JavaFX version in pom.xml (${POM_JFX_VERSION}) != amd64 jmod version (${JMOD_VERSION_AMD64})"
             exit 1
-          }
-          $jfxPomVersion = (&mvn help:evaluate "-Dexpression=javafx.version" -q -DforceStdout) -split "\."
-          if ($jfxPomVersion[0] -ne $jfxJmodVersionAmd64[0]) {
-            Write-Error "Major part of JavaFX version in pom($($jfxPomVersion[0])) does not match the version of Jmods($($jfxJmodVersionAmd64[0])) "
+          fi
+
+          if [ $POM_JFX_VERSION -ne $JMOD_VERSION_AARCH64 ]; then
+            >&2 echo "Major JavaFX version in pom.xml (${POM_JFX_VERSION}) != aarch64 jmod version (${JMOD_VERSION_AARCH64})"
             exit 1
-          }
+          fi
       - name: Create orig.tar.gz with common/ libs/ mods/ jmods/
         run: |
           mkdir pkgdir