Skip to content

Commit

Permalink
[fIXUP]
Browse files Browse the repository at this point in the history
  • Loading branch information
HannesWell committed Apr 2, 2024
1 parent 1dd7b72 commit 45db48c
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 20 deletions.
33 changes: 18 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
3 changes: 3 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand All @@ -134,16 +134,16 @@ static void prepareLauncherSetup() throws Exception {
}

private static Path findBinariesRoot(Path equinoxRepositoryPath) {
String binariesRootName = "rt.equinox.binaries.loc";
Optional<Path> 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<Path> 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 {
Expand Down

0 comments on commit 45db48c

Please sign in to comment.