Skip to content

Commit

Permalink
Move SWT native binaries in this repository stored in Git LFS
Browse files Browse the repository at this point in the history
Configure this Git-repository to store the SWT native binaries, i.e. all
*.dll, *.so and *jnilib files, using Git's Large File Storage (LFS) and
move the platform-specific SWT fragments from the
eclipse.platform.swt.binaries repository into the binaries folder in
this repository.

The platform specific projects are (minimally adjusted) copies of the
corresponding projects from
https://github.com/eclipse-platform/eclipse.platform.swt.binaries/tree/9cdcee51a79a3f72e10e074b87326f80d3d6ada2

Only leave out the 'forceQualifier.txt' since the main bundle only
drives the qualifier.

Fixes eclipse-platform/eclipse.platform.swt.binaries#2
  • Loading branch information
HannesWell committed Jan 3, 2024
1 parent 56989d6 commit 7ebf16a
Show file tree
Hide file tree
Showing 121 changed files with 12,512 additions and 203 deletions.
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
*.bat text eol=crlf
*.dll filter=lfs diff=lfs merge=lfs -text
*.so filter=lfs diff=lfs merge=lfs -text
*.jnilib filter=lfs diff=lfs merge=lfs -text
16 changes: 3 additions & 13 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,9 @@ jobs:
- name: checkout swt
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
path: 'eclipse.platform.swt'
path: 'eclipse.platform.swt' #TODO: is this still necessary?
fetch-depth: 0 # required for jgit timestamp provider to work
- name: checkout swt.binaries
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
path: eclipse.platform.swt.binaries
repository: 'eclipse-platform/eclipse.platform.swt.binaries'
lfs: true
- name: Install Linux requirements
run: sudo apt-get update -qq && sudo apt-get install -qq -y webkit2gtk-driver
if: ${{ matrix.config.native == 'gtk.linux.x86_64'}}
Expand All @@ -57,18 +53,12 @@ jobs:
uses: stCarolas/setup-maven@v4.5
with:
maven-version: 3.9.2
- name: Build swt.binaries fragments with Maven
uses: coactions/setup-xvfb@b6b4fcfb9f5a895edadc3bc76318fae0ac17c8b3 # v1.0.1
with:
run: >-
mvn --batch-mode -Pbuild-individual-bundles -DforceContextQualifier=zzz
-Dcompare-version-with-baselines.skip=true -Dmaven.compiler.failOnWarning=true install
working-directory: eclipse.platform.swt.binaries
- name: Build with Maven
uses: coactions/setup-xvfb@b6b4fcfb9f5a895edadc3bc76318fae0ac17c8b3 # v1.0.1
with:
run: >-
mvn --batch-mode -V -U
-DforceContextQualifier=zzz
-DforkCount=1
-Dcompare-version-with-baselines.skip=false
-Dmaven.compiler.failOnWarning=true
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
bin/
*.log
target/
/.project
.polyglot.*
pom.tycho

/binaries/org.eclipse.swt.*/src/
tmpdir/
2 changes: 2 additions & 0 deletions .lfsconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#[lfs]
# url = https://lfs.github.com/eclipse-platform/eclipse.platform.swt
67 changes: 36 additions & 31 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*******************************************************************************
* Copyright (c) 2021, 2024 Red Hat Inc. and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Mickael Istria (Red Hat Inc.) - initial API and implementation
* Hannes Wellmann - Build SWT-natives as part of master- and verification-builds
* Hannes Wellmann - Move SWT native binaries in this repository using Git-LFS
*******************************************************************************/

