Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b3738ed1 authored by Anton Hansson's avatar Anton Hansson
Browse files

Make the srcjar for bcp available in OutputFiles

This makes it possible for Android.bp files to depends on the srcjar.

Bug: 151360309
Test: m platform-bootclasspath.srcjar
Change-Id: Id42cc3cff89c084b55c7fb0726ad84ecd4f50f58
parent 57162c51
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -57,6 +57,9 @@ type platformBootclasspathModule struct {

	// Path to the monolithic hiddenapi-unsupported.csv file.
	hiddenAPIMetadataCSV android.OutputPath

	// Path to a srcjar containing all the transitive sources of the bootclasspath.
	srcjar android.OutputPath
}

type platformBootclasspathProperties struct {
@@ -95,6 +98,8 @@ func (b *platformBootclasspathModule) OutputFiles(tag string) (android.Paths, er
		return android.Paths{b.hiddenAPIIndexCSV}, nil
	case "hiddenapi-metadata.csv":
		return android.Paths{b.hiddenAPIMetadataCSV}, nil
	case ".srcjar":
		return android.Paths{b.srcjar}, nil
	}

	return nil, fmt.Errorf("unknown tag %s", tag)
@@ -182,8 +187,8 @@ func (b *platformBootclasspathModule) GenerateAndroidBuildActions(ctx android.Mo
	}
	jarArgs := resourcePathsToJarArgs(transitiveSrcFiles)
	jarArgs = append(jarArgs, "-srcjar") // Move srcfiles to the right package
	transitiveSrcJar := android.PathForModuleOut(ctx, ctx.ModuleName()+"-transitive.srcjar")
	TransformResourcesToJar(ctx, transitiveSrcJar, jarArgs, transitiveSrcFiles)
	b.srcjar = android.PathForModuleOut(ctx, ctx.ModuleName()+"-transitive.srcjar").OutputPath
	TransformResourcesToJar(ctx, b.srcjar, jarArgs, transitiveSrcFiles)

	// Gather all the fragments dependencies.
	b.fragments = gatherApexModulePairDepsWithTag(ctx, bootclasspathFragmentDepTag)