Change the dist file path for sdk library

The dist file path is changed from apistubs/{api_scope}/*.jar to
apistubs/{owner}/{api_scope}/*.jar. it makes easy to get stub files
when updating prebuilts/sdk by making it possible to distinguish
between Android libraries and Google libraries.
And Onwer() function is added to ModuleBase for getting onwer info.

Test: make -j40 PRODUCT-sdk_phone_armv7-sdk dist sdk_repo
Change-Id: I50069aff6664901e6c9129d69643a414ee5e41d0
This commit is contained in:
Sundong Ahn 2018-08-31 18:01:37 +09:00
parent 446c666672
commit 4fd04bb506
2 changed files with 17 additions and 6 deletions

View File

@ -602,6 +602,10 @@ func (p *ModuleBase) InstallInRecovery() bool {
return Bool(p.commonProperties.Recovery)
}
func (a *ModuleBase) Owner() string {
return String(a.commonProperties.Owner)
}
func (a *ModuleBase) generateModuleTarget(ctx ModuleContext) {
allInstalledFiles := Paths{}
allCheckbuildFiles := Paths{}

View File

@ -217,38 +217,45 @@ func (module *sdkLibrary) AndroidMk() android.AndroidMkData {
fmt.Fprintln(w, "LOCAL_MODULE :=", name)
fmt.Fprintln(w, "LOCAL_REQUIRED_MODULES := "+module.implName())
fmt.Fprintln(w, "include $(BUILD_PHONY_PACKAGE)")
owner := module.ModuleBase.Owner()
if owner == "" {
owner = "android"
}
// Create dist rules to install the stubs libs to the dist dir
if len(module.publicApiStubsPath) == 1 {
fmt.Fprintln(w, "$(call dist-for-goals,sdk win_sdk,"+
module.publicApiStubsPath.Strings()[0]+
":"+path.Join("apistubs", "public", module.BaseModuleName()+".jar")+")")
":"+path.Join("apistubs", owner, "public",
module.BaseModuleName()+".jar")+")")
}
if len(module.systemApiStubsPath) == 1 {
fmt.Fprintln(w, "$(call dist-for-goals,sdk win_sdk,"+
module.systemApiStubsPath.Strings()[0]+
":"+path.Join("apistubs", "system", module.BaseModuleName()+".jar")+")")
":"+path.Join("apistubs", owner, "system",
module.BaseModuleName()+".jar")+")")
}
if len(module.testApiStubsPath) == 1 {
fmt.Fprintln(w, "$(call dist-for-goals,sdk win_sdk,"+
module.testApiStubsPath.Strings()[0]+
":"+path.Join("apistubs", "test", module.BaseModuleName()+".jar")+")")
":"+path.Join("apistubs", owner, "test",
module.BaseModuleName()+".jar")+")")
}
if module.publicApiFilePath != nil {
fmt.Fprintln(w, "$(call dist-for-goals,sdk win_sdk,"+
module.publicApiFilePath.String()+
":"+path.Join("apistubs", "public", "api",
":"+path.Join("apistubs", owner, "public", "api",
module.BaseModuleName()+".txt")+")")
}
if module.systemApiFilePath != nil {
fmt.Fprintln(w, "$(call dist-for-goals,sdk win_sdk,"+
module.systemApiFilePath.String()+
":"+path.Join("apistubs", "system", "api",
":"+path.Join("apistubs", owner, "system", "api",
module.BaseModuleName()+".txt")+")")
}
if module.testApiFilePath != nil {
fmt.Fprintln(w, "$(call dist-for-goals,sdk win_sdk,"+
module.testApiFilePath.String()+
":"+path.Join("apistubs", "test", "api",
":"+path.Join("apistubs", owner, "test", "api",
module.BaseModuleName()+".txt")+")")
}
},