xref: /aosp_15_r20/libcore/tools/docs/crypto/run_update_crypto_support.sh (revision 89a6322812dc8573315e60046e7959c50dad91d4)
1#!/usr/bin/env bash
2#
3# Updates the crypto support JSON data file by running the appropriate tools.
4
5# Ensure that the files we need are in the place we expect
6if [ ! -f libcore/tools/docs/crypto/src/java/libcore/java/security/ListProviders.java -o ! -f libcore/tools/docs/crypto/data/crypto_support.json ]; then
7  echo "This command must be run from the repo root."
8  exit 1
9fi
10
11if [ -z "$1" ]; then
12  echo "The current API level must be specified as an argument."
13  exit 1
14fi
15
16build/soong/soong_ui.bash --make-mode vogar dx
17vogar --mode=activity libcore/tools/docs/crypto/src/java/libcore/java/security/ListProviders.java | libcore/tools/docs/crypto/update_crypto_support.py --api_level=$1 --rewrite_file libcore/tools/docs/crypto/data/crypto_support.json
18