-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
65 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,74 @@ | ||
#tool "nuget:?package=vswhere&version=2.6.7" | ||
#tool "nuget:?package=ILRepack&version=2.0.18" | ||
|
||
var configuration = Argument("configuration", "Release"); | ||
var output = Argument("output", "artifacts"); | ||
var version = Argument("version", "v0.4"); | ||
|
||
var sln = "windows-terminal-quake.sln"; | ||
var bin = "./windows-terminal-quake/bin"; | ||
|
||
Task("Default").Does(() => | ||
{ | ||
NuGetRestore(sln); | ||
Task("Clean") | ||
.Does(() => | ||
{ | ||
CleanDirectory(output); | ||
}); | ||
|
||
Task("Build") | ||
.IsDependentOn("Clean") | ||
.Does(() => | ||
{ | ||
MSBuild(sln, new MSBuildSettings | ||
{ | ||
Configuration = "Release", | ||
Restore = true, | ||
ToolPath = GetFiles(VSWhereLatest() + "/**/MSBuild.exe").FirstOrDefault() | ||
}); | ||
}); | ||
|
||
MSBuild(sln, new MSBuildSettings | ||
Task("Artifact.Regular") | ||
.IsDependentOn("Build") | ||
.Does(() => | ||
{ | ||
Configuration = "Release", | ||
Restore = true, | ||
ToolPath = GetFiles(VSWhereLatest() + "/**/MSBuild.exe").FirstOrDefault() | ||
var art = output + "/Artifact.Regular"; | ||
CopyDirectory(bin, art); | ||
DeleteFiles(art + "/*.config"); | ||
DeleteFiles(art + "/*.pdb"); | ||
}); | ||
}); | ||
|
||
RunTarget("Default"); | ||
Task("Artifact.SingleExe") | ||
.IsDependentOn("Build") | ||
.Does(() => | ||
{ | ||
var deps = GetFiles(bin + "/*.dll"); | ||
var art = output + "/Artifact.SingleExe"; | ||
System.IO.Directory.CreateDirectory(art); | ||
ILRepack( | ||
art + "/windows-terminal-quake.exe", // Output file | ||
bin + "/windows-terminal-quake.exe", // Primary assembly | ||
deps, // Assembly paths | ||
new ILRepackSettings() | ||
); | ||
CopyFile(bin + "/windows-terminal-quake.json", art + "/windows-terminal-quake.json"); | ||
DeleteFile(art + "/windows-terminal-quake.exe.config"); | ||
}); | ||
|
||
Task("Artifact.SingleExe.Zip") | ||
.IsDependentOn("Artifact.SingleExe") | ||
.Does(() => | ||
{ | ||
var art = output + "/Artifact.SingleExe.Zip"; | ||
System.IO.Directory.CreateDirectory(art); | ||
Zip(output + "/Artifact.SingleExe", art + $"/windows-terminal-quake-{version}-{DateTimeOffset.UtcNow:yyyy-MM-dd_HHmm}.zip"); | ||
}); | ||
|
||
Task("Default") | ||
.IsDependentOn("Artifact.Regular") | ||
.IsDependentOn("Artifact.SingleExe") | ||
.IsDependentOn("Artifact.SingleExe.Zip") | ||
.Does(() => {}); | ||
|
||
RunTarget("Default"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters