Skip to content

Commit 8e49199

Browse files
committed
Use MsBuild/dotnet pack targets instead of NuGet.exe.
1 parent b95f88a commit 8e49199

File tree

12 files changed

+84
-126
lines changed

12 files changed

+84
-126
lines changed

build-common/NHibernate.props

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,17 @@
1212
<Product>NHibernate</Product>
1313
<Company>NHibernate.info</Company>
1414
<Copyright>Licensed under LGPL.</Copyright>
15+
<Authors>NHibernate community, Hibernate community</Authors>
16+
<Company>NHibernate.info</Company>
17+
<NeutralLanguage>en-US</NeutralLanguage>
18+
<PackageProjectUrl>http://nhibernate.info</PackageProjectUrl>
19+
<PackageIconUrl>https://raw.githubusercontent.com/nhibernate/nhibernate-core/master/logo/NHibernate-NuGet.png</PackageIconUrl>
20+
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
21+
<PackageLicenseUrl>https://raw.githubusercontent.com/nhibernate/nhibernate-core/master/LICENSE.txt</PackageLicenseUrl>
22+
<RepositoryUrl>https://github.com/nhibernate/nhibernate-core.git</RepositoryUrl>
23+
<RepositoryType>git</RepositoryType>
24+
25+
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
26+
<TreatSpecificWarningsAsErrors>1717;1574</TreatSpecificWarningsAsErrors>
1527
</PropertyGroup>
1628
</Project>

build-common/common-project.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,18 @@
6262
</exec>
6363
</target>
6464

65-
<target name="common.compile-all" depends="common.nuget-restore">
65+
<target name="common.compile-all" depends="common.nuget-restore nuget.set-properties">
6666
<!--property name="msbuild.cmd" value="${cmd.sln} ${cmd.out} ${cmd.platform} ${cmd.debug} ${cmd.optimize} ${cmd.doc} /t:Rebuild /v:q /m" /-->
6767
<exec program="${path::combine(tools.dir, 'msbuild.cmd')}" verbose="true">
6868
<arg value="${root.dir}/src/NHibernate.sln" />
6969
<arg value="/p:OutputPath=&quot;${path::get-full-path(bin.dir)}&quot;" />
7070
<arg value="/p:Platform=&quot;Any CPU&quot;" />
7171
<arg value="/p:Configuration=&quot;Debug&quot;" if="${build.debug == 'true'}" />
7272
<arg value="/p:Configuration=&quot;Release&quot;" if="${build.release == 'true'}" />
73+
<arg value="/p:GeneratePackageOnBuild=&quot;True&quot;" />
74+
<arg value="/p:IncludeSymbols=&quot;True&quot;" />
75+
<arg value="/p:IncludeSource=&quot;True&quot;" />
76+
<arg value="/p:PackageOutputPath=&quot;${path::get-full-path(nuget.nupackages.dir)}&quot;" />
7377
<arg value="/t:Restore" />
7478
<arg value="/t:Rebuild" />
7579
<arg value="/v:q" />

build-common/common.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,6 @@
181181

182182
<target name="nuget.set-properties">
183183
<property name="nuget.nupackages.relative-dir" value="nuget_gallery" />
184-
<!-- The nuget.workingdir is the directory from where all *.nuspec files will work.
185-
This is to simplify the compilation of *.nuspec.template files (see section 'files')-->
186-
<property name="nuget.workingdir" value="${build.dir}/tmp_nugetdeploy" />
187184

188185
<property name="nuget.nupackages.dir" value="${build.dir}/${nuget.nupackages.relative-dir}" />
189186
<property name="nuget.nupackages.pushbatfile" value="${nuget.nupackages.dir}/NuGetPush.bat" />

default.build

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -243,33 +243,8 @@
243243
commandline="src\NHibernate\nhibernate-mapping.xsd /classes /fields /order /namespace:NHibernate.Cfg.MappingSchema /out:src\NHibernate\Cfg\MappingSchema\"/>
244244

245245
</target>
246-
247-
<fileset id="nugetfiles.all" basedir="src">
248-
<include name="NHibernate/NHibernate.build" />
249-
</fileset>
250-
251-
<target name="nuspec" depends="init nuget.set-properties" description="Create nuspec files">
252-
<nant target="nuspec">
253-
<buildfiles refid="nugetfiles.all" />
254-
</nant>
255-
</target>
256-
257-
<target name="nuget" depends="init binaries nuget.set-properties nuspec"
258-
description="Creates files for the release on nuget gallery.">
259-
260-
<nant target="nuget">
261-
<buildfiles refid="nugetfiles.all" />
262-
</nant>
263-
264-
<mkdir dir="${nuget.nupackages.dir}" />
265-
<move todir="${nuget.nupackages.dir}">
266-
<fileset basedir="${nuget.workingdir}">
267-
<include name="*.nupkg" />
268-
</fileset>
269-
</move>
270-
</target>
271246

272-
<target name="nugetpushbat" depends="init binaries common.download-nuget nuget.set-properties nuspec nuget"
247+
<target name="nugetpushbat" depends="init binaries common.download-nuget nuget.set-properties"
273248
description="Creates files for the release on nuget gallery.">
274249

