Merge "Rename jetifier property and add it to androidmk" am: 4ada982da9

am: 33938d3188

Change-Id: If3091a403e82cb0ca19d87f812e51d3257a119ed
This commit is contained in:
Colin Cross 2019-03-22 23:28:53 -07:00 committed by android-build-merger
commit eb1cebad0d
4 changed files with 7 additions and 4 deletions

View file

@ -201,6 +201,7 @@ func init() {
"LOCAL_DEX_PREOPT_GENERATE_PROFILE": "dex_preopt.profile_guided",
"LOCAL_PRIVATE_PLATFORM_APIS": "platform_apis",
"LOCAL_JETIFIER_ENABLED": "jetifier",
})
}

View file

@ -631,12 +631,14 @@ include $(call all-makefiles-under,$(LOCAL_PATH))
LOCAL_SRC_FILES := test.jar
LOCAL_MODULE_CLASS := JAVA_LIBRARIES
LOCAL_STATIC_ANDROID_LIBRARIES :=
LOCAL_JETIFIER_ENABLED := true
include $(BUILD_PREBUILT)
`,
expected: `
java_import {
jars: ["test.jar"],
jetifier: true,
}
`,
},

View file

@ -446,7 +446,7 @@ type AARImportProperties struct {
Libs []string
// if set to true, run Jetifier against .aar file. Defaults to false.
Jetifier_enabled *bool
Jetifier *bool
}
type AARImport struct {
@ -540,7 +540,7 @@ func (a *AARImport) GenerateAndroidBuildActions(ctx android.ModuleContext) {
aarName := ctx.ModuleName() + ".aar"
var aar android.Path
aar = android.PathForModuleSrc(ctx, a.properties.Aars[0])
if Bool(a.properties.Jetifier_enabled) {
if Bool(a.properties.Jetifier) {
inputFile := aar
aar = android.PathForModuleOut(ctx, "jetifier", aarName)
TransformJetifier(ctx, aar.(android.WritablePath), inputFile)

View file

@ -1726,7 +1726,7 @@ type ImportProperties struct {
Exclude_dirs []string
// if set to true, run Jetifier against .jar file. Defaults to false.
Jetifier_enabled *bool
Jetifier *bool
}
type Import struct {
@ -1771,7 +1771,7 @@ func (j *Import) GenerateAndroidBuildActions(ctx android.ModuleContext) {
outputFile := android.PathForModuleOut(ctx, "combined", jarName)
TransformJarsToJar(ctx, outputFile, "for prebuilts", jars, android.OptionalPath{},
false, j.properties.Exclude_files, j.properties.Exclude_dirs)
if Bool(j.properties.Jetifier_enabled) {
if Bool(j.properties.Jetifier) {
inputFile := outputFile
outputFile = android.PathForModuleOut(ctx, "jetifier", jarName)
TransformJetifier(ctx, outputFile, inputFile)