diff options
| author | Goffert van Gool <ruphin@ruphin.net> | 2018-12-13 22:16:58 +0100 |
|---|---|---|
| committer | Ryan Dahl <ry@tinyclouds.org> | 2018-12-13 16:16:58 -0500 |
| commit | 40d6daf8240f9dc090c23f975488c424b88f120f (patch) | |
| tree | 5b502de7a3d286861fb826f4242004a2e8218b25 /BUILD.gn | |
| parent | 07369a6270473a2e4eb74d0c1936284d3b9558f3 (diff) | |
Read version from Cargo.toml (#1267)
Diffstat (limited to 'BUILD.gn')
| -rw-r--r-- | BUILD.gn | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -119,12 +119,25 @@ group("deno_deps") { ] } +# Reads the cargo info from Cargo.toml +deno_cargo_info = exec_script("build_extra/rust/get_cargo_info.py", + [ rebase_path("Cargo.toml", root_build_dir) ], + "json") + rust_executable("deno") { source_root = "src/main.rs" extern = main_extern deps = [ ":deno_deps", ] + + # Extract version from Cargo.toml + # TODO integrate this into rust.gni by allowing the rust_executable template + # to specify a cargo.toml from which it will extract a version. + crate_version = deno_cargo_info.version + inputs = [ + "Cargo.toml", + ] } rust_test("test_rs") { @@ -133,6 +146,12 @@ rust_test("test_rs") { deps = [ ":deno_deps", ] + + # Extract version from Cargo.toml + crate_version = deno_cargo_info.version + inputs = [ + "Cargo.toml", + ] } rust_executable("hyper_hello") { |
