Skip to content

Commit a5d4ff9

Browse files
committed
Merge branch 'additions' into develop
* additions: (GH-50) Added null check (maint) Changing project structure and layout
2 parents ac825e0 + f146cd8 commit a5d4ff9

29 files changed

+537
-551
lines changed
Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<package xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
3-
<metadata xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
4-
<id>githubreleasemanager.portable</id>
5-
<title>GitHubReleaseManager</title>
6-
<version>$version$</version>
7-
<authors>gep13</authors>
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<package xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
3+
<metadata xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
4+
<id>githubreleasemanager.portable</id>
5+
<title>GitHubReleaseManager</title>
6+
<version>$version$</version>
7+
<authors>gep13</authors>
88
<owners>gep13</owners>
9-
<licenseUrl>https://github.com/gep13/GitHubReleaseManager/blob/develop/LICENSE</licenseUrl>
9+
<licenseUrl>https://github.com/gep13/GitHubReleaseManager/blob/develop/LICENSE</licenseUrl>
1010
<projectUrl>https://github.com/gep13/GitHubReleaseManager</projectUrl>
11-
<iconUrl>http://cdn.rawgit.com/gep13/GitHubReleaseManager/9c547452a10afaf83fce1b5833f4762487b017b7/Icons/package_icon.svg</iconUrl>
12-
<requireLicenseAcceptance>false</requireLicenseAcceptance>
13-
<description>Tool for creating and exporting releases for software applications hosted on Github</description>
14-
<summary>Tool for creating and exporting releases for software applications hosted on Github</summary>
15-
<copyright>Copyright 2015</copyright>
16-
<language>en-GB</language>
17-
<tags>github release notes create export</tags>
18-
</metadata>
19-
<files>
20-
<file src="..\..\BuildArtifacts\GitHubReleaseManager.Cli.exe" target="tools" />
11+
<iconUrl>http://cdn.rawgit.com/gep13/GitHubReleaseManager/9c547452a10afaf83fce1b5833f4762487b017b7/Icons/package_icon.svg</iconUrl>
12+
<requireLicenseAcceptance>false</requireLicenseAcceptance>
13+
<description>Tool for creating and exporting releases for software applications hosted on GitHub</description>
14+
<summary>Tool for creating and exporting releases for software applications hosted on GitHub</summary>
15+
<copyright>Copyright 2015</copyright>
16+
<language>en-GB</language>
17+
<tags>github release notes create export</tags>
18+
</metadata>
19+
<files>
20+
<file src="..\..\BuildArtifacts\GitHubReleaseManager.exe" target="tools" />
2121
<file src="chocolateyInstall.ps1" target="tools"/>
22-
<file src="chocolateyUninstall.ps1" target="tools"/>
23-
</files>
22+
<file src="chocolateyUninstall.ps1" target="tools"/>
23+
</files>
2424
</package>
Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<package xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
3-
<metadata xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
4-
<id>githubreleasemanager</id>
5-
<title>GitHubReleaseManager</title>
6-
<version>$version$</version>
7-
<authors>gep13</authors>
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<package xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
3+
<metadata xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
4+
<id>githubreleasemanager</id>
5+
<title>GitHubReleaseManager</title>
6+
<version>$version$</version>
7+
<authors>gep13</authors>
88
<owners>gep13</owners>
9-
<licenseUrl>https://github.com/gep13/GitHubReleaseManager/blob/develop/LICENSE</licenseUrl>
10-
<projectUrl>https://github.com/gep13/GitHubReleaseManager</projectUrl>
9+
<licenseUrl>https://github.com/gep13/GitHubReleaseManager/blob/develop/LICENSE</licenseUrl>
10+
<projectUrl>https://github.com/gep13/GitHubReleaseManager</projectUrl>
1111
<iconUrl>http://cdn.rawgit.com/gep13/GitHubReleaseManager/9c547452a10afaf83fce1b5833f4762487b017b7/Icons/package_icon.svg</iconUrl>
12-
<requireLicenseAcceptance>false</requireLicenseAcceptance>
13-
<description>Tool for creating and exporting releases for software applications hosted on Github</description>
14-
<summary>Tool for creating and exporting releases for software applications hosted on Github</summary>
15-
<copyright>Copyright 2015</copyright>
16-
<language>en-GB</language>
17-
<tags>github release notes create export</tags>
18-
</metadata>
19-
<files>
20-
<file src="..\..\BuildArtifacts\GitHubReleaseManager.dll" target="tools" />
21-
</files>
12+
<requireLicenseAcceptance>false</requireLicenseAcceptance>
13+
<description>Tool for creating and exporting releases for software applications hosted on GitHub</description>
14+
<summary>Tool for creating and exporting releases for software applications hosted on GitHub</summary>
15+
<copyright>Copyright 2015</copyright>
16+
<language>en-GB</language>
17+
<tags>github release notes create export</tags>
18+
</metadata>
19+
<files>
20+
<file src="..\..\BuildArtifacts\GitHubReleaseManager.exe" target="tools" />
21+
</files>
2222
</package>