275250
<copy file="${tools.dir}/NuGet.exe" todir="${nuget.nupackages.dir}"/>
@@ -287,7 +262,7 @@
287262
</foreach>
288263
</target>
289264

290-
<target name="nugetpush" depends="init binaries common.download-nuget nuget.set-properties nuspec nuget"
265+
<target name="nugetpush" depends="init binaries common.download-nuget nuget.set-properties"
291266
description="Push packages on nuget gallery.">
292267
<!-- In order to use this task you have to be sure you have executed 'nuget SetApiKey' -->
293268
<foreach item="File" property="filename">

src/NHibernate.DomainModel/NHibernate.DomainModel.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
<Description>The Domain Model used by the Unit Tests.</Description>
66

77
<TargetFramework>net461</TargetFramework>
8+
<DisableImplicitPackageTargetFallback>true</DisableImplicitPackageTargetFallback>
89
<NoWarn>$(NoWarn);3001;3002;3003;3005</NoWarn>
10+
11+
<IsPackable>false</IsPackable>
912
</PropertyGroup>
1013

1114
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">

src/NHibernate.Test.VisualBasic/NHibernate.Test.VisualBasic.vbproj

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@
55
<Description>The Visual Basic Unit Tests for NHibernate.</Description>
66

77
<TargetFramework>net461</TargetFramework>
8-
8+
<DisableImplicitPackageTargetFallback>true</DisableImplicitPackageTargetFallback>
99
<NoWarn>$(NoWarn);3001;3002;3003;3005</NoWarn>
1010
<OptionExplicit>On</OptionExplicit>
1111
<OptionStrict>On</OptionStrict>
12+
13+
<IsPackable>false</IsPackable>
1214
</PropertyGroup>
1315

1416
<ItemGroup>
@@ -31,9 +33,9 @@
3133
<PackageReference Include="Remotion.Linq" Version="2.1.2" />
3234
<PackageReference Include="Remotion.Linq.EagerFetching" Version="2.1.0" />
3335
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.0.7.6" />
34-
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.3.0" />
36+
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.4.0" />
3537
<PackageReference Include="NUnit3TestAdapter" Version="3.8.0" />
36-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
38+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" />
3739
<PackageReference Include="Microsoft.VisualBasic" Version="10.2.0" />
3840
</ItemGroup>
3941

src/NHibernate.Test/NHibernate.Test.csproj

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,29 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<Import Project="../../build-common/NHibernate.props" />
3+
34
<PropertyGroup>
45
<Description>The Unit Tests for NHibernate.</Description>
6+
57
<TargetFramework>net461</TargetFramework>
8+
<DisableImplicitPackageTargetFallback>true</DisableImplicitPackageTargetFallback>
69
<NoWarn>$(NoWarn);3001;3002;3003;3005</NoWarn>
10+
11+
<IsPackable>false</IsPackable>
712
</PropertyGroup>
13+
814
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
915
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
1016
<TreatSpecificWarningsAsErrors />
1117
</PropertyGroup>
18+
1219
<ItemGroup>
1320
<None Remove="**\*.hbm.xml" />
1421
<None Remove="**\*.jpg" />
1522
<None Update="DbScripts\*.sql">
1623
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
1724
</None>
1825
</ItemGroup>
26+
1927
<ItemGroup>
2028
<EmbeddedResource Include="**\*.hbm.xml" Exclude="bin\**\*.*" />
2129
<EmbeddedResource Include="**\*.jpg" />
@@ -27,11 +35,13 @@
2735
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
2836
</EmbeddedResource>
2937
</ItemGroup>
38+
3039
<ItemGroup>
3140
<Content Include="..\NHibernate.DomainModel\ABC.hbm.xml" Link="ABC.hbm.xml">
3241
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
3342
</Content>
3443
</ItemGroup>
44+
3545
<ItemGroup>
3646
<PackageReference Include="Antlr3.Runtime" Version="3.5.1" />
3747
<PackageReference Include="Iesi.Collections" Version="4.0.2" />
@@ -40,20 +50,24 @@
4050
<PackageReference Include="Remotion.Linq" Version="2.1.2" />
4151
<PackageReference Include="Remotion.Linq.EagerFetching" Version="2.1.0" />
4252
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.0.7.6" />
43-
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.3.0" />
53+
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.4.0" />
4454
<PackageReference Include="NUnit3TestAdapter" Version="3.8.0" />
45-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
55+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" />
4656
</ItemGroup>
57+
4758
<ItemGroup>
4859
<ProjectReference Include="..\NHibernate.DomainModel\NHibernate.DomainModel.csproj" />
4960
<ProjectReference Include="..\NHibernate\NHibernate.csproj" />
5061
</ItemGroup>
62+
5163
<ItemGroup>
5264
<Reference Include="System.Configuration" />
5365
<Reference Include="System.Data.OracleClient" />
5466
<Reference Include="System.Transactions" />
5567
</ItemGroup>
68+
5669
<ItemGroup>
5770
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
5871
</ItemGroup>
72+
5973
</Project>

