mirror of
https://github.com/Ellpeck/TinyLifeExampleMod.git
synced 2024-11-22 20:08: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
25
build.cake
25
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}");
|
var dllName = System.IO.Path.GetFileNameWithoutExtension(dllFile.ToString());
|
||||||
continue;
|
var zipLoc = $"{d.GetParent()}/{dllName}.zip";
|
||||||
}
|
Zip(d, zipLoc, GetFiles($"{d}/**/*"));
|
||||||
var dllName = System.IO.Path.GetFileNameWithoutExtension(dllFile.ToString());
|
Information($"Published {dllName} to {zipLoc}");
|
||||||
var zipLoc = $"{dir.GetParent()}/{dllName}.zip";
|
|
||||||
Zip(dir, zipLoc, GetFiles($"{dir}/**/*"));
|
|
||||||
Information($"Published {dllName} to {zipLoc}");
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
RunTarget(target);
|
RunTarget(target);
|
||||||
|
|
Loading…
Reference in a new issue