Merge "Add storage API as dependency to Rust codegen" into main am: 97045effe0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3018163 Change-Id: I8afe491d9ec0178131991c9ea1865a5ff3a4f89f Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -101,6 +101,7 @@ func (a *aconfigDecorator) SourceProviderDeps(ctx rust.DepsContext, deps rust.De
|
|||||||
deps = a.BaseSourceProvider.SourceProviderDeps(ctx, deps)
|
deps = a.BaseSourceProvider.SourceProviderDeps(ctx, deps)
|
||||||
deps.Rustlibs = append(deps.Rustlibs, "libflags_rust")
|
deps.Rustlibs = append(deps.Rustlibs, "libflags_rust")
|
||||||
deps.Rustlibs = append(deps.Rustlibs, "liblazy_static")
|
deps.Rustlibs = append(deps.Rustlibs, "liblazy_static")
|
||||||
|
deps.Rustlibs = append(deps.Rustlibs, "libaconfig_storage_read_api")
|
||||||
ctx.AddDependency(ctx.Module(), rustDeclarationsTag, a.Properties.Aconfig_declarations)
|
ctx.AddDependency(ctx.Module(), rustDeclarationsTag, a.Properties.Aconfig_declarations)
|
||||||
return deps
|
return deps
|
||||||
}
|
}
|
||||||
|
@@ -28,6 +28,11 @@ func TestRustAconfigLibrary(t *testing.T) {
|
|||||||
crate_name: "lazy_static",
|
crate_name: "lazy_static",
|
||||||
srcs: ["src/lib.rs"],
|
srcs: ["src/lib.rs"],
|
||||||
}
|
}
|
||||||
|
rust_library {
|
||||||
|
name: "libaconfig_storage_read_api", // test mock
|
||||||
|
crate_name: "aconfig_storage_read_api",
|
||||||
|
srcs: ["lib.rs"],
|
||||||
|
}
|
||||||
aconfig_declarations {
|
aconfig_declarations {
|
||||||
name: "my_aconfig_declarations",
|
name: "my_aconfig_declarations",
|
||||||
package: "com.example.package",
|
package: "com.example.package",
|
||||||
@@ -98,6 +103,11 @@ func testRustCodegenModeHelper(t *testing.T, bpMode string, ruleMode string) {
|
|||||||
crate_name: "lazy_static",
|
crate_name: "lazy_static",
|
||||||
srcs: ["src/lib.rs"],
|
srcs: ["src/lib.rs"],
|
||||||
}
|
}
|
||||||
|
rust_library {
|
||||||
|
name: "libaconfig_storage_read_api", // test mock
|
||||||
|
crate_name: "aconfig_storage_read_api",
|
||||||
|
srcs: ["lib.rs"],
|
||||||
|
}
|
||||||
aconfig_declarations {
|
aconfig_declarations {
|
||||||
name: "my_aconfig_declarations",
|
name: "my_aconfig_declarations",
|
||||||
package: "com.example.package",
|
package: "com.example.package",
|
||||||
@@ -145,6 +155,11 @@ func testIncorrectRustCodegenModeHelper(t *testing.T, bpMode string, err string)
|
|||||||
crate_name: "lazy_static",
|
crate_name: "lazy_static",
|
||||||
srcs: ["src/lib.rs"],
|
srcs: ["src/lib.rs"],
|
||||||
}
|
}
|
||||||
|
rust_library {
|
||||||
|
name: "libaconfig_storage_read_api", // test mock
|
||||||
|
crate_name: "aconfig_storage_read_api",
|
||||||
|
srcs: ["lib.rs"],
|
||||||
|
}
|
||||||
aconfig_declarations {
|
aconfig_declarations {
|
||||||
name: "my_aconfig_declarations",
|
name: "my_aconfig_declarations",
|
||||||
package: "com.example.package",
|
package: "com.example.package",
|
||||||
|
@@ -217,6 +217,12 @@ func TestValidationAcrossContainersExportedPass(t *testing.T) {
|
|||||||
srcs: ["src/lib.rs"],
|
srcs: ["src/lib.rs"],
|
||||||
apex_available: ["myapex"],
|
apex_available: ["myapex"],
|
||||||
}
|
}
|
||||||
|
rust_library {
|
||||||
|
name: "libaconfig_storage_read_api", // test mock
|
||||||
|
crate_name: "aconfig_storage_read_api",
|
||||||
|
srcs: ["src/lib.rs"],
|
||||||
|
apex_available: ["myapex"],
|
||||||
|
}
|
||||||
rust_ffi_shared {
|
rust_ffi_shared {
|
||||||
name: "libmy_rust_library",
|
name: "libmy_rust_library",
|
||||||
srcs: ["src/lib.rs"],
|
srcs: ["src/lib.rs"],
|
||||||
@@ -480,6 +486,12 @@ func TestValidationAcrossContainersNotExportedFail(t *testing.T) {
|
|||||||
srcs: ["src/lib.rs"],
|
srcs: ["src/lib.rs"],
|
||||||
apex_available: ["myapex"],
|
apex_available: ["myapex"],
|
||||||
}
|
}
|
||||||
|
rust_library {
|
||||||
|
name: "libaconfig_storage_read_api", // test mock
|
||||||
|
crate_name: "aconfig_storage_read_api",
|
||||||
|
srcs: ["src/lib.rs"],
|
||||||
|
apex_available: ["myapex"],
|
||||||
|
}
|
||||||
rust_ffi_shared {
|
rust_ffi_shared {
|
||||||
name: "libmy_rust_library",
|
name: "libmy_rust_library",
|
||||||
srcs: ["src/lib.rs"],
|
srcs: ["src/lib.rs"],
|
||||||
@@ -524,6 +536,12 @@ func TestValidationAcrossContainersNotExportedFail(t *testing.T) {
|
|||||||
srcs: ["src/lib.rs"],
|
srcs: ["src/lib.rs"],
|
||||||
apex_available: ["myapex"],
|
apex_available: ["myapex"],
|
||||||
}
|
}
|
||||||
|
rust_library {
|
||||||
|
name: "libaconfig_storage_read_api", // test mock
|
||||||
|
crate_name: "aconfig_storage_read_api",
|
||||||
|
srcs: ["src/lib.rs"],
|
||||||
|
apex_available: ["myapex"],
|
||||||
|
}
|
||||||
rust_binary {
|
rust_binary {
|
||||||
name: "my_rust_binary",
|
name: "my_rust_binary",
|
||||||
srcs: ["foo/bar/MyClass.rs"],
|
srcs: ["foo/bar/MyClass.rs"],
|
||||||
|
@@ -11296,6 +11296,15 @@ func TestAconfigFilesRustDeps(t *testing.T) {
|
|||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rust_library {
|
||||||
|
name: "libaconfig_storage_read_api", // test mock
|
||||||
|
crate_name: "aconfig_storage_read_api",
|
||||||
|
srcs: ["src/lib.rs"],
|
||||||
|
apex_available: [
|
||||||
|
"myapex",
|
||||||
|
],
|
||||||
|
}
|
||||||
|
|
||||||
rust_ffi_shared {
|
rust_ffi_shared {
|
||||||
name: "libmy_rust_library",
|
name: "libmy_rust_library",
|
||||||
srcs: ["src/lib.rs"],
|
srcs: ["src/lib.rs"],
|
||||||
@@ -11380,14 +11389,14 @@ func TestAconfigFilesRustDeps(t *testing.T) {
|
|||||||
mod := ctx.ModuleForTests("myapex", "android_common_myapex")
|
mod := ctx.ModuleForTests("myapex", "android_common_myapex")
|
||||||
s := mod.Rule("apexRule").Args["copy_commands"]
|
s := mod.Rule("apexRule").Args["copy_commands"]
|
||||||
copyCmds := regexp.MustCompile(" *&& *").Split(s, -1)
|
copyCmds := regexp.MustCompile(" *&& *").Split(s, -1)
|
||||||
if len(copyCmds) != 26 {
|
if len(copyCmds) != 28 {
|
||||||
t.Fatalf("Expected 26 commands, got %d in:\n%s", len(copyCmds), s)
|
t.Fatalf("Expected 28 commands, got %d in:\n%s", len(copyCmds), s)
|
||||||
}
|
}
|
||||||
|
|
||||||
ensureMatches(t, copyCmds[22], "^cp -f .*/aconfig_flags.pb .*/image.apex/etc$")
|
ensureMatches(t, copyCmds[24], "^cp -f .*/aconfig_flags.pb .*/image.apex/etc$")
|
||||||
ensureMatches(t, copyCmds[23], "^cp -f .*/package.map .*/image.apex/etc$")
|
ensureMatches(t, copyCmds[25], "^cp -f .*/package.map .*/image.apex/etc$")
|
||||||
ensureMatches(t, copyCmds[24], "^cp -f .*/flag.map .*/image.apex/etc$")
|
ensureMatches(t, copyCmds[26], "^cp -f .*/flag.map .*/image.apex/etc$")
|
||||||
ensureMatches(t, copyCmds[25], "^cp -f .*/flag.val .*/image.apex/etc$")
|
ensureMatches(t, copyCmds[27], "^cp -f .*/flag.val .*/image.apex/etc$")
|
||||||
|
|
||||||
inputs := []string{
|
inputs := []string{
|
||||||
"my_aconfig_declarations_foo/intermediate.pb",
|
"my_aconfig_declarations_foo/intermediate.pb",
|
||||||
|
Reference in New Issue
Block a user