Source/CustomDictionary.xml

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
1-
<Dictionary>
2-
<Words>
3-
<Unrecognized>
4-
<Word />
5-
</Unrecognized>
6-
<Recognized>
7-
<Word>Cli</Word>
8-
<Word>commitish</Word>
9-
<Word>Git</Word>
10-
<Word>Octokit</Word>
11-
</Recognized>
12-
<Deprecated>
13-
<Term />
14-
</Deprecated>
15-
<DiscreteExceptions>
16-
<Term />
17-
</DiscreteExceptions>
18-
</Words>
19-
<Acronyms>
20-
<CasingExceptions>
21-
<Acronym />
22-
</CasingExceptions>
23-
</Acronyms>
1+
<Dictionary>
2+
<Words>
3+
<Unrecognized>
4+
<Word />
5+
</Unrecognized>
6+
<Recognized>
7+
<Word>Cli</Word>
8+
<Word>commitish</Word>
9+
<Word>Git</Word>
10+
<Word>Octokit</Word>
11+
<Word>Prerelease</Word>
12+
</Recognized>
13+
<Deprecated>
14+
<Term />
15+
</Deprecated>
16+
<DiscreteExceptions>
17+
<Term />
18+
</DiscreteExceptions>
19+
</Words>
20+
<Acronyms>
21+
<CasingExceptions>
22+
<Acronym />
23+
</CasingExceptions>
24+
</Acronyms>
2425
</Dictionary>

Source/GitHubReleaseManager.Cli/GitHubReleaseManager.Cli.csproj

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<OutputType>Exe</OutputType>
99
<AppDesignerFolder>Properties</AppDesignerFolder>
1010
<RootNamespace>GitHubReleaseManager.Cli</RootNamespace>
11-
<AssemblyName>GitHubReleaseManager.Cli</AssemblyName>
11+
<AssemblyName>GitHubReleaseManager</AssemblyName>
1212
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
1313
<FileAlignment>512</FileAlignment>
1414
<NuGetPackageImportStamp>7ec2b379</NuGetPackageImportStamp>
@@ -97,6 +97,7 @@
9797
<ItemGroup>
9898
<CodeAnalysisDictionary Include="..\CustomDictionary.xml">
9999
<Link>CustomDictionary.xml</Link>
100+
<SubType>Designer</SubType>
100101
</CodeAnalysisDictionary>
101102
</ItemGroup>
102103
<ItemGroup>
@@ -120,9 +121,9 @@
120121
<Content Include="FodyWeavers.xml" />
121122
</ItemGroup>
122123
<ItemGroup>
123-
<ProjectReference Include="..\GitHubReleaseManager\GitHubReleaseManager.csproj">
124+
<ProjectReference Include="..\GitHubReleaseManager\GitHubReleaseManager.Core.csproj">
124125
<Project>{b02a026e-ca3a-48f4-bba9-eb337b0a2035}</Project>
125-
<Name>GitHubReleaseManager</Name>
126+
<Name>GitHubReleaseManager.Core</Name>
126127
</ProjectReference>
127128
</ItemGroup>
128129
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

Source/GitHubReleaseManager.Cli/Options/CreateSubOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public class CreateSubOptions : BaseGitHubSubOptions
2121
[Option('m', "milestone", HelpText = "The milestone to use.", Required = false)]
2222
public string Milestone { get; set; }
2323

24-
[Option('n', "name", HelpText = "The name of the release (Typically this is the generated SemVer Version Number.", Required = false)]
24+
[Option('n', "name", HelpText = "The name of the release (Typically this is the generated SemVer Version Number).", Required = false)]
2525
public string Name { get; set; }
2626

2727
[Option('i', "inputFilePath", HelpText = "The path to the file to be used as the content of the release notes.", Required = false)]

Source/GitHubReleaseManager.Cli/Program.cs

Lines changed: 19 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ namespace GitHubReleaseManager.Cli
1515
using System.Threading.Tasks;
1616
using CommandLine;
1717
using GitHubReleaseManager.Cli.Options;
18-
using GitHubReleaseManager.Configuration;
19-
using GitHubReleaseManager.Helpers;
18+
using GitHubReleaseManager.Core;
19+
using GitHubReleaseManager.Core.Configuration;
20+
using GitHubReleaseManager.Core.Helpers;
2021
using Octokit;
2122
using FileMode = System.IO.FileMode;
2223

