Skip to content

Commit 198b436

Browse files
authored
Merge branch 'main' into bump-pmd-7.15.0
2 parents 56a4926 + a42a243 commit 198b436

25 files changed

+118
-112
lines changed

.ci/files/prepare_release_notes.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash
2+
set -e -o pipefail
3+
4+
outfile="release_notes_prepared.md"
5+
infile="ReleaseNotes.md"
6+
7+
if [ ! -e "$infile" ]; then
8+
echo "File ${infile} not found!"
9+
exit 1
10+
fi
11+
12+
13+
# Extract the release notes.
14+
# Note: "|| test $? -eq 141" is added to ignore SIGPIPE errors when head finishes before grep is done.
15+
BEGIN_LINE=$( (grep -n "^## " "${infile}" || test $? -eq 141) | head -1|cut -d ":" -f 1)
16+
END_LINE=$( (grep -n "^## " "${infile}" || test $? -eq 141) | head -2|tail -1|cut -d ":" -f 1)
17+
END_LINE=$((END_LINE - 1))
18+
EXTRACT=$(head -$END_LINE "${infile}" | tail -$((END_LINE - BEGIN_LINE)))
19+
20+
RELEASE_BODY="A new PMD for Eclipse plugin version has been released.
21+
It is available via the update site: https://pmd.github.io/pmd-eclipse-plugin-p2-site/
22+
23+
$EXTRACT
24+
"
25+
echo "${RELEASE_BODY}" > "${outfile}"
26+
echo "Created file ${outfile}"

.ci/files/regenerate_metadata.sh

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
#!/bin/bash
22

33
echo "Regenerating metadata for p2-site..."
4-
local releases=($(find . -maxdepth 1 -type d -regex "\./[0-9]+\.[0-9]+\.[0-9]+\..*" -printf '%f\n'| tr '.' '\0' | sort -t '\0' -k1,1nr -k2,2nr -k3,3nr -k4dr |awk -F '\0' '{printf "%s.%s.%s.%s\n", $1, $2, $3, $4}'))
4+
mapfile -t releases < <(find . -maxdepth 1 -type d -regex "\./[0-9]+\.[0-9]+\.[0-9]+\..*" -printf '%f\n'| tr '.' '\0' | sort -t '\0' -k1,1nr -k2,2nr -k3,3nr -k4dr |awk -F '\0' '{printf "%s.%s.%s.%s\n", $1, $2, $3, $4}')
55
# remove old releases
66
for i in "${releases[@]:5}"; do
7-
pmd_ci_log_info "Removing old release $i..."
7+
echo " Removing old release $i..."
88
rm -rf "$i"
99
done
1010
releases=("${releases[@]:0:5}")
1111

1212
# regenerate metadata
13-
local now
1413
now=$(date +%s000)
15-
local children=""
16-
local children_index=""
14+
children=""
15+
children_index=""
1716
for i in "${releases[@]}"; do
17+
echo " Adding release $i"
1818
children="${children} <child location=\"$i\"/>\n"
1919
children_index="${children_index} * [$i]($i/)\n"
2020
echo "This is a Eclipse Update Site for the [PMD Eclipse Plugin](https://github.com/pmd/pmd-eclipse-plugin/) ${i}.
@@ -33,8 +33,8 @@ Use <https://pmd.github.io/pmd-eclipse-plugin-p2-site/${i}/> to install the plug
3333
git add "$i"/index.md
3434
done
3535

