Skip to content

Commit

Permalink
App icon, single exe output
Browse files Browse the repository at this point in the history
  • Loading branch information
flyingpie committed Aug 17, 2020
1 parent cab4664 commit 947aac0
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 10 deletions.
73 changes: 64 additions & 9 deletions build.cake
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");
2 changes: 1 addition & 1 deletion windows-terminal-quake/windows-terminal-quake.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<OutputPath>bin</OutputPath>
<OutputType>WinExe</OutputType>
<TargetFramework>net472</TargetFramework>
<ApplicationIcon />
<ApplicationIcon>UI\icon.ico</ApplicationIcon>
<StartupObject />
</PropertyGroup>
<ItemGroup>
Expand Down

0 comments on commit 947aac0

Please sign in to comment.