Skip to content

Refactor to simplify netfx retargeting #2024

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 3 commits into from
Mar 2, 2019
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
3 changes: 3 additions & 0 deletions build-common/NHibernate.props
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@

<NhAppTargetFrameworks Condition ="$(NhAppTargetFrameworks) == ''">net461;netcoreapp2.0</NhAppTargetFrameworks>
<NhLibTargetFrameworks Condition ="$(NhLibTargetFrameworks) == ''">net461;netcoreapp2.0;netstandard2.0</NhLibTargetFrameworks>
<NhNetFx>false</NhNetFx>
<NhNetFx Condition="$(TargetFramework.StartsWith('net4'))">true</NhNetFx>
<DefineConstants Condition="$(NhNetFx) AND $(NhVbNet) == ''" >NETFX;$(DefineConstants)</DefineConstants>

<Product>NHibernate</Product>
<Company>NHibernate.info</Company>
Expand Down
15 changes: 8 additions & 7 deletions default.build
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
>

<property name="root.dir" value="." />
<property name="target.dir" value="net461" />

<include buildfile="${root.dir}/build-common/common.xml" />

Expand Down Expand Up @@ -144,7 +145,7 @@
</target>

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

Expand All @@ -156,15 +157,15 @@

<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="${root.dir}/src/${test.file}/bin/${build.config}/${target.dir}/${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="${root.dir}/src/${test.file}/bin/${build.config}/net461/${test.file}.dll.config" />
<property name="app.config" value="${root.dir}/src/${test.file}/bin/${build.config}/${target.dir}/${test.file}.dll.config" />

<xmlpoke
file="${app.config}"
Expand Down Expand Up @@ -246,7 +247,7 @@
</fileset>
</copy>
<copy todir="${bin-pack.required}">
<fileset basedir="${root.dir}/src/NHibernate/bin/${build.config}/net461/">
<fileset basedir="${root.dir}/src/NHibernate/bin/${build.config}/${target.dir}/">
<include name="Antlr3.Runtime.???" />
<include name="Iesi.Collections.???" />
<include name="NHibernate.???" />
Expand All @@ -263,20 +264,20 @@
</fileset>
</copy>
<copy todir="${bin-pack.tests}">
<fileset basedir="${root.dir}/src/NHibernate.Test/bin/${build.config}/net461">
<fileset basedir="${root.dir}/src/NHibernate.Test/bin/${build.config}/${target.dir}">
<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">
<fileset basedir="${root.dir}/src/NHibernate.Test.VisualBasic/bin/${build.config}/${target.dir}">
<include name="NHibernate.Test.VisualBasic.*" />
</fileset>
</copy>
<copy todir="${bin-pack.tests}">
<fileset basedir="${root.dir}/src/NHibernate.TestDatabaseSetup/bin/${build.config}/net461">
<fileset basedir="${root.dir}/src/NHibernate.TestDatabaseSetup/bin/${build.config}/${target.dir}">
<include name="NHibernate.TestDatabaseSetup.*" />
</fileset>
</copy>
Expand Down
3 changes: 0 additions & 3 deletions src/NHibernate.DomainModel/NHibernate.DomainModel.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
<IsTestProject>true</IsTestProject>
<NoWarn>$(NoWarn);3001;3002;3003;3005</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net461'">
<DefineConstants>NETFX;$(DefineConstants)</DefineConstants>
</PropertyGroup>
<ItemGroup>
<None Remove="**\*.hbm.xml" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<NhVbNet>true</NhVbNet>
</PropertyGroup>
<Import Project="../../build-common/NHibernate.props" />
<PropertyGroup>
<Description>The Visual Basic Unit Tests for NHibernate.</Description>
Expand All @@ -13,8 +16,8 @@
<OutputType>Exe</OutputType>
<GenerateProgramFile>false</GenerateProgramFile>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net461'">
<DefineConstants>NET461,$(DefineConstants)</DefineConstants>
<PropertyGroup Condition="$(NhNetFx)">
<DefineConstants>NETFX,$(DefineConstants)</DefineConstants>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

</PropertyGroup>
<ItemGroup>
<None Remove="**\*.hbm.xml" />
Expand All @@ -41,4 +44,4 @@
<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>
</Project>
</Project>
5 changes: 1 addition & 4 deletions src/NHibernate.Test/NHibernate.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
<NoWarn>$(NoWarn);3001;3002;3003;3005</NoWarn>
<ContentSQLiteInteropFiles>true</ContentSQLiteInteropFiles>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net461'">
<DefineConstants>NETFX;$(DefineConstants)</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp2.0'">
<OutputType>Exe</OutputType>
<GenerateProgramFile>false</GenerateProgramFile>
Expand Down Expand Up @@ -58,7 +55,7 @@
<PackageReference Include="FirebirdSql.Data.FirebirdClient" Version="6.3.0" />
<PackageReference Include="Npgsql" Version="4.0.3" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='net461'">
<ItemGroup Condition="$(NhNetFx)">
<Reference Include="System.Configuration" />
<Reference Include="System.Runtime" />
<Reference Include="System.Transactions" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
<IsTestProject>true</IsTestProject>
<NoWarn>$(NoWarn);3001;3002;3003;3005</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net461'">
<DefineConstants>NETFX;$(DefineConstants)</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp2.0'">
<OutputType>Exe</OutputType>
<GenerateProgramFile>false</GenerateProgramFile>
Expand Down
6 changes: 1 addition & 5 deletions src/NHibernate/NHibernate.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
<PackageTags>ORM; O/RM; DataBase; DAL; ObjectRelationalMapping; NHibernate; ADO.Net; Core</PackageTags>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'net461'">
<DefineConstants>NETFX;$(DefineConstants)</DefineConstants>
</PropertyGroup>

<ItemGroup>
<None Remove="**\*.g" />
<None Remove="**\*.xsd" />
Expand Down Expand Up @@ -45,7 +41,7 @@
<PackageReference Include="Remotion.Linq.EagerFetching" Version="[2.2.0, 3.0)" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net461'">
<ItemGroup Condition="$(NhNetFx)">
<Reference Include="System.ServiceModel" />
<Reference Include="System.Transactions" />
<Reference Include="System.Configuration" />
Expand Down