Merge "Merge libs/ directory of imported aars into classes.jar"

This commit is contained in:
Treehugger Robot 2020-08-08 00:51:38 +00:00 committed by Gerrit Code Review
commit 7189f5d1e2
1 changed files with 7 additions and 4 deletions

View File

@ -641,9 +641,11 @@ func (a *AARImport) DepsMutator(ctx android.BottomUpMutatorContext) {
var unzipAAR = pctx.AndroidStaticRule("unzipAAR",
blueprint.RuleParams{
Command: `rm -rf $outDir && mkdir -p $outDir && ` +
`unzip -qoDD -d $outDir $in && rm -rf $outDir/res && touch $out`,
`unzip -qoDD -d $outDir $in && rm -rf $outDir/res && touch $out && ` +
`${config.MergeZipsCmd} $combinedClassesJar $$(ls $outDir/classes.jar 2> /dev/null) $$(ls $outDir/libs/*.jar 2> /dev/null)`,
CommandDeps: []string{"${config.MergeZipsCmd}"},
},
"outDir")
"outDir", "combinedClassesJar")
func (a *AARImport) GenerateAndroidBuildActions(ctx android.ModuleContext) {
if len(a.properties.Aars) != 1 {
@ -661,7 +663,7 @@ func (a *AARImport) GenerateAndroidBuildActions(ctx android.ModuleContext) {
}
extractedAARDir := android.PathForModuleOut(ctx, "aar")
a.classpathFile = extractedAARDir.Join(ctx, "classes.jar")
a.classpathFile = extractedAARDir.Join(ctx, "classes-combined.jar")
a.proguardFlags = extractedAARDir.Join(ctx, "proguard.txt")
a.manifest = extractedAARDir.Join(ctx, "AndroidManifest.xml")
@ -672,6 +674,7 @@ func (a *AARImport) GenerateAndroidBuildActions(ctx android.ModuleContext) {
Description: "unzip AAR",
Args: map[string]string{
"outDir": extractedAARDir.String(),
"combinedClassesJar": a.classpathFile.String(),
},
})