aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2020-06-19 05:52:55 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-06-19 05:52:55 +0000
commita5ab264b9ddc248027aa200914c8dfa6089c6b35 (patch)
tree5e43b52076379fda7548baa79386319ca90f1d8c
parent5b568db45f4e420e6524aef6bff52c98af514f98 (diff)
parent0ba096d926f38a8002b6885460464b8a44e7fdc6 (diff)
downloadauto-android11-mainline-tethering-release.tar.gz
Add Android files to build AutoValue am: 8d0c8f812f am: 0ba096d926r_aml_301500702android-mainline-12.0.0_r55android-mainline-11.0.0_r9android-mainline-11.0.0_r8android-mainline-11.0.0_r7android-mainline-11.0.0_r6android-mainline-11.0.0_r5android-mainline-11.0.0_r45android-mainline-11.0.0_r44android-mainline-11.0.0_r43android-mainline-11.0.0_r42android-mainline-11.0.0_r41android-mainline-11.0.0_r40android-mainline-11.0.0_r4android-mainline-11.0.0_r39android-mainline-11.0.0_r38android-mainline-11.0.0_r37android-mainline-11.0.0_r36android-mainline-11.0.0_r35android-mainline-11.0.0_r34android-mainline-11.0.0_r33android-mainline-11.0.0_r32android-mainline-11.0.0_r31android-mainline-11.0.0_r30android-mainline-11.0.0_r3android-mainline-11.0.0_r29android-mainline-11.0.0_r28android-mainline-11.0.0_r27android-mainline-11.0.0_r26android-mainline-11.0.0_r25android-mainline-11.0.0_r24android-mainline-11.0.0_r23android-mainline-11.0.0_r22android-mainline-11.0.0_r21android-mainline-11.0.0_r20android-mainline-11.0.0_r19android-mainline-11.0.0_r18android-mainline-11.0.0_r17android-mainline-11.0.0_r16android-mainline-11.0.0_r15android-mainline-11.0.0_r14android-mainline-11.0.0_r13android-mainline-11.0.0_r12android-mainline-11.0.0_r10android11-mainline-tethering-releaseandroid11-mainline-sparse-2021-jan-releaseandroid11-mainline-sparse-2020-dec-releaseandroid11-mainline-releaseandroid11-mainline-permission-releaseandroid11-mainline-os-statsd-releaseandroid11-mainline-networkstack-releaseandroid11-mainline-media-swcodec-releaseandroid11-mainline-media-releaseandroid11-mainline-extservices-releaseandroid11-mainline-documentsui-releaseandroid11-mainline-conscrypt-releaseandroid11-mainline-cellbroadcast-releaseandroid11-mainline-captiveportallogin-release
Original change: https://android-review.googlesource.com/c/platform/external/auto/+/1341935 Change-Id: I21d8a0543fb8b16ae95deb229d6ffdfecdb3e59e
-rw-r--r--Android.bp3
-rw-r--r--METADATA17
-rw-r--r--MODULE_LICENSE_APACHE20
-rw-r--r--android-annotation-stubs/Android.bp4
-rwxr-xr-xandroid-annotation-stubs/gen_annotations.sh72
-rw-r--r--android-annotation-stubs/src/net/ltgt/gradle/incap/IncrementalAnnotationProcessor.java43
-rw-r--r--android-annotation-stubs/src/net/ltgt/gradle/incap/IncrementalAnnotationProcessorType.java29
-rw-r--r--android-annotation-stubs/tmpl.java43
-rw-r--r--common/Android.bp9
-rw-r--r--factory/Android.bp31
-rw-r--r--service/Android.bp19
-rw-r--r--value/Android.bp100
12 files changed, 370 insertions, 0 deletions
diff --git a/Android.bp b/Android.bp
new file mode 100644
index 00000000..7c7db3ef
--- /dev/null
+++ b/Android.bp
@@ -0,0 +1,3 @@
+package {
+ default_visibility: [":__subpackages__"]
+}
diff --git a/METADATA b/METADATA
new file mode 100644
index 00000000..abeb0af2
--- /dev/null
+++ b/METADATA
@@ -0,0 +1,17 @@
+name: "auto"
+description:
+ "A collection of source code generators for Java."
+
+third_party {
+ url {
+ type: HOMEPAGE
+ value: "https://github.com/google/auto"
+ }
+ url {
+ type: GIT
+ value: "https://github.com/google/auto"
+ }
+ version: "auto-value-1.7.3"
+ last_upgrade_date { year: 2020 month: 6 day: 12 }
+ license_type: NOTICE
+}
diff --git a/MODULE_LICENSE_APACHE2 b/MODULE_LICENSE_APACHE2
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/MODULE_LICENSE_APACHE2
diff --git a/android-annotation-stubs/Android.bp b/android-annotation-stubs/Android.bp
new file mode 100644
index 00000000..a2bd9e98
--- /dev/null
+++ b/android-annotation-stubs/Android.bp
@@ -0,0 +1,4 @@
+java_library_host {
+ name: "auto_android_annotation_stubs",
+ srcs: ["src/**/*.java"],
+}
diff --git a/android-annotation-stubs/gen_annotations.sh b/android-annotation-stubs/gen_annotations.sh
new file mode 100755
index 00000000..90c9fcfb
--- /dev/null
+++ b/android-annotation-stubs/gen_annotations.sh
@@ -0,0 +1,72 @@
+#!/bin/bash
+
+declare -A INNER
+declare -A PARAMETER
+declare -A IMPORT
+
+ANNOTATIONS=(
+ net.ltgt.gradle.incap.IncrementalAnnotationProcessor
+)
+
+PARAMETER["net.ltgt.gradle.incap.IncrementalAnnotationProcessor"]="IncrementalAnnotationProcessorType"
+IMPORT["net.ltgt.gradle.incap.IncrementalAnnotationProcessor"]="net.ltgt.gradle.incap.IncrementalAnnotationProcessorType"
+
+for a in ${ANNOTATIONS[@]}; do
+ package=${a%.*}
+ class=${a##*.}
+ dir=$(dirname $0)/src/${package//.//}
+ file=${class}.java
+ inner=${INNER[$a]}
+ parameter=${PARAMETER[$a]}
+ import=
+
+ if [ -n "${parameter}" ]; then
+ parameter="${parameter} value();"
+ fi
+
+ for i in ${IMPORT[$a]}; do
+ import="${import}import ${i};"
+ done
+
+ mkdir -p ${dir}
+ sed -e"s/__PACKAGE__/${package}/" \
+ -e"s/__CLASS__/${class}/" \
+ -e"s/__INNER__/${inner}/" \
+ -e"s/__PARAMETER__/${parameter}/" \
+ -e"s/__IMPORT__/${import}/" \
+ $(dirname $0)/tmpl.java > ${dir}/${file}
+ google-java-format -i ${dir}/${file}
+done
+
+f=$(dirname $0)/src/net/ltgt/gradle/incap/IncrementalAnnotationProcessorType.java
+cat > ${f} <<EOF
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package net.ltgt.gradle.incap;
+
+import java.util.Locale;
+
+public enum IncrementalAnnotationProcessorType {
+ DYNAMIC,
+ ISOLATING,
+ AGGREGATING;
+
+ public String getProcessorOption() {
+ return "org.gradle.annotation.processing." + name().toLowerCase(Locale.ROOT);
+ }
+}
+EOF
diff --git a/android-annotation-stubs/src/net/ltgt/gradle/incap/IncrementalAnnotationProcessor.java b/android-annotation-stubs/src/net/ltgt/gradle/incap/IncrementalAnnotationProcessor.java
new file mode 100644
index 00000000..aa1ce76c
--- /dev/null
+++ b/android-annotation-stubs/src/net/ltgt/gradle/incap/IncrementalAnnotationProcessor.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package net.ltgt.gradle.incap;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/* This is an annotation stub to avoid dependencies on annotations that aren't
+ * in the Android platform source tree. */
+
+@Target({
+ ElementType.ANNOTATION_TYPE,
+ ElementType.CONSTRUCTOR,
+ ElementType.FIELD,
+ ElementType.LOCAL_VARIABLE,
+ ElementType.METHOD,
+ ElementType.PACKAGE,
+ ElementType.PARAMETER,
+ ElementType.TYPE,
+ ElementType.TYPE_PARAMETER,
+ ElementType.TYPE_USE
+})
+@Retention(RetentionPolicy.SOURCE)
+public @interface IncrementalAnnotationProcessor {
+
+ IncrementalAnnotationProcessorType value();
+}
diff --git a/android-annotation-stubs/src/net/ltgt/gradle/incap/IncrementalAnnotationProcessorType.java b/android-annotation-stubs/src/net/ltgt/gradle/incap/IncrementalAnnotationProcessorType.java
new file mode 100644
index 00000000..1abee42e
--- /dev/null
+++ b/android-annotation-stubs/src/net/ltgt/gradle/incap/IncrementalAnnotationProcessorType.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package net.ltgt.gradle.incap;
+
+import java.util.Locale;
+
+public enum IncrementalAnnotationProcessorType {
+ DYNAMIC,
+ ISOLATING,
+ AGGREGATING;
+
+ public String getProcessorOption() {
+ return "org.gradle.annotation.processing." + name().toLowerCase(Locale.ROOT);
+ }
+}
diff --git a/android-annotation-stubs/tmpl.java b/android-annotation-stubs/tmpl.java
new file mode 100644
index 00000000..c4df6090
--- /dev/null
+++ b/android-annotation-stubs/tmpl.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package __PACKAGE__;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+__IMPORT__
+
+/* This is an annotation stub to avoid dependencies on annotations that aren't
+ * in the Android platform source tree. */
+
+@Target({
+ ElementType.ANNOTATION_TYPE,
+ ElementType.CONSTRUCTOR,
+ ElementType.FIELD,
+ ElementType.LOCAL_VARIABLE,
+ ElementType.METHOD,
+ ElementType.PACKAGE,
+ ElementType.PARAMETER,
+ ElementType.TYPE,
+ ElementType.TYPE_PARAMETER,
+ ElementType.TYPE_USE})
+@Retention(RetentionPolicy.SOURCE)
+public @interface __CLASS__ {
+ __INNER__
+ __PARAMETER__
+}
diff --git a/common/Android.bp b/common/Android.bp
new file mode 100644
index 00000000..279b90d9
--- /dev/null
+++ b/common/Android.bp
@@ -0,0 +1,9 @@
+java_library_host {
+ name: "auto_common",
+ srcs: ["src/main/java/**/*.java"],
+ libs: [
+ "guava",
+ "javapoet",
+ ],
+ visibility: ["//visibility:public"],
+}
diff --git a/factory/Android.bp b/factory/Android.bp
new file mode 100644
index 00000000..bf4899bf
--- /dev/null
+++ b/factory/Android.bp
@@ -0,0 +1,31 @@
+java_library {
+ name: "auto_factory_annotations",
+ host_supported: true,
+ srcs: ["src/main/**/com/google/auto/factory/*.java"],
+ visibility: ["//visibility:public"],
+}
+
+java_plugin {
+ name: "auto_factory_plugin",
+ srcs: ["src/main/**/com/google/auto/factory/processor/*.java"],
+ static_libs: [
+ "auto_common",
+ "auto_factory_annotations",
+ "google_java_format",
+ "guava",
+ "javapoet",
+ "jsr330",
+ ],
+ libs: [
+ "auto_android_annotation_stubs",
+ "auto_value_annotations",
+ "auto_service_annotations",
+ ],
+ plugins: [
+ "auto_service_plugin",
+ "auto_value_plugin",
+ ],
+ processor_class: "com.google.auto.factory.processor.AutoFactoryProcessor",
+ generates_api: true,
+ visibility: ["//visibility:public"],
+}
diff --git a/service/Android.bp b/service/Android.bp
new file mode 100644
index 00000000..033fd84a
--- /dev/null
+++ b/service/Android.bp
@@ -0,0 +1,19 @@
+java_library {
+ name: "auto_service_annotations",
+ host_supported: true,
+ srcs: ["annotations/src/main/java/**/*.java"],
+ sdk_version: "core_current",
+ visibility: ["//visibility:public"],
+}
+
+java_plugin {
+ name: "auto_service_plugin",
+ srcs: ["processor/src/main/java/**/*.java"],
+ static_libs: [
+ "auto_common",
+ "auto_service_annotations",
+ "guava",
+ ],
+ processor_class: "com.google.auto.service.processor.AutoServiceProcessor",
+ visibility: ["//visibility:public"],
+}
diff --git a/value/Android.bp b/value/Android.bp
new file mode 100644
index 00000000..2e1d819d
--- /dev/null
+++ b/value/Android.bp
@@ -0,0 +1,100 @@
+filegroup {
+ name: "auto_value_plugin_resources",
+ path: "src/main/java",
+ srcs: ["src/main/java/com/google/auto/value/processor/*.vm"],
+}
+
+java_library_host {
+ name: "libauto_value_plugin",
+ srcs: ["src/main/java/com/google/auto/value/processor/**/*.java"],
+ java_resources: [":auto_value_plugin_resources"],
+ libs: [
+ "auto_android_annotation_stubs",
+ "auto_service_annotations",
+ "error_prone_annotations",
+
+ "auto_common",
+ "auto_value_extension",
+ "escapevelocity",
+ "guava",
+ "javapoet",
+ ],
+}
+
+java_library_host {
+ name: "auto_value_extension",
+ srcs: ["src/main/java/com/google/auto/value/extension/*.java"],
+ libs: [
+ "guava",
+ ],
+}
+
+
+java_library {
+ name: "auto_value_annotations",
+ host_supported: true,
+ srcs: ["src/main/java/com/google/auto/value/*.java"],
+ sdk_version: "core_current",
+ visibility: ["//visibility:public"],
+}
+
+java_plugin {
+ name: "auto_value_plugin",
+ static_libs: [
+ "libauto_value_plugin",
+
+ "auto_android_annotation_stubs",
+ "auto_common",
+ "auto_service_plugin",
+ "auto_value_extension",
+ "escapevelocity",
+ "guava",
+ "javapoet",
+ ],
+ processor_class: "com.google.auto.value.processor.AutoValueProcessor",
+ visibility: ["//visibility:public"],
+}
+
+java_plugin {
+ name: "auto_annotation_plugin",
+ static_libs: [
+ "libauto_value_plugin",
+
+ "auto_android_annotation_stubs",
+ "auto_common",
+ "auto_service_plugin",
+ "auto_value_extension",
+ "escapevelocity",
+ "guava",
+ "javapoet",
+ ],
+ processor_class: "com.google.auto.value.processor.AutoAnnotationProcessor",
+ visibility: ["//visibility:public"],
+}
+
+java_library {
+ name: "auto_value_memoized_extension_annotations",
+ host_supported: true,
+ srcs: ["src/main/java/com/google/auto/value/extension/memoized/*.java"],
+ sdk_version: "core_current",
+ visibility: ["//visibility:public"],
+}
+
+java_plugin {
+ name: "auto_value_memoized_extension_plugin",
+ srcs: ["src/main/java/com/google/auto/value/extension/memoized/processor/*.java"],
+ static_libs: [
+ "auto_android_annotation_stubs",
+ "auto_common",
+ "auto_service_annotations",
+ "auto_value_extension",
+ "error_prone_annotations",
+ "escapevelocity",
+ "guava",
+ "javapoet",
+ "jsr305",
+ ],
+ plugins: ["auto_service_plugin"],
+ processor_class: "com.google.auto.value.extension.memoized.processor.MemoizedValidator",
+ visibility: ["//visibility:public"],
+}