Skip to content

Commit 1f95680

Browse files
vincentparrettjrgcubano
authored andcommitted
Target netstandard2.0 and NH 5.1.0 (#391)
* Target netcore2.0 and NH 5.1.0 * Updated dotnetcore sdk to 2.1.4 * Updated test projects to NH 5.1.0 * Reference NH 5.1.0 for net461 * Updated examples to NH 5.1.0 * Commented out appveyor build number update as it's broken * Added netstandard2.0 and netcoreapp2 to test projects * Update build process and nuspec to include netstandard2.0 and netcoreapp2 * Changed netcoreapp2 to netcoreapp2.0 * Updated shared.msbuild, changed netcoreapp2 to netcoreapp2.0
1 parent c5ffaa6 commit 1f95680

File tree

13 files changed

+161
-71
lines changed

13 files changed

+161
-71
lines changed

build.cake

Lines changed: 47 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#addin "Cake.FileHelpers"
2-
#tool "nuget:?package=NUnit.ConsoleRunner&version=3.7.0"
2+
#tool "nuget:?package=NUnit.ConsoleRunner&version=3.8.0"
33
#tool "nuget:?package=Machine.Specifications.Runner.Console&version=0.9.3"
44
#tool "nuget:?package=GitReleaseManager&version=0.5.0"
55
#tool "nuget:?package=GitVersion.CommandLine&version=3.6.2"
@@ -41,7 +41,7 @@ Teardown((context) =>
4141
});
4242

4343
Task("Clean")
44-
.Does(() =>
44+
.Does(() =>
4545
{
4646
CleanDirectories(parameters.Paths.Directories.ToClean);
4747
CleanProjects("src", SrcProjects);
@@ -51,7 +51,7 @@ Task("Clean")
5151
EnsureDirectoryExists(parameters.Paths.Directories.ArtifactsBinFullFx);
5252
EnsureDirectoryExists(parameters.Paths.Directories.TestResults);
5353
EnsureDirectoryExists(parameters.Paths.Directories.NugetRoot);
54-
});
54+
});
5555

5656
Task("Restore")
5757
.IsDependentOn("Clean")
@@ -75,20 +75,35 @@ Task("Build")
7575
Task("Test")
7676
.IsDependentOn("Build")
7777
.Does(() =>
78-
{
79-
var runtime = "net461";
80-
var testAssemblies = $"./src/**/bin/{parameters.Configuration}/{runtime}/*.Testing.dll";
81-
NUnit3(testAssemblies, new NUnit3Settings {
82-
NoResults = true
83-
});
78+
{
79+
var frameworks = new [] { "net461"};
80+
foreach (var framework in frameworks)
81+
{
82+
var testAssemblies = $"./src/**/bin/{parameters.Configuration}/{framework}/*.Testing.dll";
83+
NUnit3(testAssemblies, new NUnit3Settings {
84+
NoResults = true
85+
});
8486

85-
testAssemblies = $"./src/**/bin/{parameters.Configuration}/{runtime}/*.Specs.dll";
86-
MSpec(testAssemblies, new MSpecSettings {
87-
Silent = true
88-
});
87+
testAssemblies = $"./src/**/bin/{parameters.Configuration}/{framework}/*.Specs.dll";
88+
MSpec(testAssemblies, new MSpecSettings {
89+
Silent = true
90+
});
91+
}
92+
/* Tests not working in netcoreapp2.0
93+
foreach(var project in TestProjects)
94+
{
95+
var projectPath = File($"./src/{project}/{project}.csproj");
96+
DotNetCoreTest(projectPath, new DotNetCoreTestSettings
97+
{
98+
Framework = "netcoreapp2.0",
99+
NoBuild = true,
100+
NoRestore = true,
101+
Configuration = parameters.Configuration
102+
});
103+
}
104+
*/
89105
});
90106

91-
92107
Task("Copy-Files")
93108
.IsDependentOn("Test")
94109
.Does(() =>
@@ -100,6 +115,20 @@ Task("Copy-Files")
100115
parameters.Configuration,
101116
msBuildSettings
102117
);
118+
PublishProjects(
119+
SrcProjects, "netstandard2.0",
120+
parameters.Paths.Directories.ArtifactsBinNetStandard20.FullPath,
121+
parameters.Version.DotNetAsterix,
122+
parameters.Configuration,
123+
msBuildSettings
124+
);
125+
PublishProjects(
126+
SrcProjects, "netcoreapp2.0",
127+
parameters.Paths.Directories.ArtifactsBinNetCoreApp2.FullPath,
128+
parameters.Version.DotNetAsterix,
129+
parameters.Configuration,
130+
msBuildSettings
131+
);
103132

104133
CopyFileToDirectory("./LICENSE", parameters.Paths.Directories.ArtifactsBinFullFx);
105134
});
@@ -111,7 +140,7 @@ Task("Zip-Files")
111140
Zip(parameters.Paths.Directories.ArtifactsBinFullFx, parameters.Paths.Files.ZipArtifactPathDesktop,
112141
GetFiles($"{parameters.Paths.Directories.ArtifactsBinFullFx.FullPath}/**/*"));
113142
});
114-
143+
115144
Task("Create-NuGet-Packages")
116145
.IsDependentOn("Copy-Files")
117146
.Does(() =>
@@ -120,7 +149,7 @@ Task("Create-NuGet-Packages")
120149
SrcProjects,
121150
parameters.Paths.Directories.NuspecRoot.FullPath,
122151
parameters.Paths.Directories.NugetRoot.FullPath,
123-
parameters.Paths.Directories.ArtifactsBinFullFx.FullPath,
152+
parameters.Paths.Directories.ArtifactsBin.FullPath,
124153
parameters.Version.SemVersion);
125154
});
126155

@@ -186,7 +215,7 @@ Task("Update-AppVeyor-BuildNumber")
186215
.WithCriteria(() => parameters.IsRunningOnAppVeyor)
187216
.Does(() =>
188217
{
189-
AppVeyor.UpdateBuildVersion(parameters.Version.SemVersion);
218+
// AppVeyor.UpdateBuildVersion(parameters.Version.SemVersion);
190219
})
191220
.ReportError(exception =>
192221
{
@@ -249,7 +278,7 @@ private void BuildProjects(
249278
foreach(var project in projectNames)
250279
{
251280
var projectPath = File($"./{projectKind}/{project}/{project}.csproj");
252-
DotNetCoreBuild(projectPath, new DotNetCoreBuildSettings()
281+
DotNetCoreBuild(projectPath.ToString(), new DotNetCoreBuildSettings
253282
{
254283
Configuration = configuration,
255284
MSBuildSettings = msBuildSettings

build/paths.cake

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ public class BuildPaths
2424
var artifactsDir = (DirectoryPath)(context.Directory("./artifacts") + context.Directory("v" + semVersion));
2525
var artifactsBinDir = artifactsDir.Combine("bin");
2626
var artifactsBinFullFx = artifactsBinDir.Combine("net461");
27+
var artifactsBinNetStandard20 = artifactsBinDir.Combine("netstandard2.0");
28+
var artifactsBinNetCoreapp2 = artifactsBinDir.Combine("netcoreapp2.0");
2729
var testResultsDir = artifactsDir.Combine("test-results");
2830
var nuspecRoot = (DirectoryPath)"nuspec";
2931
var nugetRoot = artifactsDir.Combine("nuget");
@@ -37,7 +39,9 @@ public class BuildPaths
3739
nuspecRoot,
3840
nugetRoot,
3941
artifactsBinDir,
40-
artifactsBinFullFx);
42+
artifactsBinFullFx,
43+
artifactsBinNetStandard20,
44+
artifactsBinNetCoreapp2);
4145

4246
// Files
4347
var buildFiles = new BuildFiles(
@@ -72,6 +76,8 @@ public class BuildDirectories
7276
public DirectoryPath NugetRoot { get; private set; }
7377
public DirectoryPath ArtifactsBin { get; private set; }
7478
public DirectoryPath ArtifactsBinFullFx { get; private set; }
79+
public DirectoryPath ArtifactsBinNetStandard20 { get; private set; }
80+
public DirectoryPath ArtifactsBinNetCoreApp2 { get; private set; }
7581
public ICollection<DirectoryPath> ToClean { get; private set; }
7682

7783
public BuildDirectories(
@@ -80,14 +86,19 @@ public class BuildDirectories
8086
DirectoryPath nuspecRoot,
8187
DirectoryPath nugetRoot,
8288
DirectoryPath artifactsBinDir,
83-
DirectoryPath artifactsBinFullFx)
89+
DirectoryPath artifactsBinFullFx,
90+
DirectoryPath artifactsBinNetStandard20,
91+
DirectoryPath artifactsBinNetCoreapp2
92+
)
8493
{
8594
Artifacts = artifactsDir;
8695
TestResults = testResultsDir;
8796
NuspecRoot = nuspecRoot;
8897
NugetRoot = nugetRoot;
8998
ArtifactsBin = artifactsBinDir;
9099
ArtifactsBinFullFx = artifactsBinFullFx;
100+
ArtifactsBinNetStandard20 = artifactsBinNetStandard20;
101+
ArtifactsBinNetCoreApp2 = artifactsBinNetCoreapp2;
91102
ToClean = new[] {
92103
Artifacts,
93104
TestResults,

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"projects": [ "src" ],
33
"sdk": {
4-
"version": "2.0.0"
4+
"version": "2.1.4"
55
}
66
}

nuspec/FluentNHibernate.nuspec

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,15 @@
1515
<tags>ORM DAL NHibernate DataBase ADO.Net Mappings Conventions</tags>
1616
<copyright>Copyright (c) James Gregory and contributors (Paul Batum, Hudson Akridge, Gleb Chermennov, Jorge Rodríguez Galán).</copyright>
1717
<dependencies>
18-
<dependency id="NHibernate" version="5.0.3" />
18+
<dependency id="NHibernate" version="5.1.0" />
1919
</dependencies>
2020
</metadata>
2121
<files>
22-
<file src="FluentNHibernate.dll" target="lib/net461" />
23-
<file src="FluentNHibernate.xml" target="lib/net461" />
22+
<file src="net461/FluentNHibernate.dll" target="lib/net461" />
23+
<file src="net461/FluentNHibernate.xml" target="lib/net461" />
24+
<file src="netstandard2.0/FluentNHibernate.dll" target="lib/netstandard2.0" />
25+
<file src="netstandard2.0/FluentNHibernate.xml" target="lib/netstandard2.0" />
26+
<file src="netcoreapp2.0/FluentNHibernate.dll" target="lib/netcoreapp2.0" />
27+
<file src="netcoreapp2.0/FluentNHibernate.xml" target="lib/netcoreapp2.0" />
2428
</files>
2529
</package>

nuspec/FluentNHibernate.symbols.nuspec

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,18 @@
1515
<tags>ORM DAL NHibernate DataBase ADO.Net Mappings Conventions</tags>
1616
<copyright>Copyright (c) James Gregory and contributors (Paul Batum, Hudson Akridge, Gleb Chermennov, Jorge Rodríguez Galán).</copyright>
1717
<dependencies>
18-
<dependency id="NHibernate" version="5.0.3" />
18+
<dependency id="NHibernate" version="5.1.0" />
1919
</dependencies>
2020
</metadata>
2121
<files>
22-
<file src="FluentNHibernate.dll" target="lib/net461" />
23-
<file src="FluentNHibernate.pdb" target="lib/net461" />
24-
<file src="FluentNHibernate.xml" target="lib/net461" />
22+
<file src="net461/FluentNHibernate.dll" target="lib/net461" />
23+
<file src="net461/FluentNHibernate.xml" target="lib/net461" />
24+
<file src="net461/FluentNHibernate.pdb" target="lib/net461" />
25+
<file src="netstandard2.0/FluentNHibernate.dll" target="lib/netstandard2.0" />
26+
<file src="netstandard2.0/FluentNHibernate.xml" target="lib/netstandard2.0" />
27+
<file src="netstandard2.0/FluentNHibernate.pdb" target="lib/netstandard2.0" />
28+
<file src="netcoreapp2.0/FluentNHibernate.dll" target="lib/netcoreapp2.0" />
29+
<file src="netcoreapp2.0/FluentNHibernate.xml" target="lib/netcoreapp2.0" />
30+
<file src="netcoreapp2.0/FluentNHibernate.pdb" target="lib/netcoreapp2.0" />
2531
</files>
2632
</package>

src/Examples.FirstAutomappedProject/Examples.FirstAutomappedProject.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
<ItemGroup>
1717
<PackageReference Include="EntityFramework" Version="6.2.0" />
18-
<PackageReference Include="NHibernate" Version="5.0.3" />
18+
<PackageReference Include="NHibernate" Version="5.1.0" />
1919
<PackageReference Include="System.Data.SQLite" Version="1.0.106.0" />
2020
<PackageReference Include="System.Data.SQLite.Core" Version="1.0.106.0" />
2121
<PackageReference Include="System.Data.SQLite.EF6" Version="1.0.106.0" />

src/Examples.FirstProject/Examples.FirstProject.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
<ItemGroup>
1717
<PackageReference Include="EntityFramework" Version="6.2.0" />
18-
<PackageReference Include="NHibernate" Version="5.0.3" />
18+
<PackageReference Include="NHibernate" Version="5.1.0" />
1919
<PackageReference Include="System.Data.SQLite" Version="1.0.106.0" />
2020
<PackageReference Include="System.Data.SQLite.Core" Version="1.0.106.0" />
2121
<PackageReference Include="System.Data.SQLite.EF6" Version="1.0.106.0" />
Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>net461</TargetFramework>
3+
<TargetFrameworks>net461;netcoreapp2.0</TargetFrameworks>
44
<NoWarn>1591</NoWarn>
55
<PlatformTarget>AnyCpu</PlatformTarget>
66
</PropertyGroup>
@@ -15,14 +15,12 @@
1515
<ProjectReference Include="..\FluentNHibernate\FluentNHibernate.csproj" />
1616
</ItemGroup>
1717

18-
<ItemGroup>
19-
<PackageReference Include="NHibernate" Version="5.0.3" />
18+
<ItemGroup Condition="'$(TargetFramework)' == 'net461'">
19+
<PackageReference Include="NHibernate" Version="5.1.0" />
2020
</ItemGroup>
2121

22-
<ItemGroup Condition=" '$(TargetFramework)' == 'net461' ">
23-
<Reference Include="System.Configuration" />
24-
<Reference Include="System.ServiceModel" />
25-
<Reference Include="System.Transactions" />
22+
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.0'">
23+
<PackageReference Include="NHibernate" Version="5.1.0" />
2624
</ItemGroup>
2725

2826
</Project>

src/FluentNHibernate.Specs/FluentNHibernate.Specs.csproj

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

33
<PropertyGroup>
4-
<TargetFramework>net461</TargetFramework>
4+
<TargetFrameworks>net461;netcoreapp2.0</TargetFrameworks>
55
<NoWarn>1591</NoWarn>
66
<PlatformTarget>AnyCpu</PlatformTarget>
7-
<DebugType Condition="'$(TargetFramework)' != '' AND '$(TargetFramework)' != 'netcoreapp1.0'">Full</DebugType>
7+
<DebugType Condition="'$(TargetFramework)' != '' AND '$(TargetFramework)' != 'netcoreapp2.0'">Full</DebugType>
88
</PropertyGroup>
99

1010
<Import Project="$(MSBuildThisFileDirectory)..\Shared.msbuild" />
@@ -14,23 +14,30 @@
1414
<ProjectReference Include="..\FluentNHibernate\FluentNHibernate.csproj" />
1515
</ItemGroup>
1616

17-
<ItemGroup>
18-
<PackageReference Include="FluentAssertions" Version="4.19.4" />
19-
<PackageReference Include="Machine.Specifications" Version="0.12.0" />
20-
<PackageReference Include="Machine.Specifications.Runner.Console" Version="0.9.3" />
21-
<PackageReference Include="Machine.Specifications.Runner.VisualStudio" Version="2.5.2" />
22-
<PackageReference Include="Mono.Cecil" Version="0.9.6.1" />
23-
<PackageReference Include="NHibernate" Version="5.0.3" />
24-
</ItemGroup>
25-
26-
<ItemGroup Condition=" '$(TargetFramework)' == 'net461' ">
17+
<ItemGroup Condition="'$(TargetFramework)' == 'net461'">
2718
<Reference Include="System.Configuration" />
2819
<Reference Include="System.Runtime.Remoting" />
2920
<Reference Include="System.ServiceModel" />
3021
<Reference Include="System.Transactions" />
3122
<Reference Include="System.Data.DataSetExtensions" />
3223
<Reference Include="System.Xml.Serialization" />
24+
<PackageReference Include="NHibernate" Version="5.1.0" />
25+
<PackageReference Include="FluentAssertions" Version="4.19.4" />
26+
<PackageReference Include="Machine.Specifications" Version="0.12.0" />
27+
<PackageReference Include="Machine.Specifications.Runner.Console" Version="0.9.3" />
28+
<PackageReference Include="Machine.Specifications.Runner.VisualStudio" Version="2.5.2" />
29+
<PackageReference Include="Mono.Cecil" Version="0.9.6.1" />
30+
</ItemGroup>
31+
32+
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.0'">
33+
<PackageReference Include="NHibernate" Version="5.1.0" />
34+
<PackageReference Include="FluentAssertions" Version="4.19.4" />
35+
<PackageReference Include="Machine.Specifications" Version="0.12.0" />
36+
<PackageReference Include="Machine.Specifications.Runner.Console" Version="0.9.3" />
37+
<PackageReference Include="Machine.Specifications.Runner.VisualStudio" Version="2.5.2" />
3338
</ItemGroup>
39+
40+
3441

3542
<ItemGroup>
3643
<Compile Include="..\CommonAssemblyInfo.cs">

src/FluentNHibernate.Testing/AutoMapping/TestFixtures.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
using System;
44
using System.Data;
55
using System.Drawing;
6-
using System.IO;
76
using FluentNHibernate.Automapping.TestFixtures.ComponentTypes;
87
using FluentNHibernate.Automapping.TestFixtures.CustomCompositeTypes;
98
using FluentNHibernate.Automapping.TestFixtures.CustomTypes;

0 commit comments

Comments
 (0)