mirror of
https://github.com/Ellpeck/TinyLifeExampleMod.git
synced 2024-11-26 05:28:34 +01:00
improved build.cake formatting
This commit is contained in:
parent
307ad45de9
commit
056827822b
1 changed files with 10 additions and 15 deletions
21
build.cake
21
build.cake
|
@ -7,9 +7,8 @@ var config = Argument("configuration", "Release");
|
||||||
|
|
||||||
var tinyLifeDir = $"{Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)}/Tiny Life";
|
var tinyLifeDir = $"{Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)}/Tiny Life";
|
||||||
|
|
||||||
Task("Build").Does(() => {
|
Task("Build").DoesForEach(GetFiles("**/*.csproj"), p => {
|
||||||
foreach (var project in GetFiles("**/*.csproj"))
|
DotNetBuild(p.FullPath, new DotNetBuildSettings { Configuration = config });
|
||||||
DotNetBuild(project.FullPath, new DotNetBuildSettings { Configuration = config });
|
|
||||||
});
|
});
|
||||||
|
|
||||||
Task("CopyToMods").IsDependentOn("Build").Does(() => {
|
Task("CopyToMods").IsDependentOn("Build").Does(() => {
|
||||||
|
@ -56,18 +55,14 @@ Task("Run").IsDependentOn("CopyToMods").Does(() => {
|
||||||
Information($"Tiny Life exited with exit code {process.ExitCode}");
|
Information($"Tiny Life exited with exit code {process.ExitCode}");
|
||||||
});
|
});
|
||||||
|
|
||||||
Task("Publish").IsDependentOn("Build").Does(() => {
|
Task("Publish").IsDependentOn("Build").DoesForEach(GetDirectories($"bin/{config}/net*"), d => {
|
||||||
foreach (var dir in GetDirectories($"bin/{config}/net*")) {
|
var dllFile = GetFiles($"{d}/**/*.dll").FirstOrDefault();
|
||||||
var dllFile = GetFiles($"{dir}/**/*.dll").FirstOrDefault();
|
if (dllFile == null)
|
||||||
if (dllFile == null) {
|
throw new Exception($"Couldn't find built mod in {d}");
|
||||||
Warning($"Couldn't find built mod in {dir}");
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
var dllName = System.IO.Path.GetFileNameWithoutExtension(dllFile.ToString());
|
var dllName = System.IO.Path.GetFileNameWithoutExtension(dllFile.ToString());
|
||||||
var zipLoc = $"{dir.GetParent()}/{dllName}.zip";
|
var zipLoc = $"{d.GetParent()}/{dllName}.zip";
|
||||||
Zip(dir, zipLoc, GetFiles($"{dir}/**/*"));
|
Zip(d, zipLoc, GetFiles($"{d}/**/*"));
|
||||||
Information($"Published {dllName} to {zipLoc}");
|
Information($"Published {dllName} to {zipLoc}");
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
RunTarget(target);
|
RunTarget(target);
|
||||||
|
|
Loading…
Reference in a new issue