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
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user