Skip to content

Commit 41e0af8

Browse files
committed
Testing more frameworks - See GitTools/GitVersion#2330
1 parent 1d31f19 commit 41e0af8

19 files changed

+163
-126
lines changed

ClassLibrary1/ClassLibrary1.vbproj

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netstandard2.0</TargetFramework>
4+
<!--<TargetFramework>netstandard2.0</TargetFramework>-->
5+
<!-- List of targets retrieved here: https://docs.microsoft.com/en-us/dotnet/standard/frameworks -->
6+
<!-- ;net403 -->
7+
<TargetFrameworks>netstandard1.0;netstandard1.1;netstandard1.2;netstandard1.3;netstandard1.4;netstandard1.5;netstandard1.6;netstandard2.0;netstandard2.1;net35;net40;net45;net451;net452;net46;net461;net462;net47;net471;net472</TargetFrameworks>
58
</PropertyGroup>
69

10+
<ItemGroup>
11+
<Compile Include="..\GitVersionInfoTest.vb" Link="GitVersionInfoTest.vb" />
12+
</ItemGroup>
13+
714
</Project>

ClassLibrary1/GitVersionInfoGeneratorTests.ShouldCreateFile.old.vb

Lines changed: 0 additions & 51 deletions
This file was deleted.

ClassLibrary2/ClassLibrary2.csproj

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netstandard2.0</TargetFramework>
4+
<!--<TargetFramework>netstandard2.0</TargetFramework>-->
5+
<!-- List of targets retrieved here: https://docs.microsoft.com/en-us/dotnet/standard/frameworks -->
6+
<!-- ;net403 -->
7+
<TargetFrameworks>netstandard1.0;netstandard1.1;netstandard1.2;netstandard1.3;netstandard1.4;netstandard1.5;netstandard1.6;netstandard2.0;netstandard2.1;net35;net40;net45;net451;net452;net46;net461;net462;net47;net471;net472</TargetFrameworks>
58
</PropertyGroup>
69

10+
<ItemGroup>
11+
<Compile Include="..\GitVersionInfoTest.cs" Link="GitVersionInfoTest.cs" />
12+
</ItemGroup>
13+
714
</Project>

ClassLibrary3/Class1.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
namespace ClassLibrary3
22

3-
type Class1() =
3+
type Class1 =
44
static member Add x y = x + y

ClassLibrary3/ClassLibrary3.fsproj

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netstandard2.0</TargetFramework>
4+
<!--<TargetFramework>netstandard2.0</TargetFramework>-->
5+
<!-- List of targets retrieved here: https://docs.microsoft.com/en-us/dotnet/standard/frameworks -->
6+
<!-- netstandard1.0;netstandard1.1;netstandard1.2;netstandard1.3;netstandard1.4;netstandard1.5;netstandard1.6;net35;net40;net403 -->
7+
<TargetFrameworks>netstandard2.0;netstandard2.1;net45;net451;net452;net46;net461;net462;net47;net471;net472</TargetFrameworks>
58
</PropertyGroup>
69

710
<ItemGroup>
11+
<Compile Include="..\GitVersionInfoTest.fs" Link="GitVersionInfoTest.fs" />
812
<Compile Include="*.fs" />
913
</ItemGroup>
1014

15+
<ItemGroup />
16+
1117
<ItemGroup>
1218
<PackageReference Update="FSharp.Core" Version="4.7.2" />
1319
</ItemGroup>

ClassLibrary3/GitVersionInfoGeneratorTests.ShouldCreateFile.old.fs

Lines changed: 0 additions & 63 deletions
This file was deleted.

FSLibWithGitVersion/FSLibWithGitVersion.fsproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</ItemGroup>
1010

1111
<ItemGroup>
12-
<PackageReference Include="GitVersionTask" Version="5.3.5">
12+
<PackageReference Include="GitVersionTask" Version="5.3.6">
1313
<PrivateAssets>all</PrivateAssets>
1414
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1515
</PackageReference>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,30 @@
88
// </auto-generated>
99
//------------------------------------------------------------------------------
1010

11+
#if NET20 || NET35
12+
#define SHOULD_DEFINE_EXCLUDE_FROM_CODE_COVERAGE
13+
#elif NETCOREAPP1_0 || NETCOREAPP1_1
14+
#define SHOULD_DEFINE_EXCLUDE_FROM_CODE_COVERAGE
15+
#elif NETSTANDARD1_0 || NETSTANDARD1_1 || NETSTANDARD1_2 || NETSTANDARD1_3 || NETSTANDARD1_4 || NETSTANDARD1_5 || NETSTANDARD1_6
16+
#define SHOULD_DEFINE_EXCLUDE_FROM_CODE_COVERAGE
17+
#endif
18+
19+
#if SHOULD_DEFINE_EXCLUDE_FROM_CODE_COVERAGE
20+
namespace System.Diagnostics.CodeAnalysis
21+
{
22+
[global::System.AttributeUsage(
23+
global::System.AttributeTargets.Assembly |
24+
global::System.AttributeTargets.Class |
25+
global::System.AttributeTargets.Struct |
26+
global::System.AttributeTargets.Constructor |
27+
global::System.AttributeTargets.Method |
28+
global::System.AttributeTargets.Property |
29+
global::System.AttributeTargets.Event,
30+
Inherited = false, AllowMultiple = false)]
31+
internal sealed class ExcludeFromCodeCoverageAttribute : global::System.Attribute { }
32+
}
33+
#endif
34+
1135
[global::System.Runtime.CompilerServices.CompilerGenerated]
1236
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
1337
static class GitVersionInformation
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,22 @@
88
// </auto-generated>
99
//------------------------------------------------------------------------------
1010

