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 new file mode 100755 index 000000000..e1c81eb10 --- /dev/null +++ b/check-library-support.sh @@ -0,0 +1,34 @@ +#!/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" + +REMOTE_BASE_URL="https://raw.githubusercontent.com/oracle/graalvm-reachability-metadata/master/metadata" +REMOTE_INDEX_URL="$REMOTE_BASE_URL/$GROUP/$ARTIFACT/index.json" + +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 + +FOUND=$( + awk -v ver="$VERSION" ' + /"tested-versions"[[:space:]]*:/ {inside=1; next} + inside && /\]/ {inside=0} + inside && $0 ~ "\"" ver "\"" {print "yes"} + ' <<< "$INDEX_CONTENT" +) + +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