@@ -50,17 +50,20 @@ Task("Restore-Packages")
50
50
. IsDependentOn ( "Clean" )
51
51
. Does ( ( ) =>
52
52
{
53
- NuGetRestore ( "./src/AngleSharp.Io.sln" , new NuGetRestoreSettings {
54
- ToolPath = "tools/nuget.exe"
53
+ NuGetRestore ( "./src/AngleSharp.Io.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.Io.sln" , new DotNetCoreBuildSettings ( ) {
63
- Configuration = configuration
63
+ ReplaceRegexInFiles ( "./src/Directory.Build.props" , "(?<=<Version>)(.+?)(?=</Version>)" , version ) ;
64
+ DotNetCoreBuild ( "./src/AngleSharp.Io.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 )
@@ -96,7 +99,7 @@ Task("Copy-Files")
96
99
CopyFiles ( new FilePath [ ]
97
100
{
98
101
buildDir + Directory ( framework ) + File ( "AngleSharp.Io.dll" ) ,
99
- buildDir + Directory ( framework ) + File ( "AngleSharp.Io.xml" )
102
+ buildDir + Directory ( framework ) + File ( "AngleSharp.Io.xml" ) ,
100
103
} , target ) ;
101
104
102
105
CopyFiles ( new FilePath [ ] { "src/AngleSharp.Io.nuspec" } , nugetRoot ) ;
@@ -107,12 +110,8 @@ Task("Create-Package")
107
110
. Does ( ( ) =>
108
111
{
109
112
var nugetExe = GetFiles ( "./tools/**/nuget.exe" ) . FirstOrDefault ( )
110
- ?? ( isRunningOnAppVeyor ? GetFiles ( "C:\\ Tools\\ NuGet3\\ nuget.exe" ) . FirstOrDefault ( ) : null ) ;
111
-
112
- if ( nugetExe == null )
113
- {
114
- throw new InvalidOperationException ( "Could not find nuget.exe." ) ;
115
- }
113
+ ?? ( isRunningOnAppVeyor ? GetFiles ( "C:\\ Tools\\ NuGet3\\ nuget.exe" ) . FirstOrDefault ( ) : null )
114
+ ?? throw new InvalidOperationException ( "Could not find nuget.exe." ) ;
116
115
117
116
var nuspec = nugetRoot + File ( "AngleSharp.Io.nuspec" ) ;
118
117
@@ -121,7 +120,10 @@ Task("Create-Package")
121
120
Version = version ,
122
121
OutputDirectory = nugetRoot ,
123
122
Symbols = false ,
124
- Properties = new Dictionary < String , String > { { "Configuration" , configuration } }
123
+ Properties = new Dictionary < String , String >
124
+ {
125
+ { "Configuration" , configuration } ,
126
+ } ,
125
127
} ) ;
126
128
} ) ;
127
129
@@ -142,7 +144,7 @@ Task("Publish-Package")
142
144
NuGetPush ( nupkg , new NuGetPushSettings
143
145
{
144
146
Source = "https://nuget.org/api/v2/package" ,
145
- ApiKey = apiKey
147
+ ApiKey = apiKey ,
146
148
} ) ;
147
149
}
148
150
} ) ;
@@ -161,7 +163,7 @@ Task("Publish-Release")
161
163
162
164
var github = new GitHubClient ( new ProductHeaderValue ( "AngleSharpCakeBuild" ) )
163
165
{
164
- Credentials = new Credentials ( githubToken )
166
+ Credentials = new Credentials ( githubToken ) ,
165
167
} ;
166
168
167
169
var newRelease = github . Repository . Release ;
@@ -170,7 +172,7 @@ Task("Publish-Release")
170
172
Name = version ,
171
173
Body = String . Join ( Environment . NewLine , releaseNotes . Notes ) ,
172
174
Prerelease = false ,
173
- TargetCommitish = "master"
175
+ TargetCommitish = "master" ,
174
176
} ) . Wait ( ) ;
175
177
} ) ;
176
178
0 commit comments