diff options
| author | 2021-08-20 22:58:06 +0000 | |
|---|---|---|
| committer | 2021-08-20 22:58:06 +0000 | |
| commit | 804943ee8e1a077f5e52754ef138e07ab907139e (patch) | |
| tree | 71a9a62f8a03d5653de63777114a1e201c43173e | |
| parent | 52ffd03b17945dbe1c7b3b440ef25596e1ab303c (diff) | |
| parent | 43f89f2ddd1b4a97003ade041fe63ff4d2deb64b (diff) | |
Merge "rust: doc: Zip up docs when done" am: 899b98d508 am: 6506614e2b am: 43f89f2ddd
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1804477
Change-Id: Ic3042dce8395cec92ddc69cc65bd9413fcc78b49
| -rw-r--r-- | rust/doc.go | 12 | ||||
| -rwxr-xr-x | scripts/build-rustdocs.sh | 2 |
2 files changed, 12 insertions, 2 deletions
diff --git a/rust/doc.go b/rust/doc.go index e7f137198..fe3581b42 100644 --- a/rust/doc.go +++ b/rust/doc.go @@ -29,6 +29,14 @@ func RustdocSingleton() android.Singleton { type rustdocSingleton struct{} func (n *rustdocSingleton) GenerateBuildActions(ctx android.SingletonContext) { + docDir := android.PathForOutput(ctx, "rustdoc") + docZip := android.PathForOutput(ctx, "rustdoc.zip") + rule := android.NewRuleBuilder(pctx, ctx) + zipCmd := rule.Command().BuiltTool("soong_zip"). + FlagWithOutput("-o ", docZip). + FlagWithArg("-C ", docDir.String()). + FlagWithArg("-D ", docDir.String()) + ctx.VisitAllModules(func(module android.Module) { if !module.Enabled() { return @@ -36,8 +44,10 @@ func (n *rustdocSingleton) GenerateBuildActions(ctx android.SingletonContext) { if m, ok := module.(*Module); ok { if m.docTimestampFile.Valid() { - ctx.Phony("rustdoc", m.docTimestampFile.Path()) + zipCmd.Implicit(m.docTimestampFile.Path()) } } }) + rule.Build("rustdoc-zip", "Zipping all built Rust documentation...") + ctx.Phony("rustdoc", docZip) } diff --git a/scripts/build-rustdocs.sh b/scripts/build-rustdocs.sh index ad8ba16d5..fda9688c8 100755 --- a/scripts/build-rustdocs.sh +++ b/scripts/build-rustdocs.sh @@ -27,5 +27,5 @@ m rustdoc if [ -n "${DIST_DIR}" ]; then mkdir -p ${DIST_DIR} - cp -r ${OUT_DIR}/soong/rustdoc $DIST_DIR/rustdoc + cp ${OUT_DIR}/soong/rustdoc.zip $DIST_DIR fi |