36-
local site_name="PMD for Eclipse - Update Site"
37-
local artifactsTemplate="<?xml version=\"1.0\" encoding=\"UTF-8\"?>
36+
site_name="PMD for Eclipse - Update Site"
37+
artifactsTemplate="<?xml version=\"1.0\" encoding=\"UTF-8\"?>
3838
<?compositeArtifactRepository version=\"1.0.0\"?>
3939
<repository name=\"${site_name}\" type=\"org.eclipse.equinox.internal.p2.artifact.repository.CompositeArtifactRepository\" version=\"1.0.0\">
4040
<properties size=\"2\">
@@ -45,8 +45,9 @@ local artifactsTemplate="<?xml version=\"1.0\" encoding=\"UTF-8\"?>
4545
${children} </children>
4646
</repository>"
4747
echo -e "${artifactsTemplate}" > compositeArtifacts.xml
48+
git add compositeArtifacts.xml
4849

49-
local contentTemplate="<?xml version=\"1.0\" encoding=\"UTF-8\"?>
50+
contentTemplate="<?xml version=\"1.0\" encoding=\"UTF-8\"?>
5051
<?compositeMetadataRepository version=\"1.0.0\"?>
5152
<repository name=\"${site_name}\" type=\"org.eclipse.equinox.internal.p2.metadata.repository.CompositeMetadataRepository\" version=\"1.0.0\">
5253
<properties size=\"2\">
@@ -57,12 +58,14 @@ local contentTemplate="<?xml version=\"1.0\" encoding=\"UTF-8\"?>
5758
${children} </children>
5859
</repository>"
5960
echo -e "${contentTemplate}" > compositeContent.xml
61+
git add compositeContent.xml
6062

6163
# p2.index
62-
local p2_index="version = 1
64+
p2_index="version = 1
6365
metadata.repository.factory.order = compositeContent.xml,\!
6466
artifact.repository.factory.order = compositeArtifacts.xml,\!"
6567
echo -e "${p2_index}" > p2.index
68+
git add p2.index
6669

6770
# regenerate index.md
6871
echo -e "This is a composite Eclipse Update Site for the [PMD Eclipse Plugin](https://github.com/pmd/pmd-eclipse-plugin/).
@@ -78,4 +81,7 @@ ${children_index}
7881
For older versions, see <https://sourceforge.net/projects/pmd/files/pmd-eclipse/zipped/>
7982
8083
" > index.md
84+
git add index.md
85+
86+
echo "Done."
8187

.github/workflows/build.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ env:
1818
jobs:
1919
# verify build on one node before multiple builds on different os are started
2020
fail-fast-build:
21-
name: verify (ubuntu-latest, 2025-03)
21+
name: verify (ubuntu-latest, 2025-06)
2222
timeout-minutes: 30
2323
defaults:
2424
run:
@@ -61,19 +61,19 @@ jobs:
6161
strategy:
6262
matrix:
6363
os: [ ubuntu-latest, windows-latest, macos-latest ]
64-
targetPlatform: [ 2025-03 ]
64+
targetPlatform: [ 2025-06 ]
6565
exclude:
6666
# exclude the fail-fast-build, which already ran
6767
- os: ubuntu-latest
68-
targetPlatform: 2025-03
68+
targetPlatform: 2025-06
6969
# run other target platforms only on linux
7070
include:
71+
- os: ubuntu-latest
72+
targetPlatform: 2025-03
7173
- os: ubuntu-latest
7274
targetPlatform: 2024-12
7375
- os: ubuntu-latest
7476
targetPlatform: 2024-09
75-
- os: ubuntu-latest
76-
targetPlatform: 2024-06
7777
fail-fast: true
7878

7979
runs-on: ${{ matrix.os }}

