diff options
| author | Jiyong Park <jiyong@google.com> | 2018-05-02 19:30:15 +0900 |
|---|---|---|
| committer | Jiyong Park <jiyong@google.com> | 2018-05-02 19:33:45 +0900 |
| commit | 9007838c93cc89d3c74abe5b34714dea07144e5d (patch) | |
| tree | e15fd1d5198e100f84c67aa64f278ee75f8f905a /java/sdk_library.go | |
| parent | d126f7b52f3a8b6dee6a75992e8090359d8b5ab4 (diff) | |
| download | android_build_soong-9007838c93cc89d3c74abe5b34714dea07144e5d.tar.gz android_build_soong-9007838c93cc89d3c74abe5b34714dea07144e5d.tar.bz2 android_build_soong-9007838c93cc89d3c74abe5b34714dea07144e5d.zip | |
Stubs libs are dist artifacts
stubs libs from a java_sdk_library are automatically registered as dist
artifacts for sdk and win_sdk targets.
They are installed under $(DIST_DIR)/apistubs/<apiscope>/<name>.jar
where <apiscope> can be public, system and test.
Bug: 605033
Test: m -j
Test: choosecombo 1 sdk_phone_armv7 userdebug; m -j sdk dist
the stubs libs are found under out/dist/apistubs
Change-Id: I3487634f1ec5bb3b5b60d636b64461d391add35a
Diffstat (limited to 'java/sdk_library.go')
| -rw-r--r-- | java/sdk_library.go | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/java/sdk_library.go b/java/sdk_library.go index 703401cf..64bbb8b6 100644 --- a/java/sdk_library.go +++ b/java/sdk_library.go @@ -68,10 +68,9 @@ var ( // // TODO: these are big features that are currently missing // 1) check for API consistency -// 2) install stubs libs as the dist artifacts -// 3) ensuring that apps have appropriate <uses-library> tag -// 4) disallowing linking to the runtime shared lib -// 5) HTML generation +// 2) ensuring that apps have appropriate <uses-library> tag +// 3) disallowing linking to the runtime shared lib +// 4) HTML generation func init() { android.RegisterModuleType("java_sdk_library", sdkLibraryFactory) @@ -155,15 +154,25 @@ func (module *sdkLibrary) GenerateAndroidBuildActions(ctx android.ModuleContext) } func (module *sdkLibrary) AndroidMk() android.AndroidMkData { - // Create a phony module that installs the impl library, for the case when this lib is - // in PRODUCT_PACKAGES. return android.AndroidMkData{ Custom: func(w io.Writer, name, prefix, moduleDir string, data android.AndroidMkData) { + // Create a phony module that installs the impl library, for the case when this lib is + // in PRODUCT_PACKAGES. fmt.Fprintln(w, "\ninclude $(CLEAR_VARS)") fmt.Fprintln(w, "LOCAL_PATH :=", moduleDir) fmt.Fprintln(w, "LOCAL_MODULE :=", name) fmt.Fprintln(w, "LOCAL_REQUIRED_MODULES := "+module.implName()) fmt.Fprintln(w, "include $(BUILD_PHONY_PACKAGE)") + // Create dist rules to install the stubs libs to the dist dir + fmt.Fprintln(w, "$(call dist-for-goals,sdk win_sdk,"+ + module.publicApiStubsPath.Strings()[0]+ + ":"+path.Join("apistubs", "public", module.BaseModuleName()+".jar")+")") + fmt.Fprintln(w, "$(call dist-for-goals,sdk win_sdk,"+ + module.systemApiStubsPath.Strings()[0]+ + ":"+path.Join("apistubs", "system", module.BaseModuleName()+".jar")+")") + fmt.Fprintln(w, "$(call dist-for-goals,sdk win_sdk,"+ + module.testApiStubsPath.Strings()[0]+ + ":"+path.Join("apistubs", "test", module.BaseModuleName()+".jar")+")") }, } } |
