-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"version": 1, | ||
"isRoot": true, | ||
"tools": { | ||
"cake.tool": { | ||
"version": "5.0.0", | ||
"commands": [ | ||
"dotnet-cake" | ||
], | ||
"rollForward": false | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
namespace AquaMai; | ||
|
||
public static class BuildInfo | ||
public static partial class BuildInfo | ||
{ | ||
public const string Name = "AquaMai"; | ||
public const string Description = "Mod for Sinmai"; | ||
public const string Author = "Aza ft. Clansty ft. Menci"; | ||
public const string Company = null; | ||
public const string Version = "1.3.3"; | ||
public const string DownloadLink = null; | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#addin nuget:?package=Cake.Git&version=5.0.1 | ||
#addin nuget:?package=Cake.FileHelpers&version=7.0.0 | ||
|
||
var target = Argument("target", "Build"); | ||
var configuration = Argument("configuration", "Release"); | ||
|
||
Task("Restore") | ||
.Does(() => | ||
{ | ||
// 运行 dotnet restore | ||
DotNetRestore("./AquaMai.sln"); | ||
}); | ||
|
||
Task("PreBuild") | ||
.Does(() => | ||
{ | ||
var gitDescribe = GitDescribe(".", GitDescribeStrategy.Tags); // 获取 git describe 的输出 | ||
var buildDate = DateTime.UtcNow.ToString("yyyy-MM-ddTHH:mm:ssZ"); | ||
|
||
var shortVers = gitDescribe.Substring(1).Split('-'); | ||
string shortVer; | ||
if (shortVers.Length > 1) | ||
{ | ||
shortVer = $"{shortVers[0]}.{shortVers[1]}"; | ||
} | ||
else | ||
{ | ||
shortVer = shortVers[0]; | ||
} | ||
|
||
var versionContent = $@" | ||
// Auto-generated file. Do not modify manually. | ||
namespace AquaMai; | ||
public static partial class BuildInfo | ||
{{ | ||
public const string Version = ""{shortVer}""; | ||
public const string GitVersion = ""{gitDescribe}""; | ||
public const string BuildDate = ""{buildDate}""; | ||
}} | ||
"; | ||
FileWriteText("./AquaMai/BuildInfo.g.cs", versionContent); | ||
}); | ||
|
||
Task("Build") | ||
.IsDependentOn("Restore") | ||
.IsDependentOn("PreBuild") | ||
.Does(() => | ||
{ | ||
// 使用 dotnet build 进行构建 | ||
DotNetBuild("./AquaMai.sln", new DotNetBuildSettings | ||
{ | ||
Configuration = configuration | ||
}); | ||
}); | ||
|
||
RunTarget(target); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
$ErrorActionPreference = 'Stop' | ||
|
||
Set-Location -LiteralPath $PSScriptRoot | ||
|
||
$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = '1' | ||
$env:DOTNET_CLI_TELEMETRY_OPTOUT = '1' | ||
$env:DOTNET_NOLOGO = '1' | ||
|
||
dotnet tool restore | ||
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } | ||
|
||
dotnet cake @args | ||
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } |