Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Target netstandard2.0 and NH 5.1.0 #391

Merged
merged 10 commits into from
Mar 28, 2018
65 changes: 47 additions & 18 deletions build.cake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#addin "Cake.FileHelpers"
#tool "nuget:?package=NUnit.ConsoleRunner&version=3.7.0"
#tool "nuget:?package=NUnit.ConsoleRunner&version=3.8.0"
#tool "nuget:?package=Machine.Specifications.Runner.Console&version=0.9.3"
#tool "nuget:?package=GitReleaseManager&version=0.5.0"
#tool "nuget:?package=GitVersion.CommandLine&version=3.6.2"
Expand Down Expand Up @@ -41,7 +41,7 @@ Teardown((context) =>
});

Task("Clean")
.Does(() =>
.Does(() =>
{
CleanDirectories(parameters.Paths.Directories.ToClean);
CleanProjects("src", SrcProjects);
Expand All @@ -51,7 +51,7 @@ Task("Clean")
EnsureDirectoryExists(parameters.Paths.Directories.ArtifactsBinFullFx);
EnsureDirectoryExists(parameters.Paths.Directories.TestResults);
EnsureDirectoryExists(parameters.Paths.Directories.NugetRoot);
});
});

Task("Restore")
.IsDependentOn("Clean")
Expand All @@ -75,20 +75,35 @@ Task("Build")
Task("Test")
.IsDependentOn("Build")
.Does(() =>
{
var runtime = "net461";
var testAssemblies = $"./src/**/bin/{parameters.Configuration}/{runtime}/*.Testing.dll";
NUnit3(testAssemblies, new NUnit3Settings {
NoResults = true
});
{
var frameworks = new [] { "net461"};
foreach (var framework in frameworks)
{
var testAssemblies = $"./src/**/bin/{parameters.Configuration}/{framework}/*.Testing.dll";
NUnit3(testAssemblies, new NUnit3Settings {
NoResults = true
});

testAssemblies = $"./src/**/bin/{parameters.Configuration}/{runtime}/*.Specs.dll";
MSpec(testAssemblies, new MSpecSettings {
Silent = true
});
testAssemblies = $"./src/**/bin/{parameters.Configuration}/{framework}/*.Specs.dll";
MSpec(testAssemblies, new MSpecSettings {
Silent = true
});
}
/* Tests not working in netcoreapp2.0
foreach(var project in TestProjects)
{
var projectPath = File($"./src/{project}/{project}.csproj");
DotNetCoreTest(projectPath, new DotNetCoreTestSettings
{
Framework = "netcoreapp2.0",
NoBuild = true,
NoRestore = true,
Configuration = parameters.Configuration
});
}
*/
});


Task("Copy-Files")
.IsDependentOn("Test")
.Does(() =>
Expand All @@ -100,6 +115,20 @@ Task("Copy-Files")
parameters.Configuration,
msBuildSettings
);
PublishProjects(
SrcProjects, "netstandard2.0",
parameters.Paths.Directories.ArtifactsBinNetStandard20.FullPath,
parameters.Version.DotNetAsterix,
parameters.Configuration,
msBuildSettings
);
PublishProjects(
SrcProjects, "netcoreapp2.0",
parameters.Paths.Directories.ArtifactsBinNetCoreApp2.FullPath,
parameters.Version.DotNetAsterix,
parameters.Configuration,
msBuildSettings
);

CopyFileToDirectory("./LICENSE", parameters.Paths.Directories.ArtifactsBinFullFx);
});
Expand All @@ -111,7 +140,7 @@ Task("Zip-Files")
Zip(parameters.Paths.Directories.ArtifactsBinFullFx, parameters.Paths.Files.ZipArtifactPathDesktop,
GetFiles($"{parameters.Paths.Directories.ArtifactsBinFullFx.FullPath}/**/*"));
});

Task("Create-NuGet-Packages")
.IsDependentOn("Copy-Files")
.Does(() =>
Expand All @@ -120,7 +149,7 @@ Task("Create-NuGet-Packages")
SrcProjects,
parameters.Paths.Directories.NuspecRoot.FullPath,
parameters.Paths.Directories.NugetRoot.FullPath,
parameters.Paths.Directories.ArtifactsBinFullFx.FullPath,
parameters.Paths.Directories.ArtifactsBin.FullPath,
parameters.Version.SemVersion);
});

