Update currysrc to support stable core/platform API.

This change allows you to specify a flat file to add
@CorePlatformApi(status=STABLE) to (previously it only supported bare
@CorePlatformApi). This would have been possible using the JSON format
before, but this would be more verbose and error-prone in the case (as
with conscrypt) where the whole surface is stable.

Test: external/conscrypt/srcgen/generate_android_src.sh (and check result)
Bug: 157640067
Change-Id: Ie69e2805ed6c76cde395e48532236fdd31bb0c67
diff --git a/scripts/repackage-common.sh b/scripts/repackage-common.sh
index 5f1e058..dc4b4e7 100644
--- a/scripts/repackage-common.sh
+++ b/scripts/repackage-common.sh
@@ -105,6 +105,7 @@
 
 DEFAULT_CONSTRUCTORS_FILE=${PROJECT_DIR}/srcgen/default-constructors.txt
 CORE_PLATFORM_API_FILE=${PROJECT_DIR}/srcgen/core-platform-api.txt
+STABLE_CORE_PLATFORM_API_FILE=${PROJECT_DIR}/srcgen/stable-core-platform-api.txt
 INTRA_CORE_API_FILE=${PROJECT_DIR}/srcgen/intra-core-api.txt
 UNSUPPORTED_APP_USAGE_FILE=${PROJECT_DIR}/srcgen/unsupported-app-usage.json
 
@@ -130,6 +131,12 @@
   SEP=" "
 fi
 
+if [[ -f "${STABLE_CORE_PLATFORM_API_FILE}" ]]; then
+  echo "Adding CorePlatformApi(status=STABLE) annotations from ${STABLE_CORE_PLATFORM_API_FILE}"
+  REPACKAGE_ARGS="${REPACKAGE_ARGS}${SEP}--stable-core-platform-api-file ${STABLE_CORE_PLATFORM_API_FILE}"
+  SEP=" "
+fi
+
 if [[ -f "${INTRA_CORE_API_FILE}" ]]; then
   echo "Adding IntraCoreApi annotations from ${INTRA_CORE_API_FILE}"
   REPACKAGE_ARGS="${REPACKAGE_ARGS}${SEP}--intra-core-api-file ${INTRA_CORE_API_FILE}"
@@ -217,6 +224,12 @@
       "CorePlatformApi annotations were not added at the following locations from ${CORE_PLATFORM_API_FILE}:"
 fi
 
+if [[ -f "${STABLE_CORE_PLATFORM_API_FILE}" ]]; then
+  # Check to ensure that all the requested annotations were added.
+  checkChangeLog <(sort -u "${STABLE_CORE_PLATFORM_API_FILE}" | grep -v '^#') "@libcore.api.CorePlatformApi" \
+      "CorePlatformApi annotations were not added at the following locations from ${STABLE_CORE_PLATFORM_API_FILE}:"
+fi
+
 if [[ -f "${INTRA_CORE_API_FILE}" ]]; then
   # Check to ensure that all the requested annotations were added.
   checkChangeLog <(sort -u "${INTRA_CORE_API_FILE}" | grep -v '^#') "@libcore.api.IntraCoreApi" \