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

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

Convert merged srcjar rule to Android.bp

api.go was made to create modules that were hard to create in
Android.bp. However since we now have a filegroup with all the
public srcjars this rule can very easily be expressed in Android.bp.

Test: build before & after (no diff)
Change-Id: I1d6c6bdcd6b75693de1e80ced13efd1d10202171
parent 07044e05
Loading
Loading
Loading
Loading
+12 −0
Original line number Original line Diff line number Diff line
@@ -178,6 +178,18 @@ genrule {
        "$(location :frameworks-base-api-module-lib-current.txt)",
        "$(location :frameworks-base-api-module-lib-current.txt)",
}
}


genrule {
    name: "frameworks-base-api-current.srcjar",
    tools: ["merge_zips"],
    out: ["current.srcjar"],
    cmd: "$(location merge_zips) $(out) $(in)",
    srcs: [
        ":api-stubs-docs-non-updatable",
        ":all-modules-public-stubs-source",
    ],
    visibility: ["//visibility:private"], // Used by make module in //development, mind
}

// This produces the same annotations.zip as framework-doc-stubs, but by using
// This produces the same annotations.zip as framework-doc-stubs, but by using
// outputs from individual modules instead of all the source code.
// outputs from individual modules instead of all the source code.
genrule_defaults {
genrule_defaults {
+0 −13
Original line number Original line Diff line number Diff line
@@ -147,17 +147,6 @@ func createMergedTxt(ctx android.LoadHookContext, txt MergedTxtDefinition) {
	ctx.CreateModule(genrule.GenRuleFactory, &props)
	ctx.CreateModule(genrule.GenRuleFactory, &props)
}
}


func createMergedStubsSrcjar(ctx android.LoadHookContext, modules []string) {
	props := genruleProps{}
	props.Name = proptools.StringPtr(ctx.ModuleName() + "-current.srcjar")
	props.Tools = []string{"merge_zips"}
	props.Out = []string{"current.srcjar"}
	props.Cmd = proptools.StringPtr("$(location merge_zips) $(out) $(in)")
	props.Srcs = append([]string{":api-stubs-docs-non-updatable"}, createSrcs(modules, "{.public.stubs.source}")...)
	props.Visibility = []string{"//visibility:private"} // Used by make module in //development, mind
	ctx.CreateModule(genrule.GenRuleFactory, &props)
}

func createMergedAnnotationsFilegroups(ctx android.LoadHookContext, modules, system_server_modules []string) {
func createMergedAnnotationsFilegroups(ctx android.LoadHookContext, modules, system_server_modules []string) {
	for _, i := range []struct{
	for _, i := range []struct{
		name    string
		name    string
@@ -382,8 +371,6 @@ func (a *CombinedApis) createInternalModules(ctx android.LoadHookContext) {
	}
	}
	createMergedTxts(ctx, bootclasspath, system_server_classpath)
	createMergedTxts(ctx, bootclasspath, system_server_classpath)


	createMergedStubsSrcjar(ctx, bootclasspath)

	createMergedPublicStubs(ctx, bootclasspath)
	createMergedPublicStubs(ctx, bootclasspath)
	createMergedSystemStubs(ctx, bootclasspath)
	createMergedSystemStubs(ctx, bootclasspath)
	createMergedTestStubsForNonUpdatableModules(ctx)
	createMergedTestStubsForNonUpdatableModules(ctx)