summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/aosp/aosp_sha.sh24
-rwxr-xr-xtools/hiddenapi/generate_hiddenapi_lists.py4
-rwxr-xr-xtools/hiddenapi/sort_api.sh6
-rw-r--r--tools/processors/unsupportedappusage/Android.bp10
4 files changed, 43 insertions, 1 deletions
diff --git a/tools/aosp/aosp_sha.sh b/tools/aosp/aosp_sha.sh
new file mode 100755
index 000000000000..e50c70d0656a
--- /dev/null
+++ b/tools/aosp/aosp_sha.sh
@@ -0,0 +1,24 @@
+#!/bin/bash
+LOCAL_DIR="$( dirname "${BASH_SOURCE}" )"
+
+if git branch -vv | grep -q -P "^\*[^\[]+\[aosp/"; then
+ # Change appears to be in AOSP
+ exit 0
+else
+ # Change appears to be non-AOSP; search for files
+ count=0
+ while read -r file ; do
+ if (( count == 0 )); then
+ echo
+ fi
+ echo -e "\033[0;31mThe source of truth for '$file' is in AOSP.\033[0m"
+ (( count++ ))
+ done < <(git show --name-only --pretty=format: $1 | grep -- "$2")
+ if (( count != 0 )); then
+ echo
+ echo "If your change contains no confidential details (such as security fixes), please"
+ echo "upload and merge this change at https://android-review.googlesource.com/."
+ echo
+ exit 77
+ fi
+fi
diff --git a/tools/hiddenapi/generate_hiddenapi_lists.py b/tools/hiddenapi/generate_hiddenapi_lists.py
index 4a0931a149af..6c46e67be63d 100755
--- a/tools/hiddenapi/generate_hiddenapi_lists.py
+++ b/tools/hiddenapi/generate_hiddenapi_lists.py
@@ -59,6 +59,8 @@ def get_args():
def read_lines(filename):
"""Reads entire file and return it as a list of lines.
+ Lines which begin with a hash are ignored.
+
Args:
filename (string): Path to the file to read from.
@@ -66,7 +68,7 @@ def read_lines(filename):
list: Lines of the loaded file as a list of strings.
"""
with open(filename, 'r') as f:
- return f.readlines()
+ return filter(lambda line: not line.startswith('#'), f.readlines())
def write_lines(filename, lines):
"""Writes list of lines into a file, overwriting the file it it exists.
diff --git a/tools/hiddenapi/sort_api.sh b/tools/hiddenapi/sort_api.sh
index 1c6eb1b286b1..bdcc8076dde1 100755
--- a/tools/hiddenapi/sort_api.sh
+++ b/tools/hiddenapi/sort_api.sh
@@ -11,8 +11,14 @@ fi
readarray A < "$source_list"
# Sort
IFS=$'\n'
+# Stash away comments
+C=( $(grep -E '^#' <<< "${A[*]}") )
+A=( $(grep -v -E '^#' <<< "${A[*]}") )
+# Sort entries
A=( $(LC_COLLATE=C sort -f <<< "${A[*]}") )
A=( $(uniq <<< "${A[*]}") )
+# Concatenate comments and entries
+A=( ${C[*]} ${A[*]} )
unset IFS
# Dump array back into the file
printf '%s\n' "${A[@]}" > "$dest_list"
diff --git a/tools/processors/unsupportedappusage/Android.bp b/tools/processors/unsupportedappusage/Android.bp
index 98f3c955a2d2..1aca3edfab88 100644
--- a/tools/processors/unsupportedappusage/Android.bp
+++ b/tools/processors/unsupportedappusage/Android.bp
@@ -11,5 +11,15 @@ java_library_host {
"guava",
"unsupportedappusage-annotation"
],
+ openjdk9: {
+ javacflags: [
+ "--add-modules=jdk.compiler",
+ "--add-exports jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED",
+ "--add-exports jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED",
+ "--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED",
+ "--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED",
+ ],
+ },
+
use_tools_jar: true,
}