@@ -50,17 +50,20 @@ Task("Restore-Packages")
5050 . IsDependentOn ( "Clean" )
5151 . Does ( ( ) =>
5252 {
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" ,
5556 } ) ;
5657 } ) ;
5758
5859Task ( "Build" )
5960 . IsDependentOn ( "Restore-Packages" )
6061 . Does ( ( ) =>
6162 {
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 ,
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 )
@@ -91,7 +94,7 @@ Task("Copy-Files")
9194 {
9295 var mapping = new Dictionary < String , String >
9396 {
94- { "netstandard1.3" , "netstandard1.3" }
97+ { "netstandard1.3" , "netstandard1.3" } ,
9598 } ;
9699
97100 foreach ( var item in mapping )
@@ -101,7 +104,7 @@ Task("Copy-Files")
101104 CopyFiles ( new FilePath [ ]
102105 {
103106 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" ) ,
105108 } , targetDir ) ;
106109 }
107110
@@ -113,12 +116,8 @@ Task("Create-Package")
113116 . Does ( ( ) =>
114117 {
115118 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." ) ;
122121
123122 var nuspec = nugetRoot + File ( "AngleSharp.Xml.nuspec" ) ;
124123
@@ -127,7 +126,10 @@ Task("Create-Package")
127126 Version = version ,
128127 OutputDirectory = nugetRoot ,
129128 Symbols = false ,
130- Properties = new Dictionary < String , String > { { "Configuration" , configuration } }
129+ Properties = new Dictionary < String , String >
130+ {
131+ { "Configuration" , configuration } ,
132+ } ,
131133 } ) ;
132134 } ) ;
133135
@@ -148,7 +150,7 @@ Task("Publish-Package")
148150 NuGetPush ( nupkg , new NuGetPushSettings
149151 {
150152 Source = "https://nuget.org/api/v2/package" ,
151- ApiKey = apiKey
153+ ApiKey = apiKey ,
152154 } ) ;
153155 }
154156 } ) ;
@@ -167,7 +169,7 @@ Task("Publish-Release")
167169
168170 var github = new GitHubClient ( new ProductHeaderValue ( "AngleSharpCakeBuild" ) )
169171 {
170- Credentials = new Credentials ( githubToken )
172+ Credentials = new Credentials ( githubToken ) ,
171173 } ;
172174
173175 var newRelease = github . Repository . Release ;
@@ -176,7 +178,7 @@ Task("Publish-Release")
176178 Name = version ,
177179 Body = String . Join ( Environment . NewLine , releaseNotes . Notes ) ,
178180 Prerelease = false ,
179- TargetCommitish = "master"
181+ TargetCommitish = "master" ,
180182 } ) . Wait ( ) ;
181183 } ) ;
182184
0 commit comments