.github/workflows/publish-release.yml

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -144,18 +144,7 @@ jobs:
144144
with:
145145
name: update-site
146146
- name: Prepare Release Notes
147-
run: |
148-
# extract the release notes
149-
BEGIN_LINE=$(grep -n "^## " ReleaseNotes.md|head -1|cut -d ":" -f 1)
150-
END_LINE=$(grep -n "^## " ReleaseNotes.md|head -2|tail -1|cut -d ":" -f 1)
151-
END_LINE=$((END_LINE - 1))
152-
153-
RELEASE_BODY="A new PMD for Eclipse plugin version has been released.
154-
It is available via the update site: https://pmd.github.io/pmd-eclipse-plugin-p2-site/
155-
156-
$(head -$END_LINE ReleaseNotes.md | tail -$((END_LINE - BEGIN_LINE)))
157-
"
158-
echo "${RELEASE_BODY}" > release_notes_prepared.md
147+
run: .ci/files/prepare_release_notes.sh
159148
- name: Create Release
160149
env:
161150
# Token required for GH CLI:
@@ -208,7 +197,7 @@ jobs:
208197
uploadUrl="${PMD_SF_USER}@web.sourceforge.net:/home/frs/project/pmd/pmd-eclipse/zipped/"
209198
rsync -avh \
210199
"net.sourceforge.pmd.eclipse.p2updatesite-${VERSION}.zip" \
211-
"${uploadUrl}/net.sourceforge.pmd.eclipse.p2updatesite-SNAPSHOT.zip"
200+
"${uploadUrl}/net.sourceforge.pmd.eclipse.p2updatesite-${VERSION}.zip"
212201
213202
- name: Cleanup ssh
214203
if: ${{ always() }}
@@ -226,6 +215,9 @@ jobs:
226215
run:
227216
shell: bash
228217
steps:
218+
- uses: actions/checkout@v4
219+
with:
220+
ref: ${{ github.event.workflow_run.head_branch }}
229221
- uses: actions/download-artifact@v4
230222
with:
231223
name: update-site
@@ -278,18 +270,7 @@ jobs:
278270
with:
279271
ref: ${{ github.event.workflow_run.head_branch }}
280272
- name: Prepare Release Notes
281-
run: |
282-
# extract the release notes
283-
BEGIN_LINE=$(grep -n "^## " ReleaseNotes.md|head -1|cut -d ":" -f 1)
284-
END_LINE=$(grep -n "^## " ReleaseNotes.md|head -2|tail -1|cut -d ":" -f 1)
285-
END_LINE=$((END_LINE - 1))
286-
287-
RELEASE_BODY="A new PMD for Eclipse plugin version has been released.
288-
It is available via the update site: https://pmd.github.io/pmd-eclipse-plugin-p2-site/
289-
290-
$(head -$END_LINE ReleaseNotes.md | tail -$((END_LINE - BEGIN_LINE)))
291-
"
292-
echo "${RELEASE_BODY}" > release_notes_prepared.md
273+
run: .ci/files/prepare_release_notes.sh
293274
- name: Create Blog Post
294275
id: upload
295276
env:

ReleaseNotes.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,24 @@ Eclipse Update Site:
1111

1212
This is a minor release.
1313

14-
### New and noteworthy
14+
### 🚀 New and noteworthy
1515
* Update to PMD 7.15.0
16+
* Support for Eclipse 2025-06 added
17+
* Support for Eclipse 2024-06 removed
1618

17-
### Fixed Issues
19+
### 🐛 Fixed Issues
1820

