@@ -50,17 +50,20 @@ Task("Restore-Packages")
50
50
. IsDependentOn ( "Clean" )
51
51
. Does ( ( ) =>
52
52
{
53
- NuGetRestore ( "./src/AngleSharp.Css.sln" , new NuGetRestoreSettings {
54
- ToolPath = "tools/nuget.exe"
53
+ NuGetRestore ( "./src/AngleSharp.Css.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.Css.sln" , new DotNetCoreBuildSettings ( ) {
63
- Configuration = configuration
63
+ ReplaceRegexInFiles ( "./src/Directory.Build.props" , "(?<=<Version>)(.+?)(?=</Version>)" , version ) ;
64
+ DotNetCoreBuild ( "./src/AngleSharp.Css.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 )
@@ -92,7 +95,7 @@ Task("Copy-Files")
92
95
var mapping = new Dictionary < String , String >
93
96
{
94
97
{ "net46" , "net46" } ,
95
- { "netstandard2.0" , "netstandard2.0" }
98
+ { "netstandard2.0" , "netstandard2.0" } ,
96
99
} ;
97
100
98
101
if ( ! isRunningOnWindows )
@@ -107,7 +110,7 @@ Task("Copy-Files")
107
110
CopyFiles ( new FilePath [ ]
108
111
{
109
112
buildDir + Directory ( item . Value ) + File ( "AngleSharp.Css.dll" ) ,
110
- buildDir + Directory ( item . Value ) + File ( "AngleSharp.Css.xml" )
113
+ buildDir + Directory ( item . Value ) + File ( "AngleSharp.Css.xml" ) ,
111
114
} , targetDir ) ;
112
115
}
113
116
@@ -119,12 +122,8 @@ Task("Create-Package")
119
122
. Does ( ( ) =>
120
123
{
121
124
var nugetExe = GetFiles ( "./tools/**/nuget.exe" ) . FirstOrDefault ( )
122
- ?? ( isRunningOnAppVeyor ? GetFiles ( "C:\\ Tools\\ NuGet3\\ nuget.exe" ) . FirstOrDefault ( ) : null ) ;
123
-
124
- if ( nugetExe == null )
125
- {
126
- throw new InvalidOperationException ( "Could not find nuget.exe." ) ;
127
- }
125
+ ?? ( isRunningOnAppVeyor ? GetFiles ( "C:\\ Tools\\ NuGet3\\ nuget.exe" ) . FirstOrDefault ( ) : null )
126
+ ?? throw new InvalidOperationException ( "Could not find nuget.exe." ) ;
128
127
129
128
var nuspec = nugetRoot + File ( "AngleSharp.Css.nuspec" ) ;
130
129
@@ -133,7 +132,10 @@ Task("Create-Package")
133
132
Version = version ,
134
133
OutputDirectory = nugetRoot ,
135
134
Symbols = false ,
136
- Properties = new Dictionary < String , String > { { "Configuration" , configuration } }
135
+ Properties = new Dictionary < String , String >
136
+ {
137
+ { "Configuration" , configuration } ,
138
+ } ,
137
139
} ) ;
138
140
} ) ;
139
141
@@ -154,7 +156,7 @@ Task("Publish-Package")
154
156
NuGetPush ( nupkg , new NuGetPushSettings
155
157
{
156
158
Source = "https://nuget.org/api/v2/package" ,
157
- ApiKey = apiKey
159
+ ApiKey = apiKey ,
158
160
} ) ;
159
161
}
160
162
} ) ;
@@ -173,7 +175,7 @@ Task("Publish-Release")
173
175
174
176
var github = new GitHubClient ( new ProductHeaderValue ( "AngleSharpCakeBuild" ) )
175
177
{
176
- Credentials = new Credentials ( githubToken )
178
+ Credentials = new Credentials ( githubToken ) ,
177
179
} ;
178
180
179
181
var newRelease = github . Repository . Release ;
0 commit comments