Skip to content

Commit e74b525

Browse files
committed
Refresh resource files such as build script
1 parent 421079c commit e74b525

4 files changed

Lines changed: 125 additions & 32 deletions

File tree

.config/dotnet-tools.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"isRoot": true,
44
"tools": {
55
"cake.tool": {
6-
"version": "1.1.0",
6+
"version": "1.2.0",
77
"commands": [
88
"dotnet-cake"
99
]

.gitattributes

Lines changed: 90 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,96 @@
11
# Auto detect text files and perform LF normalization
22
* text=auto
33

4+
#
5+
# The above will handle all files NOT found below
6+
#
7+
8+
# Documents
9+
*.bibtex text diff=bibtex
10+
*.doc diff=astextplain
11+
*.DOC diff=astextplain
12+
*.docx diff=astextplain
13+
*.DOCX diff=astextplain
14+
*.dot diff=astextplain
15+
*.DOT diff=astextplain
16+
*.pdf diff=astextplain
17+
*.PDF diff=astextplain
18+
*.rtf diff=astextplain
19+
*.RTF diff=astextplain
20+
*.md text
21+
*.tex text diff=tex
22+
*.adoc text
23+
*.textile text
24+
*.mustache text
25+
*.csv text
26+
*.tab text
27+
*.tsv text
28+
*.txt text
29+
*.sql text
30+
31+
# Graphics
32+
*.png binary
33+
*.jpg binary
34+
*.jpeg binary
35+
*.gif binary
36+
*.tif binary
37+
*.tiff binary
38+
*.ico binary
39+
# SVG treated as an asset (binary) by default.
40+
*.svg text
41+
# If you want to treat it as binary,
42+
# use the following line instead.
43+
# *.svg binary
44+
*.eps binary
45+
46+
# Scripts
47+
*.bash text eol=lf
48+
*.fish text eol=lf
49+
*.sh text eol=lf
50+
# These are explicitly windows files and should use crlf
51+
*.bat text eol=crlf
52+
*.cmd text eol=crlf
53+
*.ps1 text eol=crlf
54+
55+
# Serialisation
56+
*.json text
57+
*.toml text
58+
*.xml text
59+
*.yaml text
60+
*.yml text
61+
62+
# Archives
63+
*.7z binary
64+
*.gz binary
65+
*.tar binary
66+
*.tgz binary
67+
*.zip binary
68+
469
# Custom for Visual Studio
5-
*.cs diff=csharp
70+
*.cs diff=csharp
71+
*.sln text eol=crlf
72+
*.csproj text eol=crlf
73+
*.vbproj text eol=crlf
74+
*.vcxproj text eol=crlf
75+
*.vcproj text eol=crlf
76+
*.dbproj text eol=crlf
77+
*.fsproj text eol=crlf
78+
*.lsproj text eol=crlf
79+
*.wixproj text eol=crlf
80+
*.modelproj text eol=crlf
81+
*.sqlproj text eol=crlf
82+
*.wwaproj text eol=crlf
83+
*.xproj text eol=crlf
84+
*.props text eol=crlf
85+
*.filters text eol=crlf
86+
*.vcxitems text eol=crlf
687

788
# Standard to msysgit
8-
*.doc diff=astextplain
9-
*.DOC diff=astextplain
10-
*.docx diff=astextplain
11-
*.DOCX diff=astextplain
12-
*.dot diff=astextplain
13-
*.DOT diff=astextplain
14-
*.pdf diff=astextplain
15-
*.PDF diff=astextplain
16-
*.rtf diff=astextplain
17-
*.RTF diff=astextplain
89+
*.doc diff=astextplain
90+
*.DOC diff=astextplain
91+
*.docx diff=astextplain
92+
*.DOCX diff=astextplain
93+
*.dot diff=astextplain
94+
*.DOT diff=astextplain
95+
*.rtf diff=astextplain
96+
*.RTF diff=astextplain

build.cake

Lines changed: 33 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
// Install tools.
22
#tool dotnet:?package=GitVersion.Tool&version=5.6.6
3-
#tool nuget:?package=GitReleaseManager&version=0.11.0
3+
#tool nuget:?package=GitReleaseManager&version=0.12.1
44
#tool nuget:?package=OpenCover&version=4.7.1221
55
#tool nuget:?package=ReportGenerator&version=4.8.12
66
#tool nuget:?package=coveralls.io&version=1.4.2
77
#tool nuget:?package=xunit.runner.console&version=2.4.1
88

99
// Install addins.
1010
#addin nuget:?package=Cake.Coveralls&version=1.1.0
11-
#addin nuget:?package=Cake.Git&version=1.0.1
11+
#addin nuget:?package=Cake.Git&version=1.1.0
1212

1313

1414
///////////////////////////////////////////////////////////////////////////////
@@ -67,14 +67,22 @@ var isTagged = (
6767
);
6868
var isBenchmarkPresent = FileExists(benchmarkProject);
6969

70+
// Generally speaking, we want to honor all the TFM configured in the source project and the unit test project.
71+
// However, there are a few scenarios where a single framework is sufficient. Here are a few examples that come to mind:
72+
// - when building source project on Ubuntu
73+
// - when running unit tests on Ubuntu
74+
// - when calculating code coverage
75+
// FYI, this will cause an error if the source project and/or the unit test project are not configured to target this desired framework:
76+
var desiredFramework = IsRunningOnWindows() ? null : "net5.0";
77+
7078

7179
///////////////////////////////////////////////////////////////////////////////
7280
// SETUP / TEARDOWN
7381
///////////////////////////////////////////////////////////////////////////////
7482

7583
Setup(context =>
7684
{
77-
if (isMainBranch && (context.Log.Verbosity != Verbosity.Diagnostic))
85+
if (!isLocalBuild && context.Log.Verbosity != Verbosity.Diagnostic)
7886
{
7987
Information("Increasing verbosity to diagnostic.");
8088
context.Log.Verbosity = Verbosity.Diagnostic;
@@ -200,9 +208,14 @@ Task("Build")
200208
DotNetCoreBuild(solutionFile, new DotNetCoreBuildSettings
201209
{
202210
Configuration = configuration,
211+
Framework = desiredFramework,
203212
NoRestore = true,
204-
ArgumentCustomization = args => args.Append("/p:SemVer=" + versionInfo.LegacySemVerPadded),
205-
Framework = IsRunningOnWindows() ? null : "net5.0"
213+
ArgumentCustomization = args =>
214+
{
215+
return args
216+
.Append("/p:SemVer={0}", versionInfo.LegacySemVerPadded)
217+
.Append("/p:ContinuousIntegrationBuild={0}", BuildSystem.IsLocalBuild ? "false" : "true");
218+
}
206219
});
207220
});
208221

@@ -215,19 +228,14 @@ Task("Run-Unit-Tests")
215228
NoBuild = true,
216229
NoRestore = true,
217230
Configuration = configuration,
218-
Framework = IsRunningOnWindows() ? null : "net5.0"
231+
Framework = desiredFramework
219232
});
220233
});
221234

