Skip to content

Commit 4dbe178

Browse files
committed
Merge branch 'pr111' into develop
* pr111: (build) Update to latest Cake version (build) Pin to specific version of Cake.Recipe (GH-110) Update code due API changes (GH-110) Update NuGet packages
2 parents d3afcc0 + 7f9dae5 commit 4dbe178

15 files changed

+68
-66
lines changed

Source/GitReleaseManager.Cli/GitReleaseManager.Cli.csproj

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,11 @@
6060
<RunCodeAnalysisRestore>true</RunCodeAnalysisRestore>
6161
</PropertyGroup>
6262
<ItemGroup>
63-
<Reference Include="CommandLine, Version=2.0.275.0, Culture=neutral, PublicKeyToken=de6f01bd326f8c32, processorArchitecture=MSIL">
64-
<HintPath>..\packages\CommandLineParser.2.0.275-beta\lib\net45\CommandLine.dll</HintPath>
65-
<Private>True</Private>
63+
<Reference Include="CommandLine, Version=2.2.1.0, Culture=neutral, PublicKeyToken=de6f01bd326f8c32, processorArchitecture=MSIL">
64+
<HintPath>..\packages\CommandLineParser.2.2.1\lib\net45\CommandLine.dll</HintPath>
6665
</Reference>
67-
<Reference Include="Octokit, Version=0.17.0.0, Culture=neutral, processorArchitecture=MSIL">
68-
<HintPath>..\packages\Octokit.0.17.0\lib\net45\Octokit.dll</HintPath>
69-
<Private>True</Private>
66+
<Reference Include="Octokit, Version=0.29.0.0, Culture=neutral, processorArchitecture=MSIL">
67+
<HintPath>..\packages\Octokit.0.29.0\lib\net45\Octokit.dll</HintPath>
7068
</Reference>
7169
<Reference Include="System" />
7270
<Reference Include="System.Core" />