11+
#if NET20 || NET35 || NETCOREAPP1_0 || NETCOREAPP1_1 || NETSTANDARD1_0 || NETSTANDARD1_1 || NETSTANDARD1_2 || NETSTANDARD1_3 || NETSTANDARD1_4 || NETSTANDARD1_5 || NETSTANDARD1_6
12+
namespace System.Diagnostics.CodeAnalysis
13+
14+
[<Sealed>]
15+
[<global.System.AttributeUsage(
16+
global.System.AttributeTargets.Assembly |||
17+
global.System.AttributeTargets.Class |||
18+
global.System.AttributeTargets.Struct |||
19+
global.System.AttributeTargets.Constructor |||
20+
global.System.AttributeTargets.Method |||
21+
global.System.AttributeTargets.Property |||
22+
global.System.AttributeTargets.Event,
23+
Inherited = false, AllowMultiple = false)>]
24+
type ExcludeFromCodeCoverageAttribute() = inherit global.System.Attribute()
25+
#endif
26+
1127
namespace global
1228

1329
[<AbstractClass; Sealed>]
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,32 @@
88
' </auto-generated>
99
'------------------------------------------------------------------------------
1010

11+
#If NET20 OrElse NET35 Then
12+
#Const SHOULD_DEFINE_EXCLUDE_FROM_CODE_COVERAGE = 1
13+
#End If
14+
#If NETCOREAPP1_0 OrElse NETCOREAPP1_1 Then
15+
#Const SHOULD_DEFINE_EXCLUDE_FROM_CODE_COVERAGE = 1
16+
#End If
17+
#If NETSTANDARD1_0 OrElse NETSTANDARD1_1 OrElse NETSTANDARD1_2 OrElse NETSTANDARD1_3 OrElse NETSTANDARD1_4 OrElse NETSTANDARD1_5 OrElse NETSTANDARD1_6 Then
18+
#Const SHOULD_DEFINE_EXCLUDE_FROM_CODE_COVERAGE = 1
19+
#End If
20+
21+
#If SHOULD_DEFINE_EXCLUDE_FROM_CODE_COVERAGE Then
22+
Namespace Global.System.Diagnostics.CodeAnalysis
23+
<Global.System.AttributeUsage(
24+
Global.System.AttributeTargets.Assembly Or
25+
Global.System.AttributeTargets.Class Or
26+
Global.System.AttributeTargets.Struct Or
27+
Global.System.AttributeTargets.Constructor Or
28+
Global.System.AttributeTargets.Method Or
29+
Global.System.AttributeTargets.Property Or
30+
Global.System.AttributeTargets.Event, Inherited:=False, AllowMultiple:=False)>
31+
Friend NotInheritable Class ExcludeFromCodeCoverageAttribute
32+
Inherits Global.System.Attribute
33+
End Class
34+
End Namespace
35+
#End If
36+
1137
Namespace Global
1238

1339
<Global.System.Runtime.CompilerServices.CompilerGenerated()>

