Skip to content

Commit 782c2c7

Browse files
committed
Improved build process, prepare for 0.13
1 parent e3ad3b3 commit 782c2c7

File tree

2 files changed

+19
-17
lines changed

2 files changed

+19
-17
lines changed

build.cake

+18-16
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.Css.sln", new NuGetRestoreSettings {
54-
ToolPath = "tools/nuget.exe"
53+
NuGetRestore("./src/AngleSharp.Css.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.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,
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.Css.dll"),
110-
buildDir + Directory(item.Value) + File("AngleSharp.Css.xml")
113+
buildDir + Directory(item.Value) + File("AngleSharp.Css.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;

src/Directory.Build.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
<PropertyGroup>
33
<Description>Extends the CSSOM from the core AngleSharp library.</Description>
44
<Product>AngleSharp.Css</Product>
5-
<Version>0.10.1</Version>
5+
<Version>0.13.0</Version>
66
</PropertyGroup>
77
</Project>

0 commit comments

Comments
 (0)