19-
### API Changes
21+
### ✨ Merged pull requests
22+
* [#277](https://github.com/pmd/pmd-eclipse-plugin/pull/277): \[ci] Fix publish release - [Andreas Dangel](https://github.com/adangel) (@adangel)
23+
* [#281](https://github.com/pmd/pmd-eclipse-plugin/pull/281): Support eclipse 2025-06 - [Andreas Dangel](https://github.com/adangel) (@adangel)
2024

21-
### External Contributions
25+
### 📦 Dependency updates
26+
* [#275](https://github.com/pmd/pmd-eclipse-plugin/pull/275): Bump com.puppycrawl.tools:checkstyle from 10.24.0 to 10.25.0
27+
* [#276](https://github.com/pmd/pmd-eclipse-plugin/pull/276): Bump org.apache.maven.plugins:maven-clean-plugin from 3.4.1 to 3.5.0
28+
* [#278](https://github.com/pmd/pmd-eclipse-plugin/pull/278): Bump com.puppycrawl.tools:checkstyle from 10.25.0 to 10.25.1
29+
* [#280](https://github.com/pmd/pmd-eclipse-plugin/pull/280): Bump build-tools from 30 to 32
30+
31+
### API Changes
2232

2333
## 30-May-2025: 7.14.0.v20250530-1904-r
2434

@@ -2264,4 +2274,3 @@ a lib subdirectory.
22642274
**Development**
22652275
* Adding a ant build file
22662276
* Adapting .project to be compatible with both Eclipse 2.02 and WSAD v5.
2267-

do-release.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,16 @@ ${RELEASE_NOTES_HEADER}
9696
9797
This is a minor release.
9898
99-
### New and noteworthy
99+
### 🚀 New and noteworthy
100100
101-
### Fixed Issues
101+
### 🐛 Fixed Issues
102+
103+
### ✨ Merged pull requests
104+
105+
### 📦 Dependency updates
102106
103107
### API Changes
104108
105-
### External Contributions
106109
${RELEASE_NOTES_BODY}
107110
108111
EOF

net.sourceforge.pmd.eclipse.plugin/src/main/java/net/sourceforge/pmd/eclipse/plugin/PMDPlugin.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,12 @@ public class PMDPlugin extends AbstractUIPlugin {
9898

9999
private Map<RGB, Color> coloursByRgb = new HashMap<>();
100100

101-
private StringTable stringTable; // NOPMD by Herlin on 11/10/06 00:22
101+
private StringTable stringTable;
102102

103103
private IPreferencesFactory preferencesFactory = new PreferencesFactoryImpl();
104104
private IPropertiesFactory propertiesFactory = new PropertiesFactoryImpl();
105105

106-
private final IRuleSetManager ruleSetManager = new RuleSetManagerImpl(); // NOPMD:SingularField
106+
private final IRuleSetManager ruleSetManager = new RuleSetManagerImpl();
107107

108108
private final LogbackConfiguration logbackConfiguration = new LogbackConfiguration();
109109

net.sourceforge.pmd.eclipse.plugin/src/main/java/net/sourceforge/pmd/eclipse/runtime/cmd/DeleteMarkersCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public DeleteMarkersCommand() {
2828
setUserInitiated(false);
2929
}
3030

31-
public final void setMarkers(IMarker[] theMarkers) { // NOPMD by Sven on 13.11.06 11:43
31+
public final void setMarkers(IMarker[] theMarkers) {
3232
markers = theMarkers;
3333
}
3434

net.sourceforge.pmd.eclipse.plugin/src/main/java/net/sourceforge/pmd/eclipse/runtime/properties/impl/ProjectPropertiesManagerImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ private ProjectPropertiesTO fillTransferObject(IProjectProperties projectPropert
348348

349349
for (RuleSet ruleSet : ruleSets) {
350350
for (Rule rule : ruleSet.getRules()) {
351-
rules.add(new RuleSpecTO(rule.getName(), rule.getRuleSetName())); // NOPMD:AvoidInstantiatingObjectInLoop
351+
rules.add(new RuleSpecTO(rule.getName(), rule.getRuleSetName()));
352352
}
353353
for (Pattern pattern : ruleSet.getFileExclusions()) {
354354
excludePatterns.add(pattern.pattern());

net.sourceforge.pmd.eclipse.plugin/src/main/java/net/sourceforge/pmd/eclipse/ui/actions/CPDCheckProjectAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public class CPDCheckProjectAction extends AbstractUIAction {
5050
private static final String CSV_KEY = "CSV";
5151

5252
@Override
53-
public void run(final IAction action) { // NOPMD:UnusedFormalParameter
53+
public void run(final IAction action) {
5454
final IWorkbenchPartSite site = targetPartSite();
5555
final ISelection sel = targetSelection();
5656
final Shell shell = site.getShell();

0 commit comments

Comments
 (0)