diff options
Diffstat (limited to 'aconfig/init.go')
-rw-r--r-- | aconfig/init.go | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/aconfig/init.go b/aconfig/init.go index ab6ee46d0..b2fe5a309 100644 --- a/aconfig/init.go +++ b/aconfig/init.go @@ -70,6 +70,13 @@ var ( "${aconfig}", }, }, "cache_files") + RecordFinalizedFlagsRule = pctx.AndroidStaticRule("RecordFinalizedFlagsRule", + blueprint.RuleParams{ + Command: `${record-finalized-flags} ${parsed_flags_file} ${finalized_flags_file} ${api_signature_files} > ${out}`, + CommandDeps: []string{ + "${record-finalized-flags}", + }, + }, "api_signature_files", "finalized_flags_file", "parsed_flags_file") CreateStorageRule = pctx.AndroidStaticRule("aconfig_create_storage", blueprint.RuleParams{ @@ -88,6 +95,7 @@ var ( // exported flags (only). Finally collect all generated code // into the ${out} JAR file. blueprint.RuleParams{ + // LINT.IfChange Command: `rm -rf ${out}.tmp` + `&& for cache in ${cache_files}; do ` + ` if [ -n "$$(${aconfig} dump-cache --dedup --cache $$cache --filter=is_exported:true --format='{fully_qualified_name}')" ]; then ` + @@ -96,28 +104,33 @@ var ( ` --mode=exported` + ` --allow-instrumentation ${use_new_storage}` + ` --new-exported ${use_new_exported}` + + ` --single-exported-file true` + + ` --check-api-level ${check_api_level}` + ` --out ${out}.tmp; ` + ` fi ` + `done` + `&& $soong_zip -write_if_changed -jar -o ${out} -C ${out}.tmp -D ${out}.tmp` + `&& rm -rf ${out}.tmp`, + // LINT.ThenChange(/aconfig/codegen/init.go) CommandDeps: []string{ "$aconfig", "$soong_zip", }, - }, "cache_files", "use_new_storage", "use_new_exported") + }, "cache_files", "use_new_storage", "use_new_exported", "check_api_level") ) func init() { RegisterBuildComponents(android.InitRegistrationContext) pctx.HostBinToolVariable("aconfig", "aconfig") pctx.HostBinToolVariable("soong_zip", "soong_zip") + pctx.HostBinToolVariable("record-finalized-flags", "record-finalized-flags") } func RegisterBuildComponents(ctx android.RegistrationContext) { ctx.RegisterModuleType("aconfig_declarations", DeclarationsFactory) ctx.RegisterModuleType("aconfig_values", ValuesFactory) ctx.RegisterModuleType("aconfig_value_set", ValueSetFactory) - ctx.RegisterParallelSingletonType("all_aconfig_declarations", AllAconfigDeclarationsFactory) + ctx.RegisterSingletonModuleType("all_aconfig_declarations", AllAconfigDeclarationsFactory) ctx.RegisterParallelSingletonType("exported_java_aconfig_library", ExportedJavaDeclarationsLibraryFactory) + ctx.RegisterModuleType("all_aconfig_declarations_extension", AllAconfigDeclarationsExtensionFactory) } |