Expand Down Expand Up @@ -186,7 +215,7 @@ Task("Update-AppVeyor-BuildNumber")
.WithCriteria(() => parameters.IsRunningOnAppVeyor)
.Does(() =>
{
AppVeyor.UpdateBuildVersion(parameters.Version.SemVersion);
// AppVeyor.UpdateBuildVersion(parameters.Version.SemVersion);
})
.ReportError(exception =>
{
Expand Down Expand Up @@ -249,7 +278,7 @@ private void BuildProjects(
foreach(var project in projectNames)
{
var projectPath = File($"./{projectKind}/{project}/{project}.csproj");
DotNetCoreBuild(projectPath, new DotNetCoreBuildSettings()
DotNetCoreBuild(projectPath.ToString(), new DotNetCoreBuildSettings
{
Configuration = configuration,
MSBuildSettings = msBuildSettings
Expand Down
15 changes: 13 additions & 2 deletions build/paths.cake
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ public class BuildPaths
var artifactsDir = (DirectoryPath)(context.Directory("./artifacts") + context.Directory("v" + semVersion));
var artifactsBinDir = artifactsDir.Combine("bin");
var artifactsBinFullFx = artifactsBinDir.Combine("net461");
var artifactsBinNetStandard20 = artifactsBinDir.Combine("netstandard2.0");
var artifactsBinNetCoreapp2 = artifactsBinDir.Combine("netcoreapp2.0");
var testResultsDir = artifactsDir.Combine("test-results");
var nuspecRoot = (DirectoryPath)"nuspec";
var nugetRoot = artifactsDir.Combine("nuget");
Expand All @@ -37,7 +39,9 @@ public class BuildPaths
nuspecRoot,
nugetRoot,
artifactsBinDir,
artifactsBinFullFx);
artifactsBinFullFx,
artifactsBinNetStandard20,
artifactsBinNetCoreapp2);

// Files
var buildFiles = new BuildFiles(
Expand Down Expand Up @@ -72,6 +76,8 @@ public class BuildDirectories
public DirectoryPath NugetRoot { get; private set; }
public DirectoryPath ArtifactsBin { get; private set; }
public DirectoryPath ArtifactsBinFullFx { get; private set; }
public DirectoryPath ArtifactsBinNetStandard20 { get; private set; }
public DirectoryPath ArtifactsBinNetCoreApp2 { get; private set; }
public ICollection<DirectoryPath> ToClean { get; private set; }

public BuildDirectories(
Expand All @@ -80,14 +86,19 @@ public class BuildDirectories
DirectoryPath nuspecRoot,
DirectoryPath nugetRoot,
DirectoryPath artifactsBinDir,
DirectoryPath artifactsBinFullFx)
DirectoryPath artifactsBinFullFx,
DirectoryPath artifactsBinNetStandard20,
DirectoryPath artifactsBinNetCoreapp2
)
{
Artifacts = artifactsDir;
TestResults = testResultsDir;
NuspecRoot = nuspecRoot;
NugetRoot = nugetRoot;
ArtifactsBin = artifactsBinDir;
ArtifactsBinFullFx = artifactsBinFullFx;
ArtifactsBinNetStandard20 = artifactsBinNetStandard20;
ArtifactsBinNetCoreApp2 = artifactsBinNetCoreapp2;
ToClean = new[] {
Artifacts,
TestResults,
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"projects": [ "src" ],
"sdk": {
"version": "2.0.0"
"version": "2.1.4"
}
}
10 changes: 7 additions & 3 deletions nuspec/FluentNHibernate.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,15 @@
<tags>ORM DAL NHibernate DataBase ADO.Net Mappings Conventions</tags>
<copyright>Copyright (c) James Gregory and contributors (Paul Batum, Hudson Akridge, Gleb Chermennov, Jorge Rodríguez Galán).</copyright>
<dependencies>
<dependency id="NHibernate" version="5.0.3" />
<dependency id="NHibernate" version="5.1.0" />
</dependencies>
</metadata>
<files>
<file src="FluentNHibernate.dll" target="lib/net461" />
<file src="FluentNHibernate.xml" target="lib/net461" />
<file src="net461/FluentNHibernate.dll" target="lib/net461" />
<file src="net461/FluentNHibernate.xml" target="lib/net461" />
<file src="netstandard2.0/FluentNHibernate.dll" target="lib/netstandard2.0" />
<file src="netstandard2.0/FluentNHibernate.xml" target="lib/netstandard2.0" />
<file src="netcoreapp2.0/FluentNHibernate.dll" target="lib/netcoreapp2.0" />
<file src="netcoreapp2.0/FluentNHibernate.xml" target="lib/netcoreapp2.0" />
</files>
</package>
14 changes: 10 additions & 4 deletions nuspec/FluentNHibernate.symbols.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,18 @@
<tags>ORM DAL NHibernate DataBase ADO.Net Mappings Conventions</tags>
<copyright>Copyright (c) James Gregory and contributors (Paul Batum, Hudson Akridge, Gleb Chermennov, Jorge Rodríguez Galán).</copyright>
<dependencies>
<dependency id="NHibernate" version="5.0.3" />
<dependency id="NHibernate" version="5.1.0" />
</dependencies>
</metadata>
<files>
<file src="FluentNHibernate.dll" target="lib/net461" />
<file src="FluentNHibernate.pdb" target="lib/net461" />
<file src="FluentNHibernate.xml" target="lib/net461" />
<file src="net461/FluentNHibernate.dll" target="lib/net461" />
<file src="net461/FluentNHibernate.xml" target="lib/net461" />
<file src="net461/FluentNHibernate.pdb" target="lib/net461" />
<file src="netstandard2.0/FluentNHibernate.dll" target="lib/netstandard2.0" />
<file src="netstandard2.0/FluentNHibernate.xml" target="lib/netstandard2.0" />
<file src="netstandard2.0/FluentNHibernate.pdb" target="lib/netstandard2.0" />
<file src="netcoreapp2.0/FluentNHibernate.dll" target="lib/netcoreapp2.0" />
<file src="netcoreapp2.0/FluentNHibernate.xml" target="lib/netcoreapp2.0" />
<file src="netcoreapp2.0/FluentNHibernate.pdb" target="lib/netcoreapp2.0" />
</files>
</package>
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

<ItemGroup>
<PackageReference Include="EntityFramework" Version="6.2.0" />
<PackageReference Include="NHibernate" Version="5.0.3" />
<PackageReference Include="NHibernate" Version="5.1.0" />
<PackageReference Include="System.Data.SQLite" Version="1.0.106.0" />
<PackageReference Include="System.Data.SQLite.Core" Version="1.0.106.0" />
<PackageReference Include="System.Data.SQLite.EF6" Version="1.0.106.0" />
Expand Down
2 changes: 1 addition & 1 deletion src/Examples.FirstProject/Examples.FirstProject.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

<ItemGroup>
<PackageReference Include="EntityFramework" Version="6.2.0" />
<PackageReference Include="NHibernate" Version="5.0.3" />
<PackageReference Include="NHibernate" Version="5.1.0" />
<PackageReference Include="System.Data.SQLite" Version="1.0.106.0" />
<PackageReference Include="System.Data.SQLite.Core" Version="1.0.106.0" />
<PackageReference Include="System.Data.SQLite.EF6" Version="1.0.106.0" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net461</TargetFramework>
<TargetFrameworks>net461;netcoreapp2.0</TargetFrameworks>
<NoWarn>1591</NoWarn>
<PlatformTarget>AnyCpu</PlatformTarget>
</PropertyGroup>
Expand All @@ -15,14 +15,12 @@
<ProjectReference Include="..\FluentNHibernate\FluentNHibernate.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="NHibernate" Version="5.0.3" />
<ItemGroup Condition="'$(TargetFramework)' == 'net461'">
<PackageReference Include="NHibernate" Version="5.1.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net461' ">
<Reference Include="System.Configuration" />
<Reference Include="System.ServiceModel" />
<Reference Include="System.Transactions" />
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.0'">
<PackageReference Include="NHibernate" Version="5.1.0" />
</ItemGroup>

</Project>
31 changes: 19 additions & 12 deletions src/FluentNHibernate.Specs/FluentNHibernate.Specs.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net461</TargetFramework>
<TargetFrameworks>net461;netcoreapp2.0</TargetFrameworks>
<NoWarn>1591</NoWarn>
<PlatformTarget>AnyCpu</PlatformTarget>
<DebugType Condition="'$(TargetFramework)' != '' AND '$(TargetFramework)' != 'netcoreapp1.0'">Full</DebugType>
<DebugType Condition="'$(TargetFramework)' != '' AND '$(TargetFramework)' != 'netcoreapp2.0'">Full</DebugType>
</PropertyGroup>

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

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="4.19.4" />
<PackageReference Include="Machine.Specifications" Version="0.12.0" />
<PackageReference Include="Machine.Specifications.Runner.Console" Version="0.9.3" />
<PackageReference Include="Machine.Specifications.Runner.VisualStudio" Version="2.5.2" />
<PackageReference Include="Mono.Cecil" Version="0.9.6.1" />
<PackageReference Include="NHibernate" Version="5.0.3" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net461' ">
<ItemGroup Condition="'$(TargetFramework)' == 'net461'">
<Reference Include="System.Configuration" />
<Reference Include="System.Runtime.Remoting" />
<Reference Include="System.ServiceModel" />
<Reference Include="System.Transactions" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Xml.Serialization" />
<PackageReference Include="NHibernate" Version="5.1.0" />
<PackageReference Include="FluentAssertions" Version="4.19.4" />
<PackageReference Include="Machine.Specifications" Version="0.12.0" />
<PackageReference Include="Machine.Specifications.Runner.Console" Version="0.9.3" />
<PackageReference Include="Machine.Specifications.Runner.VisualStudio" Version="2.5.2" />
<PackageReference Include="Mono.Cecil" Version="0.9.6.1" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.0'">
<PackageReference Include="NHibernate" Version="5.1.0" />
<PackageReference Include="FluentAssertions" Version="4.19.4" />
<PackageReference Include="Machine.Specifications" Version="0.12.0" />
<PackageReference Include="Machine.Specifications.Runner.Console" Version="0.9.3" />
<PackageReference Include="Machine.Specifications.Runner.VisualStudio" Version="2.5.2" />
</ItemGroup>



<ItemGroup>
<Compile Include="..\CommonAssemblyInfo.cs">
Expand Down
1 change: 0 additions & 1 deletion src/FluentNHibernate.Testing/AutoMapping/TestFixtures.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using System;
using System.Data;
using System.Drawing;
using System.IO;
using FluentNHibernate.Automapping.TestFixtures.ComponentTypes;
using FluentNHibernate.Automapping.TestFixtures.CustomCompositeTypes;
using FluentNHibernate.Automapping.TestFixtures.CustomTypes;
Expand Down
36 changes: 24 additions & 12 deletions src/FluentNHibernate.Testing/FluentNHibernate.Testing.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net461</TargetFramework>
<TargetFrameworks>net461;netcoreapp2.0</TargetFrameworks>
<NoWarn>1591</NoWarn>
<PlatformTarget>AnyCpu</PlatformTarget>
<DebugType Condition="'$(TargetFramework)' != '' AND '$(TargetFramework)' != 'netcoreapp1.0'">Full</DebugType>
Expand All @@ -22,26 +22,38 @@
<ProjectReference Include="..\FluentNHibernate\FluentNHibernate.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="FakeItEasy" Version="4.3.0" />
<PackageReference Include="Machine.Specifications" Version="0.12.0" />
<PackageReference Include="NHibernate" Version="5.0.3" />
<PackageReference Include="NUnit" Version="3.9.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.9.0" />
<PackageReference Include="System.Data.SQLite" Version="1.0.106" />
<PackageReference Include="System.Data.SQLite.EF6" Version="1.0.106" />
<PackageReference Include="System.Data.SQLite.Linq" Version="1.0.106" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net461' ">
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Configuration" />
<Reference Include="System.Runtime.Remoting" />
<Reference Include="System.ServiceModel" />
<Reference Include="System.Transactions" />
<Reference Include="System.Xml.Serialization" />
<PackageReference Include="FakeItEasy" Version="4.3.0" />
<PackageReference Include="Machine.Specifications" Version="0.12.0" />
<PackageReference Include="NHibernate" Version="5.1.0" />
<PackageReference Include="NUnit" Version="3.10.1" />
<PackageReference Include="NUnit3TestAdapter" Version="3.10.0" />
<PackageReference Include="System.Data.SQLite" Version="1.0.106" />
<PackageReference Include="System.Data.SQLite.EF6" Version="1.0.106" />
<PackageReference Include="System.Data.SQLite.Linq" Version="1.0.106" />

</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.0' ">
<PackageReference Include="FakeItEasy" Version="4.3.0" />
<PackageReference Include="Machine.Specifications" Version="0.12.0" />
<PackageReference Include="NHibernate" Version="5.1.0" />
<PackageReference Include="NUnit" Version="3.10.1" />
<PackageReference Include="NUnit3TestAdapter" Version="3.10.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.6.1" />
<PackageReference Include="System.Data.SQLite" Version="1.0.106" />
<PackageReference Include="System.Data.SQLite.EF6" Version="1.0.106" />
<PackageReference Include="System.Data.SQLite.Linq" Version="1.0.106" />
<PackageReference Include="System.Drawing.Common" Version="4.5.0-preview1-26216-02" />
</ItemGroup>


<ItemGroup>
<Compile Include="..\CommonAssemblyInfo.cs">
<Link>Properties\CommonAssemblyInfo.cs</Link>
Expand Down
Loading