Skip to content

Commit

Permalink
Sign assembly with the old key (#471)
Browse files Browse the repository at this point in the history
* Restore old signing key
* Build Strong Named Assembly
* Make assembly version major.minor

Fixes #450

+semver:breaking
  • Loading branch information
hazzik authored Oct 7, 2020
1 parent fecbea6 commit 454fa9a
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 15 deletions.
1 change: 1 addition & 0 deletions GitVersion.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
assembly-versioning-scheme: MajorMinor
branches:
master:
mode: ContinuousDelivery
Expand Down
5 changes: 4 additions & 1 deletion build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ Setup((context) =>

Information("FluentNHibernate");
Information($"SemVersion: {parameters.Version.SemVersion}");
Information($"AssemblyVersion: {parameters.Version.AssemblyVersion}");
Information($"Version: {parameters.Version.Version}");
Information($"IsLocalBuild: {parameters.IsLocalBuild}");
Information($"IsTagged: {parameters.IsTagged}");
Information($"IsPullRequest: {parameters.IsPullRequest}");
Expand All @@ -31,8 +33,9 @@ Setup((context) =>

msBuildSettings = new DotNetCoreMSBuildSettings()
.WithProperty("Version", parameters.Version.SemVersion)
.WithProperty("AssemblyVersion", parameters.Version.Version)
.WithProperty("AssemblyVersion", parameters.Version.AssemblyVersion)
.WithProperty("FileVersion", parameters.Version.Version)
.WithProperty("InformationalVersion", parameters.Version.InformationalVersion)
.WithProperty("PackageReleaseNotes", string.Concat("\"", releaseNotes, "\""));
});

Expand Down
12 changes: 11 additions & 1 deletion build/version.cake
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ public class BuildVersion
public string DotNetAsterix { get; private set; }
public string Milestone { get; private set; }
public string AppVersion { get; private set; }
public string AssemblyVersion { get; private set; }
public string InformationalVersion {get; private set; }

public static BuildVersion Calculate(ICakeContext context, BuildParameters parameters)
{
Expand All @@ -15,6 +17,8 @@ public class BuildVersion

string version = null;
string semVersion = null;
string assemblyVersion = null;
string informationalVersion = null;
string milestone = null;

if (context.IsRunningOnWindows())
Expand All @@ -29,6 +33,8 @@ public class BuildVersion

version = context.EnvironmentVariable("GitVersion_MajorMinorPatch");
semVersion = context.EnvironmentVariable("GitVersion_LegacySemVerPadded");
assemblyVersion = context.EnvironmentVariable("GitVersion_AssemblySemVer");
informationalVersion = context.EnvironmentVariable("GitVersion_InformationalVersion");
milestone = string.Concat("v", version);
}

Expand All @@ -39,6 +45,8 @@ public class BuildVersion

version = assertedVersions.MajorMinorPatch;
semVersion = assertedVersions.LegacySemVerPadded;
assemblyVersion = assertedVersions.AssemblySemVer;
informationalVersion = assertedVersions.InformationalVersion;
milestone = string.Concat("v", version);

context.Information("Calculated Semantic Version: {0}", semVersion);
Expand All @@ -52,7 +60,9 @@ public class BuildVersion
SemVersion = semVersion,
DotNetAsterix = semVersion.Substring(version.Length).TrimStart('-'),
Milestone = milestone,
AppVersion = appVersion
AppVersion = appVersion,
AssemblyVersion = assemblyVersion,
InformationalVersion = informationalVersion,
};
}
}
Binary file added src/FluentKey.snk
Binary file not shown.
3 changes: 0 additions & 3 deletions src/FluentNHibernate.Testing/FluentNHibernate.Testing.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@
</ItemGroup>

<ItemGroup>
<None Include="..\FluentKey.snk">
<Link>FluentKey.snk</Link>
</None>
<None Include="App.config" />
<Content Include="Cfg\hibernate.cfg.xml" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ public override void establish_context()
manyToOneARankedFirstToHolder.Set(x => x.Class, Layer.Defaults, new TypeReference(typeof(Holder)));
manyToOneARankedFirstToHolder.Set(x => x.Name, Layer.Defaults, "ARankedFirstProperty");
manyToOneARankedFirstToHolder.ContainingEntityType = typeof(ARankedFirst);
manyToOneARankedFirstToHolder.Member = new PropertyMember(typeof(ARankedFirst).GetProperty("ARankedFirstProperty"));
manyToOneARankedFirstToHolder.Member = typeof(ARankedFirst).GetProperty("ARankedFirstProperty").ToMember();

manyToOneBRankedSecondToHolder = new ManyToOneMapping();
manyToOneBRankedSecondToHolder.Set(x => x.Class, Layer.Defaults, new TypeReference(typeof(Holder)));
manyToOneBRankedSecondToHolder.Set(x => x.Name, Layer.Defaults, "BRankedSecondProperty");
manyToOneBRankedSecondToHolder.ContainingEntityType = typeof(BRankedSecond);
manyToOneBRankedSecondToHolder.Member = new PropertyMember(typeof(BRankedSecond).GetProperty("BRankedSecondProperty"));
manyToOneBRankedSecondToHolder.Member = typeof(BRankedSecond).GetProperty("BRankedSecondProperty").ToMember();

var relationship = new OneToManyMapping();
relationship.Set(x => x.Class, Layer.Defaults, new TypeReference(typeof(BRankedSecond)));
Expand Down
7 changes: 2 additions & 5 deletions src/FluentNHibernate/FluentNHibernate.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,10 @@
<OutputType>Library</OutputType>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>../FluentKey.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

<PropertyGroup>
<Description>FluentNHibernate</Description>
</PropertyGroup>


<PropertyGroup>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
Expand Down
4 changes: 1 addition & 3 deletions src/FluentNHibernate/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

[assembly: ComVisible(false)]
[assembly: CLSCompliant(true)]
[assembly: InternalsVisibleTo("FluentNHibernate.Testing")]
[assembly: CLSCompliant(true)]

0 comments on commit 454fa9a

Please sign in to comment.