Skip to content

Commit

Permalink
maven tycho (eclipse-xtext#1459)
Browse files Browse the repository at this point in the history
* use upstream

Signed-off-by: Christian Dietrich <[email protected]>

* <skipPomGeneration>true</skipPomGeneration>

* adjusted POM with configurations and latest by default

* currently latest TP from milestores

* xtend.core compiles

* added missing maven properties

* xtend-maven-plugin configured in pluginManagement

* added xtext-dev-bom to parent

* root project as Maven project (tycho-pom -> pom)

* xtend.core as Maven/Tycho project

* GitHub Actions workflow

* build with Java 17

Error:  org.eclipse.m2e.core 2.0.5.20221128-1757 requires Execution Environment that matches (&(osgi.ee=JavaSE)(version=17)) but the current resolution context uses [a.jre.javase 11.0.0]
Error:  Cannot resolve target definition:
Error:    Software being installed: org.eclipse.m2e.feature.feature.group 2.1.2.20221130-2239
Error:    Missing requirement: org.eclipse.m2e.core 2.0.5.20221128-1757 requires 'osgi.ee; (&(osgi.ee=JavaSE)(version=17))' but it could not be found
Error:    Cannot satisfy dependency: org.eclipse.m2e.feature.feature.group 2.1.2.20221130-2239 depends on: org.eclipse.equinox.p2.iu; org.eclipse.m2e.core [2.0.5.20221128-1757,2.0.5.20221128-1757]

* POM only builds xtend.core

* xtend.core.tests compiles

* renamed test classes to follow surefire convention

* xtend.core.tests executed with tycho-surefire

* skip testCompileSymlinkedResource on Windows

because of symlinks

* ide.common compiles

* xtend.ide.common as Maven/Tycho project

* xtend.ide as Maven/Tycho project

* xtend.ide.tests output to target/classes

* converted to Maven project

* refer to .target with a file path

* ide.tests.data as Maven/Tycho project

* ide.tests run in the build

* xvfb in Linux GitHub Actions

* Revert "skip testCompileSymlinkedResource on Windows"

This reverts commit 7176e61fbefe923ccb6515f22505f0c651c65796.

* disabled Windows on GitHub Actions

it's too flaky for UI tests

* xtend.m2e Maven nature

* xtend.standalone as Maven project

* .ide.tests no test source folders: needed by .performance.tests

* performance.tests in the build

* xtend.doc in the build

* xtend.examples built

* fixed openPreferences in SWTBot tests for macOS

* swtbot.tests as Maven project

* xtend-maven-plugin in performance.tests

* additional TP environment aarch64 for macOS

* SWTBot tests in the build

* moved swtbot tests as last

* correctly ignore .DS_Store

* new p2 repository project

* updated classpath of maven archetype and plugin

* added new maven.releng project

* GitHub Actions job for Maven artifacts

* removed the old maven-pom.xml

* removed reference to gradle local-repo

* -PuseJenkinsSnapshots in GitHub Actions as well

* updated Jenkins build files

* archive build directory in Jenkins

* some "x-friend" for core.tests

* removed gradle buildcommand from root project

* temurin-jdk17-latest first in Jenkinsfile

* [eclipse-xtext#1212] add workaround for RebuildAffectedResourcesTest flakyness
Signed-off-by: Christian Dietrich <[email protected]>

* extracted tests from suite

* move TP latest first in Jenkinsfile

* run tycho build first in Jenkins

* GitHub Actions: if condition for xvfb-run on Linux

* updated build for signing/deploy

* jenkinsfile for deploying Maven artifacts

* -PuseJenkinsSnapshots when maven deploy

* also deploy xtend.ide.common

* always use project.version for xtext deps

* -P useJenkinsSnapshots in Jenkins

* removed old xtend.maven.releng project

* xtend.maven.parent inherits from the main parent

* harmonized parent POM with xtext-lib

* exec-maven-plugin

* disabled signing and javadoc profile

* tycho.tests.parent to aggregator

* bumped version 2.31.0 in POMs

* removed gradle files

* don't sign maven artifacts

---------

Signed-off-by: Christian Dietrich <[email protected]>
Co-authored-by: Christian Dietrich <[email protected]>
  • Loading branch information
LorenzoBettini and cdietrich authored Mar 10, 2023
1 parent bf1d415 commit 2382bcc
Show file tree
Hide file tree
Showing 156 changed files with 1,947 additions and 2,266 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/clear-all-caches.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Clear all caches

on:
workflow_dispatch:

permissions:
actions: write

jobs:
clear-all-caches:
runs-on: ubuntu-latest
steps:
- name: Clear cache
uses: actions/github-script@v6
with:
script: |
console.log("About to clear")
const caches = await github.rest.actions.getActionsCacheList({
owner: context.repo.owner,
repo: context.repo.repo,
})
for (const cache of caches.data.actions_caches) {
console.log(cache)
github.rest.actions.deleteActionsCacheById({
owner: context.repo.owner,
repo: context.repo.repo,
cache_id: cache.id,
})
}
console.log("Clear completed")
68 changes: 68 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Build

on:
push:
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'

jobs:
build:
strategy:
matrix:
os: ['ubuntu-latest', 'macos-latest' ] # 'windows-latest' too flaky
fail-fast: false
runs-on: ${{ matrix.os }}

steps:
- name: 'Check out repository'
uses: actions/checkout@v3

- name: 'Set up Java'
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'temurin'

- name: 'Cache Maven packages'
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml', '**/*.target') }}
restore-keys: ${{ runner.os }}-m2

- name: Build and test (headless with xvfb in Linux)
run: xvfb-run mvn clean verify -PuseJenkinsSnapshots
if: matrix.os == 'ubuntu-latest'
working-directory: org.eclipse.xtext.p2.releng

- name: Build and test (in other OSes)
run: mvn clean verify -PuseJenkinsSnapshots
if: matrix.os != 'ubuntu-latest'
working-directory: org.eclipse.xtext.p2.releng

build-maven-artifacts:
runs-on: ubuntu-latest

steps:
- name: 'Check out repository'
uses: actions/checkout@v3

- name: 'Set up Java'
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'temurin'

- name: 'Cache Maven packages'
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml', '**/*.target') }}
restore-keys: ${{ runner.os }}-maven

- name: Build Maven artifacts
run: mvn clean verify -PuseJenkinsSnapshots
working-directory: org.eclipse.xtext.maven.releng
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ target/
*._trace
*.xtendbin
org.eclipse.buildship.core.prefs
/.DS_Store
.DS_Store
20 changes: 12 additions & 8 deletions .project
Original file line number Diff line number Diff line change
@@ -1,28 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>xtext-xtend</name>
<comment>Project xtext-xtend created by Buildship.</comment>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
<filteredResources>
<filter>
<id>1467961783301</id>
<id>1674841737238</id>
<name></name>
<type>10</type>
<matcher>
<id>org.eclipse.ui.ide.multiFilter</id>
<arguments>1.0-name-matches-false-false-org.eclipse.xtend.*</arguments>
</matcher>
</filter>
<filter>
<id>1674841737248</id>
<name></name>
<type>10</type>
<matcher>
<id>org.eclipse.ui.ide.multiFilter</id>
<arguments>1.0-name-matches-false-false-org.eclipse.xtext.*</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
2 changes: 1 addition & 1 deletion .settings/org.eclipse.core.resources.prefs
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
eclipse.preferences.version=1
encoding/<project>=UTF-8
encoding/<project>=ISO-8859-1
File renamed without changes.
16 changes: 0 additions & 16 deletions 1-gradle-build.sh

This file was deleted.

23 changes: 7 additions & 16 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ pipeline {
}

parameters {
choice(name: 'TARGET_PLATFORM', choices: ['r202203', 'r202206', 'r202209', 'r202212', 'latest'], description: 'Which Target Platform should be used?')
choice(name: 'TARGET_PLATFORM', choices: ['latest', 'r202203', 'r202206', 'r202209', 'r202212'], description: 'Which Target Platform should be used?')
// see https://wiki.eclipse.org/Jenkins#JDK
choice(name: 'JDK_VERSION', description: 'Which JDK should be used?', choices: [
'temurin-jdk11-latest', 'temurin-jdk17-latest'
'temurin-jdk17-latest', 'temurin-jdk11-latest'
])
booleanParam(
name: 'TRIGGER_DOWNSTREAM_BUILD',
Expand Down Expand Up @@ -66,31 +66,22 @@ pipeline {
}
}

stage('Gradle Build') {
steps {
sh '''
JAVA_OPTS="-Xmx1500m"
./1-gradle-build.sh
'''
}
}

stage('Maven Build & Test') {
stages { // TODO use of parallel { here kills Tycho process with OOM
stage('Maven Plugin Build') {
steps {
sh '''
export MAVEN_OPTS="-Xmx1500m"
./2-maven-plugin-build.sh -s /home/jenkins/.m2/settings.xml --local-repository=/home/jenkins/.m2/repository
./maven-build.sh
'''
} // END steps
} // END stage
stage('Maven Tycho Build') {
stage('Maven Tycho Build and Test') {
steps {
wrap([$class: 'Xvnc', takeScreenshot: false, useXauthority: true]) {
sh """
export MAVEN_OPTS=-Xmx1500m
./3-maven-tycho-build.sh -s /home/jenkins/.m2/settings.xml --tp=${selectedTargetPlatform()} --local-repository=/home/jenkins/.m2/repository
./tycho-test.sh -s /home/jenkins/.m2/settings.xml --tp=${selectedTargetPlatform()} --local-repository=/home/jenkins/.m2/repository
"""
}
}// END steps
Expand All @@ -101,7 +92,7 @@ pipeline {

post {
always {
junit testResults: '**/target/surefire-reports/*.xml, **/build/test-results/test/*.xml'
junit testResults: '**/target/surefire-reports/*.xml'
}
success {
archiveArtifacts artifacts: 'build/**, **/target/work/data/.metadata/.log'
Expand All @@ -118,7 +109,7 @@ pipeline {
}
}
unsuccessful {
archiveArtifacts artifacts: 'org.eclipse.xtend.ide.swtbot.tests/screenshots/**, build/**, **/target/work/data/.metadata/.log, **/hs_err_pid*.log'
archiveArtifacts artifacts: 'org.eclipse.xtend.ide.swtbot.tests/screenshots/**, **/target/work/data/.metadata/.log, **/hs_err_pid*.log'
}
cleanup {
script {
Expand Down
21 changes: 21 additions & 0 deletions RUN_ME_before_tests.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.m2e.Maven2LaunchConfigurationType">
<intAttribute key="M2_COLORS" value="0"/>
<booleanAttribute key="M2_DEBUG_OUTPUT" value="false"/>
<stringAttribute key="M2_GOALS" value="package"/>
<booleanAttribute key="M2_NON_RECURSIVE" value="false"/>
<booleanAttribute key="M2_OFFLINE" value="false"/>
<stringAttribute key="M2_PROFILES" value=""/>
<listAttribute key="M2_PROPERTIES"/>
<stringAttribute key="M2_RUNTIME" value="EMBEDDED"/>
<booleanAttribute key="M2_SKIP_TESTS" value="true"/>
<intAttribute key="M2_THREADS" value="1"/>
<booleanAttribute key="M2_UPDATE_SNAPSHOTS" value="false"/>
<stringAttribute key="M2_USER_SETTINGS" value=""/>
<booleanAttribute key="M2_WORKSPACE_RESOLUTION" value="false"/>
<booleanAttribute key="org.eclipse.debug.core.ATTR_FORCE_SYSTEM_CONSOLE_ENCODING" value="false"/>
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_ATTR_USE_ARGFILE" value="false"/>
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_SHOW_CODEDETAILS_IN_EXCEPTION_MESSAGES" value="true"/>
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_CLASSPATH_ONLY_JAR" value="false"/>
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc:/xtext-xtend}"/>
</launchConfiguration>
48 changes: 0 additions & 48 deletions build.gradle

This file was deleted.

1 change: 0 additions & 1 deletion gradle.properties

This file was deleted.

36 changes: 0 additions & 36 deletions gradle/bootstrap-setup.gradle

This file was deleted.

Loading

0 comments on commit 2382bcc

Please sign in to comment.