Skip to content

Commit 217d1ed

Browse files
committed
BUILD-8083 Add missing script file for javadoc
1 parent de03e7f commit 217d1ed

File tree

3 files changed

+58
-6
lines changed

3 files changed

+58
-6
lines changed

.github/workflows/test-javadoc-logic.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,23 @@ on:
66
- 'scripts/extract-javadoc.sh'
77
- 'spec/extract_javadoc_spec.sh'
88
- '.github/workflows/javadoc-publication.yaml'
9+
- 'mise.toml'
910

1011
jobs:
1112
test:
1213
name: Test Javadoc Script
13-
runs-on: sonar-xs
14+
runs-on: github-ubuntu-latest-s
1415

1516
steps:
1617
- name: Checkout code
1718
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1819

19-
- name: Install shellspec
20-
run: |
21-
curl -fsSL https://git.io/shellspec | sh
22-
echo "$HOME/.local/bin" >> $GITHUB_PATH
20+
- name: Install tools with mise
21+
uses: jdx/mise-action@c37c93293d6b742fc901e1406b8f764f6fb19dac # v2.4.4
22+
with:
23+
version: 2025.7.12
24+
install: true
25+
cache: true
2326

2427
- name: Run tests
25-
run: shellspec --format documentation
28+
run: mise exec -- shellspec --format documentation

mise.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[tools]
2+
shellcheck = "0.10.0"
3+
shellspec = "0.28.1"

scripts/extract-javadoc.sh

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/usr/bin/env bash
2+
3+
# Extract and publish javadoc jar
4+
# Usage: extract-javadoc.sh <target-directory> <version>
5+
# Example: ./extract-javadoc.sh /tmp/repo.ABCDEFGH 13.0.0.3026
6+
7+
set -euo pipefail
8+
9+
TARGET_DIR="${1:-.}"
10+
VERSION="${2:?Version parameter is required}"
11+
12+
cd "$TARGET_DIR"
13+
14+
# Enable nullglob so the glob expands to nothing (instead of itself) when no files match
15+
shopt -s nullglob
16+
17+
jars=( *-javadoc.jar )
18+
JAVADOC_COUNT=${#jars[@]}
19+
20+
if (( JAVADOC_COUNT == 0 )); then
21+
echo "No javadoc files found!" >&2
22+
exit 1
23+
elif (( JAVADOC_COUNT == 1 )); then
24+
echo "Found single javadoc file, using simple extraction"
25+
mv "${jars[0]}" javadoc.zip
26+
else
27+
echo "Found multiple javadoc files, selecting main one"
28+
printf '%s\n' "${jars[@]}"
29+
for jar in "${jars[@]}"; do
30+
if [[ ! $jar =~ (test|fixture) ]]; then
31+
MAIN_JAVADOC="$jar"
32+
break
33+
fi
34+
done
35+
36+
if [[ -z "${MAIN_JAVADOC:-}" ]]; then
37+
echo "No main javadoc found, please contact Engineering Experience team" >&2
38+
exit 1
39+
fi
40+
41+
echo "Selected main javadoc: $MAIN_JAVADOC"
42+
mv "$MAIN_JAVADOC" javadoc.zip
43+
fi
44+
45+
mkdir -p "javadoc/$VERSION"
46+
unzip -q javadoc.zip -d "javadoc/$VERSION"

0 commit comments

Comments
 (0)