Loading api/api.go +30 −23 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import ( const art = "art.module.public.api" const conscrypt = "conscrypt.module.public.api" const i18n = "i18n.module.public.api" var core_libraries_modules = []string{art, conscrypt, i18n} // The intention behind this soong plugin is to generate a number of "merged" Loading Loading @@ -92,6 +93,8 @@ type fgProps struct { type MergedTxtDefinition struct { // "current.txt" or "removed.txt" TxtFilename string // Filename in the new dist dir. "android.txt" or "android-removed.txt" DistFilename string // The module for the non-updatable / non-module part of the api. BaseTxt string // The list of modules that are relevant for this merged txt. Loading @@ -112,7 +115,6 @@ func createMergedTxt(ctx android.LoadHookContext, txt MergedTxtDefinition) { if txt.Scope != "public" { filename = txt.Scope + "-" + filename } props := genruleProps{} props.Name = proptools.StringPtr(ctx.ModuleName() + "-" + filename) props.Tools = []string{"metalava"} Loading @@ -126,9 +128,9 @@ func createMergedTxt(ctx android.LoadHookContext, txt MergedTxtDefinition) { Dest: proptools.StringPtr(filename), }, { Targets: []string{"sdk"}, Targets: []string{"api_txt", "sdk"}, Dir: proptools.StringPtr("apistubs/android/" + txt.Scope + "/api"), Dest: proptools.StringPtr(txt.TxtFilename), Dest: proptools.StringPtr(txt.DistFilename), }, } props.Visibility = []string{"//visibility:public"} Loading Loading @@ -242,9 +244,11 @@ func createMergedTxts(ctx android.LoadHookContext, bootclasspath, system_server_ var textFiles []MergedTxtDefinition tagSuffix := []string{".api.txt}", ".removed-api.txt}"} distFilename := []string{"android.txt", "android-removed.txt"} for i, f := range []string{"current.txt", "removed.txt"} { textFiles = append(textFiles, MergedTxtDefinition{ TxtFilename: f, DistFilename: distFilename[i], BaseTxt: ":non-updatable-" + f, Modules: bootclasspath, ModuleTag: "{.public" + tagSuffix[i], Loading @@ -252,6 +256,7 @@ func createMergedTxts(ctx android.LoadHookContext, bootclasspath, system_server_ }) textFiles = append(textFiles, MergedTxtDefinition{ TxtFilename: f, DistFilename: distFilename[i], BaseTxt: ":non-updatable-system-" + f, Modules: bootclasspath, ModuleTag: "{.system" + tagSuffix[i], Loading @@ -259,6 +264,7 @@ func createMergedTxts(ctx android.LoadHookContext, bootclasspath, system_server_ }) textFiles = append(textFiles, MergedTxtDefinition{ TxtFilename: f, DistFilename: distFilename[i], BaseTxt: ":non-updatable-module-lib-" + f, Modules: bootclasspath, ModuleTag: "{.module-lib" + tagSuffix[i], Loading @@ -266,6 +272,7 @@ func createMergedTxts(ctx android.LoadHookContext, bootclasspath, system_server_ }) textFiles = append(textFiles, MergedTxtDefinition{ TxtFilename: f, DistFilename: distFilename[i], BaseTxt: ":non-updatable-system-server-" + f, Modules: system_server_classpath, ModuleTag: "{.system-server" + tagSuffix[i], Loading Loading
api/api.go +30 −23 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import ( const art = "art.module.public.api" const conscrypt = "conscrypt.module.public.api" const i18n = "i18n.module.public.api" var core_libraries_modules = []string{art, conscrypt, i18n} // The intention behind this soong plugin is to generate a number of "merged" Loading Loading @@ -92,6 +93,8 @@ type fgProps struct { type MergedTxtDefinition struct { // "current.txt" or "removed.txt" TxtFilename string // Filename in the new dist dir. "android.txt" or "android-removed.txt" DistFilename string // The module for the non-updatable / non-module part of the api. BaseTxt string // The list of modules that are relevant for this merged txt. Loading @@ -112,7 +115,6 @@ func createMergedTxt(ctx android.LoadHookContext, txt MergedTxtDefinition) { if txt.Scope != "public" { filename = txt.Scope + "-" + filename } props := genruleProps{} props.Name = proptools.StringPtr(ctx.ModuleName() + "-" + filename) props.Tools = []string{"metalava"} Loading @@ -126,9 +128,9 @@ func createMergedTxt(ctx android.LoadHookContext, txt MergedTxtDefinition) { Dest: proptools.StringPtr(filename), }, { Targets: []string{"sdk"}, Targets: []string{"api_txt", "sdk"}, Dir: proptools.StringPtr("apistubs/android/" + txt.Scope + "/api"), Dest: proptools.StringPtr(txt.TxtFilename), Dest: proptools.StringPtr(txt.DistFilename), }, } props.Visibility = []string{"//visibility:public"} Loading Loading @@ -242,9 +244,11 @@ func createMergedTxts(ctx android.LoadHookContext, bootclasspath, system_server_ var textFiles []MergedTxtDefinition tagSuffix := []string{".api.txt}", ".removed-api.txt}"} distFilename := []string{"android.txt", "android-removed.txt"} for i, f := range []string{"current.txt", "removed.txt"} { textFiles = append(textFiles, MergedTxtDefinition{ TxtFilename: f, DistFilename: distFilename[i], BaseTxt: ":non-updatable-" + f, Modules: bootclasspath, ModuleTag: "{.public" + tagSuffix[i], Loading @@ -252,6 +256,7 @@ func createMergedTxts(ctx android.LoadHookContext, bootclasspath, system_server_ }) textFiles = append(textFiles, MergedTxtDefinition{ TxtFilename: f, DistFilename: distFilename[i], BaseTxt: ":non-updatable-system-" + f, Modules: bootclasspath, ModuleTag: "{.system" + tagSuffix[i], Loading @@ -259,6 +264,7 @@ func createMergedTxts(ctx android.LoadHookContext, bootclasspath, system_server_ }) textFiles = append(textFiles, MergedTxtDefinition{ TxtFilename: f, DistFilename: distFilename[i], BaseTxt: ":non-updatable-module-lib-" + f, Modules: bootclasspath, ModuleTag: "{.module-lib" + tagSuffix[i], Loading @@ -266,6 +272,7 @@ func createMergedTxts(ctx android.LoadHookContext, bootclasspath, system_server_ }) textFiles = append(textFiles, MergedTxtDefinition{ TxtFilename: f, DistFilename: distFilename[i], BaseTxt: ":non-updatable-system-server-" + f, Modules: system_server_classpath, ModuleTag: "{.system-server" + tagSuffix[i], Loading