Merge "Use glob for java_sdk_library_import stub_srcs"

This commit is contained in:
Paul Duffin
2020-11-10 13:54:23 +00:00
committed by Gerrit Code Review
2 changed files with 31 additions and 30 deletions

View File

@@ -2292,10 +2292,11 @@ func (s *sdkLibrarySdkMemberProperties) AddToPropertySet(ctx android.SdkMemberCo
scopeSet.AddProperty("jars", jars)
// Merge the stubs source jar into the snapshot zip so that when it is unpacked
// the source files are also unpacked.
// the source files are also unpacked. Use a glob so that if the directory is missing
// (because there are no stubs sources for this scope) it will not fail.
snapshotRelativeDir := filepath.Join(scopeDir, ctx.Name()+"_stub_sources")
ctx.SnapshotBuilder().UnzipToSnapshot(properties.StubsSrcJar, snapshotRelativeDir)
scopeSet.AddProperty("stub_srcs", []string{snapshotRelativeDir})
scopeSet.AddProperty("stub_srcs", []string{snapshotRelativeDir + "/**/*.java"})
if properties.CurrentApiFile != nil {
currentApiSnapshotPath := filepath.Join(scopeDir, ctx.Name()+".txt")