Skip to content

Commit bc681de

Browse files
author
Antoine Aubry
committed
Fix missing assembly version
1 parent f9f69e9 commit bc681de

File tree

4 files changed

+66
-1
lines changed

4 files changed

+66
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,4 @@ samples/dotnet/project.lock.json
2828
YamlDotNet/Properties/AssemblyInfo.Generated.cs
2929

3030
/.vs
31+
/YamlDotNet/Properties/AssemblyInfo.cs
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// This file is part of YamlDotNet - A .NET library for YAML.
2+
// Copyright (c) Antoine Aubry and contributors
3+
4+
// Permission is hereby granted, free of charge, to any person obtaining a copy of
5+
// this software and associated documentation files (the "Software"), to deal in
6+
// the Software without restriction, including without limitation the rights to
7+
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
8+
// of the Software, and to permit persons to whom the Software is furnished to do
9+
// so, subject to the following conditions:
10+
11+
// The above copyright notice and this permission notice shall be included in all
12+
// copies or substantial portions of the Software.
13+
14+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20+
// SOFTWARE.
21+
22+
#if !UNITY
23+
using System.Reflection;
24+
using System.Runtime.InteropServices;
25+
26+
// Setting ComVisible to false makes the types in this assembly not visible
27+
// to COM components. If you need to access a type in this assembly from
28+
// COM, set the ComVisible attribute to true on that type.
29+
[assembly: ComVisible(false)]
30+
31+
// Version information for an assembly consists of the following four values:
32+
//
33+
// Major Version
34+
// Minor Version
35+
// Build Number
36+
// Revision
37+
//
38+
// You can specify all the values or you can default the Revision and Build Numbers
39+
// by using the '*' as shown below:
40+
[assembly: AssemblyVersion("<%assemblyVersion%>")]
41+
[assembly: AssemblyFileVersion("<%assemblyFileVersion%>")]
42+
[assembly: AssemblyInformationalVersion("<%assemblyInformationalVersion%>")]
43+
44+
#endif

YamlDotNet/Properties/AssemblyInfo.cs renamed to YamlDotNet/Properties/CustomAssemblyInfo.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,20 @@
2121

2222
#if !UNITY
2323
using System;
24+
using System.Reflection;
2425
using System.Runtime.CompilerServices;
2526

27+
// General Information about an assembly is controlled through the following
28+
// set of attributes. Change these attribute values to modify the information
29+
// associated with an assembly.
30+
[assembly: AssemblyTitle("YamlDotNet")]
31+
[assembly: AssemblyDescription("The YamlDotNet library.")]
32+
[assembly: AssemblyCompany("")]
33+
[assembly: AssemblyProduct("YamlDotNet")]
34+
[assembly: AssemblyCopyright("Copyright (c) Antoine Aubry and contributors 2008 - 2018")]
35+
[assembly: AssemblyTrademark("")]
36+
[assembly: AssemblyCulture("")]
37+
2638
[assembly: CLSCompliant(true)]
2739
#if !SIGNED
2840
#if NETSTANDARD1_3 || !PORTABLE

build.cake

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,18 @@ Task("Set-Build-Version")
6969
{
7070
var version = GitVersion(new GitVersionSettings
7171
{
72-
UpdateAssemblyInfo = false
72+
UpdateAssemblyInfo = false,
7373
});
7474
nugetVersion = version.NuGetVersion;
7575

76+
var assemblyInfo = TransformTextFile("YamlDotNet/Properties/AssemblyInfo.template")
77+
.WithToken("assemblyVersion", $"{version.Major}.0.0.0")
78+
.WithToken("assemblyFileVersion", $"{version.MajorMinorPatch}.0")
79+
.WithToken("assemblyInformationalVersion", nugetVersion)
80+
.ToString();
81+
82+
System.IO.File.WriteAllText("YamlDotNet/Properties/AssemblyInfo.cs", assemblyInfo);
83+
7684
if(AppVeyor.IsRunningOnAppVeyor)
7785
{
7886
if (!string.IsNullOrEmpty(version.PreReleaseTag))

0 commit comments

Comments
 (0)