Skip to content

Commit

Permalink
cleanup, use major and minor version in assembly version
Browse files Browse the repository at this point in the history
  • Loading branch information
halex2005 committed May 25, 2016
1 parent a0e33ec commit d3beb5f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
4 changes: 0 additions & 4 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ configuration:
- Debug
- Release

branches:
except:
- /^diadocsdk-csharp-v/

environment:
diadoc_signing_secret:
secure: anZ3SPfv+ZQGxXQdwHzCqwo0sKmdAVySXJr6j8sDIcuUjFqit9n1V+Va+UG+dIw8
Expand Down
17 changes: 12 additions & 5 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -85,27 +85,34 @@ Task("Build")
Task("GenerateVersionInfo")
.Does(context =>
{
var majorVersion = 1;
var tagVersion = GetVersionFromTag();
var clearVersion = ClearVersionTag(tagVersion) ?? "1.36.1";
var clearVersion = ClearVersionTag(tagVersion) ?? "1.0.0";
var semanticVersionForNuget = GetSemanticVersionV1(clearVersion);
var semanticVersion = GetSemanticVersionV2(clearVersion) + dbgSuffix;
var appveyorVersion = GetAppVeyorBuildVersion(clearVersion);

var versionParts = clearVersion.Split('.');
var majorVersion = 1;
var minorVersion = 0;
int.TryParse(versionParts[0], out majorVersion);
if (versionParts.Length > 1)
int.TryParse(versionParts[1], out minorVersion);
var assemblyVersion = string.Format("{0}.{1}.0.0", majorVersion, minorVersion);

if (!string.IsNullOrEmpty(clearVersion))
{
Information("Version from tag: {0}", clearVersion);
Information("Assembly version: {0}", assemblyVersion);
Information("Nuget version: {0}", semanticVersionForNuget);
Information("Semantic version: {0}", semanticVersion);
Information("AppVeyor version: {0}", appveyorVersion);
var versionParts = clearVersion.Split('.');
int.TryParse(versionParts[0], out majorVersion);
}

var datetimeNow = DateTime.Now;
var secondsPart = (long)datetimeNow.TimeOfDay.TotalSeconds;
var assemblyInfo = new AssemblyInfoSettings
{
Version = string.Format("{0}.0.0.0", majorVersion),
Version = assemblyVersion,
FileVersion = semanticVersionForNuget,
InformationalVersion = semanticVersion
};
Expand Down
2 changes: 1 addition & 1 deletion nuspec/DiadocApi.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<owners>SKB Kontur</owners>
<licenseUrl>https://github.com/diadoc/diadocsdk-charp/blob/master/LICENSE.md</licenseUrl>
<projectUrl>https://github.com/diadoc/diadocsdk-charp</projectUrl>
<iconUrl>https://raw.githubusercontent.com/diadoc/diadocsdk-csharp/master/nuspec/diadoc-icon-64-64.png</iconUrl>
<iconUrl>https://raw.githubusercontent.com/diadoc/diadocsdk-csharp/master/nuspec/diadoc-icon-128-128.png</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Official Diadoc SDK</description>
<copyright>Copyright 2016</copyright>
Expand Down
Binary file added nuspec/diadoc-icon-128-128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d3beb5f

Please sign in to comment.