Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge SWT native binaries into this repository stored in Git LFS #956

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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: 1 addition & 15 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,8 @@ jobs:
- name: checkout swt
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
path: 'eclipse.platform.swt'
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,13 +52,6 @@ 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:
Expand All @@ -76,7 +64,6 @@ jobs:
-DskipNativeTests=false
-DfailIfNoTests=false
clean install
working-directory: eclipse.platform.swt
- name: Performance tests
if: contains(github.event.pull_request.labels.*.name, 'performance')
uses: coactions/setup-xvfb@b6b4fcfb9f5a895edadc3bc76318fae0ac17c8b3 # v1.0.1
Expand All @@ -91,7 +78,6 @@ jobs:
-DfailIfNoTests=true
-Dtest=PerformanceTests
integration-test
working-directory: eclipse.platform.swt/tests/org.eclipse.swt.tests
- name: Upload Test Results for ${{ matrix.config.name }} / Java-${{ matrix.java }}
if: always()
uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4.0.0
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/
56 changes: 25 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 @@ -71,17 +87,15 @@ pipeline {
}
}
sh '''
git version
git lfs version
git config --unset core.hooksPath # Jenkins disables hooks by default as security feature, but we need the hooks for LFS
git lfs update # Install Git LFS hooks in repository, which has been skipped due to the initially nulled hookspath
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'
}
}
}
stage('Check if SWT-binaries build is needed') {
Expand Down Expand Up @@ -115,7 +129,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 +219,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 +259,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 +273,6 @@ pipeline {
git status
git log -p -2
popd

pushd eclipse.platform.swt.binaries
git status
git log -p -1
popd
'''
}
}
Expand All @@ -276,13 +285,6 @@ 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 \
Expand Down Expand Up @@ -310,7 +312,7 @@ 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}"
Expand All @@ -326,11 +328,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,9 +339,6 @@ 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
11 changes: 11 additions & 0 deletions binaries/binaries-parent/build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?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}" />

<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>v20240108-0716</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
Loading