Skip to content

Commit

Permalink
Add RLS to .exe and .msi installers
Browse files Browse the repository at this point in the history
  • Loading branch information
efyang committed May 30, 2017
1 parent 5d2512e commit eeebfd6
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
36 changes: 36 additions & 0 deletions src/bootstrap/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -949,6 +949,8 @@ pub fn extended(build: &Build, stage: u32, target: &str) {
let _ = fs::remove_dir_all(&exe);
t!(fs::create_dir_all(exe.join("rustc")));
t!(fs::create_dir_all(exe.join("cargo")));
t!(fs::create_dir_all(exe.join("rls")));
t!(fs::create_dir_all(exe.join("rust-analysis")));
t!(fs::create_dir_all(exe.join("rust-docs")));
t!(fs::create_dir_all(exe.join("rust-std")));
cp_r(&work.join(&format!("{}-{}", pkgname(build, "rustc"), target))
Expand All @@ -963,11 +965,19 @@ pub fn extended(build: &Build, stage: u32, target: &str) {
cp_r(&work.join(&format!("{}-{}", pkgname(build, "rust-std"), target))
.join(format!("rust-std-{}", target)),
&exe.join("rust-std"));
cp_r(&work.join(&format!("{}-{}", pkgname(build, "rls"), target))
.join("rls"),
&exe.join("rls"));
cp_r(&work.join(&format!("{}-{}", pkgname(build, "rust-analysis"), target))
.join(format!("rust-analysis-{}", target)),
&exe.join("rust-analysis"));

t!(fs::remove_file(exe.join("rustc/manifest.in")));
t!(fs::remove_file(exe.join("cargo/manifest.in")));
t!(fs::remove_file(exe.join("rust-docs/manifest.in")));
t!(fs::remove_file(exe.join("rust-std/manifest.in")));
t!(fs::remove_file(exe.join("rls/manifest.in")));
t!(fs::remove_file(exe.join("rust-analysis/manifest.in")));

if target.contains("windows-gnu") {
t!(fs::create_dir_all(exe.join("rust-mingw")));
Expand Down Expand Up @@ -1041,6 +1051,26 @@ pub fn extended(build: &Build, stage: u32, target: &str) {
.arg("-dr").arg("Std")
.arg("-var").arg("var.StdDir")
.arg("-out").arg(exe.join("StdGroup.wxs")));
build.run(Command::new(&heat)
.current_dir(&exe)
.arg("dir")
.arg("rls")
.args(&heat_flags)
.arg("-cg").arg("RlsGroup")
.arg("-dr").arg("Rls")
.arg("-var").arg("var.RlsDir")
.arg("-out").arg(exe.join("RlsGroup.wxs"))
.arg("-t").arg(etc.join("msi/remove-duplicates.xsl")));
build.run(Command::new(&heat)
.current_dir(&exe)
.arg("dir")
.arg("rust-analysis")
.args(&heat_flags)
.arg("-cg").arg("AnalysisGroup")
.arg("-dr").arg("Analysis")
.arg("-var").arg("var.AnalysisDir")
.arg("-out").arg(exe.join("AnalysisGroup.wxs"))
.arg("-t").arg(etc.join("msi/remove-duplicates.xsl")));
if target.contains("windows-gnu") {
build.run(Command::new(&heat)
.current_dir(&exe)
Expand All @@ -1064,6 +1094,8 @@ pub fn extended(build: &Build, stage: u32, target: &str) {
.arg("-dDocsDir=rust-docs")
.arg("-dCargoDir=cargo")
.arg("-dStdDir=rust-std")
.arg("-dRlsDir=rls")
.arg("-dAnalysisDir=rust-analysis")
.arg("-arch").arg(&arch)
.arg("-out").arg(&output)
.arg(&input);
Expand All @@ -1081,6 +1113,8 @@ pub fn extended(build: &Build, stage: u32, target: &str) {
candle("DocsGroup.wxs".as_ref());
candle("CargoGroup.wxs".as_ref());
candle("StdGroup.wxs".as_ref());
candle("RlsGroup.wxs".as_ref());
candle("AnalysisGroup.wxs".as_ref());

if target.contains("windows-gnu") {
candle("GccGroup.wxs".as_ref());
Expand All @@ -1103,6 +1137,8 @@ pub fn extended(build: &Build, stage: u32, target: &str) {
.arg("DocsGroup.wixobj")
.arg("CargoGroup.wixobj")
.arg("StdGroup.wixobj")
.arg("RlsGroup.wixobj")
.arg("AnalysisGroup.wixobj")
.current_dir(&exe);

if target.contains("windows-gnu") {
Expand Down
3 changes: 3 additions & 0 deletions src/etc/installer/exe/rust.iss
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Name: gcc; Description: "Linker and platform libraries"; Types: full
Name: docs; Description: "HTML documentation"; Types: full
Name: cargo; Description: "Cargo, the Rust package manager"; Types: full
Name: std; Description: "The Rust Standard Library"; Types: full
Name: rls; Description: "RLS, the Rust Language Server"

[Files]
Source: "rustc/*.*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; Components: rust
Expand All @@ -55,6 +56,8 @@ Source: "rust-mingw/*.*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs;
Source: "rust-docs/*.*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; Components: docs
Source: "cargo/*.*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; Components: cargo
Source: "rust-std/*.*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; Components: std
Source: "rls/*.*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; Components: rls
Source: "rust-analysis/*.*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; Components: rls

[Code]
const
Expand Down
10 changes: 10 additions & 0 deletions src/etc/installer/msi/rust.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@
<Directory Id="Docs" Name="." />
<Directory Id="Cargo" Name="." />
<Directory Id="Std" Name="." />
<Directory Id="Rls" Name="." />
<Directory Id="Analysis" Name="." />
</Directory>
</Directory>

Expand Down Expand Up @@ -273,6 +275,14 @@
<ComponentRef Id="PathEnvPerMachine" />
<ComponentRef Id="PathEnvPerUser" />
</Feature>
<Feature Id="RLS"
Title="RLS, the Rust Language Server"
Display="7"
Level="2"
AllowAdvertise="no">
<ComponentGroupRef Id="RlsGroup" />
<ComponentGroupRef Id="AnalysisGroup" />
</Feature>

<UIRef Id="RustUI" />
</Product>
Expand Down

0 comments on commit eeebfd6

Please sign in to comment.