Skip to content

Commit 48d8065

Browse files
committed
Improve update site index.md files
1 parent c3ba706 commit 48d8065

File tree

1 file changed

+35
-8
lines changed

1 file changed

+35
-8
lines changed

.ci/build.sh

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,16 @@ function snapshot_build() {
5252
pmd_ci_log_group_start "Snapshot Build: ${PMD_CI_MAVEN_PROJECT_VERSION}"
5353
pmd_ci_log_info "This is a snapshot build on branch ${PMD_CI_BRANCH} (version: ${PMD_CI_MAVEN_PROJECT_VERSION})"
5454

55-
# Uploading the update site to Bintray
55+
# Build and upload the update site to Bintray
5656
xvfb-run --auto-servernum ./mvnw clean verify --show-version --errors --batch-mode \
5757
--no-transfer-progress \
5858
--activate-profiles snapshot-properties,release-composite
5959

60-
mv net.sourceforge.pmd.eclipse.p2updatesite/target/net.sourceforge.pmd.eclipse.p2updatesite-*.zip "net.sourceforge.pmd.eclipse.p2updatesite/target/net.sourceforge.pmd.eclipse.p2updatesite-SNAPSHOT.zip"
60+
local qualifiedVersion
61+
qualifiedVersion="$(basename net.sourceforge.pmd.eclipse.p2updatesite/target/net.sourceforge.pmd.eclipse.p2updatesite-*.zip)"
62+
qualifiedVersion="${qualifiedVersion%.zip}"
63+
qualifiedVersion="${qualifiedVersion#net.sourceforge.pmd.eclipse.p2updatesite-}"
64+
mv "net.sourceforge.pmd.eclipse.p2updatesite/target/net.sourceforge.pmd.eclipse.p2updatesite-${qualifiedVersion}.zip" "net.sourceforge.pmd.eclipse.p2updatesite/target/net.sourceforge.pmd.eclipse.p2updatesite-SNAPSHOT.zip"
6165
pmd_ci_sourceforge_uploadFile "pmd-eclipse/zipped" "net.sourceforge.pmd.eclipse.p2updatesite/target/net.sourceforge.pmd.eclipse.p2updatesite-SNAPSHOT.zip"
6266

6367
# Cleanup old snapshots
@@ -75,7 +79,18 @@ function snapshot_build() {
7579

7680
rm -rf snapshot
7781
unzip -q -d snapshot "../net.sourceforge.pmd.eclipse.p2updatesite/target/net.sourceforge.pmd.eclipse.p2updatesite-SNAPSHOT.zip"
78-
echo -e "This is a Eclipse Update Site for the PMD Eclipse Plugin for version ${PMD_CI_MAVEN_PROJECT_VERSION} ($(date -Iminutes)).\n\n<https://github.com/pmd/pmd-eclipse-plugin/>" > snapshot/index.md
82+
echo "This is a Eclipse Update Site for the [PMD Eclipse Plugin](https://github.com/pmd/pmd-eclipse-plugin/) ${PMD_CI_MAVEN_PROJECT_VERSION}.
83+
84+
Use <https://pmd.github.io/pmd-eclipse-plugin-p2-site/snapshot/> to install the plugin with the Eclipse Update Manager.
85+
86+
<dl>
87+
<dt>Feature ID</dt>
88+
<dd>net.sourceforge.pmd.eclipse</dd>
89+
<dt>Version</dt>
90+
<dd>${qualifiedVersion}</dd>
91+
</dl>
92+
93+
" > snapshot/index.md
7994
git add snapshot
8095

8196
# create a new single commit
@@ -179,7 +194,19 @@ function regenerate_metadata() {
179194
for i in "${releases[@]}"; do
180195
children="${children} <child location=\"$i\"/>\n"
181196
children_index="${children_index} * [$i]($i/)\n"
182-
echo -e "This is a Eclipse Update Site for the PMD Eclipse Plugin for version $i.\n\n<https://github.com/pmd/pmd-eclipse-plugin/>" > "$i"/index.md
197+
echo "This is a Eclipse Update Site for the [PMD Eclipse Plugin](https://github.com/pmd/pmd-eclipse-plugin/) ${i}.
198+
199+
Use <https://pmd.github.io/pmd-eclipse-plugin-p2-site/${i}/> to install the plugin with the Eclipse Update Manager.
200+
201+
<dl>
202+
<dt>Feature ID</dt>
203+
<dd>net.sourceforge.pmd.eclipse</dd>
204+
<dt>Version</dt>
205+
<dd>${i}</dd>
206+
</dl>
207+
208+
" > "$i"/index.md
209+
183210
git add "$i"/index.md
184211
done
185212

@@ -215,9 +242,9 @@ artifact.repository.factory.order = compositeArtifacts.xml,\!"
215242
echo -e "${p2_index}" > p2.index
216243

217244
# regenerate index.md
218-
local index_md="This URL is a composite Eclipse Update Site for the PMD Eclipse Plugin.
245+
echo -e "This is a composite Eclipse Update Site for the [PMD Eclipse Plugin](https://github.com/pmd/pmd-eclipse-plugin/).
219246
220-
Github: <https://github.com/pmd/pmd-eclipse-plugin/>
247+
Use <https://pmd.github.io/pmd-eclipse-plugin-p2-site/> to install the plugin with the Eclipse Update Manager.
221248
222249
----
223250
@@ -226,8 +253,8 @@ Versions available at <https://pmd.github.io/pmd-eclipse-plugin-p2-site/>:
226253
${children_index}
227254
228255
For older versions, see <https://sourceforge.net/projects/pmd/files/pmd-eclipse/zipped/>
229-
"
230-
echo -e "${index_md}" > index.md
256+
257+
" > index.md
231258
}
232259

233260
build

0 commit comments

Comments
 (0)