@@ -50,17 +50,20 @@ Task("Restore-Packages")
50
50
. IsDependentOn ( "Clean" )
51
51
. Does ( ( ) =>
52
52
{
53
- NuGetRestore ( "./src/AngleSharp.Xml.sln" , new NuGetRestoreSettings {
54
- ToolPath = "tools/nuget.exe"
53
+ NuGetRestore ( "./src/AngleSharp.Xml.sln" , new NuGetRestoreSettings
54
+ {
55
+ ToolPath = "tools/nuget.exe" ,
55
56
} ) ;
56
57
} ) ;
57
58
58
59
Task ( "Build" )
59
60
. IsDependentOn ( "Restore-Packages" )
60
61
. Does ( ( ) =>
61
62
{
62
- DotNetCoreBuild ( "./src/AngleSharp.Xml.sln" , new DotNetCoreBuildSettings ( ) {
63
- Configuration = configuration
63
+ ReplaceRegexInFiles ( "./src/Directory.Build.props" , "(?<=<Version>)(.+?)(?=</Version>)" , version ) ;
64
+ DotNetCoreBuild ( "./src/AngleSharp.Xml.sln" , new DotNetCoreBuildSettings
65
+ {
66
+ Configuration = configuration ,
64
67
} ) ;
65
68
} ) ;
66
69
@@ -70,7 +73,7 @@ Task("Run-Unit-Tests")
70
73
{
71
74
var settings = new DotNetCoreTestSettings
72
75
{
73
- Configuration = configuration
76
+ Configuration = configuration ,
74
77
} ;
75
78
76
79
if ( isRunningOnAppVeyor )
@@ -91,7 +94,7 @@ Task("Copy-Files")
91
94
{
92
95
var mapping = new Dictionary < String , String >
93
96
{
94
- { "netstandard1.3" , "netstandard1.3" }
97
+ { "netstandard1.3" , "netstandard1.3" } ,
95
98
} ;
96
99
97
100
foreach ( var item in mapping )
@@ -101,7 +104,7 @@ Task("Copy-Files")
101
104
CopyFiles ( new FilePath [ ]
102
105
{
103
106
buildDir + Directory ( item . Value ) + File ( "AngleSharp.Xml.dll" ) ,
104
- buildDir + Directory ( item . Value ) + File ( "AngleSharp.Xml.xml" )
107
+ buildDir + Directory ( item . Value ) + File ( "AngleSharp.Xml.xml" ) ,
105
108
} , targetDir ) ;
106
109
}
107
110
@@ -113,12 +116,8 @@ Task("Create-Package")
113
116
. Does ( ( ) =>
114
117
{
115
118
var nugetExe = GetFiles ( "./tools/**/nuget.exe" ) . FirstOrDefault ( )
116
- ?? ( isRunningOnAppVeyor ? GetFiles ( "C:\\ Tools\\ NuGet3\\ nuget.exe" ) . FirstOrDefault ( ) : null ) ;
117
-
118
- if ( nugetExe == null )
119
- {
120
- throw new InvalidOperationException ( "Could not find nuget.exe." ) ;
121
- }
119
+ ?? ( isRunningOnAppVeyor ? GetFiles ( "C:\\ Tools\\ NuGet3\\ nuget.exe" ) . FirstOrDefault ( ) : null )
120
+ ?? throw new InvalidOperationException ( "Could not find nuget.exe." ) ;
122
121
123
122
var nuspec = nugetRoot + File ( "AngleSharp.Xml.nuspec" ) ;
124
123
@@ -127,7 +126,10 @@ Task("Create-Package")
127
126
Version = version ,
128
127
OutputDirectory = nugetRoot ,
129
128
Symbols = false ,
130
- Properties = new Dictionary < String , String > { { "Configuration" , configuration } }
129
+ Properties = new Dictionary < String , String >
130
+ {
131
+ { "Configuration" , configuration } ,
132
+ } ,
131
133
} ) ;
132
134
} ) ;
133
135
@@ -148,7 +150,7 @@ Task("Publish-Package")
148
150
NuGetPush ( nupkg , new NuGetPushSettings
149
151
{
150
152
Source = "https://nuget.org/api/v2/package" ,
151
- ApiKey = apiKey
153
+ ApiKey = apiKey ,
152
154
} ) ;
153
155
}
154
156
} ) ;
@@ -167,7 +169,7 @@ Task("Publish-Release")
167
169
168
170
var github = new GitHubClient ( new ProductHeaderValue ( "AngleSharpCakeBuild" ) )
169
171
{
170
- Credentials = new Credentials ( githubToken )
172
+ Credentials = new Credentials ( githubToken ) ,
171
173
} ;
172
174
173
175
var newRelease = github . Repository . Release ;
@@ -176,7 +178,7 @@ Task("Publish-Release")
176
178
Name = version ,
177
179
Body = String . Join ( Environment . NewLine , releaseNotes . Notes ) ,
178
180
Prerelease = false ,
179
- TargetCommitish = "master"
181
+ TargetCommitish = "master" ,
180
182
} ) . Wait ( ) ;
181
183
} ) ;
182
184
0 commit comments