FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Remove NerdBank.GitVersioning by neuecc · Pull Request #2094 · MessagePack-CSharp/MessagePack-CSharp · GitHub

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .cs  (3) .json  (3) .props  (2) .sln  (1) .yaml  (1) All 5 file types selected
Deleted files Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
Empty file removed .prettierrc.yaml
Empty file.
5 changes: 0 additions & 5 deletions Directory.Build.props
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,4 @@
<PackageReference GeneratePathProperty="true" />
</ItemDefinitionGroup>

<Target Name="PrepareReleaseNotes" BeforeTargets="GenerateNuspec" DependsOnTargets="GetBuildVersion">
<PropertyGroup>
<PackageReleaseNotes Condition="'$(PackageProjectUrl)'!=''">$(PackageProjectUrl)/releases/tag/v$(Version)</PackageReleaseNotes>
</PropertyGroup>
</Target>
</Project>
1 change: 0 additions & 1 deletion Directory.Packages.props
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@
<PackageVersion Include="System.Threading.Tasks.Extensions" Version="4.5.4" />
</ItemGroup>
<ItemGroup>
<GlobalPackageReference Include="Nerdbank.GitVersioning" Version="3.6.146" />
<GlobalPackageReference Include="CSharpIsNullAnalyzer" Version="0.1.593" />
<GlobalPackageReference Include="PolySharp" Version="1.15.0" />
<GlobalPackageReference Include="StyleCop.Analyzers.Unstable" Version="1.2.0.556" />
Expand Down
1 change: 0 additions & 1 deletion MessagePack.sln
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{301F812B
global.json = global.json
nuget.config = nuget.config
stylecop.json = stylecop.json
version.json = version.json
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MessagePack.AspNetCoreMvcFormatter.Tests", "tests\MessagePack.AspNetCoreMvcFormatter.Tests\MessagePack.AspNetCoreMvcFormatter.Tests.csproj", "{79C2B2CB-872A-4BA9-82DC-60F6DD77F940}"
Expand Down
7 changes: 0 additions & 7 deletions src/MessagePack.Analyzers.CodeFixes/version.json

This file was deleted.

26 changes: 26 additions & 0 deletions src/MessagePack.SourceGenerator/ThisAssembly.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Copyright (c) All contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

namespace MessagePack.SourceGenerator
{
public static class ThisAssembly
{
public static string AssemblyFileVersion
{
get
{
var version = typeof(ThisAssembly).Assembly.GetName().Version.ToString();
return version;
}
}

public static Version Version
{
get
{
var version = typeof(ThisAssembly).Assembly.GetName().Version;
return version;
}
}
}
}
7 changes: 0 additions & 7 deletions src/MessagePack.SourceGenerator/version.json

This file was deleted.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public Test AddGeneratedSources()
static void AddGeneratedSources(ProjectState project, string testMethod, bool withPrefix)
{
string prefix = withPrefix ? $"{project.Name}." : string.Empty;
string expectedPrefix = $"{ThisAssembly.AssemblyName}.Resources.{testMethod}.{prefix}"
string expectedPrefix = $"{typeof(Test).Assembly.GetName().Name}.Resources.{testMethod}.{prefix}"
.Replace(' ', '_')
.Replace(',', '_')
.Replace('(', '_')
Expand All @@ -132,7 +132,12 @@ static void AddGeneratedSources(ProjectState project, string testMethod, bool wi

using var reader = new StreamReader(resourceStream, Encoding.UTF8, detectEncodingFromByteOrderMarks: true, bufferSize: 4096, leaveOpen: true);
var name = resourceName.Substring(expectedPrefix.Length);
project.GeneratedSources.Add((typeof(TSourceGenerator), name, reader.ReadToEnd()));
var code = reader.ReadToEnd();
var version = MessagePack.SourceGenerator.ThisAssembly.Version;
code = code.Replace(
"[assembly: MsgPack::Internal.GeneratedAssemblyMessagePackResolverAttribute(typeof(MessagePack.GeneratedMessagePackResolver), 3, 0)]",
$"[assembly: MsgPack::Internal.GeneratedAssemblyMessagePackResolverAttribute(typeof(MessagePack.GeneratedMessagePackResolver), {version.Major}, {version.Minor})]");
project.GeneratedSources.Add((typeof(TSourceGenerator), name, code));
}
}

Expand Down Expand Up @@ -198,7 +203,7 @@ protected override ParseOptions CreateParseOptions()
expectedNames.Add(Path.GetFileName(tree.FilePath));
}

var currentTestPrefix = $"{ThisAssembly.AssemblyName}.Resources.{this.testMethod}.{fileNamePrefix}";
var currentTestPrefix = $"{typeof(Test).Assembly.GetName().Name}.Resources.{this.testMethod}.{fileNamePrefix}";
foreach (var name in this.GetType().Assembly.GetManifestResourceNames())
{
if (!name.StartsWith(currentTestPrefix))
Expand Down
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,16 @@ public void GuidShouldBeDeserializedAsGuid()
Assert.IsType(boxedValue.Value.GetType(), roundTripValue.Value);
}

[Fact]
public void OmitAssemblyVersion()
{
string json = MessagePackSerializer.ConvertToJson(MessagePackSerializer.Typeless.Serialize(new MyObject { SomeValue = 5 }));
this.logger.WriteLine(json);
Assert.Contains(ThisAssembly.AssemblyVersion, json);
json = MessagePackSerializer.ConvertToJson(MessagePackSerializer.Typeless.Serialize(new MyObject { SomeValue = 5 }, MessagePackSerializer.Typeless.DefaultOptions.WithOmitAssemblyVersion(true)));
this.logger.WriteLine(json);
Assert.DoesNotContain(ThisAssembly.AssemblyVersion, json);
}
//[Fact]
//public void OmitAssemblyVersion()
//{
// string json = MessagePackSerializer.ConvertToJson(MessagePackSerializer.Typeless.Serialize(new MyObject { SomeValue = 5 }));
// this.logger.WriteLine(json);
// Assert.Contains(ThisAssembly.AssemblyVersion, json);
// json = MessagePackSerializer.ConvertToJson(MessagePackSerializer.Typeless.Serialize(new MyObject { SomeValue = 5 }, MessagePackSerializer.Typeless.DefaultOptions.WithOmitAssemblyVersion(true)));
// this.logger.WriteLine(json);
// Assert.DoesNotContain(ThisAssembly.AssemblyVersion, json);
//}

[Fact]
public void SerializeInterface()
Expand Down
17 changes: 0 additions & 17 deletions version.json

This file was deleted.


Back | FazBrowse Home | New Git URL