Skip to content

Commit 2a77877

Browse files
committed
Merge pull request #173 from adangel:update-target-platform
Update target platform #173
2 parents 38af1c6 + a41af91 commit 2a77877

File tree

34 files changed

+481
-434
lines changed

34 files changed

+481
-434
lines changed

.ci/build.sh

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,6 @@ SCRIPT_INCLUDES="log.bash utils.bash setup-secrets.bash openjdk.bash maven.bash
88
source "$(dirname "$0")/inc/fetch_ci_scripts.bash" && fetch_ci_scripts
99

1010
function build() {
11-
pmd_ci_log_group_start "Install OpenJDK 8+17"
12-
pmd_ci_openjdk_install_adoptopenjdk 8
13-
pmd_ci_openjdk_install_adoptopenjdk 17
14-
pmd_ci_openjdk_setdefault 17
15-
pmd_ci_log_group_end
16-
1711
echo
1812
pmd_ci_maven_display_info_banner
1913
pmd_ci_utils_determine_build_env pmd/pmd-eclipse-plugin
@@ -33,7 +27,7 @@ function build() {
3327
pmd_ci_log_group_start "Build with mvnw"
3428
${xvfb_cmd} ./mvnw clean verify \
3529
--show-version --errors --batch-mode --no-transfer-progress \
36-
--toolchains .ci/files/toolchains.xml
30+
-Dtarget.platform=${TARGET_PLATFORM}
3731
pmd_ci_log_group_end
3832
exit 0
3933
fi
@@ -45,7 +39,7 @@ function build() {
4539
pmd_ci_log_group_start "Build with mvnw"
4640
${xvfb_cmd} ./mvnw clean verify \
4741
--show-version --errors --batch-mode --no-transfer-progress \
48-
--toolchains .ci/files/toolchains.xml
42+
-Dtarget.platform=${TARGET_PLATFORM}
4943
pmd_ci_log_group_end
5044

5145
pmd_ci_log_info "Stopping build here, because os is not linux"
@@ -77,13 +71,13 @@ function snapshot_build() {
7771
# Build 1 - without signing but with tests
7872
${xvfb_cmd} ./mvnw clean verify \
7973
--show-version --errors --batch-mode --no-transfer-progress \
80-
--toolchains .ci/files/toolchains.xml
74+
-Dtarget.platform=${TARGET_PLATFORM}
8175

8276
# Build 2 - with signing, but skipping tests, pmd, checkstyle
8377
${xvfb_cmd} ./mvnw clean verify \
8478
--show-version --errors --batch-mode --no-transfer-progress \
85-
--toolchains .ci/files/toolchains.xml \
8679
--activate-profiles sign \
80+
-Dtarget.platform=${TARGET_PLATFORM} \
8781
-Dpmd.skip=true -DskipTests -Dcheckstyle.skip
8882

8983
# Upload update site to sourceforge
@@ -134,13 +128,13 @@ function release_build() {
134128
# Build 1 - without signing but with tests
135129
${xvfb_cmd} ./mvnw clean verify \
136130
--show-version --errors --batch-mode --no-transfer-progress \
137-
--toolchains .ci/files/toolchains.xml
131+
-Dtarget.platform=${TARGET_PLATFORM}
138132

139133
# Build 2 - with signing, but skipping tests, pmd, checkstyle
140134
${xvfb_cmd} ./mvnw clean verify \
141135
--show-version --errors --batch-mode --no-transfer-progress \
142-
--toolchains .ci/files/toolchains.xml \
143136
--activate-profiles sign \
137+
-Dtarget.platform=${TARGET_PLATFORM} \
144138
-Dpmd.skip=true -DskipTests -Dcheckstyle.skip
145139

146140
pmd_ci_log_group_end

.ci/files/toolchains.xml

Lines changed: 0 additions & 28 deletions
This file was deleted.

.github/actions/build/action.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: 'Build'
2+
description: 'Runs the build script'
3+
inputs:
4+
targetPlatform:
5+
description: 'The eclipse target platform to build the plugins against'
6+
required: true
7+
pmdCiSecretPassphrase:
8+
description: 'Secret needed for releases'
9+
required: false
10+
githubToken:
11+
description: 'The GitHub Token used for releases'
12+
required: false
13+
14+
runs:
15+
using: 'composite'
16+
steps:
17+
- name: Build
18+
run: .ci/build.sh
19+
shell: bash
20+
env:
21+
TARGET_PLATFORM: ${{ inputs.targetPlatform }}
22+
PMD_CI_SECRET_PASSPHRASE: ${{ inputs.pmdCiSecretPassphrase }}
23+
GITHUB_TOKEN: ${{ inputs.githubToken }}

.github/actions/setup/action.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: 'Setup'
2+
description: 'Setup java and ruby, check environment'
3+
4+
runs:
5+
using: 'composite'
6+
steps:
7+
- name: Set up JDK 17
8+
id: java17
9+
uses: actions/setup-java@v3
10+
with:
11+
distribution: temurin
12+
java-version: '17'
13+
- name: Cache local Maven repository
14+
uses: actions/cache@v3
15+
with:
16+
path: ~/.m2/repository
17+
# re-cache on changes in the pom and target files
18+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml', '**/*.target') }}
19+
restore-keys: |
20+
${{ runner.os }}-maven-
21+
- name: Set up Ruby 2.7
22+
uses: ruby/setup-ruby@v1
23+
with:
24+
ruby-version: 2.7
25+
- name: Setup Environment
26+
shell: bash
27+
run: |
28+
echo "LANG=en_US.UTF-8" >> $GITHUB_ENV
29+
echo "MAVEN_OPTS=-Dmaven.wagon.httpconnectionManager.ttlSeconds=180 -Dmaven.wagon.http.retryHandler.count=3" >> $GITHUB_ENV
30+
echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/20/scripts" >> $GITHUB_ENV
31+
- name: Check Environment
32+
shell: bash
33+
run: |
34+
f=check-environment.sh; \
35+
mkdir -p .ci && \
36+
( [ -e .ci/$f ] || curl -sSL "${PMD_CI_SCRIPTS_URL}/$f" > ".ci/$f" ) && \
37+
chmod 755 .ci/$f && \
38+
.ci/$f

.github/workflows/build.yml

Lines changed: 52 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -14,44 +14,61 @@ on:
1414
workflow_dispatch:
1515

1616
jobs:
17+
# verify build on one node before multiple builds on different os are started
18+
fail-fast-build:
19+
name: verify (ubuntu-latest, 2023-03)
20+
timeout-minutes: 60
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v3
25+
26+
- name: Setup Environment
27+
uses: ./.github/actions/setup
28+
29+
- name: Build
30+
uses: ./.github/actions/build
31+
with:
32+
targetPlatform: 2023-03
33+
pmdCiSecretPassphrase: ${{ secrets.PMD_CI_SECRET_PASSPHRASE }}
34+
githubToken: ${{ secrets.GITHUB_TOKEN }}
35+
36+
1737
build:
18-
runs-on: ${{ matrix.os }}
38+
needs: fail-fast-build
39+
name: verify (${{ matrix.os }}, ${{ matrix.targetPlatform }})
40+
timeout-minutes: 60
1941
continue-on-error: false
42+
2043
strategy:
2144
matrix:
2245
os: [ ubuntu-latest, windows-latest, macos-latest ]
23-
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
46+
targetPlatform: [ 2023-03 ]
47+
exclude:
48+
# exclude the fail-fast-build, which already ran
49+
- os: ubuntu-latest
50+
targetPlatform: 2023-03
51+
# run other target platforms only on linux
52+
include:
53+
- os: ubuntu-latest
54+
targetPlatform: 2022-12
55+
- os: ubuntu-latest
56+
targetPlatform: 2022-09
57+
- os: ubuntu-latest
58+
targetPlatform: 2022-06
59+
fail-fast: true
60+
61+
runs-on: ${{ matrix.os }}
2462
steps:
25-
- uses: actions/checkout@v3
26-
- uses: actions/cache@v3
27-
with:
28-
path: |
29-
~/.m2/repository
30-
~/.cache
31-
key: ${{ runner.os }}-${{ hashFiles('**/pom.xml') }}
32-
restore-keys: |
33-
${{ runner.os }}-
34-
- name: Set up Ruby 2.7
35-
uses: ruby/setup-ruby@v1
36-
with:
37-
ruby-version: 2.7
38-
- name: Setup Environment
39-
shell: bash
40-
run: |
41-
echo "LANG=en_US.UTF-8" >> $GITHUB_ENV
42-
echo "MAVEN_OPTS=-Dmaven.wagon.httpconnectionManager.ttlSeconds=180 -Dmaven.wagon.http.retryHandler.count=3" >> $GITHUB_ENV
43-
echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/20/scripts" >> $GITHUB_ENV
44-
- name: Check Environment
45-
shell: bash
46-
run: |
47-
f=check-environment.sh; \
48-
mkdir -p .ci && \
49-
( [ -e .ci/$f ] || curl -sSL "${PMD_CI_SCRIPTS_URL}/$f" > ".ci/$f" ) && \
50-
chmod 755 .ci/$f && \
51-
.ci/$f
52-
- name: Build
53-
run: .ci/build.sh
54-
shell: bash
55-
env:
56-
PMD_CI_SECRET_PASSPHRASE: ${{ secrets.PMD_CI_SECRET_PASSPHRASE }}
57-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
63+
- name: Checkout
64+
uses: actions/checkout@v3
65+
66+
- name: Setup Environment
67+
uses: ./.github/actions/setup
68+
69+
- name: Build
70+
uses: ./.github/actions/build
71+
with:
72+
targetPlatform: ${{ matrix.targetPlatform }}
73+
pmdCiSecretPassphrase: ${{ secrets.PMD_CI_SECRET_PASSPHRASE }}
74+
githubToken: ${{ secrets.GITHUB_TOKEN }}

README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,7 @@ the repository on github and create pull requests. Any contributions are welcome
2020

2121
### Testing the latest version
2222

23-
The plugin builds with Java 17 but also requires Java 8. This is achieved through
24-
[maven toolchains](https://maven.apache.org/guides/mini/guide-using-toolchains.html).
25-
You can use [toolchains.xml](.ci/files/toolchains.xml) from this repo to
26-
configure your own `toolchains.xml` file.
23+
The plugin requires Java 17 for building.
2724

2825
Then simply build the plugin locally using maven:
2926

ReleaseNotes.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,23 @@ Eclipse Update Site:
77
* Releases: <https://pmd.github.io/pmd-eclipse-plugin-p2-site/>
88
* Snapshots: <https://pmd.github.io/pmd-eclipse-plugin-p2-site/snapshot/>
99

10-
## ????: 4.45.0.v????
10+
## ????: 7.0.0.v????
1111

12-
This is a minor release.
12+
This is a major release.
1313

1414
### New and noteworthy
1515

16+
* Beginning with version 7 of this plugin, only the last four eclipse releases are supported. The plugin
17+
might still work with older versions, but it's only developed and tested against the newer versions.
18+
19+
* The version number of the PMD Eclipse Plugin now is synchronized with the supported and used PMD version.
20+
For Bugfixes in the PMD Eclipse Plugin only, a new version is released with the same major, minor, and patch,
21+
but a new qualifier only.
22+
1623
### Fixed Issues
1724

25+
* [#172](https://github.com/pmd/pmd-eclipse-plugin/issues/172): Only support the last 4 eclipse releases
26+
1827
### API Changes
1928

2029
### External Contributions

kepler/kepler.target

Lines changed: 0 additions & 21 deletions
This file was deleted.

kepler/pom.xml

Lines changed: 0 additions & 18 deletions
This file was deleted.

net.sourceforge.pmd.eclipse.p2updatesite/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>net.sourceforge.pmd</groupId>
88
<artifactId>net.sourceforge.pmd.eclipse.parent</artifactId>
9-
<version>4.45.0-SNAPSHOT</version>
9+
<version>7.0.0-SNAPSHOT</version>
1010
<relativePath>../pom.xml</relativePath>
1111
</parent>
1212

0 commit comments

Comments
 (0)