Setup ANDROID_RUST_VERSION env variable

Some crates (i.e. rustversion) probe at build time the version of Rust
to enable features or tests. Pass the version via an environment
variable so it can be used by a patched crate.

Bug: 178357400
Test: m librustversion
Change-Id: If57a6339b71d2188c56e7dc6709075e4537403b4
This commit is contained in:
Thiébaud Weksteen 2021-02-22 10:52:22 +01:00
parent 2391d08872
commit 9997ea73a3

View file

@ -230,6 +230,8 @@ func transformSrctoCrate(ctx ModuleContext, main android.Path, deps PathDeps, fl
envVars = append(envVars, "OUT_DIR="+filepath.Join(outDirPrefix, moduleGenDir.String()))
}
envVars = append(envVars, "ANDROID_RUST_VERSION="+config.RustDefaultVersion)
if flags.Clippy {
clippyFile := android.PathForModuleOut(ctx, outputFile.Base()+".clippy")
ctx.Build(pctx, android.BuildParams{