Merge changes from topic "soong_dexpreopt" am: 9e094ebe1d

am: ccb900af00

Change-Id: I3ac2830c2ca266e2729c80c8693bb2985b22bca3
This commit is contained in:
Colin Cross
2017-12-07 08:51:15 +00:00
committed by android-build-merger
5 changed files with 38 additions and 8 deletions

View File

@@ -94,6 +94,8 @@ func init() {
"LOCAL_NOTICE_FILE": "notice", "LOCAL_NOTICE_FILE": "notice",
"LOCAL_JAVA_LANGUAGE_VERSION": "java_version", "LOCAL_JAVA_LANGUAGE_VERSION": "java_version",
"LOCAL_INSTRUMENTATION_FOR": "instrumentation_for", "LOCAL_INSTRUMENTATION_FOR": "instrumentation_for",
"LOCAL_DEX_PREOPT_PROFILE_CLASS_LISTING": "dex_preopt.profile",
}) })
addStandardProperties(bpparser.ListType, addStandardProperties(bpparser.ListType,
map[string]string{ map[string]string{
@@ -151,7 +153,10 @@ func init() {
"LOCAL_PROPRIETARY_MODULE": "proprietary", "LOCAL_PROPRIETARY_MODULE": "proprietary",
"LOCAL_VENDOR_MODULE": "vendor", "LOCAL_VENDOR_MODULE": "vendor",
"LOCAL_EXPORT_PACKAGE_RESOURCES": "export_package_resources", "LOCAL_EXPORT_PACKAGE_RESOURCES": "export_package_resources",
"LOCAL_DEX_PREOPT": "dex_preopt",
"LOCAL_DEX_PREOPT": "dex_preopt.enabled",
"LOCAL_DEX_PREOPT_APP_IMAGE": "dex_preopt.app_image",
"LOCAL_DEX_PREOPT_GENERATE_PROFILE": "dex_preopt.profile_guided",
}) })
} }

View File

@@ -368,4 +368,4 @@ func (c *vndkPrebuiltLibraryDecorator) AndroidMk(ctx AndroidMkContext, ret *andr
fmt.Fprintln(w, "LOCAL_MODULE_PATH := $(OUT_DIR)/"+filepath.Clean(dir)) fmt.Fprintln(w, "LOCAL_MODULE_PATH := $(OUT_DIR)/"+filepath.Clean(dir))
fmt.Fprintln(w, "LOCAL_MODULE_STEM := "+stem) fmt.Fprintln(w, "LOCAL_MODULE_STEM := "+stem)
}) })
} }

View File

@@ -137,4 +137,4 @@ func vndkPrebuiltSharedFactory() android.Module {
func init() { func init() {
android.RegisterModuleType("vndk_prebuilt_shared", vndkPrebuiltSharedFactory) android.RegisterModuleType("vndk_prebuilt_shared", vndkPrebuiltSharedFactory)
} }

View File

@@ -36,8 +36,18 @@ func (library *Library) AndroidMk() android.AndroidMkData {
} }
if library.dexJarFile != nil { if library.dexJarFile != nil {
fmt.Fprintln(w, "LOCAL_SOONG_DEX_JAR :=", library.dexJarFile.String()) fmt.Fprintln(w, "LOCAL_SOONG_DEX_JAR :=", library.dexJarFile.String())
if library.deviceProperties.Dex_preopt != nil && *library.deviceProperties.Dex_preopt == false { if library.deviceProperties.Dex_preopt.Enabled != nil {
fmt.Fprintln(w, "LOCAL_DEX_PREOPT := false") fmt.Fprintln(w, "LOCAL_DEX_PREOPT :=", *library.deviceProperties.Dex_preopt.Enabled)
}
if library.deviceProperties.Dex_preopt.App_image != nil {
fmt.Fprintln(w, "LOCAL_DEX_PREOPT_APP_IMAGE :=", *library.deviceProperties.Dex_preopt.App_image)
}
if library.deviceProperties.Dex_preopt.Profile_guided != nil {
fmt.Fprintln(w, "LOCAL_DEX_PREOPT_GENERATE_PROFILE :=", *library.deviceProperties.Dex_preopt.Profile_guided)
}
if library.deviceProperties.Dex_preopt.Profile != nil {
fmt.Fprintln(w, "LOCAL_DEX_PREOPT_GENERATE_PROFILE := true")
fmt.Fprintln(w, "LOCAL_DEX_PREOPT_PROFILE_CLASS_LISTING := $(LOCAL_PATH)/"+*library.deviceProperties.Dex_preopt.Profile)
} }
} }
fmt.Fprintln(w, "LOCAL_SDK_VERSION :=", String(library.deviceProperties.Sdk_version)) fmt.Fprintln(w, "LOCAL_SDK_VERSION :=", String(library.deviceProperties.Sdk_version))

View File

@@ -167,9 +167,24 @@ type CompilerDeviceProperties struct {
// If true, export a copy of the module as a -hostdex module for host testing. // If true, export a copy of the module as a -hostdex module for host testing.
Hostdex *bool Hostdex *bool
// If false, prevent dexpreopting and stripping the dex file from the final jar. Defaults to Dex_preopt struct {
// true. // If false, prevent dexpreopting and stripping the dex file from the final jar. Defaults to
Dex_preopt *bool // true.
Enabled *bool
// If true, generate an app image (.art file) for this module.
App_image *bool
// If true, use a checked-in profile to guide optimization. Defaults to false unless
// a matching profile is set or a profile is found in PRODUCT_DEX_PREOPT_PROFILE_DIR
// that matches the name of this module, in which case it is defaulted to true.
Profile_guided *bool
// If set, provides the path to profile relative to the Android.bp file. If not set,
// defaults to searching for a file that matches the name of this module in the default
// profile location set by PRODUCT_DEX_PREOPT_PROFILE_DIR, or empty if not found.
Profile *string
}
// When targeting 1.9, override the modules to use with --system // When targeting 1.9, override the modules to use with --system
System_modules *string System_modules *string