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
diff --git a/java/sdk_library.go b/java/sdk_library.go
index d588801..3e6908b 100644
--- a/java/sdk_library.go
+++ b/java/sdk_library.go
@@ -217,38 +217,45 @@
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")+")")
}
},