From c569387033f0cbb05eb19edea7edd5aaf9fb2ba4 Mon Sep 17 00:00:00 2001 From: Hannes Wellmann Date: Tue, 2 Apr 2024 23:11:24 +0200 Subject: [PATCH] [fIXUP] --- .github/workflows/build.yml | 33 ++++++++++--------- Jenkinsfile | 3 ++ .../equinox/launcher/tests/LauncherTests.java | 10 +++--- 3 files changed, 26 insertions(+), 20 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 818ac4e7e9d..eb482669f6f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -58,14 +58,14 @@ jobs: build-launcher: name: Build launcher ${{ matrix.config.name }} - runs-on: ${{ matrix.config.os }} + runs-on: ${{ matrix.config.runner-os }} strategy: fail-fast: false matrix: config: - - { name: Linux, os: ubuntu-latest, ws: gtk, native-extension: so } - - { name: Windows, os: windows-2019, ws: win32, native-extension: dll } - - { name: MacOS, os: macos-latest, ws: cocoa, native-extension: so } + - { name: Linux, runner-os: ubuntu-latest, ws: gtk, os: linux, native-extension: so } + - { name: Windows, runner-os: windows-2019, ws: win32, os: win32, native-extension: dll } + - { name: MacOS, runner-os: macos-latest, ws: cocoa, os: macosx, native-extension: so } steps: - uses: actions/checkout@v4 with: @@ -89,26 +89,29 @@ jobs: working-directory: features/org.eclipse.equinox.executable.feature/library/${{ matrix.config.ws }} run: | ./build.sh - mkdir -p $GITHUB_WORKSPACE/equinox.binaries/org.eclipse.equinox.executable/bin/win32/win32/x86_64/ - cp eclipse $GITHUB_WORKSPACE/equinox.binaries/org.eclipse.equinox.executable/bin/win32/win32/x86_64/ - mkdir -p $GITHUB_WORKSPACE/equinox.binaries/org.eclipse.equinox.launcher.win32.win32.x86_64/ - rm -f $GITHUB_WORKSPACE/equinox.binaries/org.eclipse.equinox.launcher.win32.win32.x86_64/eclipse_*.so - cp eclipse_*.so $GITHUB_WORKSPACE/equinox.binaries/org.eclipse.equinox.launcher.win32.win32.x86_64/ + + exeTarget='${{ github.workspace }}/equinox.binaries/org.eclipse.equinox.executable/bin/${{ matrix.config.ws }}/${{ matrix.config.os }}/x86_64/' + mkdir -p $exeTarget + cp eclipse $exeTarget + libraryTarget'${{ github.workspace }}/equinox.binaries/org.eclipse.equinox.launcher.${{ matrix.config.ws }}.${{ matrix.config.os }}.x86_64' + mkdir -p $libraryTarget + rm -f $libraryTarget/eclipse_*.so + cp eclipse_*.so $libraryTarget if: ${{ matrix.config.ws != 'win32'}} - name: Build on Windows working-directory: features/org.eclipse.equinox.executable.feature/library/win32 run: | .\build.bat - mkdir $env:GITHUB_WORKSPACE\equinox.binaries\org.eclipse.equinox.executable\bin\win32\win32\x86_64\ - copy eclipse*.exe $env:GITHUB_WORKSPACE\equinox.binaries\org.eclipse.equinox.executable\bin\win32\win32\x86_64\ - mkdir $env:GITHUB_WORKSPACE\equinox.binaries\org.eclipse.equinox.launcher.win32.win32.x86_64\ - del $env:GITHUB_WORKSPACE\equinox.binaries\org.eclipse.equinox.launcher.win32.win32.x86_64\eclipse_*.dll - copy eclipse_*.dll $env:GITHUB_WORKSPACE\equinox.binaries\org.eclipse.equinox.launcher.win32.win32.x86_64\ + mkdir ${{ github.workspace }}\equinox.binaries\org.eclipse.equinox.executable\bin\win32\win32\x86_64\ + copy eclipse*.exe ${{ github.workspace }}\equinox.binaries\org.eclipse.equinox.executable\bin\win32\win32\x86_64\ + mkdir ${{ github.workspace }}\equinox.binaries\org.eclipse.equinox.launcher.win32.win32.x86_64\ + del ${{ github.workspace }}\equinox.binaries\org.eclipse.equinox.launcher.win32.win32.x86_64\eclipse_*.dll + copy eclipse_*.dll ${{ github.workspace }}\equinox.binaries\org.eclipse.equinox.launcher.win32.win32.x86_64\ if: ${{ matrix.config.ws == 'win32'}} - name: Test native launcher and executable env: - rt.equinox.binaries.loc: ${{ github.workspace }}/equinox.binaries + EQUINOX_BINARIES_LOC: ${{ github.workspace }}/equinox.binaries run: mvn -B -pl org.eclipse.equinox:org.eclipse.equinox.launcher.tests -am verify - name: Upload artifacts diff --git a/Jenkinsfile b/Jenkinsfile index d603e9b8c00..3ffbd0728ab 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -20,6 +20,9 @@ pipeline { } } stage('Build') { + environment { + EQUINOX_BINARIES_LOC = "$WORKSPACE/rt.equinox.binaries" + } steps { sh """ mvn clean verify --batch-mode --fail-at-end -Dmaven.repo.local=$WORKSPACE/.m2/repository \ diff --git a/bundles/org.eclipse.equinox.launcher.tests/src/org/eclipse/equinox/launcher/tests/LauncherTests.java b/bundles/org.eclipse.equinox.launcher.tests/src/org/eclipse/equinox/launcher/tests/LauncherTests.java index 5dbc9547d30..3dbe5f8be5f 100644 --- a/bundles/org.eclipse.equinox.launcher.tests/src/org/eclipse/equinox/launcher/tests/LauncherTests.java +++ b/bundles/org.eclipse.equinox.launcher.tests/src/org/eclipse/equinox/launcher/tests/LauncherTests.java @@ -111,7 +111,7 @@ static void prepareLauncherSetup() throws Exception { versions.load(in); } String launcherLibrary = "eclipse_" + versions.get("maj_ver") + versions.get("min_ver") - + (os.contains("win") ? ".dll" : ".so"); + + (os.contains("win") ? ".dll" : ".so"); String launcherLibFile = "org.eclipse.equinox.launcher." + ws + "." + os + "." + arch + "/" + launcherLibrary; Files.copy(binariesRoot.resolve(launcherLibFile), Files.createDirectories(eclipseInstallationMockLocation.resolve("plugins/org.eclipse.equinox.launcher")) @@ -134,16 +134,16 @@ static void prepareLauncherSetup() throws Exception { } private static Path findBinariesRoot(Path equinoxRepositoryPath) { - String binariesRootName = "rt.equinox.binaries.loc"; - Optional binariesRepo = Optional - .ofNullable(System.getProperty(binariesRootName, System.getenv(binariesRootName))).map(Path::of); + String binariesLocationName = "EQUINOX_BINARIES_LOC"; // dots in variable names are not permitted in POSIX + Optional binariesRepo = Optional.ofNullable(System.getProperty(binariesLocationName)) + .or(() -> Optional.ofNullable(System.getenv(binariesLocationName))).map(Path::of); if (binariesRepo.isEmpty()) { // search for co-located repository with known names binariesRepo = Stream.of("equinox.binaries", "rt.equinox.binaries") .map(equinoxRepositoryPath::resolveSibling).filter(Files::isDirectory).findFirst(); } return binariesRepo.orElseThrow(() -> new IllegalStateException( "Location of equinox binaries could not be auto-detected and was not provided via the System.property or environment.variable '" - + binariesRootName + "'.")); + + binariesLocationName + "'.")); } private static void addProjectsClassFiles(JarOutputStream jar, Path classesFolder) throws IOException {