src/NHibernate.TestDatabaseSetup/NHibernate.TestDatabaseSetup.csproj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
<Description>Test Database Setup for NHibernate.</Description>
77

88
<TargetFramework>net461</TargetFramework>
9+
<DisableImplicitPackageTargetFallback>true</DisableImplicitPackageTargetFallback>
910
<NoWarn>$(NoWarn);3001;3002;3003;3005</NoWarn>
11+
12+
<IsPackable>false</IsPackable>
1013
</PropertyGroup>
1114

1215
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
@@ -16,7 +19,7 @@
1619

1720
<ItemGroup>
1821
<PackageReference Include="nunit" Version="3.7.1" />
19-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
22+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" />
2023
<PackageReference Include="NUnit3TestAdapter" Version="3.8.0" />
2124
</ItemGroup>
2225

src/NHibernate.Tool.HbmXsd/NHibernate.Tool.HbmXsd.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
<AssemblyName>HbmXsd</AssemblyName>
88
<AssemblyTitle>NHibernate.Tool.HbmXsd</AssemblyTitle>
99
<OutputType>Exe</OutputType>
10+
11+
<IsPackable>false</IsPackable>
1012
</PropertyGroup>
1113

1214
<ItemGroup>

src/NHibernate/NHibernate.build

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

src/NHibernate/NHibernate.csproj

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,72 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<Import Project="../../build-common/NHibernate.props" />
3+
34
<PropertyGroup>
4-
<Description>An object persistence library for relational databases.</Description>
5+
<Description>NHibernate is a mature, open source object-relational mapper for the .NET framework. It is actively developed, fully featured and used in thousands of successful projects.</Description>
6+
<PackageTags>ORM; O/RM; DataBase; DAL; ObjectRelationalMapping; NHibernate; ADO.Net; Core</PackageTags>
7+
58
<TargetFramework>net461</TargetFramework>
9+
<DisableImplicitPackageTargetFallback>true</DisableImplicitPackageTargetFallback>
610
<NoWarn>$(NoWarn);3001;3002;3003;3005;1591</NoWarn>
711
<SignAssembly>True</SignAssembly>
12+
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
813
<AssemblyOriginatorKeyFile>..\NHibernate.snk</AssemblyOriginatorKeyFile>
914
<GenerateDocumentationFile>true</GenerateDocumentationFile>
1015
</PropertyGroup>
16+
1117
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
1218
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
1319
<TreatSpecificWarningsAsErrors />
1420
</PropertyGroup>
21+
1522
<ItemGroup>
1623
<None Remove="**\*.g" />
1724
<None Remove="**\*.xsd" />
1825
</ItemGroup>
26+
1927
<ItemGroup>
2028
<Antlr3 Include="**\*.g" />
2129
</ItemGroup>
30+
2231
<ItemGroup>
2332
<EmbeddedResource Include="**\*.xsd" />
2433
</ItemGroup>
34+
2535
<ItemGroup>
2636
<None Include="..\NHibernate.snk" Link="NHibernate.snk" />
2737
</ItemGroup>
38+
2839
<ItemGroup>
2940
<PackageReference Include="Antlr3.CodeGenerator" Version="3.5.2-beta1">
3041
<PrivateAssets>All</PrivateAssets>
3142
</PackageReference>
32-
<PackageReference Include="Antlr3.Runtime" Version="3.5.1" />
33-
<PackageReference Include="iesi.collections" Version="4.0.2" />
34-
<PackageReference Include="Remotion.Linq" Version="2.1.2" />
35-
<PackageReference Include="Remotion.Linq.EagerFetching" Version="2.1.0" />
43+
<PackageReference Include="Antlr3.Runtime" Version="[3.5.1, 4.0)" />
44+
<PackageReference Include="Iesi.Collections" Version="[4.0.2, 5.0)" />
45+
<PackageReference Include="Remotion.Linq" Version="[2.1.2, 3.0)" />
46+
<PackageReference Include="Remotion.Linq.EagerFetching" Version="[2.1.0, 3.0)" />
3647
</ItemGroup>
48+
3749
<ItemGroup>
3850
<Reference Include="System.ServiceModel" />
3951
<Reference Include="System.Transactions" />
4052
<Reference Include="System.Configuration" />
4153
</ItemGroup>
54+
55+
<ItemGroup>
56+
<Content Include="*.xsd">
57+
<PackagePath>./</PackagePath>
58+
</Content>
59+
<Content Include="../NHibernate.Config.Templates/*">
60+
<PackagePath>./ConfigurationTemplates/</PackagePath>
61+
</Content>
62+
<Content Include="../../releasenotes.txt">
63+
<PackagePath>./NHibernate.releasenotes.txt</PackagePath>
64+
</Content>
65+
<Content Include="../../README.md">
66+
<PackagePath>./NHibernate.readme.md</PackagePath>
67+
</Content>
68+
<Content Include="../../LICENSE.txt">
69+
<PackagePath>./NHibernate.license.txt</PackagePath>
70+
</Content>
71+
</ItemGroup>
4272
</Project>

src/NHibernate/NHibernate.nuspec.template

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

0 commit comments

Comments
 (0)