Skip to content

Use MsBuild for packing .nupkg files #1404

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 1 commit into from
Oct 25, 2017
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
9 changes: 9 additions & 0 deletions build-common/NHibernate.props
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,14 @@
<Product>NHibernate</Product>
<Company>NHibernate.info</Company>
<Copyright>Licensed under LGPL.</Copyright>
<Authors>NHibernate community, Hibernate community</Authors>
<NeutralLanguage>en-US</NeutralLanguage>

<PackageProjectUrl>http://nhibernate.info</PackageProjectUrl>
<PackageIconUrl>https://raw.githubusercontent.com/nhibernate/nhibernate-core/master/logo/NHibernate-NuGet.png</PackageIconUrl>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<PackageLicenseUrl>https://raw.githubusercontent.com/nhibernate/nhibernate-core/master/LICENSE.txt</PackageLicenseUrl>
<RepositoryUrl>https://github.com/nhibernate/nhibernate-core.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
</PropertyGroup>
</Project>
6 changes: 5 additions & 1 deletion build-common/common-project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,18 @@
</exec>
</target>

<target name="common.compile-all" depends="common.nuget-restore">
<target name="common.compile-all" depends="common.nuget-restore nuget.set-properties">
<!--property name="msbuild.cmd" value="${cmd.sln} ${cmd.out} ${cmd.platform} ${cmd.debug} ${cmd.optimize} ${cmd.doc} /t:Rebuild /v:q /m" /-->
<exec program="${path::combine(tools.dir, 'msbuild.cmd')}" verbose="true">
<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="${build.debug == 'true'}" />
<arg value="/p:Configuration=&quot;Release&quot;" if="${build.release == 'true'}" />
<arg value="/p:GeneratePackageOnBuild=&quot;True&quot;" />
<arg value="/p:IncludeSymbols=&quot;True&quot;" />
<arg value="/p:IncludeSource=&quot;True&quot;" />
<arg value="/p:PackageOutputPath=&quot;${path::get-full-path(nuget.nupackages.dir)}&quot;" />
<arg value="/t:Restore" />
<arg value="/t:Rebuild" />
<arg value="/v:q" />
Expand Down
3 changes: 0 additions & 3 deletions build-common/common.xml
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,6 @@

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

<property name="nuget.nupackages.dir" value="${build.dir}/${nuget.nupackages.relative-dir}" />
<property name="nuget.nupackages.pushbatfile" value="${nuget.nupackages.dir}/NuGetPush.bat" />
Expand Down
29 changes: 2 additions & 27 deletions default.build
Original file line number Diff line number Diff line change
Expand Up @@ -243,33 +243,8 @@
commandline="src\NHibernate\nhibernate-mapping.xsd /classes /fields /order /namespace:NHibernate.Cfg.MappingSchema /out:src\NHibernate\Cfg\MappingSchema\"/>

</target>

<fileset id="nugetfiles.all" basedir="src">
<include name="NHibernate/NHibernate.build" />
</fileset>

<target name="nuspec" depends="init nuget.set-properties" description="Create nuspec files">
<nant target="nuspec">
<buildfiles refid="nugetfiles.all" />
</nant>
</target>

<target name="nuget" depends="init binaries nuget.set-properties nuspec"
description="Creates files for the release on nuget gallery.">

<nant target="nuget">
<buildfiles refid="nugetfiles.all" />
</nant>

<mkdir dir="${nuget.nupackages.dir}" />
<move todir="${nuget.nupackages.dir}">
<fileset basedir="${nuget.workingdir}">
<include name="*.nupkg" />
</fileset>
</move>
</target>

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

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

<target name="nugetpush" depends="init binaries common.download-nuget nuget.set-properties nuspec nuget"
<target name="nugetpush" depends="init binaries common.download-nuget nuget.set-properties"
description="Push packages on nuget gallery.">
<!-- In order to use this task you have to be sure you have executed 'nuget SetApiKey' -->
<foreach item="File" property="filename">
Expand Down
1 change: 1 addition & 0 deletions src/NHibernate.DomainModel/NHibernate.DomainModel.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<Description>The Domain Model used by the Unit Tests.</Description>

<TargetFramework>net461</TargetFramework>
<IsTestProject>true</IsTestProject>
<NoWarn>$(NoWarn);3001;3002;3003;3005</NoWarn>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Description>The Visual Basic Unit Tests for NHibernate.</Description>

