diff options
author | Jiyong Park <jiyong@google.com> | 2018-05-06 07:53:02 +0900 |
---|---|---|
committer | Jiyong Park <jiyong@google.com> | 2018-05-06 07:56:17 +0900 |
commit | b674a5226abcfc70a82feccd5e48700647dd8df2 (patch) | |
tree | 6c76049faa6cd1e2720c0d96d29a82a843c5fa14 /java/sdk_library.go | |
parent | 75dec2291b73995ca4d4ddb1b828dfce7f959043 (diff) | |
download | android_build_soong-b674a5226abcfc70a82feccd5e48700647dd8df2.tar.gz android_build_soong-b674a5226abcfc70a82feccd5e48700647dd8df2.tar.bz2 android_build_soong-b674a5226abcfc70a82feccd5e48700647dd8df2.zip |
Prevent index out of range
I3487634f1ec5bb3b5b60d636b64461d391add35a is causing build breakages in
unbundled builds.
The stubs libs are disabled for unbundled builds, and thus we shouldn't
declare them as dist artifacts.
Bug: 605033
Test: make -j dist ANDROID_BUILDSPEC=vendor/google/build/app_build_spec.mk
Change-Id: I3cd92e2cc6aeb48baf47d37780d8df2aa4756438
Diffstat (limited to 'java/sdk_library.go')
-rw-r--r-- | java/sdk_library.go | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/java/sdk_library.go b/java/sdk_library.go index 64bbb8b6..ee6998c3 100644 --- a/java/sdk_library.go +++ b/java/sdk_library.go @@ -164,15 +164,21 @@ func (module *sdkLibrary) AndroidMk() android.AndroidMkData { 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")+")") + if len(module.publicApiStubsPath) == 1 { + fmt.Fprintln(w, "$(call dist-for-goals,sdk win_sdk,"+ + module.publicApiStubsPath.Strings()[0]+ + ":"+path.Join("apistubs", "public", module.BaseModuleName()+".jar")+")") + } + if len(module.systemApiStubsPath) == 1 { + fmt.Fprintln(w, "$(call dist-for-goals,sdk win_sdk,"+ + module.systemApiStubsPath.Strings()[0]+ + ":"+path.Join("apistubs", "system", module.BaseModuleName()+".jar")+")") + } + if len(module.testApiStubsPath) == 1 { + fmt.Fprintln(w, "$(call dist-for-goals,sdk win_sdk,"+ + module.testApiStubsPath.Strings()[0]+ + ":"+path.Join("apistubs", "test", module.BaseModuleName()+".jar")+")") + } }, } } |