aboutsummaryrefslogtreecommitdiff
path: root/xtask/src/dist.rs
diff options
context:
space:
mode:
Diffstat (limited to 'xtask/src/dist.rs')
-rw-r--r--xtask/src/dist.rs20
1 files changed, 16 insertions, 4 deletions
diff --git a/xtask/src/dist.rs b/xtask/src/dist.rs
index 12bad820f..bb3593b11 100644
--- a/xtask/src/dist.rs
+++ b/xtask/src/dist.rs
@@ -27,7 +27,13 @@ fn dist_client(nightly: bool) -> Result<()> {
27 let _restore = 27 let _restore =
28 Restore { path: package_json_path.clone(), contents: original_package_json.clone() }; 28 Restore { path: package_json_path.clone(), contents: original_package_json.clone() };
29 29
30 let mut package_json = original_package_json.replace(r#""enableProposedApi": true,"#, r#""#); 30 let date = run!("date --utc +%Y%m%d")?;
31 let version_suffix = if nightly { "-nightly" } else { "" };
32
33 let mut package_json = original_package_json.replace(
34 r#""version": "0.2.20200211-dev""#,
35 &format!(r#""version": "0.1.{}{}""#, date, version_suffix),
36 );
31 37
32 if nightly { 38 if nightly {
33 package_json = package_json.replace( 39 package_json = package_json.replace(
@@ -35,7 +41,7 @@ fn dist_client(nightly: bool) -> Result<()> {
35 r#""displayName": "rust-analyzer nightly""#, 41 r#""displayName": "rust-analyzer nightly""#,
36 ); 42 );
37 } else { 43 } else {
38 package_json = original_package_json.replace(r#""enableProposedApi": true,"#, r#""#); 44 package_json = package_json.replace(r#""enableProposedApi": true,"#, r#""#);
39 } 45 }
40 fs2::write(package_json_path, package_json)?; 46 fs2::write(package_json_path, package_json)?;
41 47
@@ -47,10 +53,16 @@ fn dist_client(nightly: bool) -> Result<()> {
47fn dist_server() -> Result<()> { 53fn dist_server() -> Result<()> {
48 if cfg!(target_os = "linux") { 54 if cfg!(target_os = "linux") {
49 std::env::set_var("CC", "clang"); 55 std::env::set_var("CC", "clang");
50 run!("cargo build --package rust-analyzer --bin rust-analyzer --release --target x86_64-unknown-linux-musl")?; 56 run!(
57 "cargo build --manifest-path ./crates/rust-analyzer/Cargo.toml --bin rust-analyzer --release
58 --target x86_64-unknown-linux-musl
59 "
60 // We'd want to add, but that requires setting the right linker somehow
61 // --features=jemalloc
62 )?;
51 run!("strip ./target/x86_64-unknown-linux-musl/release/rust-analyzer")?; 63 run!("strip ./target/x86_64-unknown-linux-musl/release/rust-analyzer")?;
52 } else { 64 } else {
53 run!("cargo build --package rust-analyzer --bin rust-analyzer --release")?; 65 run!("cargo build --manifest-path ./crates/rust-analyzer/Cargo.toml --bin rust-analyzer --release")?;
54 } 66 }
55 67
56 let (src, dst) = if cfg!(target_os = "linux") { 68 let (src, dst) = if cfg!(target_os = "linux") {