Skip to content

.NET Core 2.0 and .NET Standard 2.0 support #1523

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

Merged
merged 5 commits into from
Feb 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
language: csharp
mono: none
dotnet: 2.1.2
sudo: required
services:
- mysql
- postgresql
- docker
env:
- DB=SqlServer2008 CONNECTION_STRING="Server=localhost;initial catalog=nhibernate;User Id=sa;Password=P@ssw0rd;"
- DB=PostgreSQL CONNECTION_STRING="Host=localhost;Port=5432;Username=postgres;Database=nhibernate;Enlist=true;"
- DB=Firebird
- DB=MySQL CONNECTION_STRING="Server=127.0.0.1;Uid=root;Database=nhibernate;Old Guids=True;"
matrix:
allow_failures:
- env: DB=MySQL CONNECTION_STRING="Server=127.0.0.1;Uid=root;Database=nhibernate;Old Guids=True;"
before_install:
- curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
- curl https://packages.microsoft.com/config/ubuntu/14.04/prod.list | sudo tee /etc/apt/sources.list.d/microsoft.list
- sudo apt-get update -qq
- sudo apt-get install -y powershell
- |-
if [[ "$DB" == "MySQL" ]]
then
echo -e '[server]\nlower_case_table_names=1' | sudo tee -a /etc/mysql/my.cnf
sudo service mysql restart
fi
- |-
if [[ "$DB" == "Firebird" ]]
then
sudo apt-get install -y libicu-dev libtommath-dev curl
curl -L -O https://github.com/FirebirdSQL/firebird/releases/download/R3_0_3/Firebird-3.0.3.32900-0.amd64.tar.gz
tar xzvf Firebird-3.0.3.32900-0.amd64.tar.gz
pushd Firebird-3.0.3.32900-0.amd64
sudo ./install.sh -silent
popd
export $(sudo cat /opt/firebird/SYSDBA.password | grep -v ^# | xargs)
sudo chmod 775 /tmp/firebird
echo -e "nhibernate = /tmp/firebird/nhibernate.fdb" | sudo tee -a /opt/firebird/databases.conf
echo -e "AuthServer = Srp\nAuthClient = Srp\nUserManager = Srp\nWireCrypt = Enabled" | sudo tee -a /opt/firebird/firebird.conf
sudo /opt/firebird/bin/gsec -modify SYSDBA -pw masterkey -admin yes
sudo service firebird restart
fi
before_script:
- if [[ "$DB" == "SqlServer2008" ]]; then docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=P@ssw0rd" -e "MSSQL_PID=Express" -p 1433:1433 -d --name sqlexpress microsoft/mssql-server-linux:latest; fi
- if [[ "$DB" == "PostgreSQL" ]]; then psql -c "CREATE DATABASE nhibernate;" -U postgres; fi
- if [[ "$DB" == "MySQL" ]]; then mysql -e "CREATE DATABASE IF NOT EXISTS nhibernate;"; fi
script:
- pwsh -noprofile -command "& ./build.ps1 -TaskList Set-Configuration,Test -properties @{\"Database\" = \"$DB\";\"ConnectionString\"=\"$CONNECTION_STRING\"}"
2 changes: 1 addition & 1 deletion Tools/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
<package id="NUnit.Extension.NUnitV2ResultWriter" version="3.6.0" targetFramework="net461" />
<package id="NUnit.Extension.TeamCityEventListener" version="1.0.2" targetFramework="net461" />
<package id="NUnit.Extension.VSProjectLoader" version="3.6.0" targetFramework="net461" />
<package id="CSharpAsyncGenerator.CommandLine" version="0.8.1" targetFramework="net461" />
<package id="CSharpAsyncGenerator.CommandLine" version="0.8.2" targetFramework="net461" />
<package id="vswhere" version="2.1.4" targetFramework="net461" />
</packages>
66 changes: 66 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
version: 5.1.0.{build}
image: Visual Studio 2017
environment:
matrix:
- DB: SqlServer2008
CONNECTION_STRING: Server=(local)\SQL2017;User ID=sa;Password=Password12!;initial catalog=nhibernate;
- DB: PostgreSQL
CONNECTION_STRING: Host=localhost;Port=5432;Username=postgres;Password=Password12!;Database=nhibernate;Enlist=true;
- DB: Firebird
- DB: MySQL
CONNECTION_STRING: Server=127.0.0.1;Uid=root;Pwd=Password12!;Database=nhibernate;Old Guids=True;
init:
# Required for having windows endlines in sources zip
- git config --global core.autocrlf true
matrix:
allow_failures:
- DB: MySQL
build: off
before_test:
- ps: |-
switch ($env:DB) {
'Firebird' {
$FireBirdPath = 'C:\firebird'
# Install Firebird
New-Item -ItemType Directory -Force $FireBirdPath > $null
Push-Location $FireBirdPath
Invoke-WebRequest 'https://github.com/FirebirdSQL/firebird/releases/download/R3_0_3/Firebird-3.0.3.32900-0_x64.zip' -OutFile firebird.zip
Unblock-File firebird.zip
7z x firebird.zip
New-Item -ItemType Directory -Force Data
# Declare nhibernate db
Add-Content -Path '.\databases.conf' -Value "`r`nnhibernate = $FireBirdPath\Data\nhibernate.fdb"
# Minimal db settings
Add-Content -Path '.\firebird.conf' -Value "`r`nAuthServer = Srp`r`nAuthClient = Srp`r`nUserManager = Srp`r`nWireCrypt = Enabled"
# Create SYSDBA account
New-Item SYSDBA.sql -Type File
Add-Content -Path '.\SYSDBA.sql' -Value "CREATE USER SYSDBA PASSWORD 'masterkey';`r`nCOMMIT;`r`nQUIT;"
.\isql -user sysdba employee -input SYSDBA.sql
# Start Firebird
.\firebird.exe -a
Pop-Location
}
'MySQL' {
Start-Service 'MySQL57'
# Create nhibernate database (not handled by NHibernate.TestDatabaseSetup.dll)
$env:MYSQL_PWD = 'Password12!'
& 'C:\Program Files\MySQL\MySQL Server 5.7\bin\mysql' -e 'CREATE DATABASE nhibernate;' --user=root
}
'Odbc' { Start-Service 'MSSQL$SQL2017' }
'PostgreSQL' {
# Enable prepared transactions
Add-Content -Path 'C:\Program Files\PostgreSQL\10\data\postgresql.conf' -Value "`r`nmax_prepared_transactions = 100"
Start-Service 'postgresql-x64-10'
}
'SqlServer2008' { Start-Service 'MSSQL$SQL2017' }
'SqlServer2012' { Start-Service 'MSSQL$SQL2017' }
}
test_script:
- cmd: powershell -noprofile -command "& ./build.ps1 -TaskList Set-Configuration,Test -properties @{\"Database\" = \"%DB%\";\"ConnectionString\"=\"%CONNECTION_STRING%\"}"
deploy: off
on_finish:
- ps: |-
$wc = New-Object 'System.Net.WebClient'
Get-Item '*-TestResult.xml' | ForEach-Object {
$wc.UploadFile("https://ci.appveyor.com/api/testresults/nunit3/$($env:APPVEYOR_JOB_ID)", $_)
}
2 changes: 2 additions & 0 deletions build-common/NHibernate.props
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,7 @@

<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<TreatSpecificWarningsAsErrors />

<DisableImplicitPackageTargetFallback>True</DisableImplicitPackageTargetFallback>
</PropertyGroup>
</Project>
11 changes: 3 additions & 8 deletions build-common/common.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@
<property name="vshik.installed" value="false" overwrite="false" />
<property name="vshik.path" value="${environment::get-folder-path('ProgramFiles')}/Microsoft Help 2.0 SDK" />

<!--
if nunit2report tasks from http://nunit2report.sourceforge.net/ has been installed
then change this to true. It generates a nice looking html report for the test files
-->
<property name="nunit2report.installed" value="false" overwrite="false" />

<!-- Path to the folder that contain the external assemblies -->
<property name="lib.dir" value="lib" dynamic="true" />

Expand All @@ -29,10 +23,11 @@
<property name="project.config" value="debug" overwrite="false" />
<property name="build.name" value="NHibernate-${project.version}" if="${project.config == 'release'}"/>
<property name="build.name" value="NHibernate-${project.version}-${project.config}" unless="${project.config == 'release'}" />
<property name="build.config" value="Release" if="${project.config == 'release'}"/>
<property name="build.config" value="Debug" unless="${project.config == 'release'}" />
<property name="build.root.dir" value="${root.dir}/build/${build.name}" />
<property name="build.dir" value="${build.root.dir}" />
<property name="bin.dir" value="${build.dir}/bin" />
<property name="testresults.dir" value="${bin.dir}/test-results" />
<property name="testresults.dir" value="${build.dir}/bin/test-results" />
<property name="tools.dir" value="${root.dir}/Tools"/>
</target>

Expand Down
9 changes: 9 additions & 0 deletions build.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
param (
$TaskList = 'Default',
[hashtable]$Properties = @{}
)

Install-Module psake -Force -Scope CurrentUser
Import-Module psake
Invoke-psake -buildFile .\psake.ps1 -nologo -taskList $TaskList -properties $Properties
exit ( [int] ( -not $psake.build_success ) )
69 changes: 28 additions & 41 deletions default.build
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
<target name="init" depends="common.init" description="Initializes build properties" />

<target name="prepare-build-directory" depends="init">
<mkdir dir="${bin.dir}" />
<mkdir dir="${testresults.dir}" />
</target>

Expand All @@ -33,10 +32,8 @@
<exec program="dotnet" verbose="true">
<arg value="msbuild" />
<arg value="${root.dir}/src/NHibernate.sln" />
<arg value="/p:OutputPath=&quot;${path::get-full-path(bin.dir)}&quot;" />
<arg value="/p:Platform=&quot;Any CPU&quot;" />
<arg value="/p:Configuration=&quot;Debug&quot;" if="${project.config == 'debug'}" />
<arg value="/p:Configuration=&quot;Release&quot;" if="${project.config == 'release'}" />
<arg value="/p:Configuration=&quot;${build.config}&quot;"/>
<arg value="/p:GeneratePackageOnBuild=&quot;True&quot;" />
<arg value="/p:IncludeSymbols=&quot;True&quot;" />
<arg value="/p:IncludeSource=&quot;True&quot;" />
Expand Down Expand Up @@ -76,15 +73,6 @@
program="${async-generator-console}" />
</target>

<target name="test-report" if="${nunit2report.installed}">
<mkdir dir="${build.dir}/testresults" />
<nunit2report out="${build.dir}/testresults/index.html" format="Frames" todir="${build.dir}/testresults">
<fileset>
<include name="${bin.dir}/*results.xml" />
</fileset>
</nunit2report>
</target>

<target name="put-connection-settings-into-defined-app-config">

<!-- make sure the config file is writable -->
Expand Down Expand Up @@ -156,7 +144,7 @@
</target>

<target name="put-connection-settings-into-app-config">
<property name="app.config" value="${bin.dir}/${test.file}.dll.config" />
<property name="app.config" value="src/${test.file}/bin/${build.config}/net461/${test.file}.dll.config" />
<call target="put-connection-settings-into-defined-app-config" />
</target>

Expand All @@ -166,20 +154,17 @@
<property name="nunit-console" value="${nuget-package-path}/tools/nunit3-console.exe" />
</target>

<target name="run-tests" depends="find-nunit"
description="Run NUnit tests">
<property name="run-tests.failonerror" value="${not property::exists(test.file + '.IgnoreFail')}"/>
<property name="run-tests.x86" value="--x86" unless="${property::exists('nunit-x64')}" />
<property name="run-tests.x86" value="" if="${property::exists('nunit-x64')}" />
<property name="run-tests.teamcity" value="--teamcity" if="${property::exists('config.teamcity')}" />
<property name="run-tests.teamcity" value="" unless="${property::exists('run-tests.teamcity')}" />
<exec program="${nunit-console}" failonerror="${run-tests.failonerror}">
<arg line="${bin.dir}/${test.file}.dll --result=${testresults.dir}/${test.file}.dll-results.xml;format=nunit2 --framework=${framework::get-target-framework()} ${run-tests.teamcity} ${run-tests.x86}" />
<target name="run-tests" depends="find-nunit" description="Run NUnit tests">
<exec program="${nunit-console}" failonerror="${not property::exists(test.file + '.IgnoreFail')}">
<arg value="${root.dir}/src/${test.file}/bin/${build.config}/net461/${test.file}.dll" />
<arg value="--result=${testresults.dir}/${test.file}.dll-results.xml;format=nunit2" />
<arg value="--teamcity" if="${property::exists('config.teamcity')}" />
<arg value="--x86" unless="${property::exists('nunit-x64')}" />
</exec>
</target>

<target name="remove-connection-settings-from-app-config">
<property name="app.config" value="${bin.dir}/${test.file}.dll.config" />
<property name="app.config" value="${root.dir}/src/${test.file}/bin/${build.config}/net461/${test.file}.dll.config" />

<xmlpoke
file="${app.config}"
Expand Down Expand Up @@ -222,12 +207,6 @@
<call target="build" />
</target>

<target name="reports" depends="init">
<call target="test-all-frameworks" />
<call target="test-report" />
<call target="coverage-report" />
</target>

<target name="sources-zip" depends="init">
<exec program="git" commandline="archive HEAD --format zip --output &quot;${build.dir}/NHibernate-${project.version}-src.zip&quot;"/>
</target>
Expand Down Expand Up @@ -255,42 +234,50 @@

<!--Configuration templates-->
<copy todir="${bin-pack.conf-template}">
<fileset basedir="src/NHibernate.Config.Templates">
<fileset basedir="${root.dir}/src/NHibernate.Config.Templates">
<include name="*"/>
</fileset>
</copy>

<!--Minimal Required Bins-->
<copy todir="${bin-pack.required}">
<fileset basedir="src/NHibernate">
<fileset basedir="${root.dir}/src/NHibernate">
<include name="*.xsd" />
</fileset>
</copy>
<copy todir="${bin-pack.required}">
<fileset basedir="${bin.dir}">
<fileset basedir="${root.dir}/src/NHibernate/bin/${build.config}/net461/">
<include name="Antlr3.Runtime.???" />
<include name="Iesi.Collections.???" />
<include name="NHibernate.???" />
<include name="Remotion.Linq.???" />
<include name="Remotion.Linq.EagerFetching.???" />
</fileset>
</copy>
<!--Required Bins for lazy loading NHibernate.ByteCode.Castle.dll-->
<!-- Tests -->
<copy file="${bin.dir}/TestEmbeddedConfig.cfg.xml" todir="${bin-pack.tests}"/>
<copy file="${bin.dir}/ABC.hbm.xml" todir="${bin-pack.tests}"/>
<copy file="${root.dir}/src/NHibernate.Test/TestEmbeddedConfig.cfg.xml" todir="${bin-pack.tests}"/>
<copy file="${root.dir}/src/NHibernate.DomainModel/ABC.hbm.xml" todir="${bin-pack.tests}"/>
<copy todir="${bin-pack.tests}/DbScripts">
<fileset basedir="${root.dir}/src/NHibernate.Test/DbScripts">
<include name="*.sql" />
</fileset>
</copy>
<copy todir="${bin-pack.tests}">
<fileset basedir="${bin.dir}">
<include name="nunit*" />
<include name="SharpTestsEx*" />
<include name="NHibernate.Domain*" />
<include name="NHibernate.Test*" />
<fileset basedir="${root.dir}/src/NHibernate.Test/bin/${build.config}/net461">
<include name="log4net*" />
<include name="NHibernate.DomainModel.*" />
<include name="NHibernate.Test.*" />
<include name="nunit*" />
</fileset>
</copy>
<copy todir="${bin-pack.tests}">
<fileset basedir="${root.dir}/src/NHibernate.Test.VisualBasic/bin/${build.config}/net461">
<include name="NHibernate.Test.VisualBasic.*" />
</fileset>
</copy>
<copy todir="${bin-pack.tests}">
<fileset basedir="${root.dir}/src/NHibernate.TestDatabaseSetup/bin/${build.config}/net461">
<include name="NHibernate.TestDatabaseSetup.*" />
</fileset>
</copy>
</target>
Expand Down
37 changes: 0 additions & 37 deletions doc/NHibernate.ndoc.in

This file was deleted.

8 changes: 3 additions & 5 deletions doc/NHibernate.shfbproj.template
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,9 @@
<IndentHtml>False</IndentHtml>
<HelpFileVersion>${project.version.numeric}</HelpFileVersion>
<DocumentationSources>
<DocumentationSource sourceFile="${bin.dir}/Iesi.Collections.dll" />
<DocumentationSource sourceFile="${bin.dir}/Iesi.Collections.xml" />
<DocumentationSource sourceFile="${bin.dir}/NHibernate.dll" />
<DocumentationSource sourceFile="${bin.dir}/Nhibernate.xml" />
</DocumentationSources>
<DocumentationSource sourceFile="${root.dir}/src/NHibernate/bin/${build.config}/NHibernate.dll" />
<DocumentationSource sourceFile="${root.dir}/src/NHibernate/bin/${build.config}/Nhibernate.xml" />
</DocumentationSources>
</PropertyGroup>
<!-- There are no properties for these two groups but they need to appear in
order for Visual Studio to perform the build. -->
Expand Down
4 changes: 2 additions & 2 deletions doc/documentation.build
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@
<target name="api" depends="init apidocbuilder-project" description="Generates the API documentation (in MSDN style if available)">
<uptodate property="api.uptodate">
<sourcefiles>
<include name="${bin.dir}/*.dll" />
<include name="${bin.dir}/*.xml" />
<include name="${root.dir}/src/NHibernate/bin/${build.config}/net461/*.dll" />
<include name="${root.dir}/src/NHibernate/bin/${build.config}/net461/*.xml" />
</sourcefiles>
<targetfiles>
<include name="${doc.help2.out.dir}/**" />
Expand Down
Loading