aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorSundong Ahn <sundongahn@google.com>2019-05-13 15:02:50 +0900
committerSundong Ahn <sundongahn@google.com>2019-05-16 19:23:39 +0900
commita4a385f1d581d0bfdb2776b7c95311cf80654441 (patch)
tree9c1cc59800fe73dd70f725b49f21df0f4eb899d4 /java
parent2c6484e334521754c6b725f9b31c71fda3c6f50d (diff)
downloadbuild_soong-a4a385f1d581d0bfdb2776b7c95311cf80654441.tar.gz
build_soong-a4a385f1d581d0bfdb2776b7c95311cf80654441.tar.bz2
build_soong-a4a385f1d581d0bfdb2776b7c95311cf80654441.zip
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 80a87b3309192d0f0caa2097a097ed4ed20c6fff)
Diffstat (limited to 'java')
-rw-r--r--java/sdk_library.go99
1 files changed, 54 insertions, 45 deletions
diff --git a/java/sdk_library.go b/java/sdk_library.go
index dc7da334..974131cf 100644
--- a/java/sdk_library.go
+++ b/java/sdk_library.go
@@ -133,6 +133,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
}
@@ -219,52 +222,54 @@ func (module *SdkLibrary) AndroidMk() android.AndroidMkData {
android.WriteAndroidMkData(w, data)
module.Library.AndroidMkHostDex(w, name, data)
- // Create a phony module that installs the impl library, for the case when this lib is
- // in PRODUCT_PACKAGES.
- owner := module.ModuleBase.Owner()
- if owner == "" {
- if Bool(module.sdkLibraryProperties.Core_lib) {
- owner = "core"
- } else {
- owner = "android"
+ 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()
+ if owner == "" {
+ if Bool(module.sdkLibraryProperties.Core_lib) {
+ owner = "core"
+ } 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
@@ -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")
func javaSdkLibraries(config android.Config) *[]string {