Skip to content

Commit ae77951

Browse files
committed
Add script to check if a library is supported by the GraalVM Reachability Metadata repository
1 parent 81796fe commit ae77951

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

check-library-support.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
if [ "$#" -ne 1 ]; then
5+
echo "Usage: $0 <groupId:artifactId:version>"
6+
exit 1
7+
fi
8+
9+
GAV="$1"
10+
IFS=':' read -r GROUP ARTIFACT VERSION <<< "$GAV"
11+
12+
METADATA_DIR="metadata/$GROUP/$ARTIFACT"
13+
INDEX_FILE="$METADATA_DIR/index.json"
14+
15+
if [ ! -d "$METADATA_DIR" ] || [ ! -f "$INDEX_FILE" ]; then
16+
echo "Library $GAV is NOT supported by the GraalVM Reachability Metadata repository."
17+
exit 1
18+
fi
19+
20+
# Check if the version exists in any tested-versions (exact match)
21+
MATCH=$(jq --arg ver "$VERSION" 'any(.[]["tested-versions"][]?; . == $ver)' "$INDEX_FILE")
22+
23+
if [ "$MATCH" = "true" ]; then
24+
echo "Library $GAV is supported by the GraalVM Reachability Metadata repository.️"
25+
else
26+
echo "Library $GAV is NOT supported by the GraalVM Reachability Metadata repository."
27+
fi

0 commit comments

Comments
 (0)