Skip to content

Commit b3b4246

Browse files
committed
Support update site promotion via a declarative Jenkins pipeline
Improve the bundle names as they appear in the update sites. Upgrade to latest Tycho release. Upgrade to the latest jarsigner. Provide a functional Oomph setup, including a setup configuration and use it in the CONTRIBUTING.md. Ensure that the nightly target works. Reduce workspace warnings. #328 #330
1 parent 2925100 commit b3b4246

File tree

58 files changed

+961
-216
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+961
-216
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ src-gen/
77
xtend-gen/
88
xtext-gen/
99
target/
10+
/xpect/updates
1011
xpect-local-maven-repository

.project

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,15 @@
88
</buildSpec>
99
<natures>
1010
</natures>
11+
<filteredResources>
12+
<filter>
13+
<id>1697202706223</id>
14+
<name></name>
15+
<type>30</type>
16+
<matcher>
17+
<id>org.eclipse.ui.ide.multiFilter</id>
18+
<arguments>1.0-projectRelativePath-matches-false-true-org.eclipse.(xpect|xtext).*/.*</arguments>
19+
</matcher>
20+
</filter>
21+
</filteredResources>
1122
</projectDescription>

CONTRIBUTING.md

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,23 @@
1-
Contributions are welcome.
1+
# Contributing to Eclipse Xpect
22

3-
## Eclipse Contributor Agreement
4-
Before your contribution can be accepted by the project team contributors must
5-
electronically sign the Eclipse Contributor Agreement (ECA).
3+
Thanks for your interest in this project.
64

7-
* http://www.eclipse.org/legal/ECA.php
5+
## Creating an Eclipse Development Environment
86

