Merge "Add No_dist property"

am: f50406eecc

Change-Id: I9ae99c77e5aa35b052c4528f35734477f911f0d0
This commit is contained in:
Sundong Ahn
2019-05-15 18:31:45 -07:00
committed by android-build-merger
2 changed files with 55 additions and 45 deletions

View File

@@ -126,6 +126,9 @@ type sdkLibraryProperties struct {
// If set to true, the path of dist files is apistubs/core. Defaults to false.
Core_lib *bool
// don't create dist rules.
No_dist *bool `blueprint:"mutated"`
// TODO: determines whether to create HTML doc or not
//Html_doc *bool
}
@@ -212,6 +215,7 @@ func (module *SdkLibrary) AndroidMk() android.AndroidMkData {
android.WriteAndroidMkData(w, 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
// in PRODUCT_PACKAGES.
owner := module.ModuleBase.Owner()
@@ -260,6 +264,7 @@ func (module *SdkLibrary) AndroidMk() android.AndroidMkData {
module.BaseModuleName()+".txt")+")")
}
}
}
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")
func javaSdkLibraries(config android.Config) *[]string {

View File

@@ -72,6 +72,7 @@ func syspropLibraryFactory() android.Module {
&m.syspropLibraryProperties,
)
m.InitSdkLibraryProperties()
m.SetNoDist()
android.InitAndroidMultiTargetsArchModule(m, android.DeviceSupported, "common")
android.AddLoadHook(m, func(ctx android.LoadHookContext) { syspropLibraryHook(ctx, m) })
android.AddLoadHook(m, func(ctx android.LoadHookContext) { m.SdkLibrary.CreateInternalModules(ctx) })