summaryrefslogtreecommitdiff
path: root/sdk/sdk.go
diff options
context:
space:
mode:
author Paul Duffin <paulduffin@google.com> 2019-11-12 19:39:36 +0000
committer Paul Duffin <paulduffin@google.com> 2019-11-22 20:52:59 +0000
commit9154718303462596455221fda1034fb13f844b86 (patch)
tree92d1f68dea8fcb38ff8647565cd7c51f4e2e1430 /sdk/sdk.go
parent504b46160fc30a617f0b3136281730b42f4b6839 (diff)
Adds droidstubs support to sdk module
Adds stubs_sources property to sdk and unzips the droidstubs srcjar into the snapshot directory. Adds an UnzipToSnapshot method to the SnapshotBuilder which creates a rule that uses zip2zip to repackage the supplied zip content into a temporary zip file that matches what the required snapshot structure. e.g. if the supplied zip contains foo/Foo.java and that needs to be in the snapshot directory java/foo/stubs then it will create a zip that contains java/foo/stubs/foo/Foo.java. The temporary zip that is the output of that rule is added to the zipsToMerge field for merging later. If the zipsToMerge is empty then the snapshot zip is created as before. Otherwise, a temporary zip file is created. That is then merged with the other zip files in zipsToMerge to create the final snapshot zip. Adds prebuilt_stubs_sources for use by the generated .bp module. Bug: 143678475 Test: added conscrypt sdk module and attempted to build it Change-Id: Ie274263af3a08e36a73c61c0dbf0c341fd6967e2
Diffstat (limited to 'sdk/sdk.go')
-rw-r--r--sdk/sdk.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/sdk/sdk.go b/sdk/sdk.go
index 09cf2b45e..ed2f26c91 100644
--- a/sdk/sdk.go
+++ b/sdk/sdk.go
@@ -51,6 +51,8 @@ type sdkProperties struct {
Java_libs []string
// The list of native libraries in this SDK
Native_shared_libs []string
+ // The list of stub sources in this SDK
+ Stubs_sources []string
Snapshot bool `blueprint:"mutated"`
}
@@ -175,6 +177,7 @@ type sdkMemberVesionedDepTag struct {
func memberMutator(mctx android.BottomUpMutatorContext) {
if m, ok := mctx.Module().(*sdk); ok {
mctx.AddVariationDependencies(nil, sdkMemberDepTag, m.properties.Java_libs...)
+ mctx.AddVariationDependencies(nil, sdkMemberDepTag, m.properties.Stubs_sources...)
targets := mctx.MultiTargets()
for _, target := range targets {