diff options
author | Dan Albert <danalbert@google.com> | 2021-03-19 15:06:02 -0700 |
---|---|---|
committer | Dan Albert <danalbert@google.com> | 2021-04-16 13:38:01 -0700 |
commit | 06feee9352b80ebd2a2a3f186ac746f5d1d7026e (patch) | |
tree | 969542d073006c9def63f99c1b618f53c71102b5 /rust/compiler.go | |
parent | 744fb40e5fce2243c4635a315fca363d845b640c (diff) |
Rustdoc support.
Adds `m rustdoc` which generates documentation for all Rust libraries
to $OUT_DIR/soong/rustdoc.
Follow up work:
* Generate an index page that lists all modules.
* Preserve the artifacts so we can have an always-up-to-date go link.
Test: m rustdoc
Bug: None
Change-Id: Id2d6b9cbab5b02e36b575567563d7cc7606b9401
Diffstat (limited to 'rust/compiler.go')
-rw-r--r-- | rust/compiler.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/rust/compiler.go b/rust/compiler.go index bc034d7cc..bfc23b209 100644 --- a/rust/compiler.go +++ b/rust/compiler.go @@ -239,7 +239,10 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags) Flag flags.RustFlags = append(flags.RustFlags, compiler.Properties.Flags...) flags.RustFlags = append(flags.RustFlags, compiler.cfgsToFlags()...) flags.RustFlags = append(flags.RustFlags, compiler.featuresToFlags()...) + flags.RustdocFlags = append(flags.RustdocFlags, compiler.cfgsToFlags()...) + flags.RustdocFlags = append(flags.RustdocFlags, compiler.featuresToFlags()...) flags.RustFlags = append(flags.RustFlags, "--edition="+compiler.edition()) + flags.RustdocFlags = append(flags.RustdocFlags, "--edition="+compiler.edition()) flags.LinkFlags = append(flags.LinkFlags, compiler.Properties.Ld_flags...) flags.GlobalRustFlags = append(flags.GlobalRustFlags, config.GlobalRustFlags...) flags.GlobalRustFlags = append(flags.GlobalRustFlags, ctx.toolchain().ToolchainRustFlags()) @@ -272,6 +275,12 @@ func (compiler *baseCompiler) compile(ctx ModuleContext, flags Flags, deps PathD panic(fmt.Errorf("baseCrater doesn't know how to crate things!")) } +func (compiler *baseCompiler) rustdoc(ctx ModuleContext, flags Flags, + deps PathDeps) android.OptionalPath { + + return android.OptionalPath{} +} + func (compiler *baseCompiler) initialize(ctx ModuleContext) { compiler.cargoOutDir = android.PathForModuleOut(ctx, genSubDir) } |