@@ -256,7 +257,7 @@ private static async Task CreateReleaseFromInputFile(GitHubClient github, string
256257
await AddAssets(github, assets, release);
257258
}
258259

259-
private static async Task AddAssets(GitHubClient github, string owner, string repository, string tagName, IList<string> assetPaths)
260+
private static async Task AddAssets(GitHubClient github, string owner, string repository, string tagName, IList<string> assets)
260261
{
261262
var releases = await github.Release.GetAll(owner, repository);
262263

@@ -268,21 +269,7 @@ private static async Task AddAssets(GitHubClient github, string owner, string re
268269
return;
269270
}
270271

271-
foreach (var assetPath in assetPaths)
272-
{
273-
if (!File.Exists(assetPath))
274-
{
275-
continue;
276-
}
277-
278-
var upload = new ReleaseAssetUpload
279-
{
280-
FileName = Path.GetFileName(assetPath),
281-
ContentType = "application/octet-stream",
282-
RawData = File.Open(assetPath, FileMode.Open)
283-
};
284-
await github.Release.UploadAsset(release, upload);
285-
}
272+
await AddAssets(github, assets, release);
286273
}
287274

288275
private static async Task<string> ExportReleases(GitHubClient github, string owner, string repository, string tagName, Config configuration)
@@ -328,21 +315,24 @@ private static async Task PublishRelease(GitHubClient github, string owner, stri
328315

329316
private static async Task AddAssets(GitHubClient github, IList<string> assets, Release release)
330317
{
331-
foreach (var asset in assets)
318+
if (assets != null)
332319
{
333-
if (!File.Exists(asset))
320+
foreach (var asset in assets)
334321
{
335-
continue;
336-
}
322+
if (!File.Exists(asset))
323+
{
324+
continue;
325+
}
337326

338-
var upload = new ReleaseAssetUpload
339-
{
340-
FileName = Path.GetFileName(asset),
341-
ContentType = "application/octet-stream",
342-
RawData = File.Open(asset, FileMode.Open)
343-
};
327+
var upload = new ReleaseAssetUpload
328+
{
329+
FileName = Path.GetFileName(asset),
330+
ContentType = "application/octet-stream",
331+
RawData = File.Open(asset, FileMode.Open)
332+
};
344333

345-
await github.Release.UploadAsset(release, upload);
334+
await github.Release.UploadAsset(release, upload);
335+
}
346336
}
347337
}
348338

Source/GitHubReleaseManager.Tests/FakeGitHubClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace GitHubReleaseManager.Tests
1010
using System.Collections.ObjectModel;
1111
using System.Threading.Tasks;
1212
using Octokit;
13-
using IGitHubClient = GitHubReleaseManager.IGitHubClient;
13+
using IGitHubClient = GitHubReleaseManager.Core.IGitHubClient;
1414

1515
public class FakeGitHubClient : IGitHubClient
1616
{

Source/GitHubReleaseManager.Tests/GitHubReleaseManager.Tests.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@
7474
</None>
7575
</ItemGroup>
7676
<ItemGroup>
77-
<ProjectReference Include="..\GitHubReleaseManager\GitHubReleaseManager.csproj">
77+
<ProjectReference Include="..\GitHubReleaseManager\GitHubReleaseManager.Core.csproj">
7878
<Project>{b02a026e-ca3a-48f4-bba9-eb337b0a2035}</Project>
79-
<Name>GitHubReleaseManager</Name>
79+
<Name>GitHubReleaseManager.Core</Name>
8080
</ProjectReference>
8181
</ItemGroup>
8282
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

Source/GitHubReleaseManager.Tests/ReleaseNotesBuilderIntegrationTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ namespace GitHubReleaseManager.Tests
88
{
99
using System;
1010
using System.Diagnostics;
11-
using GitHubReleaseManager;
12-
using GitHubReleaseManager.Configuration;
13-
using GitHubReleaseManager.Helpers;
11+
using GitHubReleaseManager.Core;
12+
using GitHubReleaseManager.Core.Configuration;
13+
using GitHubReleaseManager.Core.Helpers;
1414
using NUnit.Framework;
1515

1616
[TestFixture]

Source/GitHubReleaseManager.Tests/ReleaseNotesBuilderTests.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ namespace GitHubReleaseManager.Tests
99
using System;
1010
using System.Linq;
1111
using ApprovalTests;
12-
using GitHubReleaseManager.Configuration;
13-
using GitHubReleaseManager.Helpers;
12+
using GitHubReleaseManager.Core;
13+
using GitHubReleaseManager.Core.Configuration;
14+
using GitHubReleaseManager.Core.Helpers;
1415
using NUnit.Framework;
1516
using Octokit;
1617

0 commit comments

Comments
 (0)