diff options
author | 2023-08-02 13:50:26 -0400 | |
---|---|---|
committer | 2023-08-08 17:30:52 -0400 | |
commit | 457ddef28eafeb79765c058a7f710d0e60567f94 (patch) | |
tree | 85cf517c246de2417b8f64a5579b2cd7094f08e9 /aconfig/init.go | |
parent | 6553cf54fb0cea5b5166adcf429d459e854f5643 (diff) |
Implement rust_aconfig_library
rust_aconfig_library generates src/lib.rs and uses it to build library variants (dylib, rlib-rlib_std, and rlib-dylib_std) as of what `rust_library` produces
Test: go test
Change-Id: I6c4603691d4306c463c2e9521f5c11c30765b1e3
Diffstat (limited to 'aconfig/init.go')
-rw-r--r-- | aconfig/init.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/aconfig/init.go b/aconfig/init.go index 7e283ea47..58b6b8ba8 100644 --- a/aconfig/init.go +++ b/aconfig/init.go @@ -16,6 +16,7 @@ package aconfig import ( "android/soong/android" + "github.com/google/blueprint" ) @@ -70,6 +71,20 @@ var ( }, }, "gendir") + rustRule = pctx.AndroidStaticRule("rust_aconfig_library", + blueprint.RuleParams{ + Command: `rm -rf ${gendir}` + + ` && mkdir -p ${gendir}` + + ` && ${aconfig} create-rust-lib` + + ` --mode ${mode}` + + ` --cache ${in}` + + ` --out ${gendir}`, + CommandDeps: []string{ + "$aconfig", + "$soong_zip", + }, + }, "gendir", "mode") + // For all_aconfig_declarations allDeclarationsRule = pctx.AndroidStaticRule("all_aconfig_declarations_dump", blueprint.RuleParams{ @@ -92,5 +107,6 @@ func registerBuildComponents(ctx android.RegistrationContext) { ctx.RegisterModuleType("aconfig_value_set", ValueSetFactory) ctx.RegisterModuleType("cc_aconfig_library", CcAconfigLibraryFactory) ctx.RegisterModuleType("java_aconfig_library", JavaDeclarationsLibraryFactory) + ctx.RegisterModuleType("rust_aconfig_library", RustAconfigLibraryFactory) ctx.RegisterParallelSingletonType("all_aconfig_declarations", AllAconfigDeclarationsFactory) } |