Replace extract-srcjars.sh with zipsync tool
extract_srcjars.sh uses zipinfo and unzip, which fail with an
error on an empty zip file. Instead of trying to hack around
this (which is hard to make guarantees for since they are
non-hermetic host tools), replace them with a go tool to unzip
a set of zip files into a directory.
Bug: 73885582
Test: m checkbuild
Change-Id: I151fed347ed5196726e36866ffc27bc831799afb
diff --git a/java/droiddoc.go b/java/droiddoc.go
index 8c60535..9a86ab5 100644
--- a/java/droiddoc.go
+++ b/java/droiddoc.go
@@ -28,14 +28,14 @@
javadoc = pctx.AndroidStaticRule("javadoc",
blueprint.RuleParams{
Command: `rm -rf "$outDir" "$srcJarDir" "$stubsDir" && mkdir -p "$outDir" "$srcJarDir" "$stubsDir" && ` +
- `${config.ExtractSrcJarsCmd} $srcJarDir $srcJarDir/list $srcJars && ` +
+ `${config.ZipSyncCmd} -d $srcJarDir -l $srcJarDir/list -f "*.java" $srcJars && ` +
`${config.JavadocCmd} -encoding UTF-8 @$out.rsp @$srcJarDir/list ` +
`$opts $bootclasspathArgs $classpathArgs -sourcepath $sourcepath ` +
`-d $outDir -quiet && ` +
`${config.SoongZipCmd} -write_if_changed -d -o $docZip -C $outDir -D $outDir && ` +
`${config.SoongZipCmd} -write_if_changed -jar -o $out -C $stubsDir -D $stubsDir`,
CommandDeps: []string{
- "${config.ExtractSrcJarsCmd}",
+ "${config.ZipSyncCmd}",
"${config.JavadocCmd}",
"${config.SoongZipCmd}",
"$JsilverJar",