Add No_dist property
For the sysprop apis, we don't need dist. So the No_dist property is added for it. Bug: 132448761 Test: m -j dist Change-Id: I51c6a6b87ab9dc90b6825c0d4d414e958dd7b265
This commit is contained in:
parent
0967b34dd9
commit
80a87b3309
|
@ -126,6 +126,9 @@ type sdkLibraryProperties struct {
|
||||||
// If set to true, the path of dist files is apistubs/core. Defaults to false.
|
// If set to true, the path of dist files is apistubs/core. Defaults to false.
|
||||||
Core_lib *bool
|
Core_lib *bool
|
||||||
|
|
||||||
|
// don't create dist rules.
|
||||||
|
No_dist *bool `blueprint:"mutated"`
|
||||||
|
|
||||||
// TODO: determines whether to create HTML doc or not
|
// TODO: determines whether to create HTML doc or not
|
||||||
//Html_doc *bool
|
//Html_doc *bool
|
||||||
}
|
}
|
||||||
|
@ -212,52 +215,54 @@ func (module *SdkLibrary) AndroidMk() android.AndroidMkData {
|
||||||
android.WriteAndroidMkData(w, data)
|
android.WriteAndroidMkData(w, data)
|
||||||
|
|
||||||
module.Library.AndroidMkHostDex(w, name, data)
|
module.Library.AndroidMkHostDex(w, name, data)
|
||||||
// Create a phony module that installs the impl library, for the case when this lib is
|
if !Bool(module.sdkLibraryProperties.No_dist) {
|
||||||
// in PRODUCT_PACKAGES.
|
// Create a phony module that installs the impl library, for the case when this lib is
|
||||||
owner := module.ModuleBase.Owner()
|
// in PRODUCT_PACKAGES.
|
||||||
if owner == "" {
|
owner := module.ModuleBase.Owner()
|
||||||
if Bool(module.sdkLibraryProperties.Core_lib) {
|
if owner == "" {
|
||||||
owner = "core"
|
if Bool(module.sdkLibraryProperties.Core_lib) {
|
||||||
} else {
|
owner = "core"
|
||||||
owner = "android"
|
} else {
|
||||||
|
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.publicApiStubsImplPath.Strings()[0]+
|
||||||
|
":"+path.Join("apistubs", owner, "public",
|
||||||
|
module.BaseModuleName()+".jar")+")")
|
||||||
|
}
|
||||||
|
if len(module.systemApiStubsPath) == 1 {
|
||||||
|
fmt.Fprintln(w, "$(call dist-for-goals,sdk win_sdk,"+
|
||||||
|
module.systemApiStubsImplPath.Strings()[0]+
|
||||||
|
":"+path.Join("apistubs", owner, "system",
|
||||||
|
module.BaseModuleName()+".jar")+")")
|
||||||
|
}
|
||||||
|
if len(module.testApiStubsPath) == 1 {
|
||||||
|
fmt.Fprintln(w, "$(call dist-for-goals,sdk win_sdk,"+
|
||||||
|
module.testApiStubsImplPath.Strings()[0]+
|
||||||
|
":"+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", 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", 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", owner, "test", "api",
|
||||||
|
module.BaseModuleName()+".txt")+")")
|
||||||
}
|
}
|
||||||
}
|
|
||||||
// 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.publicApiStubsImplPath.Strings()[0]+
|
|
||||||
":"+path.Join("apistubs", owner, "public",
|
|
||||||
module.BaseModuleName()+".jar")+")")
|
|
||||||
}
|
|
||||||
if len(module.systemApiStubsPath) == 1 {
|
|
||||||
fmt.Fprintln(w, "$(call dist-for-goals,sdk win_sdk,"+
|
|
||||||
module.systemApiStubsImplPath.Strings()[0]+
|
|
||||||
":"+path.Join("apistubs", owner, "system",
|
|
||||||
module.BaseModuleName()+".jar")+")")
|
|
||||||
}
|
|
||||||
if len(module.testApiStubsPath) == 1 {
|
|
||||||
fmt.Fprintln(w, "$(call dist-for-goals,sdk win_sdk,"+
|
|
||||||
module.testApiStubsImplPath.Strings()[0]+
|
|
||||||
":"+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", 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", 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", owner, "test", "api",
|
|
||||||
module.BaseModuleName()+".txt")+")")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return data
|
return data
|
||||||
|
@ -641,6 +646,10 @@ func (module *SdkLibrary) SdkImplementationJars(ctx android.BaseContext, sdkVers
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (module *SdkLibrary) SetNoDist() {
|
||||||
|
module.sdkLibraryProperties.No_dist = proptools.BoolPtr(true)
|
||||||
|
}
|
||||||
|
|
||||||
var javaSdkLibrariesKey = android.NewOnceKey("javaSdkLibraries")
|
var javaSdkLibrariesKey = android.NewOnceKey("javaSdkLibraries")
|
||||||
|
|
||||||
func javaSdkLibraries(config android.Config) *[]string {
|
func javaSdkLibraries(config android.Config) *[]string {
|
||||||
|
|
|
@ -72,6 +72,7 @@ func syspropLibraryFactory() android.Module {
|
||||||
&m.syspropLibraryProperties,
|
&m.syspropLibraryProperties,
|
||||||
)
|
)
|
||||||
m.InitSdkLibraryProperties()
|
m.InitSdkLibraryProperties()
|
||||||
|
m.SetNoDist()
|
||||||
android.InitAndroidMultiTargetsArchModule(m, android.DeviceSupported, "common")
|
android.InitAndroidMultiTargetsArchModule(m, android.DeviceSupported, "common")
|
||||||
android.AddLoadHook(m, func(ctx android.LoadHookContext) { syspropLibraryHook(ctx, m) })
|
android.AddLoadHook(m, func(ctx android.LoadHookContext) { syspropLibraryHook(ctx, m) })
|
||||||
android.AddLoadHook(m, func(ctx android.LoadHookContext) { m.SdkLibrary.CreateInternalModules(ctx) })
|
android.AddLoadHook(m, func(ctx android.LoadHookContext) { m.SdkLibrary.CreateInternalModules(ctx) })
|
||||||
|
|
Loading…
Reference in New Issue