Skip to content

Commit

Permalink
[Build] Remove unused ant tasks and properties
Browse files Browse the repository at this point in the history
Assume that natives are only build in the Jenkins pipeline or in a Maven
build using -Dnative=${os}.${ws}.${arch}

The "SWT Classpath Builder.launch" is not necessary anymore since Oomph
does the same and the .classpath file suitable for the running platform
can also be easily selected and renamed manually.

Part of #513
  • Loading branch information
HannesWell committed Jan 6, 2024
1 parent ee1cbf9 commit df73b36
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 660 deletions.
20 changes: 10 additions & 10 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
def nativeBuildAgent(String platform, Closure body) {
def final nativeBuildStageName = 'Build SWT-native binaries'
if(platform == 'gtk.linux.x86_64') {
if (platform == 'gtk.linux.x86_64') {
return podTemplate(yaml: '''
apiVersion: v1
kind: Pod
Expand Down Expand Up @@ -59,7 +59,7 @@ pipeline {
stages {
stage('Checkout swt git repos') {
steps {
dir ('eclipse.platform.swt') {
dir('eclipse.platform.swt') {
checkout scm
script {
def authorMail = sh(script: 'git log -1 --pretty=format:"%ce" HEAD', returnStdout: true)
Expand All @@ -75,7 +75,7 @@ pipeline {
git remote set-url --push origin git@github.com:eclipse-platform/eclipse.platform.swt.git
'''
}
dir ('eclipse.platform.swt.binaries') {
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']]
Expand All @@ -102,7 +102,7 @@ pipeline {
when {
anyOf {
expression { return params.forceNativeBuilds }
expression { return fileExists ('tmp/build_changed.txt') && fileExists ('tmp/natives_changed.txt') }
expression { return fileExists('tmp/build_changed.txt') && fileExists('tmp/natives_changed.txt') }
}
}
matrix {
Expand Down Expand Up @@ -151,7 +151,7 @@ pipeline {
}
// TODO: don't zip the sources and just (un)stash them unzipped! That safes the unzipping and removal of the the zip
withEnv(['MODEL=' + arch, "OUTPUT_DIR=${WORKSPACE}/libs", "SWT_JAVA_HOME=${WORKSPACE}/jdk.resources"]) {
if(isUnix()){
if (isUnix()){
sh '''
unzip -aa org.eclipse.swt.${PLATFORM}.master.zip
rm org.eclipse.swt.${PLATFORM}.master.zip
Expand Down Expand Up @@ -239,7 +239,7 @@ pipeline {
}
stage('Commit SWT-native binaries, if build') {
when {
expression { return params.forceNativeBuilds || fileExists ('tmp/build_changed.txt') }
expression { return params.forceNativeBuilds || fileExists('tmp/build_changed.txt') }
}
steps {
withAnt(installation: 'apache-ant-latest', jdk: 'openjdk-jdk11-latest') { // nashorn javascript-engine required in ant-scripts
Expand Down Expand Up @@ -276,14 +276,14 @@ pipeline {
}
steps {
xvnc(useXauthority: true) {
dir ('eclipse.platform.swt.binaries') {
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') {
dir('eclipse.platform.swt') {
sh '''
mvn clean verify \
--batch-mode -DforkCount=0 \
Expand All @@ -304,13 +304,13 @@ pipeline {
}
stage('Push SWT-native binaries, if build') {
when {
expression { return params.forceNativeBuilds || fileExists ('tmp/build_changed.txt') }
expression { return params.forceNativeBuilds || fileExists('tmp/build_changed.txt') }
}
steps {
sshagent(['github-bot-ssh']) {
script {
def newSWTNativesTag = null;
dir ('eclipse.platform.swt.binaries') {
dir('eclipse.platform.swt.binaries') {
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 Down

This file was deleted.

74 changes: 0 additions & 74 deletions bundles/org.eclipse.swt/build.xml

This file was deleted.

122 changes: 1 addition & 121 deletions bundles/org.eclipse.swt/buildFragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@

<project name="org.eclipse.swt.fragment" default="" basedir=".">

<target name="init" depends="properties">
<target name="init">
<property name="compilerArg" value="" />
<condition property="fragment" value="org.eclipse.swt.${swt.ws}.${swt.os}.${swt.arch}" else="org.eclipse.swt.${swt.ws}.${swt.os}">
<isset property="swt.arch"/>
</condition>
<property name="full.name" value="${fragment}_${version.suffix}" />
<property name="fragmentdir" value="${basedir}" />
<property name="temp.folder" value="${fragmentdir}/temp.folder" />
<property name="plugin.destination" value="${fragmentdir}" />
Expand All @@ -35,21 +34,6 @@
<mkdir dir="target"/>
</target>

<target name="properties" if="eclipse.running">
<property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter" />
</target>

<target name="build.update.jar" depends="init">
<delete dir="${temp.folder}" />
<mkdir dir="${temp.folder}" />
<antcall target="build.jars" />
<antcall target="gather.bin.parts">
<param name="destination.temp.folder" value="${temp.folder}/" />
</antcall>
<zip zipfile="${plugin.destination}/${full.name}.jar" basedir="${temp.folder}/${full.name}" filesonly="false" />
<delete dir="${temp.folder}" />
</target>

<target name="@dot" depends="init" unless="@dot" description="Create jar: @dot.">
<property name="destdir" value="${temp.folder}/@dot.bin" />
<property name="debug" value="true" />
Expand Down Expand Up @@ -79,7 +63,6 @@
<attribute name="SWT-OS" value="${swt.os}"/>
<attribute name="SWT-WS" value="${swt.ws}"/>
<attribute name="SWT-Arch" value="${arch}"/>
<attribute name="Implementation-Version" value="${version.suffix}"/>
<attribute name="Eclipse-Version" value="${eclipse.version}"/>
</manifest>
</jar>
Expand All @@ -104,18 +87,6 @@
<delete dir="${temp.folder}/@dot.src"/>
</target>

<target name="copy.src" depends="init">
<antcall target="copy.${swt.ws}.src"/>
<copy todir="${destination.temp.folder}/" failonerror="true" overwrite="true">
<fileset dir="${temp.folder}/@dot.src" includes="**/*.java"/>
<fileset dir="${temp.folder}/@dot.src" includes="**/*.properties"/>
<fileset dir="${temp.folder}/@dot.src/library/"/>
<fileset dir="${temp.folder}/@dot.src" includes="**/version.txt"/>
<fileset dir="${fragmentdir}" includes="about.html,about_files/"/>
</copy>
<delete dir="${temp.folder}/@dot.src"/>
</target>

<target name="copy.cocoa.src">
<property name="copy.src.dir" value="${temp.folder}/@dot.src"/>
<delete dir="${copy.src.dir}" quiet="true"/>
Expand Down Expand Up @@ -222,48 +193,6 @@
<antcall target="src.zip" />
</target>

<target name="build.zips" depends="init">
</target>

<target name="gather.sources" depends="init" if="destination.temp.folder">
<mkdir dir="${destination.temp.folder}/${full.name}" />
<copy file="${build.result.folder}/src.zip" todir="${destination.temp.folder}/${full.name}/" />
<copy todir="${destination.temp.folder}/${full.name}">
<fileset dir="${fragmentdir}" includes="about.html,about_files/" />
</copy>
</target>

<target name="gather.individual.sources" depends="init">
<antcall target="copy.src" />
<copy todir="${destination.temp.folder}">
<fileset dir="${fragmentdir}" includes="about.html,about_files/" />
</copy>
</target>

<target name="gather.logs" depends="init" if="destination.temp.folder">
<mkdir dir="${destination.temp.folder}/${full.name}" />
<copy file="${temp.folder}/@dot.bin${logExtension}" todir="${destination.temp.folder}/${full.name}/" />
</target>

<target name="publish.bin.parts" depends="init" if="p2.publish.parts">
<antcall target="gather.bin.parts">
<param name="destination.temp.folder" value="${build.result.folder}" />
</antcall>
<eclipse.gatherBundle metadataRepository="${p2.build.repo}" artifactRepository="${p2.build.repo}" buildResultFolder="${build.result.folder}" targetFolder="${build.result.folder}/${full.name}" />
</target>

<target name="gather.bin.parts" depends="init" if="destination.temp.folder">
<mkdir dir="${destination.temp.folder}/${full.name}" />
<copy todir="${destination.temp.folder}/${full.name}" failonerror="true">
<fileset dir="${build.result.folder}/@dot" includes="**" />
</copy>
<copy todir="${destination.temp.folder}/${full.name}">
<fileset dir="${fragmentdir}" includes="fragment.properties,about.html,about_files/,swt*.dll,libswt*.so,libswt*.sl,libswt*.a,libswt*.jnilib,libXm.so.2,META-INF/,WebView2Loader.dll" />
</copy>
<chmod perm="755" dir="${destination.temp.folder}/${full.name}" includes="swt*.dll,libswt*.so,libswt*.sl,libswt*.a,libswt*.jnilib,libXm.so.2,WebView2Loader.dll" />
<eclipse.versionReplacer path="${destination.temp.folder}/${full.name}" version="${version.suffix}" />
</target>

<target name="swtdownload" depends="init">
<delete dir="${temp.folder}" />
<delete dir="${build.result.folder}/@dot" />
Expand All @@ -290,53 +219,4 @@
<delete dir="${temp.folder}" />
</target>

<target name="clean" depends="init">
<delete dir="${build.result.folder}/@dot" />
<delete file="${build.result.folder}/src.zip" />
<delete file="${plugin.destination}/${full.name}.jar" />
<delete file="${plugin.destination}/${full.name}.zip" />
<delete dir="${temp.folder}" />
</target>

<target name="refresh" depends="init" if="eclipse.running">
<eclipse.refreshLocal resource="${fragment}" depth="infinite" />
</target>

<target name="zip.plugin" depends="init">
<delete dir="${temp.folder}" />
<mkdir dir="${temp.folder}" />
<antcall target="build.jars" />
<antcall target="build.sources" />
<antcall target="gather.bin.parts">
<param name="destination.temp.folder" value="${temp.folder}/" />
</antcall>
<antcall target="gather.sources">
<param name="destination.temp.folder" value="${temp.folder}/" />
</antcall>
<delete>
<fileset dir="${temp.folder}" includes="**/*.bin.xml" />
</delete>
<zip zipfile="${plugin.destination}/${full.name}.zip" basedir="${temp.folder}" filesonly="true" />
<delete dir="${temp.folder}" />
</target>

<target name="jar.plugin" depends="init">
<delete dir="${temp.folder}" />
<mkdir dir="${temp.folder}" />
<antcall target="build.jars" />
<antcall target="gather.bin.parts">
<param name="destination.temp.folder" value="${temp.folder}/" />
</antcall>
<condition property="arch" value="${swt.arch}" else="">
<isset property="swt.arch"/>
</condition>
<jar jarfile="${plugin.destination}/${full.name}.jar" basedir="${temp.folder}/${full.name}" filesonly="true" manifest="${fragmentdir}/META-INF/MANIFEST.MF">
<manifest>
<attribute name="SWT-OS" value="${swt.os}"/>
<attribute name="SWT-WS" value="${swt.ws}"/>
<attribute name="SWT-Arch" value="${arch}"/>
</manifest>
</jar>
<delete dir="${temp.folder}" />
</target>
</project>
Loading

0 comments on commit df73b36

Please sign in to comment.