diff options
author | Nan Zhang <nanzhang@google.com> | 2018-08-30 15:28:46 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2018-08-30 15:28:46 +0000 |
commit | b69575b1f697edae9f9b78765d50c8117d21f7d1 (patch) | |
tree | ae920ffcea361b58a44022897a2dc7a3b443c112 /java/java.go | |
parent | 8a9900a75f091aa57d303e6483eb2c873b68b13a (diff) | |
parent | 4c819fb59064921c2ef71fe1da489b5e3051d0d2 (diff) | |
download | android_build_soong-b69575b1f697edae9f9b78765d50c8117d21f7d1.tar.gz android_build_soong-b69575b1f697edae9f9b78765d50c8117d21f7d1.tar.bz2 android_build_soong-b69575b1f697edae9f9b78765d50c8117d21f7d1.zip |
Merge "Add jetifier support in Soong."
Diffstat (limited to 'java/java.go')
-rw-r--r-- | java/java.go | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/java/java.go b/java/java.go index 295863fe..b911078b 100644 --- a/java/java.go +++ b/java/java.go @@ -1582,6 +1582,9 @@ type ImportProperties struct { // List of directories to remove from the jar file(s) Exclude_dirs []string + + // if set to true, run Jetifier against .jar file. Defaults to false. + Jetifier_enabled *bool } type Import struct { @@ -1622,9 +1625,15 @@ func (j *Import) DepsMutator(ctx android.BottomUpMutatorContext) { func (j *Import) GenerateAndroidBuildActions(ctx android.ModuleContext) { jars := ctx.ExpandSources(j.properties.Jars, nil) - outputFile := android.PathForModuleOut(ctx, "classes.jar") + jarName := ctx.ModuleName() + ".jar" + 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) { + inputFile := outputFile + outputFile = android.PathForModuleOut(ctx, "jetifier", jarName) + TransformJetifier(ctx, outputFile, inputFile) + } j.combinedClasspathFile = outputFile ctx.VisitDirectDeps(func(module android.Module) { |