Skip to content

Commit 5c9180b

Browse files
committed
[Build] Build binaries in GH-workflows and fix local mac binaries build
Building the binaries in all workflows allows to test changes in the natives in verification builds immediately on all platforms and not only on Linux because Jenkins re-builds the binaries. Additionally this saves a lot of precious Git-LFS bandwidth.
1 parent 4cbfbd3 commit 5c9180b

File tree

5 files changed

+14
-7
lines changed

5 files changed

+14
-7
lines changed

.github/workflows/maven.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,16 @@ jobs:
3838
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
3939
with:
4040
fetch-depth: 0 # required for jgit timestamp provider to work
41-
lfs: true
41+
lfs: false # lfs-pull is not necessary, the natives are re-build in each run
4242
- name: Install Linux requirements
43-
run: sudo apt-get update -qq && sudo apt-get install -qq -y webkit2gtk-driver
43+
run: |
44+
sudo apt-get update -qq
45+
sudo apt-get install -qq -y libgtk-3-dev freeglut3-dev webkit2gtk-driver
4446
if: ${{ matrix.config.native == 'gtk.linux.x86_64'}}
47+
- name: Pull large static Windows binaries
48+
run: |
49+
git lfs pull --include='/binaries/org.eclipse.swt.win32.win32.x86_64/WebView2Loader.dll'
50+
if: ${{ matrix.config.native == 'win32.win32.x86_64'}}
4551
- name: Set up Java ${{ matrix.java }}
4652
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4.0.0
4753
with:
@@ -58,6 +64,7 @@ jobs:
5864
run: >-
5965
mvn --batch-mode -V -U
6066
-DforkCount=1
67+
-Dnative=${{ matrix.config.native }}
6168
-Dcompare-version-with-baselines.skip=true
6269
-Dtycho.baseline.replace=none
6370
-Dmaven.compiler.failOnWarning=true

binaries/org.eclipse.swt.cocoa.macosx.aarch64/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ src.includes = about.html,about_files/
1919
pom.model.property.os=macosx
2020
pom.model.property.ws=cocoa
2121
pom.model.property.arch=aarch64
22-
pom.model.property.targets=
22+
pom.model.property.targets=install

binaries/org.eclipse.swt.cocoa.macosx.x86_64/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ src.includes = about.html,about_files/
1919
pom.model.property.os=macosx
2020
pom.model.property.ws=cocoa
2121
pom.model.property.arch=x86_64
22-
pom.model.property.targets=
22+
pom.model.property.targets=install

binaries/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@
140140
<then>
141141
<property name="build_dir" value="${project.build.directory}/natives-build-temp"/>
142142
<exec executable="${java.home}/bin/java" dir="${swtMainProject}" failonerror="true">
143-
<arg line="-Dws=${ws} build-scripts/CollectSources.java -nativeSources '${build_dir}'"/>
143+
<arg line="-Dws=${ws} -Darch=${arch} build-scripts/CollectSources.java -nativeSources '${build_dir}'"/>
144144
</exec>
145145
<property name="SWT_JAVA_HOME" value="${java.home}"/><!-- Not overwritten if already set, e.g. as CLI argument -->
146146
<echo>Compile SWT natives against headers and libraries from JDK: ${SWT_JAVA_HOME}</echo>

bundles/org.eclipse.swt/build-scripts/CollectSources.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ private static void collectNativeSources(ScriptEnvironment env) throws IOExcepti
6868
String commonSources = sources.get("src_common");
6969
String nativeSources = sources.get("src_" + env.ws);
7070
List<String> allSources = Arrays.asList((commonSources + "," + nativeSources).split(","));
71-
System.out.println("Copy " + allSources.size() + " java source folders for " + env.ws + "." + env.arch);
71+
System.out.println("Copy " + allSources.size() + " native source folders for " + env.ws + "." + env.arch);
7272
copySubDirectories(env.swtProjectRoot, allSources, env.targetDirectory, Set.of());
7373
}
7474

@@ -88,7 +88,7 @@ private static void collectJavaSources(ScriptEnvironment env) throws Exception {
8888
}
8989
Set<String> srcClassPaths = readNativeJavaSourcesFromClasspath(classpathFile);
9090
Set<String> excludedExtensions = Set.of("_properties", "extras", "bridgesupport");
91-
System.out.println("Copy " + srcClassPaths.size() + " native source folders for" + env.ws + "." + env.arch);
91+
System.out.println("Copy " + srcClassPaths.size() + " java source folders for" + env.ws + "." + env.arch);
9292
copySubDirectories(env.swtProjectRoot, srcClassPaths, env.targetDirectory, excludedExtensions);
9393
}
9494

0 commit comments

Comments
 (0)