<TargetFramework>net461</TargetFramework>

<IsTestProject>true</IsTestProject>
<NoWarn>$(NoWarn);3001;3002;3003;3005</NoWarn>
<OptionExplicit>On</OptionExplicit>
<OptionStrict>On</OptionStrict>
Expand Down
4 changes: 3 additions & 1 deletion src/NHibernate.Test/NHibernate.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
<Import Project="../../build-common/NHibernate.props" />
<PropertyGroup>
<Description>The Unit Tests for NHibernate.</Description>

<TargetFramework>net461</TargetFramework>
<IsTestProject>true</IsTestProject>
<NoWarn>$(NoWarn);3001;3002;3003;3005</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<TreatSpecificWarningsAsErrors />
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<Description>Test Database Setup for NHibernate.</Description>

<TargetFramework>net461</TargetFramework>
<IsTestProject>true</IsTestProject>
<NoWarn>$(NoWarn);3001;3002;3003;3005</NoWarn>
</PropertyGroup>

Expand Down
45 changes: 0 additions & 45 deletions src/NHibernate/NHibernate.build

This file was deleted.

42 changes: 36 additions & 6 deletions src/NHibernate/NHibernate.csproj
Original file line number Diff line number Diff line change
@@ -1,42 +1,72 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="../../build-common/NHibernate.props" />

<PropertyGroup>
<Description>An object persistence library for relational databases.</Description>
<TargetFramework>net461</TargetFramework>
<NoWarn>$(NoWarn);3001;3002;3003;3005;1591</NoWarn>
<SignAssembly>True</SignAssembly>
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
<AssemblyOriginatorKeyFile>..\NHibernate.snk</AssemblyOriginatorKeyFile>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">

<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>
<PackageTags>ORM; O/RM; DataBase; DAL; ObjectRelationalMapping; NHibernate; ADO.Net; Core</PackageTags>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<TreatSpecificWarningsAsErrors />
</PropertyGroup>

<ItemGroup>
<None Remove="**\*.g" />
<None Remove="**\*.xsd" />
</ItemGroup>

<ItemGroup>
<Antlr3 Include="**\*.g" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="**\*.xsd" />
</ItemGroup>

<ItemGroup>
<None Include="..\NHibernate.snk" Link="NHibernate.snk" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Antlr3.CodeGenerator" Version="3.5.2-beta1">
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="Antlr3.Runtime" Version="3.5.1" />
<PackageReference Include="iesi.collections" Version="4.0.2" />
<PackageReference Include="Remotion.Linq" Version="2.1.2" />
<PackageReference Include="Remotion.Linq.EagerFetching" Version="2.1.0" />
<PackageReference Include="Antlr3.Runtime" Version="[3.5.1, 4.0)" />
Copy link
Member

Choose a reason for hiding this comment

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

I doubt there will be v4 of Antlr3

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Excluding v4 was how the previous .nuspec had it. It doesn't hurt to keep it.

<PackageReference Include="Iesi.Collections" Version="[4.0.2, 5.0)" />
<PackageReference Include="Remotion.Linq" Version="[2.1.2, 3.0)" />
<PackageReference Include="Remotion.Linq.EagerFetching" Version="[2.1.0, 3.0)" />
</ItemGroup>

<ItemGroup>
<Reference Include="System.ServiceModel" />
<Reference Include="System.Transactions" />
<Reference Include="System.Configuration" />
</ItemGroup>

<ItemGroup>
<Content Include="*.xsd">
<PackagePath>./</PackagePath>
</Content>
<Content Include="../NHibernate.Config.Templates/*">
<PackagePath>./ConfigurationTemplates/</PackagePath>
</Content>
<Content Include="../../releasenotes.txt">
<PackagePath>./NHibernate.releasenotes.txt</PackagePath>
</Content>
<Content Include="../../README.md">
<PackagePath>./NHibernate.readme.md</PackagePath>
</Content>
<Content Include="../../LICENSE.txt">
<PackagePath>./NHibernate.license.txt</PackagePath>
</Content>
</ItemGroup>
</Project>
39 changes: 0 additions & 39 deletions src/NHibernate/NHibernate.nuspec.template

This file was deleted.