Source/GitReleaseManager.Cli/Program.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ private static async Task<Release> CreateReleaseFromMilestone(GitHubClient githu
187187

188188
var releaseUpdate = CreateNewRelease(milestone, result, prerelease, targetCommitish);
189189

190-
var release = await github.Release.Create(owner, repository, releaseUpdate);
190+
var release = await github.Repository.Release.Create(owner, repository, releaseUpdate);
191191

192192
await AddAssets(github, assets, release);
193193

@@ -205,7 +205,7 @@ private static async Task<Release> CreateReleaseFromInputFile(GitHubClient githu
205205

206206
var releaseUpdate = CreateNewRelease(name, inputFileContents, prerelease, targetCommitish);
207207

208-
var release = await github.Release.Create(owner, repository, releaseUpdate);
208+
var release = await github.Repository.Release.Create(owner, repository, releaseUpdate);
209209

210210
await AddAssets(github, assets, release);
211211

@@ -214,7 +214,7 @@ private static async Task<Release> CreateReleaseFromInputFile(GitHubClient githu
214214

215215
private static async Task AddAssets(GitHubClient github, string owner, string repository, string tagName, IList<string> assets)
216216
{
217-
var releases = await github.Release.GetAll(owner, repository);
217+
var releases = await github.Repository.Release.GetAll(owner, repository);
218218

219219
var release = releases.FirstOrDefault(r => r.TagName == tagName);
220220

@@ -239,7 +239,7 @@ private static async Task<string> ExportReleases(GitHubClient github, string own
239239
private static async Task CloseMilestone(GitHubClient github, string owner, string repository, string milestoneTitle)
240240
{
241241
var milestoneClient = github.Issue.Milestone;
242-
var openMilestones = await milestoneClient.GetAllForRepository(owner, repository, new MilestoneRequest { State = ItemState.Open });
242+
var openMilestones = await milestoneClient.GetAllForRepository(owner, repository, new MilestoneRequest { State = ItemStateFilter.Open });
243243
var milestone = openMilestones.FirstOrDefault(m => m.Title == milestoneTitle);
244244

245245
if (milestone == null)
@@ -252,7 +252,7 @@ private static async Task CloseMilestone(GitHubClient github, string owner, stri
252252

253253
private static async Task PublishRelease(GitHubClient github, string owner, string repository, string tagName)
254254
{
255-
var releases = await github.Release.GetAll(owner, repository);
255+
var releases = await github.Repository.Release.GetAll(owner, repository);
256256
var release = releases.FirstOrDefault(r => r.TagName == tagName);
257257

258258
if (release == null)
@@ -262,7 +262,7 @@ private static async Task PublishRelease(GitHubClient github, string owner, stri
262262

263263
var releaseUpdate = new ReleaseUpdate { TagName = tagName, Draft = false };
264264

265-
await github.Release.Edit(owner, repository, release.Id, releaseUpdate);
265+
await github.Repository.Release.Edit(owner, repository, release.Id, releaseUpdate);
266266
}
267267

268268
private static async Task AddAssets(GitHubClient github, IList<string> assets, Release release)
@@ -283,7 +283,7 @@ private static async Task AddAssets(GitHubClient github, IList<string> assets, R
283283
RawData = File.Open(asset, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)
284284
};
285285

286-
await github.Release.UploadAsset(release, upload);
286+
await github.Repository.Release.UploadAsset(release, upload);
287287

288288
// Make sure to tidy up the stream that was created above
289289
upload.RawData.Dispose();
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="CommandLineParser" version="2.0.275-beta" targetFramework="net451" />
4-
<package id="Octokit" version="0.17.0" targetFramework="net451" />
3+
<package id="CommandLineParser" version="2.2.1" targetFramework="net451" />
4+
<package id="Octokit" version="0.29.0" targetFramework="net451" />
55
</packages>

Source/GitReleaseManager.Tests/GitReleaseManager.Tests.csproj

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,29 +36,25 @@
3636
<DebugSymbols>true</DebugSymbols>
3737
</PropertyGroup>
3838
<ItemGroup>
39+
<Reference Include="AlphaFS, Version=2.1.0.0, Culture=neutral, PublicKeyToken=4d31a58f7d7ad5c9, processorArchitecture=MSIL">
40+
<HintPath>..\packages\AlphaFS.2.1.3\lib\net451\AlphaFS.dll</HintPath>
41+
</Reference>
3942
<Reference Include="ApprovalTests, Version=3.0.0.0, Culture=neutral, PublicKeyToken=11bd7d124fc62e0f, processorArchitecture=MSIL">
40-
<HintPath>..\packages\ApprovalTests.3.0.10\lib\net40\ApprovalTests.dll</HintPath>
41-
<Private>True</Private>
43+
<HintPath>..\packages\ApprovalTests.3.0.14\lib\net45\ApprovalTests.dll</HintPath>
4244
</Reference>
4345
<Reference Include="ApprovalUtilities, Version=3.0.0.0, Culture=neutral, PublicKeyToken=11bd7d124fc62e0f, processorArchitecture=MSIL">
44-
<HintPath>..\packages\ApprovalUtilities.3.0.10\lib\net45\ApprovalUtilities.dll</HintPath>
45-
<Private>True</Private>
46-
</Reference>
47-
<Reference Include="ApprovalUtilities.Net45, Version=3.0.0.0, Culture=neutral, processorArchitecture=MSIL">
48-
<HintPath>..\packages\ApprovalUtilities.3.0.10\lib\net45\ApprovalUtilities.Net45.dll</HintPath>
49-
<Private>True</Private>
46+
<HintPath>..\packages\ApprovalUtilities.3.0.14\lib\net45\ApprovalUtilities.dll</HintPath>
5047
</Reference>
51-
<Reference Include="nunit.framework, Version=3.0.5813.39031, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
52-
<HintPath>..\packages\NUnit.3.0.1\lib\net45\nunit.framework.dll</HintPath>
53-
<Private>True</Private>
48+
<Reference Include="nunit.framework, Version=3.9.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
49+
<HintPath>..\packages\NUnit.3.9.0\lib\net45\nunit.framework.dll</HintPath>
5450
</Reference>
55-
<Reference Include="Octokit, Version=0.17.0.0, Culture=neutral, processorArchitecture=MSIL">
56-
<HintPath>..\packages\Octokit.0.17.0\lib\net45\Octokit.dll</HintPath>
57-
<Private>True</Private>
51+
<Reference Include="Octokit, Version=0.29.0.0, Culture=neutral, processorArchitecture=MSIL">
52+
<HintPath>..\packages\Octokit.0.29.0\lib\net45\Octokit.dll</HintPath>
5853
</Reference>
5954
<Reference Include="System" />
6055
<Reference Include="System.Core" />
6156
<Reference Include="System.Net.Http" />
57+
<Reference Include="System.Transactions" />
6258
<Reference Include="System.Windows.Forms" />
6359
<Reference Include="System.Xml.Linq" />
6460
<Reference Include="System.Data.DataSetExtensions" />

Source/GitReleaseManager.Tests/ReleaseNotesBuilderTests.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,28 +151,35 @@ private static void AcceptTest(int commits, Config config, params Issue[] issues
151151

152152
private static Milestone CreateMilestone(string version)
153153
{
154-
return new Milestone(new Uri("https://github.com/gep13/FakeRepository/issues?q=milestone%3A" + version), 0, ItemState.Open, version, String.Empty, null, 0, 0, DateTimeOffset.Now, null, null);
154+
return new Milestone(null, "https://github.com/gep13/FakeRepository/issues?q=milestone%3A" + version, 0, ItemState.Open, version, String.Empty, null, 0, 0, DateTimeOffset.Now, null, null, null);
155155
}
156156

157157
private static Issue CreateIssue(int number, params string[] labels)
158158
{
159+
var user = new User(null, null, null, 0, null, DateTimeOffset.Now, DateTimeOffset.Now, 0, null, 0, 0, null, null, 0, 0, null, "gep13", "gep31", 0, null, 0, 0, 0, null, null, false, null, null);
160+
159161
return new Issue(
160162
null,
161-
new Uri("http://example.com/" + number),
163+
"http://example.com/" + number,
162164
null,
163165
null,
164166
number,
165167
ItemState.Open,
166168
"Issue " + number,
167169
"Some issue",
168170
null,
169-
labels.Select(x => new Label (null, x, null)).ToArray(),
171+
null,
172+
labels.Select(x => new Label(null, x, null)).ToArray(),
173+
user,
170174
null,
171175
null,
172176
0,
173177
null,
174178
null,
175179
DateTimeOffset.Now,
180+
null,
181+
0,
182+
false,
176183
null);
177184
}
178185
}

Source/GitReleaseManager.Tests/ReleaseNotesExporterTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ private static Release CreateRelease(int id, DateTime createdDateTime, string mi
8686
stringBuilder.AppendLine();
8787
stringBuilder.AppendLine("- [__#3__](http://example.com/3) Issue 3");
8888

89-
return new Release(null, null, null, null, id, milestone, "master", milestone, stringBuilder.ToString(), false, false, createdDateTime, null);
89+
return new Release(null, null, null, null, id, milestone, "master", milestone, stringBuilder.ToString(), false, false, createdDateTime, null, null, null, null, null);
9090
}
9191
}
9292
}
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="ApprovalTests" version="3.0.10" targetFramework="net451" />
4-
<package id="ApprovalUtilities" version="3.0.10" targetFramework="net451" />
5-
<package id="NUnit" version="3.0.1" targetFramework="net451" />
6-
<package id="Octokit" version="0.17.0" targetFramework="net451" />
3+
<package id="AlphaFS" version="2.1.3" targetFramework="net451" />
4+
<package id="ApprovalTests" version="3.0.14" targetFramework="net451" />
5+
<package id="ApprovalUtilities" version="3.0.14" targetFramework="net451" />
6+
<package id="NUnit" version="3.9.0" targetFramework="net451" />
7+
<package id="Octokit" version="0.29.0" targetFramework="net451" />
78
</packages>

Source/GitReleaseManager/Configuration/ConfigSerializer.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ public static class ConfigSerializer
1515
{
1616
public static Config Read(TextReader reader)
1717
{
18-
var deserializer = new Deserializer(null, new HyphenatedNamingConvention());
18+
var deserializerBuilder = new DeserializerBuilder().WithNamingConvention(new HyphenatedNamingConvention());
19+
var deserializer = deserializerBuilder.Build();
1920
var deserialize = deserializer.Deserialize<Config>(reader);
20-
21+
2122
if (deserialize == null)
2223
{
2324
return new Config();
@@ -28,7 +29,8 @@ public static Config Read(TextReader reader)
2829

2930
public static void Write(Config config, TextWriter writer)
3031
{
31-
var serializer = new Serializer(SerializationOptions.None, new HyphenatedNamingConvention());
32+
var serializerBuilder = new SerializerBuilder().WithNamingConvention(new HyphenatedNamingConvention());
33+
var serializer = serializerBuilder.Build();
3234
serializer.Serialize(writer, config);
3335
}
3436

Source/GitReleaseManager/DefaultGitHubClient.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ public async Task<int> GetNumberOfCommitsBetween(Milestone previousMilestone, Mi
3131
{
3232
if (previousMilestone == null)
3333
{
34-
var gitHubClientRepositoryCommitsCompare = await this.gitHubClient.Repository.Commits.Compare(this.user, this.repository, "master", currentMilestone.Title);
34+
var gitHubClientRepositoryCommitsCompare = await this.gitHubClient.Repository.Commit.Compare(this.user, this.repository, "master", currentMilestone.Title);
3535
return gitHubClientRepositoryCommitsCompare.AheadBy;
3636
}
3737

38-
var compareResult = await this.gitHubClient.Repository.Commits.Compare(this.user, this.repository, previousMilestone.Title, "master");
38+
var compareResult = await this.gitHubClient.Repository.Commit.Compare(this.user, this.repository, previousMilestone.Title, "master");
3939
return compareResult.AheadBy;
4040
}
4141
catch (NotFoundException)
@@ -54,13 +54,13 @@ public async Task<List<Issue>> GetIssues(Milestone targetMilestone)
5454

5555
public async Task<List<Release>> GetReleases()
5656
{
57-
var allReleases = await this.gitHubClient.Release.GetAll(this.user, this.repository);
57+
var allReleases = await this.gitHubClient.Repository.Release.GetAll(this.user, this.repository);
5858
return allReleases.OrderByDescending(r => r.CreatedAt).ToList();
5959
}
6060

6161
public async Task<Release> GetSpecificRelease(string tagName)
6262
{
63-
var allReleases = await this.gitHubClient.Release.GetAll(this.user, this.repository);
63+
var allReleases = await this.gitHubClient.Repository.Release.GetAll(this.user, this.repository);
6464
return allReleases.FirstOrDefault(r => r.TagName == tagName);
6565
}
6666

@@ -71,17 +71,17 @@ public ReadOnlyCollection<Milestone> GetMilestones()
7171
this.user,
7272
this.repository,
7373
new MilestoneRequest
74-
{
75-
State = ItemState.Closed
76-
}).Result;
74+
{
75+
State = ItemStateFilter.Closed
76+
}).Result;
7777

7878
var open = milestonesClient.GetAllForRepository(
7979
this.user,
8080
this.repository,
8181
new MilestoneRequest
82-
{
83-
State = ItemState.Open
84-
}).Result;
82+
{
83+
State = ItemStateFilter.Open
84+
}).Result;
8585

8686
return new ReadOnlyCollection<Milestone>(closed.Concat(open).ToList());
8787
}

Source/GitReleaseManager/GitReleaseManager.Core.csproj

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,8 @@
4444
<RunCodeAnalysisRestore>True</RunCodeAnalysisRestore>
4545
</PropertyGroup>
4646
<ItemGroup>
47-
<Reference Include="Octokit, Version=0.17.0.0, Culture=neutral, processorArchitecture=MSIL">
48-
<HintPath>..\packages\Octokit.0.17.0\lib\net45\Octokit.dll</HintPath>
49-
<Private>True</Private>
47+
<Reference Include="Octokit, Version=0.29.0.0, Culture=neutral, processorArchitecture=MSIL">
48+
<HintPath>..\packages\Octokit.0.29.0\lib\net45\Octokit.dll</HintPath>
5049
</Reference>
5150
<Reference Include="System" />
5251
<Reference Include="System.Core" />
@@ -56,9 +55,8 @@
5655
<Reference Include="Microsoft.CSharp" />
5756
<Reference Include="System.Data" />
5857
<Reference Include="System.Xml" />
59-
<Reference Include="YamlDotNet, Version=3.7.0.0, Culture=neutral, processorArchitecture=MSIL">
60-
<HintPath>..\packages\YamlDotNet.3.7.0\lib\net35\YamlDotNet.dll</HintPath>
61-
<Private>True</Private>
58+
<Reference Include="YamlDotNet, Version=4.3.1.0, Culture=neutral, processorArchitecture=MSIL">
59+
<HintPath>..\packages\YamlDotNet.4.3.1\lib\net45\YamlDotNet.dll</HintPath>
6260
</Reference>
6361
</ItemGroup>
6462
<ItemGroup>

0 commit comments

Comments
 (0)