Skip to content

Commit 689be0c

Browse files
committed
Improved build process, prepare for 0.13
1 parent 1b818fb commit 689be0c

File tree

2 files changed

+19
-17
lines changed

2 files changed

+19
-17
lines changed

build.cake

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,20 @@ Task("Restore-Packages")
5050
.IsDependentOn("Clean")
5151
.Does(() =>
5252
{
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",
5556
});
5657
});
5758

5859
Task("Build")
5960
.IsDependentOn("Restore-Packages")
6061
.Does(() =>
6162
{
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,
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)
@@ -96,7 +99,7 @@ Task("Copy-Files")
9699
CopyFiles(new FilePath[]
97100
{
98101
buildDir + Directory(framework) + File("AngleSharp.Io.dll"),
99-
buildDir + Directory(framework) + File("AngleSharp.Io.xml")
102+
buildDir + Directory(framework) + File("AngleSharp.Io.xml"),
100103
}, target);
101104

102105
CopyFiles(new FilePath[] { "src/AngleSharp.Io.nuspec" }, nugetRoot);
@@ -107,12 +110,8 @@ Task("Create-Package")
107110
.Does(() =>
108111
{
109112
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.");
116115

117116
var nuspec = nugetRoot + File("AngleSharp.Io.nuspec");
118117

@@ -121,7 +120,10 @@ Task("Create-Package")
121120
Version = version,
122121
OutputDirectory = nugetRoot,
123122
Symbols = false,
124-
Properties = new Dictionary<String, String> { { "Configuration", configuration } }
123+
Properties = new Dictionary<String, String>
124+
{
125+
{ "Configuration", configuration },
126+
},
125127
});
126128
});
127129

@@ -142,7 +144,7 @@ Task("Publish-Package")
142144
NuGetPush(nupkg, new NuGetPushSettings
143145
{
144146
Source = "https://nuget.org/api/v2/package",
145-
ApiKey = apiKey
147+
ApiKey = apiKey,
146148
});
147149
}
148150
});
@@ -161,7 +163,7 @@ Task("Publish-Release")
161163

162164
var github = new GitHubClient(new ProductHeaderValue("AngleSharpCakeBuild"))
163165
{
164-
Credentials = new Credentials(githubToken)
166+
Credentials = new Credentials(githubToken),
165167
};
166168

167169
var newRelease = github.Repository.Release;
@@ -170,7 +172,7 @@ Task("Publish-Release")
170172
Name = version,
171173
Body = String.Join(Environment.NewLine, releaseNotes.Notes),
172174
Prerelease = false,
173-
TargetCommitish = "master"
175+
TargetCommitish = "master",
174176
}).Wait();
175177
});
176178

src/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
<PropertyGroup>
33
<Description>Providers additional requesters and IO helpers for AngleSharp.</Description>
44
<Product>AngleSharp.Io</Product>
5-
<Version>0.10.1</Version>
5+
<Version>0.13.0</Version>
66
</PropertyGroup>
77
</Project>

0 commit comments

Comments
 (0)