summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederick Mayle <fmayle@google.com>2024-01-30 17:48:30 -0800
committerFrederick Mayle <fmayle@google.com>2024-01-31 14:15:37 -0800
commit8b418a36cf4969b93cfd3c731bd2477a734b2a11 (patch)
tree67f27a8c4baae18b14b5c944a9aa6190072c41ec
parentba3b67e7492c3a8a4b4713a00fa182277a7c1765 (diff)
downloadp9-8b418a36cf4969b93cfd3c731bd2477a734b2a11.tar.gz
add cargo_embargo.json and Android.bpsimpleperf-release
Bug: 296291847 Test: m Change-Id: Ide369ac2271f1a833c7c3a53aacdac342e7efa58
-rw-r--r--Android.bp77
-rw-r--r--Android.bp.patch34
-rw-r--r--cargo_embargo.json10
3 files changed, 121 insertions, 0 deletions
diff --git a/Android.bp b/Android.bp
new file mode 100644
index 0000000..085721a
--- /dev/null
+++ b/Android.bp
@@ -0,0 +1,77 @@
+// This file is generated by cargo_embargo.
+// Do not modify this file as changes will be overridden on upgrade.
+
+package {
+ default_applicable_licenses: ["external_rust_crates_p9_license"],
+}
+
+license {
+ name: "external_rust_crates_p9_license",
+ visibility: [":__subpackages__"],
+ license_kinds: [
+ "SPDX-license-identifier-BSD-3-Clause",
+ ],
+ license_text: [
+ "LICENSE",
+ ],
+}
+
+rust_library {
+ name: "libp9",
+ host_supported: true,
+ crate_name: "p9",
+ cargo_env_compat: true,
+ cargo_pkg_version: "0.2.3",
+ srcs: ["src/lib.rs"],
+ edition: "2021",
+ rustlibs: [
+ "liblibc",
+ "libserde",
+ ],
+ proc_macros: ["libp9_wire_format_derive"],
+ compile_multilib: "first",
+ apex_available: [
+ "//apex_available:platform",
+ "//apex_available:anyapex",
+ ],
+ product_available: true,
+ vendor_available: true,
+ // Doesn't compile on 32-bit targets.
+ target: {
+ android_arm: {
+ enabled: false,
+ },
+ android_x86: {
+ enabled: false,
+ },
+ },
+}
+
+rust_test {
+ name: "p9_test_src_lib",
+ host_supported: true,
+ crate_name: "p9",
+ cargo_env_compat: true,
+ cargo_pkg_version: "0.2.3",
+ srcs: ["src/lib.rs"],
+ test_suites: ["general-tests"],
+ auto_gen_config: true,
+ test_options: {
+ unit_test: true,
+ },
+ edition: "2021",
+ rustlibs: [
+ "liblibc",
+ "libserde",
+ ],
+ proc_macros: ["libp9_wire_format_derive"],
+ // Doesn't compile on 32-bit targets.
+ target: {
+ android_arm: {
+ enabled: false,
+ },
+ android_x86: {
+ enabled: false,
+ },
+ },
+}
diff --git a/Android.bp.patch b/Android.bp.patch
new file mode 100644
index 0000000..477ac21
--- /dev/null
+++ b/Android.bp.patch
@@ -0,0 +1,34 @@
+diff --git a/Android.bp b/Android.bp
+index 7aa485c..085721a 100644
+--- a/Android.bp
++++ b/Android.bp
+@@ -36,6 +36,15 @@ rust_library {
+ ],
+ product_available: true,
+ vendor_available: true,
++ // Doesn't compile on 32-bit targets.
++ target: {
++ android_arm: {
++ enabled: false,
++ },
++ android_x86: {
++ enabled: false,
++ },
++ },
+ }
+
+ rust_test {
+@@ -56,4 +65,13 @@ rust_test {
+ "libserde",
+ ],
+ proc_macros: ["libp9_wire_format_derive"],
++ // Doesn't compile on 32-bit targets.
++ target: {
++ android_arm: {
++ enabled: false,
++ },
++ android_x86: {
++ enabled: false,
++ },
++ },
+ }
diff --git a/cargo_embargo.json b/cargo_embargo.json
new file mode 100644
index 0000000..2004b22
--- /dev/null
+++ b/cargo_embargo.json
@@ -0,0 +1,10 @@
+{
+ "run_cargo": false,
+ "tests": true,
+ "package": {
+ "p9": {
+ "patch": "Android.bp.patch",
+ "host_first_multilib": true
+ }
+ }
+}