222235
Task("Run-Code-Coverage")
223236
.IsDependentOn("Build")
224237
.Does(() =>
225238
{
226-
// For the purpose of calculating code coverage, a single target will suffice.
227-
// FYI, this will cause an error if the unit test project is not configured
228-
// to target this desired framework:
229-
var desiredFramework = "net5.0";
230-
231239
Action<ICakeContext> testAction = ctx => ctx.DotNetCoreTest(unitTestsProject, new DotNetCoreTestSettings
232240
{
233241
NoBuild = true,
@@ -254,7 +262,14 @@ Task("Upload-Coverage-Result")
254262
.IsDependentOn("Run-Code-Coverage")
255263
.Does(() =>
256264
{
257-
CoverallsIo($"{codeCoverageDir}coverage.xml");
265+
try
266+
{
267+
CoverallsIo($"{codeCoverageDir}coverage.xml");
268+
}
269+
catch (Exception e)
270+
{
271+
Warning(e.Message);
272+
}
258273
});
259274

260275
Task("Generate-Code-Coverage-Report")
@@ -285,10 +300,10 @@ Task("Create-NuGet-Package")
285300
NoRestore = true,
286301
NoDependencies = true,
287302
OutputDirectory = outputDir,
303+
SymbolPackageFormat = "snupkg",
288304
ArgumentCustomization = (args) =>
289305
{
290306
return args
291-
.Append("/p:SymbolPackageFormat=snupkg")
292307
.Append("/p:PackageReleaseNotes=\"{0}\"", releaseNotesUrl)
293308
.Append("/p:Version={0}", versionInfo.LegacySemVerPadded)
294309
.Append("/p:AssemblyVersion={0}", versionInfo.MajorMinorPatch)
@@ -304,11 +319,11 @@ Task("Upload-AppVeyor-Artifacts")
304319
.WithCriteria(() => AppVeyor.IsRunningOnAppVeyor)
305320
.Does(() =>
306321
{
307-
foreach (var file in GetFiles($"{outputDir}*.*"))
308-
{
309-
AppVeyor.UploadArtifact(file.FullPath);
310-
}
311-
foreach (var file in GetFiles($"{benchmarkDir}results/*.*"))
322+
var allFiles = GetFiles($"{outputDir}*.*") +
323+
GetFiles($"{benchmarkDir}results/*.*") +
324+
GetFiles($"{codeCoverageDir}*.*");
325+
326+
foreach (var file in allFiles)
312327
{
313328
AppVeyor.UploadArtifact(file.FullPath);
314329
}
@@ -453,7 +468,6 @@ Task("ReleaseNotes")
453468
Task("AppVeyor")
454469
.IsDependentOn("Run-Code-Coverage")
455470
.IsDependentOn("Upload-Coverage-Result")
456-
.IsDependentOn("Generate-Benchmark-Report")
457471
.IsDependentOn("Create-NuGet-Package")
458472
.IsDependentOn("Upload-AppVeyor-Artifacts")
459473
.IsDependentOn("Publish-MyGet")

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "5.0.300",
3+
"version": "5.0.400",
44
"rollForward": "latestFeature"
55
}
66
}

0 commit comments

Comments
 (0)