9-
Commits that are provided by non-committers must have a Signed-off-by field in
10-
the footer indicating that the author is aware of the terms by which the
11-
contribution has been provided to the project. The non-committer must
12-
additionally have an Eclipse Foundation account and must have a signed Eclipse
13-
Contributor Agreement (ECA) on file.
14-
For more information, please see the Eclipse Committer Handbook:
15-
https://www.eclipse.org/projects/handbook/#resources-commit
7+
You can set up a pre-configured IDE for the development of Xpect using the following link:
8+
9+
[![Create Eclipse Development Environment for Xpect](https://download.eclipse.org/oomph/www/setups/svg/Xpect.svg)](https://www.eclipse.org/setups/installer/?url=https://raw.githubusercontent.com/eclipse/Xpect/master/org.eclipse.xpect.releng/XpectConfiguration.setup&show=true "Click to open Eclipse-Installer Auto Launch or drag onto your running installer's title area")
10+
11+
12+
13+
## General Processes and Workflows
14+
15+
The [eclipse-platform](https://github.com/eclipse-platform/.github/blob/main/CONTRIBUTING.md) provides detailed contribution information that is generally applicable also for Xpect.
16+
17+
18+
## Contact
19+
20+
Contact the project developers via issues (preferred) or via "xpect-dev" mailing list.
21+
22+
* https://github.com/eclipse/Xpect/issues
23+
* https://dev.eclipse.org/mailman/listinfo/xpect-dev

Jenkinsfile

Lines changed: 175 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -1,117 +1,187 @@
1-
/*******************************************************************************
2-
* Copyright (c) 2012-2017 TypeFox GmbH and itemis AG.
3-
* This program and the accompanying materials are made
4-
* available under the terms of the Eclipse Public License 2.0
5-
* which is available at https://www.eclipse.org/legal/epl-2.0/
6-
*
7-
* SPDX-License-Identifier: EPL-2.0
8-
*
9-
* Contributors:
10-
* Moritz Eysholdt - Initial contribution and API
11-
*******************************************************************************/
12-
13-
timestamps() {
14-
properties([
15-
pipelineTriggers([cron('H 2 * * *')])
16-
])
17-
node('centos-8') {
18-
def javaHome = tool 'temurin-jdk11-latest'
19-
def java17Home = tool 'temurin-jdk17-latest'
20-
env.JAVA_HOME = "${javaHome}"
21-
def mvnHome = tool 'apache-maven-3.8.6'
22-
def mvnParams = '--batch-mode --update-snapshots -fae -Dmaven.repo.local=xpect-local-maven-repository -DtestOnly=false'
23-
try {
24-
timeout(time: 1, unit: 'HOURS') {
25-
stage('prepare workspace') {
26-
step([$class: 'WsCleanup'])
27-
// we need to live with detached head, or we need to adjust settings:
28-
// https://issues.jenkins-ci.org/browse/JENKINS-42860
29-
checkout scm
30-
}
31-
stage('log configuration') {
32-
echo("===== checking tools versions =====")
33-
sh """\
34-
git config --get remote.origin.url
35-
git reset --hard
36-
pwd
37-
ls -la
38-
${mvnHome}/bin/mvn -v
39-
${javaHome}/bin/java -version
40-
"""
41-
echo("===================================")
42-
}
43-
wrap([$class: 'Xvnc', useXauthority: true]) {
44-
stage('compile with Eclipse 2023-03 and Xtext 2.31.0') {
45-
sh "${mvnHome}/bin/mvn -P!tests -Declipsesign=true -Dtarget-platform=eclipse_2023_03-xtext_2_31_0 ${mvnParams} clean install"
46-
archiveArtifacts artifacts: 'org.eclipse.xpect.releng/p2-repository/target/repository/**/*.*,org.eclipse.xpect.releng/p2-repository/target/org.eclipse.xpect.repository-*.zip'
47-
}
48-
}
1+
pipeline {
2+
agent {
3+
label 'centos-latest'
4+
}
495

50-
wrap([$class: 'Xvnc', useXauthority: true]) {
51-
stage('test with Eclipse 2023-09 and Xtext nighly') {
52-
try{
53-
sh "JAVA_HOME=${java17Home} ${mvnHome}/bin/mvn -P!xtext-examples -Dtycho-version=2.7.5 -Dtarget-platform=eclipse_2023_09-xtext_nightly ${mvnParams} clean integration-test"
54-
}finally {
55-
junit '**/TEST-*.xml'
56-
}
57-
}
58-
}
6+
triggers {
7+
cron('H 23 * * *')
8+
}
599

60-
if(env.BRANCH_NAME?.toLowerCase() == 'master' ||
61-
env.BRANCH_NAME?.toLowerCase()?.startsWith('release_')) {
62-
stage('deploy') {
63-
withCredentials([file(credentialsId: 'secret-subkeys.asc', variable: 'KEYRING')]) {
64-
sh '''
65-
rm -r xpect-local-maven-repository
66-
gpg --batch --import "${KEYRING}"
67-
for fpr in $(gpg --list-keys --with-colons | awk -F: '/fpr:/ {print $10}' | sort -u);
68-
do
69-
echo -e "5\ny\n" | gpg --batch --command-fd 0 --expert --edit-key $fpr trust;
70-
done
71-
'''
72-
sh "${mvnHome}/bin/mvn -P!tests -P!xtext-examples -P maven-publish -Dtarget-platform=eclipse_2023_03-xtext_2_31_0 ${mvnParams} clean deploy"
73-
}
74-
}
75-
}
10+
options {
11+
buildDiscarder(logRotator(numToKeepStr: '10'))
12+
disableConcurrentBuilds()
13+
skipDefaultCheckout false
14+
}
15+
16+
tools {
17+
maven 'apache-maven-latest'
18+
jdk 'temurin-jdk17-latest'
19+
}
20+
21+
environment {
22+
PUBLISH_LOCATION = 'updates'
23+
BUILD_TIMESTAMP = sh(returnStdout: true, script: 'date +%Y%m%d%H%M').trim()
24+
}
25+
26+
parameters {
27+
choice(
28+
name: 'BUILD_TYPE',
29+
choices: ['nightly', 'milestone', 'release'],
30+
description: '''
31+
Choose the type of build.
32+
Note that a release build will not promote the build, but rather will promote the most recent milestone build.
33+
'''
34+
)
35+
36+
choice(
37+
name: 'TARGET_PLATFORM',
38+
choices: [ 'eclipse_2023_03-xtext_2_31_0', 'eclipse_2023_09-xtext_nightly' ],
39+
description: '''
40+
Choose the named target platform against which to compile and test.
41+
This is relevant only for nightly and milestone builds.
42+
'''
43+
)
44+
45+
booleanParam(
46+
name: 'ECLIPSE_SIGN',
47+
defaultValue: true,
48+
description: '''
49+
Choose whether or not the bundles will be signed.
50+
This is relevant only for nightly and milestone builds.
51+
'''
52+
)
53+
54+
booleanParam(
55+
name: 'PROMOTE',
56+
defaultValue: true,
57+
description: 'Whether to promote the build to the download server.'
58+
)
59+
}
60+
61+
stages {
62+
stage('Display Parameters') {
63+
steps {
64+
script {
65+
env.BUILD_TYPE = params.BUILD_TYPE
66+
env.TARGET_PLATFORM = params.TARGET_PLATFORM
67+
68+
if (env.BRANCH_NAME == 'master') {
69+
// Only sign the master branch.
70+
env.ECLIPSE_SIGN = params.ECLIPSE_SIGN
71+
} else {
72+
env.ECLIPSE_SIGN = false
73+
}
74+
75+
// Only promote signed builds.
76+
env.PROMOTE = params.PROMOTE && (env.ECLIPSE_SIGN == 'true')
7677
}
77-
} catch(e) {
78-
currentBuild.result = 'FAILED'
79-
throw e
80-
} finally {
81-
postAlways()
78+
echo """
79+
BUILD_TIMESTAMP=${env.BUILD_TIMESTAMP}
80+
BUILD_TYPE=${env.BUILD_TYPE}
81+
TARGET_PLATFORM=${env.TARGET_PLATFORM}
82+
ECLIPSE_SIGN=${env.ECLIPSE_SIGN}
83+
PROMOTE=${env.PROMOTE}
84+
BRANCH_NAME=${env.BRANCH_NAME}
85+
"""
86+
}
87+
}
88+
89+
stage('Build') {
90+
steps {
91+
sshagent(['projects-storage.eclipse.org-bot-ssh']) {
92+
wrap([$class: 'Xvnc', useXauthority: true]) {
93+
dir('.') {
94+
sh '''
95+
if [[ $PROMOTE != true ]]; then
96+
promotion_argument='-P!promote'
97+
fi
98+
mvn \
99+
--fail-at-end \
100+
--no-transfer-progress \
101+
--update-snapshots \
102+
$promotion_argument \
103+
-Dmaven.repo.local=xpect-local-maven-repository \
104+
-Dmaven.artifact.threads=16 \
105+
-Dbuild.id=${BUILD_TIMESTAMP} \
106+
-Dgit.commit=$GIT_COMMIT \
107+
-Declipsesign=${ECLIPSE_SIGN} \
108+
-Dbuild.type=$BUILD_TYPE \
109+
-Dtycho-version=4.0.3 \
110+
-Dtarget-platform=${TARGET_PLATFORM} \
111+
-Dorg.eclipse.justj.p2.manager.build.url=$JOB_URL \
112+
-Dorg.eclipse.justj.p2.manager.relative=$PUBLISH_LOCATION \
113+
clean \
114+
verify
115+
'''
116+
}
117+
}
82118
}
119+
}
83120
}
84-
}
121+
}
85122

123+
post {
124+
failure {
125+
mail to: '[email protected]',
126+
subject: "[EMF CI] Build Failure ${currentBuild.fullDisplayName}",
127+
mimeType: 'text/html',
128+
body: "Project: ${env.JOB_NAME}<br/>Build Number: ${env.BUILD_NUMBER}<br/>Build URL: ${env.BUILD_URL}<br/>Console: ${env.BUILD_URL}/console"
129+
archiveArtifacts allowEmptyArchive: true, artifacts: '**'
130+
}
86131

87-
def postAlways() {
88-
def curResult = currentBuild.currentResult
89-
def lastResult = 'NEW'
90-
if (currentBuild.previousBuild != null) {
91-
lastResult = currentBuild.previousBuild.result
132+
fixed {
133+
mail to: '[email protected]',
134+
subject: "[EMF CI] Back to normal ${currentBuild.fullDisplayName}",
135+
mimeType: 'text/html',
136+
body: "Project: ${env.JOB_NAME}<br/>Build Number: ${env.BUILD_NUMBER}<br/>Build URL: ${env.BUILD_URL}<br/>Console: ${env.BUILD_URL}/console"
92137
}
93138

94-
if (curResult != 'SUCCESS' || lastResult != 'SUCCESS') {
95-
def color = ''
96-
switch (curResult) {
97-
case 'SUCCESS':
98-
color = '#00FF00'
99-
break
100-
case 'UNSTABLE':
101-
color = '#FFFF00'
102-
break
103-
case 'FAILURE':
104-
color = '#FF0000'
105-
break
106-
default: // e.g. ABORTED
107-
color = '#666666'
108-
}
139+
success {
140+
archiveArtifacts artifacts: 'org.eclipse.xpect.releng/p2-repository/target/repository/**/*.*,org.eclipse.xpect.releng/p2-repository/target/org.eclipse.xpect.repository-*.zip'
141+
}
109142

110-
matrixSendMessage https: true,
111-
hostname: 'matrix.eclipse.org',
112-
accessTokenCredentialsId: "matrix-token",
113-
roomId: '!aFWRHMCLJDZBzuNIRD:matrix.eclipse.org',
114-
body: "${lastResult} => ${curResult} ${env.BUILD_URL} | ${env.JOB_NAME}#${env.BUILD_NUMBER}",
115-
formattedBody: "<div><font color='${color}'>${lastResult} => ${curResult}</font> | <a href='${env.BUILD_URL}' target='_blank'>${env.JOB_NAME}#${env.BUILD_NUMBER}</a></div>"
143+
always {
144+
junit allowEmptyResults: true, testResults: '**/TEST-*.xml'
116145
}
146+
147+
cleanup {
148+
deleteDir()
149+
postAlways()
150+
}
151+
}
117152
}
153+
154+
def postAlways() {
155+
def curResult = currentBuild.currentResult
156+
def lastResult = 'NEW'
157+
if (currentBuild.previousBuild != null) {
158+
lastResult = currentBuild.previousBuild.result
159+
}
160+
161+
echo "matrix result check: curResult=${curResult} lastResult=${lastResult}"
162+
163+
if (curResult != 'SUCCESS' || lastResult != 'SUCCESS') {
164+
def color = ''
165+
switch (curResult) {
166+
case 'SUCCESS':
167+
color = '#00FF00'
168+
break
169+
case 'UNSTABLE':
170+
color = '#FFFF00'
171+
break
172+
case 'FAILURE':
173+
color = '#FF0000'
174+
break
175+
default: // e.g. ABORTED
176+
color = '#666666'
177+
}
178+
179+
echo "matrix send message"
180+
matrixSendMessage https: true,
181+
hostname: 'matrix.eclipse.org',
182+
accessTokenCredentialsId: "matrix-token",
183+
roomId: '!aFWRHMCLJDZBzuNIRD:matrix.eclipse.org',
184+
body: "${lastResult} => ${curResult} ${env.BUILD_URL} | ${env.JOB_NAME}#${env.BUILD_NUMBER}",
185+
formattedBody: "<div><font color='${color}'>${lastResult} => ${curResult}</font> | <a href='${env.BUILD_URL}' target='_blank'>${env.JOB_NAME}#${env.BUILD_NUMBER}</a></div>"
186+
}
187+
}

README.md

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,21 @@
1-
<!--
2-
Copyright (c) 2012-2017 TypeFox GmbH and itemis AG.
3-
This program and the accompanying materials are made
4-
available under the terms of the Eclipse Public License 2.0
5-
which is available at https://www.eclipse.org/legal/epl-2.0/
6-
SPDX-License-Identifier: EPL-2.0
1+
# Eclipse Xpect
72

8-
Contributors:
9-
Moritz Eysholdt - Initial contribution and API
10-
-->
11-
12-
# Xpect
13-
14-
A unit- and integration-testing framework that stores test data in any kind of text files and is based on JUnit.
3+
Xpect&trade; is a unit- and integration-testing framework that stores test data in any kind of text files and is based on JUnit.
154
The core focus of Xpect is on testing Xtext languages and supporting the process of designing Xtext languages.
165

6+
## Documentation
177

18-
## Installation further Information
19-
20-
Go to http://www.xpect-tests.org (and look for an Eclipse update-site).
8+
Visit [xpect-tests.org](http://www.xpect-tests.org) for details.
219

2210
#### Nightly builds
2311

2412
Use Jenkins https://ci.eclipse.org/xpect/job/Xpect/job/master/lastSuccessfulBuild/artifact/org.eclipse.xpect.releng/p2-repository/target/repository/
2513

14+
15+
# Contributing
16+
17+
See [CONTRIBUTING.md](CONTRIBUTING.md) for details.
18+
2619
## Compile and Build Xpect by Yourself
2720

2821
Prerequisite: Java 11 or newer; Eclipse (2023-03 or newer recommended); Xtext 2.31.0.
@@ -32,6 +25,3 @@ Prerequisite: Java 11 or newer; Eclipse (2023-03 or newer recommended); Xtext 2.
3225
3. Set target platform to /org.eclipse.xpect.releng/target-platforms/eclipse_2023_03-xtext_2_31_0/org.eclipse.xpect.target.eclipse_2023_03-xtext_2_31_0.target (Preferences -> Plug-in Development -> Target Platform)
3326
4. Run /org.eclipse.xpect/src/org/eclipse/xpect/GenerateXpect.mwe2, /org.xtext.example.arithmetics/src/org/eclipse/xpect/example/arithmetics/GenerateXpect.mwe2, /org.xtext.example.domainmodel/src/org/xtext/example/domainmodel/GenerateDomainmodel.mwe2. Now your projects should be without errors markers. Sometimes, even after these steps, several projects still have error markers. However, this is a refresh problem in Eclipse. Simply clean build the projects with error markers will solve the issues.
3427
5. Run `mvn -P '!tests' -Dtarget-platform=eclipse_2023_03-xtext_2_31_0 --batch-mode --update-snapshots -fae -Dmaven.repo.local=xpect-local-maven-repository -DtestOnly=false clean install` to build artefacts and create a p2 repository (formerly known as update site).
35-
36-
37-

0 commit comments

Comments
 (0)