Skip to content

Commit 0157daf

Browse files
ngbrownhazzik
authored andcommitted
Use MsBuild for packing .nupkg files (nhibernate#1404)
1 parent b95f88a commit 0157daf

File tree

11 files changed

+58
-123
lines changed

11 files changed

+58
-123
lines changed

build-common/NHibernate.props

+9
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,14 @@
1212
<Product>NHibernate</Product>
1313
<Company>NHibernate.info</Company>
1414
<Copyright>Licensed under LGPL.</Copyright>
15+
<Authors>NHibernate community, Hibernate community</Authors>
16+
<NeutralLanguage>en-US</NeutralLanguage>
17+
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>
1524
</PropertyGroup>
1625
</Project>

build-common/common-project.xml

+5-1
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

-3
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

+2-27
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

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<Description>The Domain Model used by the Unit Tests.</Description>
66

77
<TargetFramework>net461</TargetFramework>
8+
<IsTestProject>true</IsTestProject>
89
<NoWarn>$(NoWarn);3001;3002;3003;3005</NoWarn>
910
</PropertyGroup>
1011

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<Description>The Visual Basic Unit Tests for NHibernate.</Description>
66

77
<TargetFramework>net461</TargetFramework>
8-
8+
<IsTestProject>true</IsTestProject>
99
<NoWarn>$(NoWarn);3001;3002;3003;3005</NoWarn>
1010
<OptionExplicit>On</OptionExplicit>
1111
<OptionStrict>On</OptionStrict>

src/NHibernate.Test/NHibernate.Test.csproj

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22
<Import Project="../../build-common/NHibernate.props" />
33
<PropertyGroup>
44
<Description>The Unit Tests for NHibernate.</Description>
5+
56
<TargetFramework>net461</TargetFramework>
7+
<IsTestProject>true</IsTestProject>
68
<NoWarn>$(NoWarn);3001;3002;3003;3005</NoWarn>
79
</PropertyGroup>
8-
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
10+
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
911
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
1012
<TreatSpecificWarningsAsErrors />
1113
</PropertyGroup>

src/NHibernate.TestDatabaseSetup/NHibernate.TestDatabaseSetup.csproj

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<Description>Test Database Setup for NHibernate.</Description>
77

88
<TargetFramework>net461</TargetFramework>
9+
<IsTestProject>true</IsTestProject>
910
<NoWarn>$(NoWarn);3001;3002;3003;3005</NoWarn>
1011
</PropertyGroup>
1112

src/NHibernate/NHibernate.build

-45
This file was deleted.

src/NHibernate/NHibernate.csproj

+36-6
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>
45
<Description>An object persistence library for relational databases.</Description>
56
<TargetFramework>net461</TargetFramework>
67
<NoWarn>$(NoWarn);3001;3002;3003;3005;1591</NoWarn>
78
<SignAssembly>True</SignAssembly>
9+
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
810
<AssemblyOriginatorKeyFile>..\NHibernate.snk</AssemblyOriginatorKeyFile>
911
<GenerateDocumentationFile>true</GenerateDocumentationFile>
10-
</PropertyGroup>
11-
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
12+
13+
<PackageDescription>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.</PackageDescription>
14+
<PackageTags>ORM; O/RM; DataBase; DAL; ObjectRelationalMapping; NHibernate; ADO.Net; Core</PackageTags>
15+
</PropertyGroup>
16+
17+
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
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

-39
This file was deleted.

0 commit comments

Comments
 (0)