diff options
-rw-r--r-- | java/sdk_library.go | 99 | ||||
-rw-r--r-- | sysprop/sysprop_library.go | 1 |
2 files changed, 55 insertions, 45 deletions
diff --git a/java/sdk_library.go b/java/sdk_library.go index 72c5cfc2..5b65c0ca 100644 --- a/java/sdk_library.go +++ b/java/sdk_library.go | |||
@@ -126,6 +126,9 @@ type sdkLibraryProperties struct { | |||
126 | // If set to true, the path of dist files is apistubs/core. Defaults to false. | 126 | // If set to true, the path of dist files is apistubs/core. Defaults to false. |
127 | Core_lib *bool | 127 | Core_lib *bool |
128 | 128 | ||
129 | // don't create dist rules. | ||
130 | No_dist *bool `blueprint:"mutated"` | ||
131 | |||
129 | // TODO: determines whether to create HTML doc or not | 132 | // TODO: determines whether to create HTML doc or not |
130 | //Html_doc *bool | 133 | //Html_doc *bool |
131 | } | 134 | } |
@@ -212,52 +215,54 @@ func (module *SdkLibrary) AndroidMk() android.AndroidMkData { | |||
212 | android.WriteAndroidMkData(w, data) | 215 | android.WriteAndroidMkData(w, data) |
213 | 216 | ||
214 | module.Library.AndroidMkHostDex(w, name, data) | 217 | module.Library.AndroidMkHostDex(w, name, data) |
215 | // Create a phony module that installs the impl library, for the case when this lib is | 218 | if !Bool(module.sdkLibraryProperties.No_dist) { |
216 | // in PRODUCT_PACKAGES. | 219 | // Create a phony module that installs the impl library, for the case when this lib is |
217 | owner := module.ModuleBase.Owner() | 220 | // in PRODUCT_PACKAGES. |
218 | if owner == "" { | 221 | owner := module.ModuleBase.Owner() |
219 | if Bool(module.sdkLibraryProperties.Core_lib) { | 222 | if owner == "" { |
220 | owner = "core" | 223 | if Bool(module.sdkLibraryProperties.Core_lib) { |
221 | } else { | 224 | owner = "core" |
222 | owner = "android" | 225 | } else { |
226 | owner = "android" | ||
227 | } | ||
228 | } | ||
229 | // Create dist rules to install the stubs libs to the dist dir | ||
230 | if len(module.publicApiStubsPath) == 1 { | ||
231 | fmt.Fprintln(w, "$(call dist-for-goals,sdk win_sdk,"+ | ||
232 | module.publicApiStubsImplPath.Strings()[0]+ | ||
233 | ":"+path.Join("apistubs", owner, "public", | ||
234 | module.BaseModuleName()+".jar")+")") | ||
235 | } | ||
236 | if len(module.systemApiStubsPath) == 1 { | ||
237 | fmt.Fprintln(w, "$(call dist-for-goals,sdk win_sdk,"+ | ||
238 | module.systemApiStubsImplPath.Strings()[0]+ | ||
239 | ":"+path.Join("apistubs", owner, "system", | ||
240 | module.BaseModuleName()+".jar")+")") | ||
241 | } | ||
242 | if len(module.testApiStubsPath) == 1 { | ||
243 | fmt.Fprintln(w, "$(call dist-for-goals,sdk win_sdk,"+ | ||
244 | module.testApiStubsImplPath.Strings()[0]+ | ||
245 | ":"+path.Join("apistubs", owner, "test", | ||
246 | module.BaseModuleName()+".jar")+")") | ||
247 | } | ||
248 | if module.publicApiFilePath != nil { | ||
249 | fmt.Fprintln(w, "$(call dist-for-goals,sdk win_sdk,"+ | ||
250 | module.publicApiFilePath.String()+ | ||
251 | ":"+path.Join("apistubs", owner, "public", "api", | ||
252 | module.BaseModuleName()+".txt")+")") | ||
253 | } | ||
254 | if module.systemApiFilePath != nil { | ||
255 | fmt.Fprintln(w, "$(call dist-for-goals,sdk win_sdk,"+ | ||
256 | module.systemApiFilePath.String()+ | ||
257 | ":"+path.Join("apistubs", owner, "system", "api", | ||
258 | module.BaseModuleName()+".txt")+")") | ||
259 | } | ||
260 | if module.testApiFilePath != nil { | ||
261 | fmt.Fprintln(w, "$(call dist-for-goals,sdk win_sdk,"+ | ||
262 | module.testApiFilePath.String()+ | ||
263 | ":"+path.Join("apistubs", owner, "test", "api", | ||
264 | module.BaseModuleName()+".txt")+")") | ||
223 | } | 265 | } |
224 | } | ||
225 | // Create dist rules to install the stubs libs to the dist dir | ||
226 | if len(module.publicApiStubsPath) == 1 { | ||
227 | fmt.Fprintln(w, "$(call dist-for-goals,sdk win_sdk,"+ | ||
228 | module.publicApiStubsImplPath.Strings()[0]+ | ||
229 | ":"+path.Join("apistubs", owner, "public", | ||
230 | module.BaseModuleName()+".jar")+")") | ||
231 | } | ||
232 | if len(module.systemApiStubsPath) == 1 { | ||
233 | fmt.Fprintln(w, "$(call dist-for-goals,sdk win_sdk,"+ | ||
234 | module.systemApiStubsImplPath.Strings()[0]+ | ||
235 | ":"+path.Join("apistubs", owner, "system", | ||
236 | module.BaseModuleName()+".jar")+")") | ||
237 | } | ||
238 | if len(module.testApiStubsPath) == 1 { | ||
239 | fmt.Fprintln(w, "$(call dist-for-goals,sdk win_sdk,"+ | ||
240 | module.testApiStubsImplPath.Strings()[0]+ | ||
241 | ":"+path.Join("apistubs", owner, "test", | ||
242 | module.BaseModuleName()+".jar")+")") | ||
243 | } | ||
244 | if module.publicApiFilePath != nil { | ||
245 | fmt.Fprintln(w, "$(call dist-for-goals,sdk win_sdk,"+ | ||
246 | module.publicApiFilePath.String()+ | ||
247 | ":"+path.Join("apistubs", owner, "public", "api", | ||
248 | module.BaseModuleName()+".txt")+")") | ||
249 | } | ||
250 | if module.systemApiFilePath != nil { | ||
251 | fmt.Fprintln(w, "$(call dist-for-goals,sdk win_sdk,"+ | ||
252 | module.systemApiFilePath.String()+ | ||
253 | ":"+path.Join("apistubs", owner, "system", "api", | ||
254 | module.BaseModuleName()+".txt")+")") | ||
255 | } | ||
256 | if module.testApiFilePath != nil { | ||
257 | fmt.Fprintln(w, "$(call dist-for-goals,sdk win_sdk,"+ | ||
258 | module.testApiFilePath.String()+ | ||
259 | ":"+path.Join("apistubs", owner, "test", "api", | ||
260 | module.BaseModuleName()+".txt")+")") | ||
261 | } | 266 | } |
262 | } | 267 | } |
263 | return data | 268 | return data |
@@ -641,6 +646,10 @@ func (module *SdkLibrary) SdkImplementationJars(ctx android.BaseContext, sdkVers | |||
641 | } | 646 | } |
642 | } | 647 | } |
643 | 648 | ||
649 | func (module *SdkLibrary) SetNoDist() { | ||
650 | module.sdkLibraryProperties.No_dist = proptools.BoolPtr(true) | ||
651 | } | ||
652 | |||
644 | var javaSdkLibrariesKey = android.NewOnceKey("javaSdkLibraries") | 653 | var javaSdkLibrariesKey = android.NewOnceKey("javaSdkLibraries") |
645 | 654 | ||
646 | func javaSdkLibraries(config android.Config) *[]string { | 655 | func javaSdkLibraries(config android.Config) *[]string { |
diff --git a/sysprop/sysprop_library.go b/sysprop/sysprop_library.go index 0313ecd0..3f2709e2 100644 --- a/sysprop/sysprop_library.go +++ b/sysprop/sysprop_library.go | |||
@@ -72,6 +72,7 @@ func syspropLibraryFactory() android.Module { | |||
72 | &m.syspropLibraryProperties, | 72 | &m.syspropLibraryProperties, |
73 | ) | 73 | ) |
74 | m.InitSdkLibraryProperties() | 74 | m.InitSdkLibraryProperties() |
75 | m.SetNoDist() | ||
75 | android.InitAndroidMultiTargetsArchModule(m, android.DeviceSupported, "common") | 76 | android.InitAndroidMultiTargetsArchModule(m, android.DeviceSupported, "common") |
76 | android.AddLoadHook(m, func(ctx android.LoadHookContext) { syspropLibraryHook(ctx, m) }) | 77 | android.AddLoadHook(m, func(ctx android.LoadHookContext) { syspropLibraryHook(ctx, m) }) |
77 | android.AddLoadHook(m, func(ctx android.LoadHookContext) { m.SdkLibrary.CreateInternalModules(ctx) }) | 78 | android.AddLoadHook(m, func(ctx android.LoadHookContext) { m.SdkLibrary.CreateInternalModules(ctx) }) |