1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-12-25 17:59:24 +01:00

updated build script

This commit is contained in:
Ell 2022-09-14 22:00:45 +02:00
parent 53cda02ec4
commit 39a7dd3e97
3 changed files with 18 additions and 14 deletions

View file

@ -3,10 +3,10 @@
"isRoot": true,
"tools": {
"cake.tool": {
"version": "1.3.0",
"version": "2.2.0",
"commands": [
"dotnet-cake"
]
}
}
}
}

6
FNA.Settings.props Normal file
View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.2" />
</ItemGroup>
</Project>

View file

@ -8,8 +8,8 @@ var branch = Argument("branch", "main");
var config = Argument("configuration", "Release");
Task("Prepare").Does(() => {
DotNetCoreRestore("MLEM.sln");
DotNetCoreRestore("MLEM.FNA.sln");
DotNetRestore("MLEM.sln");
DotNetRestore("MLEM.FNA.sln");
if (branch != "release") {
var buildNum = EnvironmentVariable("BUILD_NUMBER");
@ -21,32 +21,30 @@ Task("Prepare").Does(() => {
});
Task("Build").IsDependentOn("Prepare").Does(() =>{
var settings = new DotNetCoreBuildSettings {
var settings = new DotNetBuildSettings {
Configuration = config,
ArgumentCustomization = args => args.Append($"/p:Version={version}")
};
foreach (var project in GetFiles("**/MLEM*.csproj"))
DotNetCoreBuild(project.FullPath, settings);
DotNetCoreBuild("Demos/Demos.csproj", settings);
DotNetCoreBuild("Demos/Demos.FNA.csproj", settings);
DotNetBuild("MLEM.sln", settings);
DotNetBuild("MLEM.FNA.sln", settings);
});
Task("Test").IsDependentOn("Build").Does(() => {
var settings = new DotNetCoreTestSettings {
var settings = new DotNetTestSettings {
Configuration = config,
Collectors = {"XPlat Code Coverage"}
};
DotNetCoreTest("Tests/Tests.csproj", settings);
DotNetCoreTest("Tests/Tests.FNA.csproj", settings);
DotNetTest("Tests/Tests.csproj", settings);
DotNetTest("Tests/Tests.FNA.csproj", settings);
});
Task("Pack").IsDependentOn("Test").Does(() => {
var settings = new DotNetCorePackSettings {
var settings = new DotNetPackSettings {
Configuration = config,
ArgumentCustomization = args => args.Append($"/p:Version={version}")
};
foreach (var project in GetFiles("**/MLEM*.csproj"))
DotNetCorePack(project.FullPath, settings);
DotNetPack(project.FullPath, settings);
});
Task("Push").WithCriteria(branch == "main" || branch == "release").IsDependentOn("Pack").Does(() => {