def nativeBuildAgent(String platform, Closure body) {
def final nativeBuildStageName = 'Build SWT-native binaries'
if(platform == 'gtk.linux.x86_64') {
Expand Down Expand Up @@ -59,7 +75,14 @@ pipeline {
stages {
stage('Checkout swt git repos') {
steps {
dir ('eclipse.platform.swt') {
dir('tools') { // download git-lfs until it is available by default
sh '''
curl -L https://github.com/git-lfs/git-lfs/releases/download/v3.4.1/git-lfs-linux-amd64-v3.4.1.tar.gz | tar -xzf -
mv git-lfs-* git-lfs
'''
}
withEnv(["PATH=${WORKSPACE}/tools/git-lfs:" + env.PATH]) {
dir('eclipse.platform.swt') {
checkout scm
script {
def authorMail = sh(script: 'git log -1 --pretty=format:"%ce" HEAD', returnStdout: true)
Expand All @@ -71,16 +94,15 @@ pipeline {
}
}
sh '''
echo $PATH
git version
git lfs version
git lfs install --local # install Git LFS only locally for the repository
git lfs pull
git fetch --all --tags --quiet
git remote set-url --push origin git@github.com:eclipse-platform/eclipse.platform.swt.git
'''
}
dir ('eclipse.platform.swt.binaries') {
checkout([$class: 'GitSCM', branches: [[name: 'refs/heads/master']],
extensions: [[$class: 'CloneOption', timeout: 120, noTags: false ]],
userRemoteConfigs: [[url: 'https://github.com/eclipse-platform/eclipse.platform.swt.binaries.git']]
])
sh 'git remote set-url --push origin git@github.com:eclipse-platform/eclipse.platform.swt.binaries.git'
}
}
}
Expand Down Expand Up @@ -115,7 +137,7 @@ pipeline {
stages {
stage("Collect SWT-native's sources") {
steps {
dir('eclipse.platform.swt.binaries/bundles'){
dir('eclipse.platform.swt/binaries'){
withAnt(installation: 'apache-ant-latest', jdk: 'openjdk-jdk11-latest') { // nashorn javascript-engine required in ant-scripts
sh '''
pfSpec=(${PLATFORM//"."/ })
Expand Down Expand Up @@ -205,7 +227,7 @@ pipeline {
fi
}
binaryFragmentsRoot=${WORKSPACE}/eclipse.platform.swt.binaries/bundles
binaryFragmentsRoot=${WORKSPACE}/eclipse.platform.swt/binaries
if [[ ${PLATFORM} == cocoa.macosx.* ]]; then
#TODO: Instead use (with adjusted URL): https://github.com/eclipse-cbi/org.eclipse.cbi/tree/main/maven-plugins/eclipse-winsigner-plugin
Expand Down Expand Up @@ -245,7 +267,7 @@ pipeline {
withAnt(installation: 'apache-ant-latest', jdk: 'openjdk-jdk11-latest') { // nashorn javascript-engine required in ant-scripts
//The maven build reads the git-history so we should have to commit the native-binaries before building
sh '''
pushd eclipse.platform.swt.binaries
pushd eclipse.platform.swt
git add --all *
echo "git status after add"
git status
Expand All @@ -259,11 +281,6 @@ pipeline {
git status
git log -p -2
popd
pushd eclipse.platform.swt.binaries
git status
git log -p -1
popd
'''
}
}
Expand All @@ -276,17 +293,11 @@ pipeline {
}
steps {
xvnc(useXauthority: true) {
dir ('eclipse.platform.swt.binaries') {
sh '''
mvn install \
--batch-mode -Pbuild-individual-bundles -DforceContextQualifier=zzz \
-Dcompare-version-with-baselines.skip=true -Dmaven.compiler.failOnWarning=true
'''
}
dir ('eclipse.platform.swt') {
sh '''
mvn clean verify \
--batch-mode -DforkCount=0 \
-DforceContextQualifier=zzz
-Dcompare-version-with-baselines.skip=false -Dmaven.compiler.failOnWarning=true \
-Dmaven.test.failure.ignore=true -Dmaven.test.error.ignore=true
'''
Expand All @@ -310,10 +321,11 @@ pipeline {
sshagent(['github-bot-ssh']) {
script {
def newSWTNativesTag = null;
dir ('eclipse.platform.swt.binaries') {
dir ('eclipse.platform.swt') {
newSWTNativesTag = sh(script: 'git describe --abbrev=0 --tags --match v[0-9][0-9][0-9][0-9]*', returnStdout: true).strip()
}
echo "newSWTNativesTag: ${newSWTNativesTag}"
withEnv(["PATH=${WORKSPACE}/tools/git-lfs:" + env.PATH]) { //TODO: remove this once GIT-LFS is installed by default
sh """
# Check for the master-branch as late as possible to have as much of the same behaviour as possible
if [[ '${BRANCH_NAME}' == master ]] || [[ '${BRANCH_NAME}' =~ R[0-9]+_[0-9]+(_[0-9]+)?_maintenance ]]; then
Expand All @@ -326,11 +338,6 @@ pipeline {
git push origin refs/tags/${newSWTNativesTag}
popd
pushd eclipse.platform.swt.binaries
git push origin HEAD:refs/heads/${BRANCH_NAME}
git push origin refs/tags/${newSWTNativesTag}
popd
exit 0
else
echo Committing is skipped
Expand All @@ -342,10 +349,8 @@ pipeline {
pushd eclipse.platform.swt
git log -n 2
popd
pushd eclipse.platform.swt.binaries
git log -n 2
popd
"""
}
}
}
}
Expand Down
1 change: 0 additions & 1 deletion NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,5 @@ The project maintains the following source code repositories:
* https://github.com/eclipse-platform/eclipse.platform.releng.buildtools.git
* https://github.com/eclipse-platform/eclipse.platform.releng.git
* https://github.com/eclipse-platform/eclipse.platform.swt.git
* https://github.com/eclipse-platform/eclipse.platform.swt.binaries.git
* https://github.com/eclipse-platform/eclipse.platform.ua.git
* https://github.com/eclipse-platform/eclipse.platform.ui.git
14 changes: 14 additions & 0 deletions binaries/binaries-parent/build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="org.eclipse.swt.${ws}.${os}.${arch}" default="build.jars" basedir=".">

<property name="swt.ws" value="${ws}" />
<property name="swt.os" value="${os}" />
<property name="swt.arch" value="${arch}" />

<!-- These properties are used by eclipse when exporting as Deployable plugin and fragments -->
<property name="version.suffix" value="3.123.100" />

<property name="plugindir" value="../../bundles/org.eclipse.swt"/>
<import file="${plugindir}/buildFragment.xml"/>
<import file="${plugindir}/buildSWT.xml"/>
</project>
164 changes: 164 additions & 0 deletions binaries/binaries-parent/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--
###############################################################################
# Copyright (c) 2012, 2018 Red Hat, Inc and others.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html
#
# Contributors:
# Krzysztof Daniel, Red Hat, Inc. - initial API and implementation
###############################################################################
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>eclipse.platform.swt.binaries</artifactId>
<groupId>eclipse.platform.swt.binaries</groupId>
<version>4.31.0-SNAPSHOT</version>
</parent>

<artifactId>binaries-parent</artifactId>
<packaging>pom</packaging>

<properties>
<!--
forceContextQualifier gets updated during build input process using
ant script <SWT source repo>/bundles/org.eclipse.swt/buildInternal.xml
-->
<forceContextQualifier>v20240102-1528</forceContextQualifier>
<buildid>${buildId}</buildid>
</properties>

<build>
<plugins>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<configuration>
<filesets>
<fileset>
<directory>src</directory>
<includes>
<include>**/*</include>
</includes>
<followSymlinks>false</followSymlinks>
</fileset>
</filesets>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-compiler-plugin</artifactId>
<configuration>
<release>17</release>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-packaging-plugin</artifactId>
<configuration>
<forceContextQualifier>${forceContextQualifier}</forceContextQualifier>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<configuration>
<executionEnvironment>JavaSE-17</executionEnvironment>
<dependency-resolution>
<profileProperties>
<!-- set property so that the filter condition on the p2 dependencies from org.eclipse.swt to the fragments does not match -->
<org.eclipse.swt.buildtime>true</org.eclipse.swt.buildtime>
</profileProperties>
</dependency-resolution>
<environments>
<environment>
<os>${os}</os>
<ws>${ws}</ws>
<arch>${arch}</arch>
</environment>
</environments>
</configuration>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>normal</id>
<phase>initialize</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<property name="copy.src.dir" value="src" />
<ant antfile="../binaries-parent/build.xml" target="copy.${ws}.src" />
</target>
</configuration>
</execution>
<execution>
<id>natives</id>
<phase>process-resources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<!-- See https://stackoverflow.com/a/53227117 and http://ant-contrib.sourceforge.net/tasks/tasks/index.html -->
<taskdef resource="net/sf/antcontrib/antlib.xml" />
<if>
<equals arg1="${native}" arg2="${ws}.${os}.${arch}" />
<then>
<ant antfile="../binaries-parent/build.xml" target="build_libraries" />
</then>
</if>
</target>
</configuration>
</execution>
<execution>
<id>swtdownload</id>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<property name="eclipse.version" value="${releaseNumberSDK}" />
<ant antfile="../binaries-parent/build.xml" target="swtdownload" />
</target>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.mozilla</groupId>
<artifactId>rhino-runtime</artifactId>
<version>1.7.14</version>
</dependency>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
<version>1.10.14</version>
</dependency>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant-apache-bsf</artifactId>
<version>1.10.14</version>
</dependency>
<dependency>
<groupId>ant-contrib</groupId>
<artifactId>ant-contrib</artifactId>
<version>1.0b3</version>
<exclusions>
<exclusion>
<groupId>ant</groupId>
<artifactId>ant</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
Loading

0 comments on commit 7ebf16a

Please sign in to comment.