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
Merged-In: I51c6a6b87ab9dc90b6825c0d4d414e958dd7b265
Change-Id: I51c6a6b87ab9dc90b6825c0d4d414e958dd7b265
(cherry picked from commit 80a87b3309)
This commit is contained in:
Sundong Ahn
2019-05-13 15:02:50 +09:00
parent 2c6484e334
commit a4a385f1d5
2 changed files with 55 additions and 45 deletions

View File

@@ -133,6 +133,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
} }
@@ -219,6 +222,7 @@ 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)
if !Bool(module.sdkLibraryProperties.No_dist) {
// Create a phony module that installs the impl library, for the case when this lib is // Create a phony module that installs the impl library, for the case when this lib is
// in PRODUCT_PACKAGES. // in PRODUCT_PACKAGES.
owner := module.ModuleBase.Owner() owner := module.ModuleBase.Owner()
@@ -267,6 +271,7 @@ func (module *SdkLibrary) AndroidMk() android.AndroidMkData {
module.BaseModuleName()+".txt")+")") module.BaseModuleName()+".txt")+")")
} }
} }
}
return data return data
} }
@@ -648,6 +653,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 {

View File

@@ -75,6 +75,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) })