GitVersionTests.sln

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,17 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ILMergeTest", "ILMergeTest\
2727
EndProject
2828
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FodyTest", "FodyTest\FodyTest.csproj", "{1EBD1438-27A7-4B71-8B0C-4076FA6DB2F1}"
2929
EndProject
30+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetCoreApp", "NetCoreApp\NetCoreApp.csproj", "{165DEFE6-0861-4BC6-99F7-E691B1081D71}"
31+
EndProject
32+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{827B5FB1-560C-4C3D-968C-D5CF1F1D0BC9}"
33+
ProjectSection(SolutionItems) = preProject
34+
GitVersionInfoTest.cs = GitVersionInfoTest.cs
35+
GitVersionInfoTest.fs = GitVersionInfoTest.fs
36+
GitVersionInfoTest.vb = GitVersionInfoTest.vb
37+
EndProjectSection
38+
EndProject
39+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetStandard10", "NetStandard10\NetStandard10.csproj", "{CEE2779E-67CB-4D89-AF5A-C25B458C1E84}"
40+
EndProject
3041
Global
3142
GlobalSection(SolutionConfigurationPlatforms) = preSolution
3243
Debug|Any CPU = Debug|Any CPU
@@ -81,6 +92,14 @@ Global
8192
{1EBD1438-27A7-4B71-8B0C-4076FA6DB2F1}.Debug|Any CPU.Build.0 = Debug|Any CPU
8293
{1EBD1438-27A7-4B71-8B0C-4076FA6DB2F1}.Release|Any CPU.ActiveCfg = Release|Any CPU
8394
{1EBD1438-27A7-4B71-8B0C-4076FA6DB2F1}.Release|Any CPU.Build.0 = Release|Any CPU
95+
{165DEFE6-0861-4BC6-99F7-E691B1081D71}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
96+
{165DEFE6-0861-4BC6-99F7-E691B1081D71}.Debug|Any CPU.Build.0 = Debug|Any CPU
97+
{165DEFE6-0861-4BC6-99F7-E691B1081D71}.Release|Any CPU.ActiveCfg = Release|Any CPU
98+
{165DEFE6-0861-4BC6-99F7-E691B1081D71}.Release|Any CPU.Build.0 = Release|Any CPU
99+
{CEE2779E-67CB-4D89-AF5A-C25B458C1E84}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
100+
{CEE2779E-67CB-4D89-AF5A-C25B458C1E84}.Debug|Any CPU.Build.0 = Debug|Any CPU
101+
{CEE2779E-67CB-4D89-AF5A-C25B458C1E84}.Release|Any CPU.ActiveCfg = Release|Any CPU
102+
{CEE2779E-67CB-4D89-AF5A-C25B458C1E84}.Release|Any CPU.Build.0 = Release|Any CPU
84103
EndGlobalSection
85104
GlobalSection(SolutionProperties) = preSolution
86105
HideSolutionNode = FALSE

NetCoreApp/NetCoreApp.csproj

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<!--<OutputType>Exe</OutputType>-->
5+
<!--<TargetFrameworks>netcoreapp3.0;netcoreapp3.1</TargetFrameworks>-->
6+
<TargetFrameworks>netcoreapp1.0;netcoreapp1.1;netcoreapp2.0;netcoreapp2.1;netcoreapp2.2;netcoreapp3.0;netcoreapp3.1</TargetFrameworks>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<Compile Include="..\GitVersionInfoTest.cs" Link="GitVersionInfoTest.cs" />
11+
</ItemGroup>
12+
13+
</Project>

NetCoreApp/Program.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using System;
2+
3+
namespace NetCoreApp
4+
{
5+
class Program
6+
{
7+
static void Main(string[] args)
8+
{
9+
Console.WriteLine("Hello World!");
10+
}
11+
}
12+
}

NetStandard10/Class1.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
namespace NetStandard10
2+
{
3+
public class Class1
4+
{
5+
public static int Add(int x, int y) => x + y;
6+
}
7+
}

NetStandard10/NetStandard10.csproj

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>netstandard1.0</TargetFramework>
5+
</PropertyGroup>
6+
7+
<ItemGroup>
8+
<Compile Include="..\GitVersionInfoTest.cs" Link="GitVersionInfoTest.cs" />
9+
</ItemGroup>
10+
11+
</Project>

ReflectionTestsFS/ReflectionTestsFS.fsproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,9 @@
1414
<ProjectReference Include="..\ClassLibrary2\ClassLibrary2.csproj" />
1515
<ProjectReference Include="..\ClassLibrary3\ClassLibrary3.fsproj" />
1616
</ItemGroup>
17+
18+
<ItemGroup>
19+
<PackageReference Update="FSharp.Core" Version="4.7.2" />
20+
</ItemGroup>
1721

1822
</Project>

UnitTests/FakeTest.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@ public void FS_code_test() =>
1919
Assert.Equal(4, ClassLibrary3.Class1.Add(2, 2));
2020

2121
[Fact]
22-
public void FS_code_test2()
23-
{
24-
var instance = new ClassLibrary3.Class1();
25-
Assert.NotNull(instance);
26-
}
22+
public void CS_netstd10_code_test() =>
23+
Assert.Equal(4, NetStandard10.Class1.Add(2, 2));
2724
}
2825
}

UnitTests/UnitTests.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<PropertyGroup>
44
<OutputType>Library</OutputType>
55
<TargetFramework>netcoreapp3.0</TargetFramework>
6+
<!--<TargetFramework>net472</TargetFramework>-->
67
</PropertyGroup>
78

89
<PropertyGroup Condition="'$(Configuration)'=='Debug'">
@@ -34,5 +35,6 @@
3435
<ProjectReference Include="..\ClassLibrary1\ClassLibrary1.vbproj" />
3536
<ProjectReference Include="..\ClassLibrary2\ClassLibrary2.csproj" />
3637
<ProjectReference Include="..\ClassLibrary3\ClassLibrary3.fsproj" />
38+
<ProjectReference Include="..\NetStandard10\NetStandard10.csproj" />
3739
</ItemGroup>
3840
</Project>

VBApp/VBApp.vbproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="GitVersionTask" Version="5.3.5">
10+
<PackageReference Include="GitVersionTask" Version="5.3.6">
1111
<PrivateAssets>all</PrivateAssets>
1212
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1313
</PackageReference>

0 commit comments

Comments
 (0)