@@ -50,17 +50,20 @@ Task("Restore-Packages")
5050 . IsDependentOn ( "Clean" )
5151 . Does ( ( ) =>
5252 {
53- NuGetRestore ( "./src/AngleSharp.Js.sln" , new NuGetRestoreSettings {
54- ToolPath = "tools/nuget.exe"
53+ NuGetRestore ( "./src/AngleSharp.Js.sln" , new NuGetRestoreSettings
54+ {
55+ ToolPath = "tools/nuget.exe" ,
5556 } ) ;
5657 } ) ;
5758
5859Task ( "Build" )
5960 . IsDependentOn ( "Restore-Packages" )
6061 . Does ( ( ) =>
6162 {
62- DotNetCoreBuild ( "./src/AngleSharp.Js.sln" , new DotNetCoreBuildSettings ( ) {
63- Configuration = configuration
63+ ReplaceRegexInFiles ( "./src/Directory.Build.props" , "(?<=<Version>)(.+?)(?=</Version>)" , version ) ;
64+ DotNetCoreBuild ( "./src/AngleSharp.Js.sln" , new DotNetCoreBuildSettings
65+ {
66+ Configuration = configuration ,
6467 } ) ;
6568 } ) ;
6669
@@ -70,7 +73,7 @@ Task("Run-Unit-Tests")
7073 {
7174 var settings = new DotNetCoreTestSettings
7275 {
73- Configuration = configuration
76+ Configuration = configuration ,
7477 } ;
7578
7679 if ( isRunningOnAppVeyor )
@@ -92,7 +95,7 @@ Task("Copy-Files")
9295 var mapping = new Dictionary < String , String >
9396 {
9497 { "net46" , "net46" } ,
95- { "netstandard2.0" , "netstandard2.0" }
98+ { "netstandard2.0" , "netstandard2.0" } ,
9699 } ;
97100
98101 if ( ! isRunningOnWindows )
@@ -107,7 +110,7 @@ Task("Copy-Files")
107110 CopyFiles ( new FilePath [ ]
108111 {
109112 buildDir + Directory ( item . Value ) + File ( "AngleSharp.Js.dll" ) ,
110- buildDir + Directory ( item . Value ) + File ( "AngleSharp.Js.xml" )
113+ buildDir + Directory ( item . Value ) + File ( "AngleSharp.Js.xml" ) ,
111114 } , targetDir ) ;
112115 }
113116
@@ -119,12 +122,8 @@ Task("Create-Package")
119122 . Does ( ( ) =>
120123 {
121124 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." ) ;
128127
129128 var nuspec = nugetRoot + File ( "AngleSharp.Css.nuspec" ) ;
130129
@@ -133,7 +132,10 @@ Task("Create-Package")
133132 Version = version ,
134133 OutputDirectory = nugetRoot ,
135134 Symbols = false ,
136- Properties = new Dictionary < String , String > { { "Configuration" , configuration } }
135+ Properties = new Dictionary < String , String >
136+ {
137+ { "Configuration" , configuration } ,
138+ } ,
137139 } ) ;
138140 } ) ;
139141
@@ -154,7 +156,7 @@ Task("Publish-Package")
154156 NuGetPush ( nupkg , new NuGetPushSettings
155157 {
156158 Source = "https://nuget.org/api/v2/package" ,
157- ApiKey = apiKey
159+ ApiKey = apiKey ,
158160 } ) ;
159161 }
160162 } ) ;
@@ -173,7 +175,7 @@ Task("Publish-Release")
173175
174176 var github = new GitHubClient ( new ProductHeaderValue ( "AngleSharpCakeBuild" ) )
175177 {
176- Credentials = new Credentials ( githubToken )
178+ Credentials = new Credentials ( githubToken ) ,
177179 } ;
178180
179181 var newRelease = github . Repository . Release ;
@@ -182,7 +184,7 @@ Task("Publish-Release")
182184 Name = version ,
183185 Body = String . Join ( Environment . NewLine , releaseNotes . Notes ) ,
184186 Prerelease = false ,
185- TargetCommitish = "master"
187+ TargetCommitish = "master" ,
186188 } ) . Wait ( ) ;
187189 } ) ;
188190
0 commit comments