Skip to content

Commit

Permalink
Use cargo_embargo to generate Android.bp files
Browse files Browse the repository at this point in the history
  • Loading branch information
Gnurou committed Jul 5, 2024
1 parent 2698a09 commit 00cce08
Show file tree
Hide file tree
Showing 5 changed files with 193 additions and 55 deletions.
55 changes: 0 additions & 55 deletions Android.bp

This file was deleted.

17 changes: 17 additions & 0 deletions cargo_embargo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"module_blocklist": ["runbindgen", "runbindgen_test_src_main"],
"package": {
"v4l2r": {
"host_supported": false,
"dep_blocklist": ["libctrlc", "libclap"]
},
"v4l2r-ffi": {
"host_supported": false
},
"v4l2r-utils": {
"host_supported": false
}
},
"run_cargo": false,
"tests": true
}
82 changes: 82 additions & 0 deletions ffi/Android.bp
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
// This file is generated by cargo_embargo.
// Do not modify this file after the first "rust_*" or "genrule" module
// because the changes will be overridden on upgrade.
// Content before the first "rust_*" or "genrule" module is preserved.

// DO NOT SUBMIT: Add license before submitting.
rust_library {
name: "libv4l2r_ffi",
crate_name: "v4l2r_ffi",
cargo_env_compat: true,
cargo_pkg_version: "0.0.1",
crate_root: "src/lib.rs",
edition: "2021",
features: [
"default",
"env_logger",
"linux",
],
rustlibs: [
"libanyhow",
"libenv_logger",
"liblog_rust",
"libnix",
"libv4l2r",
],
apex_available: [
"//apex_available:platform",
"//apex_available:anyapex",
],
product_available: true,
vendor_available: true,
}

rust_ffi_static {
name: "libv4l2r_ffi_static",
crate_name: "v4l2r_ffi",
cargo_env_compat: true,
cargo_pkg_version: "0.0.1",
crate_root: "src/lib.rs",
edition: "2021",
features: [
"default",
"env_logger",
"linux",
],
rustlibs: [
"libanyhow",
"libenv_logger",
"liblog_rust",
"libnix",
"libv4l2r",
],
apex_available: [
"//apex_available:platform",
"//apex_available:anyapex",
],
product_available: true,
vendor_available: true,
}

rust_test {
name: "v4l2r-ffi_test_src_lib",
crate_name: "v4l2r_ffi",
cargo_env_compat: true,
cargo_pkg_version: "0.0.1",
crate_root: "src/lib.rs",
test_suites: ["general-tests"],
auto_gen_config: true,
edition: "2021",
features: [
"default",
"env_logger",
"linux",
],
rustlibs: [
"libanyhow",
"libenv_logger",
"liblog_rust",
"libnix",
"libv4l2r",
],
}
49 changes: 49 additions & 0 deletions lib/Android.bp
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// This file is generated by cargo_embargo.
// Do not modify this file after the first "rust_*" or "genrule" module
// because the changes will be overridden on upgrade.
// Content before the first "rust_*" or "genrule" module is preserved.

// DO NOT SUBMIT: Add license before submitting.
rust_library {
name: "libv4l2r",
crate_name: "v4l2r",
cargo_env_compat: true,
cargo_pkg_version: "0.0.2",
crate_root: "src/lib.rs",
edition: "2021",
rustlibs: [
"libanyhow",
"libbitflags",
"liblog_rust",
"libnix",
"libthiserror",
],
proc_macros: ["libenumn"],
apex_available: [
"//apex_available:platform",
"//apex_available:anyapex",
],
product_available: true,
vendor_available: true,
}

rust_test {
name: "v4l2r_test_src_lib",
crate_name: "v4l2r",
cargo_env_compat: true,
cargo_pkg_version: "0.0.2",
crate_root: "src/lib.rs",
test_suites: ["general-tests"],
auto_gen_config: true,
edition: "2021",
rustlibs: [
"libanyhow",
"libbitflags",
"libenv_logger",
"liblog_rust",
"libnix",
"libthiserror",
"libv4l2r_utils",
],
proc_macros: ["libenumn"],
}
45 changes: 45 additions & 0 deletions utils/Android.bp
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// This file is generated by cargo_embargo.
// Do not modify this file after the first "rust_*" or "genrule" module
// because the changes will be overridden on upgrade.
// Content before the first "rust_*" or "genrule" module is preserved.

// DO NOT SUBMIT: Add license before submitting.
rust_library {
name: "libv4l2r_utils",
crate_name: "v4l2r_utils",
cargo_env_compat: true,
cargo_pkg_version: "0.0.1",
crate_root: "src/lib.rs",
edition: "2021",
rustlibs: [
"libanyhow",
"liblog_rust",
"libnix",
"libthiserror",
"libv4l2r",
],
apex_available: [
"//apex_available:platform",
"//apex_available:anyapex",
],
product_available: true,
vendor_available: true,
}

rust_test {
name: "v4l2r-utils_test_src_lib",
crate_name: "v4l2r_utils",
cargo_env_compat: true,
cargo_pkg_version: "0.0.1",
crate_root: "src/lib.rs",
test_suites: ["general-tests"],
auto_gen_config: true,
edition: "2021",
rustlibs: [
"libanyhow",
"liblog_rust",
"libnix",
"libthiserror",
"libv4l2r",
],
}

0 comments on commit 00cce08

Please sign in to comment.