From 0742e365580af27094814a49919f89be9ff8d8b1 Mon Sep 17 00:00:00 2001 From: jvukicev Date: Mon, 24 Nov 2025 08:43:50 +0100 Subject: [PATCH 1/4] Add script to check if a library is supported by the GraalVM Reachability Metadata repository --- check-library-support.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 check-library-support.sh diff --git a/check-library-support.sh b/check-library-support.sh new file mode 100755 index 000000000..5ea69462a --- /dev/null +++ b/check-library-support.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash +set -euo pipefail + +if [ "$#" -ne 1 ]; then + echo "Usage: $0 " + exit 1 +fi + +GAV="$1" +IFS=':' read -r GROUP ARTIFACT VERSION <<< "$GAV" + +METADATA_DIR="metadata/$GROUP/$ARTIFACT" +INDEX_FILE="$METADATA_DIR/index.json" + +if [ ! -d "$METADATA_DIR" ] || [ ! -f "$INDEX_FILE" ]; then + echo "Library $GAV is NOT supported by the GraalVM Reachability Metadata repository." + exit 1 +fi + +# Check if the version exists in any tested-versions (exact match) +MATCH=$(jq --arg ver "$VERSION" 'any(.[]["tested-versions"][]?; . == $ver)' "$INDEX_FILE") + +if [ "$MATCH" = "true" ]; then + echo "Library $GAV is supported by the GraalVM Reachability Metadata repository.️" +else + echo "Library $GAV is NOT supported by the GraalVM Reachability Metadata repository." +fi From 600eac86132fde0c3488e30c1490f00421bc0128 Mon Sep 17 00:00:00 2001 From: jvukicev Date: Mon, 24 Nov 2025 08:56:26 +0100 Subject: [PATCH 2/4] Unify file existence checks --- check-library-support.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/check-library-support.sh b/check-library-support.sh index 5ea69462a..30cc3f5c7 100755 --- a/check-library-support.sh +++ b/check-library-support.sh @@ -9,10 +9,9 @@ fi GAV="$1" IFS=':' read -r GROUP ARTIFACT VERSION <<< "$GAV" -METADATA_DIR="metadata/$GROUP/$ARTIFACT" -INDEX_FILE="$METADATA_DIR/index.json" +INDEX_FILE="metadata/$GROUP/$ARTIFACT/index.json" -if [ ! -d "$METADATA_DIR" ] || [ ! -f "$INDEX_FILE" ]; then +if [ ! -f "$INDEX_FILE" ]; then echo "Library $GAV is NOT supported by the GraalVM Reachability Metadata repository." exit 1 fi From 4bd1a83f1bf55ebd65c3c14800d97c0e0ad9e686 Mon Sep 17 00:00:00 2001 From: jvukicev Date: Tue, 25 Nov 2025 09:17:58 +0100 Subject: [PATCH 3/4] Make the script work from command line without cloning the repo using curl and update README.md --- README.md | 5 +++++ check-library-support.sh | 22 +++++++++++++++------- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index ef93f9b55..ac8e948a0 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,11 @@ To see whether your library or framework is supported, visit [this page](https:/ If you’d like yours to appear there as well, open a pull request updating [this JSON file](https://github.com/oracle/graalvm-reachability-metadata/blob/master/library-and-framework-list.json). Before submitting a pull request, please read [this guide](docs/CONTRIBUTING.md#tested-libraries-and-frameworks). +You can also check if metadata for a library exists on the repository directly from your terminal without cloning it using: +``` +curl -sSL https://raw.githubusercontent.com/oracle/graalvm-reachability-metadata/master/check-library-support.sh | bash -s "::" +``` + ### 📚 Request Support for a New Library Open a [library-request ticket](https://github.com/oracle/graalvm-reachability-metadata/issues/new?template=01_support_new_library.yml), include the Maven coordinates, and our automation will take it from there (🤖). diff --git a/check-library-support.sh b/check-library-support.sh index 30cc3f5c7..e1c81eb10 100755 --- a/check-library-support.sh +++ b/check-library-support.sh @@ -2,25 +2,33 @@ set -euo pipefail if [ "$#" -ne 1 ]; then - echo "Usage: $0 " + echo "Usage: $0 ::" exit 1 fi GAV="$1" IFS=':' read -r GROUP ARTIFACT VERSION <<< "$GAV" -INDEX_FILE="metadata/$GROUP/$ARTIFACT/index.json" +REMOTE_BASE_URL="https://raw.githubusercontent.com/oracle/graalvm-reachability-metadata/master/metadata" +REMOTE_INDEX_URL="$REMOTE_BASE_URL/$GROUP/$ARTIFACT/index.json" -if [ ! -f "$INDEX_FILE" ]; then +INDEX_CONTENT=$(curl -fsSL "$REMOTE_INDEX_URL" 2>/dev/null || true) + +if [[ -z "$INDEX_CONTENT" ]]; then echo "Library $GAV is NOT supported by the GraalVM Reachability Metadata repository." exit 1 fi -# Check if the version exists in any tested-versions (exact match) -MATCH=$(jq --arg ver "$VERSION" 'any(.[]["tested-versions"][]?; . == $ver)' "$INDEX_FILE") +FOUND=$( + awk -v ver="$VERSION" ' + /"tested-versions"[[:space:]]*:/ {inside=1; next} + inside && /\]/ {inside=0} + inside && $0 ~ "\"" ver "\"" {print "yes"} + ' <<< "$INDEX_CONTENT" +) -if [ "$MATCH" = "true" ]; then - echo "Library $GAV is supported by the GraalVM Reachability Metadata repository.️" +if [ "$FOUND" = "yes" ]; then + echo "Library $GAV is supported by the GraalVM Reachability Metadata repository." else echo "Library $GAV is NOT supported by the GraalVM Reachability Metadata repository." fi From da3ebb02bfecf10c9416d9cb417a3dccfcf8599a Mon Sep 17 00:00:00 2001 From: jvukicev Date: Tue, 2 Dec 2025 15:03:33 +0100 Subject: [PATCH 4/4] Add license --- check-library-support.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/check-library-support.sh b/check-library-support.sh index e1c81eb10..4499e2d74 100755 --- a/check-library-support.sh +++ b/check-library-support.sh @@ -1,4 +1,10 @@ #!/usr/bin/env bash + +# Copyright and related rights waived via CC0 +# +# You should have received a copy of the CC0 legalcode along with this +# work. If not, see . + set -euo pipefail if [ "$#" -ne 1 ]; then