mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-11-22 04:53:29 +01:00
updated build script
This commit is contained in:
parent
53cda02ec4
commit
39a7dd3e97
3 changed files with 18 additions and 14 deletions
|
@ -3,10 +3,10 @@
|
||||||
"isRoot": true,
|
"isRoot": true,
|
||||||
"tools": {
|
"tools": {
|
||||||
"cake.tool": {
|
"cake.tool": {
|
||||||
"version": "1.3.0",
|
"version": "2.2.0",
|
||||||
"commands": [
|
"commands": [
|
||||||
"dotnet-cake"
|
"dotnet-cake"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
6
FNA.Settings.props
Normal file
6
FNA.Settings.props
Normal 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>
|
22
build.cake
22
build.cake
|
@ -8,8 +8,8 @@ var branch = Argument("branch", "main");
|
||||||
var config = Argument("configuration", "Release");
|
var config = Argument("configuration", "Release");
|
||||||
|
|
||||||
Task("Prepare").Does(() => {
|
Task("Prepare").Does(() => {
|
||||||
DotNetCoreRestore("MLEM.sln");
|
DotNetRestore("MLEM.sln");
|
||||||
DotNetCoreRestore("MLEM.FNA.sln");
|
DotNetRestore("MLEM.FNA.sln");
|
||||||
|
|
||||||
if (branch != "release") {
|
if (branch != "release") {
|
||||||
var buildNum = EnvironmentVariable("BUILD_NUMBER");
|
var buildNum = EnvironmentVariable("BUILD_NUMBER");
|
||||||
|
@ -21,32 +21,30 @@ Task("Prepare").Does(() => {
|
||||||
});
|
});
|
||||||
|
|
||||||
Task("Build").IsDependentOn("Prepare").Does(() =>{
|
Task("Build").IsDependentOn("Prepare").Does(() =>{
|
||||||
var settings = new DotNetCoreBuildSettings {
|
var settings = new DotNetBuildSettings {
|
||||||
Configuration = config,
|
Configuration = config,
|
||||||
ArgumentCustomization = args => args.Append($"/p:Version={version}")
|
ArgumentCustomization = args => args.Append($"/p:Version={version}")
|
||||||
};
|
};
|
||||||
foreach (var project in GetFiles("**/MLEM*.csproj"))
|
DotNetBuild("MLEM.sln", settings);
|
||||||
DotNetCoreBuild(project.FullPath, settings);
|
DotNetBuild("MLEM.FNA.sln", settings);
|
||||||
DotNetCoreBuild("Demos/Demos.csproj", settings);
|
|
||||||
DotNetCoreBuild("Demos/Demos.FNA.csproj", settings);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
Task("Test").IsDependentOn("Build").Does(() => {
|
Task("Test").IsDependentOn("Build").Does(() => {
|
||||||
var settings = new DotNetCoreTestSettings {
|
var settings = new DotNetTestSettings {
|
||||||
Configuration = config,
|
Configuration = config,
|
||||||
Collectors = {"XPlat Code Coverage"}
|
Collectors = {"XPlat Code Coverage"}
|
||||||
};
|
};
|
||||||
DotNetCoreTest("Tests/Tests.csproj", settings);
|
DotNetTest("Tests/Tests.csproj", settings);
|
||||||
DotNetCoreTest("Tests/Tests.FNA.csproj", settings);
|
DotNetTest("Tests/Tests.FNA.csproj", settings);
|
||||||
});
|
});
|
||||||
|
|
||||||
Task("Pack").IsDependentOn("Test").Does(() => {
|
Task("Pack").IsDependentOn("Test").Does(() => {
|
||||||
var settings = new DotNetCorePackSettings {
|
var settings = new DotNetPackSettings {
|
||||||
Configuration = config,
|
Configuration = config,
|
||||||
ArgumentCustomization = args => args.Append($"/p:Version={version}")
|
ArgumentCustomization = args => args.Append($"/p:Version={version}")
|
||||||
};
|
};
|
||||||
foreach (var project in GetFiles("**/MLEM*.csproj"))
|
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(() => {
|
Task("Push").WithCriteria(branch == "main" || branch == "release").IsDependentOn("Pack").Does(() => {
|
||||||
|
|
Loading…
Reference in a new issue