Skip to content

Commit a21233d

Browse files
authored
Add .NET Standard 2.0 target (4.0.x) (#15)
* Add .NET Standard 2.0 target * Run tests using .NET Core 3.1 * Fix NuGetPush.bat file generation * Remove gutter from build scripts * Add SourceLink * Enable deterministic builds * Set version 4.0.5
1 parent 269ec07 commit a21233d

File tree

7 files changed

+81
-125
lines changed

7 files changed

+81
-125
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Iesi.Collections
22
================
33

4-
Current version: 4.0.4
4+
Current version: 4.0.5
55

66
Some additional `ISet<T>` implementations for .Net 4.
77

Tools/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

default.build

Lines changed: 63 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -2,42 +2,30 @@
22
<project name="Iesi.Collections" default="build" xmlns="http://nant.sf.net/release/0.85-rc3/nant.xsd">
33

44
<property name="root.dir" value="." />
5-
<property name="project.version" value="4.0.4" overwrite="false" />
5+
<property name="project.version" value="4.0.5" overwrite="false" />
66

77
<!-- Pass -D:skip.tests=true to NAnt to skip running tests when building -->
88
<property name="skip.tests" value="false" overwrite="false" />
99

10-
<target name="dotnet-restore">
11-
<exec workingdir="${root.dir}/src" program="dotnet">
12-
<arg value="restore" />
13-
<arg value="Iesi.Collections.sln" />
14-
</exec>
10+
<target name="init" description="Initializes build properties">
11+
<property name="project.config" value="debug" overwrite="false" />
12+
<property name="build.name" value="Iesi.Collections-${project.version}-${project.config}" />
13+
<property name="build.dir" value="${root.dir}/build/${build.name}" />
1514
</target>
1615

17-
<target name="dotnet-build" depends="dotnet-restore">
16+
<target name="build"
17+
depends="init nuget.set-properties"
18+
description="Builds Iesi.Collections in the current configuration">
19+
1820
<exec workingdir="${root.dir}/src" program="dotnet">
1921
<arg value="build" />
2022
<arg value="-c" />
2123
<arg value="${project.config}" />
24+
<arg value="/p:PackageOutputPath=&quot;${path::get-full-path(nuget.nupackages.dir)}&quot;" />
2225
<arg value="Iesi.Collections.sln" />
2326
</exec>
2427
</target>
2528

26-
<target name="set-project-configuration">
27-
<property name="project.config" value="debug" overwrite="false" />
28-
<property name="build.name" value="Iesi.Collections-${project.version}-${project.config}" />
29-
<property name="build.dir" value="${root.dir}/build/${build.name}" />
30-
<property name="tools.dir" value="${root.dir}/Tools"/>
31-
</target>
32-
33-
<target name="init"
34-
depends="set-project-configuration"
35-
description="Initializes build properties" />
36-
37-
<target name="build"
38-
depends="init dotnet-build"
39-
description="Builds Iesi.Collections in the current configuration" />
40-
4129
<target name="run-tests" description="Run NUnitLite tests">
4230
<exec program="${test.file}">
4331
<arg value="--result=test-results.xml;format=nunit2" />
@@ -60,43 +48,12 @@
6048
<call target="run-tests" />
6149
<property name="test.file" value="${tests.basedir}/net461/Iesi.Collections.Test.exe" />
6250
<call target="run-tests" />
63-
<property name="test.file" value="${tests.basedir}/netcoreapp1.0/Iesi.Collections.Test.dll" />
51+
<property name="test.file" value="${tests.basedir}/netcoreapp3.1/Iesi.Collections.Test.dll" />
6452
<call target="run-core-tests" />
6553
</target>
6654

67-
<target name="binaries" depends="init">
68-
<call target="build" />
69-
</target>
70-
71-
<target name="sources">
72-
<property name="source.tmpdir" value="${build.dir}/tmp-src" />
73-
<copy todir="${source.tmpdir}">
74-
<fileset>
75-
<!-- copy all of the Iesi.Collections source -->
76-
<include name="src/Iesi*/**" />
77-
<include name="src/*.*" />
78-
<include name="*.build" />
79-
<include name="LICENSE.txt" />
80-
<include name="readme.html" />
81-
<!-- exclude ReSharper stuff -->
82-
<exclude name="**/_ReSharper*/**" />
83-
<exclude name="**/*.resharperoptions" />
84-
<exclude name="**/*resharper*" />
85-
<!-- exclude VS.NET stuff -->
86-
<exclude name="**/*.suo" />
87-
<exclude name="**/*.user" />
88-
<exclude name="**/bin/**" />
89-
<exclude name="**/obj/**" />
90-
</fileset>
91-
</copy>
92-
</target>
93-
94-
<target name="sources-zip" depends="init sources">
95-
<zip zipfile="${build.dir}/Iesi.Collections-${project.version}-src.zip">
96-
<fileset basedir="${source.tmpdir}">
97-
<include name="**/*" />
98-
</fileset>
99-
</zip>
55+
<target name="sources-zip" depends="init">
56+
<exec program="git" commandline="archive HEAD --format zip --output &quot;${build.dir}/Iesi.Collections-${project.version}-src.zip&quot;"/>
10057
</target>
10158

10259
<target name="binaries-zip" depends="init bin-pack">
@@ -107,7 +64,7 @@
10764
</zip>
10865
</target>
10966

110-
<target name="bin-pack" depends="init binaries">
67+
<target name="bin-pack" depends="init build">
11168
<property name="bin-pack.tmpdir" value="${build.dir}/tmp-bin" />
11269
<property name="bin-pack.bins" value="${bin-pack.tmpdir}/Bins" />
11370
<property name="bin-pack.tests" value="${bin-pack.tmpdir}/Tests" />
@@ -130,11 +87,11 @@
13087
</copy>
13188
</target>
13289

133-
<target name="package" depends="init binaries test sources-zip binaries-zip" description="Creates files for the General Available Release on SourceForge">
90+
<target name="package" depends="init build test sources-zip binaries-zip" description="Creates files for the General Available Release on SourceForge">
13491
<echo message="Created a '${project.config}' package in ${build.dir}" />
13592
</target>
13693

137-
<target name="release" depends="init binaries binaries-zip sources-zip" description="Creates files for the partial (Alpha-Beta-Candidate) Release on SourceForge">
94+
<target name="release" depends="init build binaries-zip sources-zip" description="Creates files for the partial (Alpha-Beta-Candidate) Release on SourceForge">
13895
<echo message="Created a '${project.config}' package in ${build.dir}" />
13996
</target>
14097

@@ -148,63 +105,56 @@
148105
</target>
149106

150107
<target name="nuget.set-properties">
151-
<property name="nuget.nupackages.relative-dir" value="nuget_gallery" />
152-
<property name="nuget.workingdir" value="${build.dir}/tmp_nugetdeploy" />
153-
<property name="nuget.nupackages.dir" value="${build.dir}/${nuget.nupackages.relative-dir}" />
108+
<property name="nuget.nupackages.dir" value="${build.dir}/nuget_gallery" />
154109
<property name="nuget.nupackages.pushbatfile" value="${nuget.nupackages.dir}/NuGetPush.bat" />
155110
</target>
156111

157-
<target name="nuget" depends="init binaries nuget.set-properties" description="Creates files for the release on nuget gallery.">
158-
<mkdir dir="${nuget.nupackages.dir}" />
159-
<move todir="${nuget.nupackages.dir}">
160-
<fileset basedir="${root.dir}/src/Iesi.Collections/bin/${project.config}">
161-
<include name="*.nupkg" />
162-
</fileset>
163-
</move>
164-
</target>
165-
166-
<target name="download-nuget" depends="init">
167-
<get
168-
src="https://dist.nuget.org/win-x86-commandline/latest/nuget.exe"
169-
dest="${tools.dir}/nuget.exe"
170-
usetimestamp="true"
171-
/>
112+
<target name="nugetpushbat" depends="init build"
113+
description="Creates files for the release on nuget gallery.">
114+
115+
<echo message="rem In order to use this bat you have to be sure you have executed 'nuget SetApiKey' ${environment::newline()}" file="${nuget.nupackages.pushbatfile}" append="false"/>
116+
<foreach item="File" property="filename">
117+
<in>
118+
<items>
119+
<include name="${nuget.nupackages.dir}/*.nupkg"/>
120+
<exclude name="${nuget.nupackages.dir}/*.symbols.nupkg"/>
121+
</items>
122+
</in>
123+
<do>
124+
<echo message="dotnet nuget push -s https://nuget.org/ ${path::get-file-name(filename)} ${environment::newline()}" file="${nuget.nupackages.pushbatfile}" append="true"/>
125+
</do>
126+
</foreach>
127+
<foreach item="File" property="filename">
128+
<in>
129+
<items>
130+
<include name="${nuget.nupackages.dir}/*.symbols.nupkg"/>
131+
</items>
132+
</in>
133+
<do>
134+
<echo message="nuget push -source https://nuget.smbsrc.net/ ${path::get-file-name(filename)} ${environment::newline()}" file="${nuget.nupackages.pushbatfile}" append="true"/>
135+
</do>
136+
</foreach>
137+
</target>
138+
139+
<target name="nugetpush" depends="init build"
140+
description="Push packages on nuget gallery.">
141+
<!-- In order to use this task you have to be sure you have executed 'nuget SetApiKey' -->
142+
<foreach item="File" property="filename">
143+
<in>
144+
<items>
145+
<include name="${nuget.nupackages.dir}/*.nupkg"/>
146+
</items>
147+
</in>
148+
<do>
149+
<exec workingdir="${nuget.nupackages.dir}" program="dotnet">
150+
<arg value="nuget" />
151+
<arg value="push" />
152+
<arg value="-s" />
153+
<arg value="https://nuget.org" />
154+
<arg value="${filename}" />
155+
</exec>
156+
</do>
157+
</foreach>
172158
</target>
173159

174-
<target name="nugetpushbat" depends="init binaries download-nuget nuget.set-properties nuget"
175-
description="Creates files for the release on nuget gallery.">
176-
177-
<copy file="${tools.dir}/NuGet.exe" todir="${nuget.nupackages.dir}"/>
178-
179-
<echo message="rem In order to use this bat you have to be sure you have executed 'nuget SetApiKey' ${environment::newline()}" file="${nuget.nupackages.pushbatfile}" append="false"/>
180-
<foreach item="File" property="filename" >
181-
<in>
182-
<items>
183-
<include name="${nuget.nupackages.dir}/*.nupkg"/>
184-
</items>
185-
</in>
186-
<do>
187-
<echo message="nuget push ${filename} ${environment::newline()}" file="${nuget.nupackages.pushbatfile}" append="true"/>
188-
</do>
189-
</foreach>
190-
</target>
191-
192-
<target name="nugetpush" depends="init binaries download-nuget nuget.set-properties nuget"
193-
description="Push packages on nuget gallery.">
194-
<!-- In order to use this task you have to be sure you have executed 'nuget SetApiKey' -->
195-
<foreach item="File" property="filename">
196-
<in>
197-
<items>
198-
<include name="${nuget.nupackages.dir}/*.nupkg"/>
199-
</items>
200-
</in>
201-
<do>
202-
<exec basedir="${tools.dir}" workingdir="${nuget.nupackages.dir}" program="NuGet.exe">
203-
<arg value="push" />
204-
<arg value="${filename}" />
205-
</exec>
206-
</do>
207-
</foreach>
208-
</target>
209-
210160
</project>

src/Iesi.Collections.Test/Iesi.Collections.Test.csproj

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>netcoreapp1.0;net40;net461</TargetFrameworks>
3+
<TargetFrameworks>net40;net461;netcoreapp3.1</TargetFrameworks>
44
<Company>NHibernate community</Company>
55
<Description>The Unit Tests for Iesi.Collections.</Description>
66
<OutputType>exe</OutputType>
77
<GenerateProgramFile>false</GenerateProgramFile>
88
</PropertyGroup>
99

10-
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.1' ">
11-
<RuntimeFrameworkVersion>1.0.4</RuntimeFrameworkVersion>
12-
</PropertyGroup>
13-
1410
<ItemGroup>
1511
<PackageReference Include="NUnit" Version="3.6.1" />
1612
<PackageReference Include="NUnitLite" Version="3.6.1" />

src/Iesi.Collections.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ EndProject
88
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{46EEA13E-9366-4A18-AC82-C0F4C516A301}"
99
ProjectSection(SolutionItems) = preProject
1010
..\LICENSE.txt = ..\LICENSE.txt
11+
..\default.build = ..\default.build
1112
EndProjectSection
1213
EndProject
1314
Global

src/Iesi.Collections/Iesi.Collections.csproj

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>netstandard1.0;netstandard1.3;net40;net461</TargetFrameworks>
3+
<TargetFrameworks>netstandard1.0;netstandard1.3;netstandard2.0;net40;net461</TargetFrameworks>
44
<Company>NHibernate community</Company>
55
<Summary>Additional implementations of System.Collections.Generic.ISet&lt;T&gt;.</Summary>
66
<Description>The System.Collections namespace in the .NET Framework provides a number of collection types that are extremely useful for manipulating data in memory. However, some specialized implementations of ISet are not available. Iesi.Collections 4.0 for .Net 4.0 contains the LinkedHashSet (preserves insertion order), the ReadOnlySet and the SynchronizedSet. The latter two wrap an actual set.</Description>
7-
<Version>4.0.4</Version>
8-
<FileVersion>4.0.4.0</FileVersion>
7+
<Version>4.0.5</Version>
8+
<FileVersion>4.0.5.0</FileVersion>
99
<AssemblyVersion>4.0.0.4000</AssemblyVersion>
1010
<Copyright>Declaration of code in public domain can be found in comment by Jason Smith at https://www.codeproject.com/Messages/1622667/Re-Licensing-terms.aspx.
1111
Copyright © 2002-2004 by Aidant Systems, Inc., and by Jason Smith.
@@ -18,9 +18,19 @@ Copyright © 2012 Oskar Berggren</Copyright>
1818
<PackageTags>Collections ISet</PackageTags>
1919
<PackageProjectUrl>https://github.com/nhibernate/iesi.collections</PackageProjectUrl>
2020
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\Iesi.Collections.xml</DocumentationFile>
21+
22+
<PublishRepositoryUrl>true</PublishRepositoryUrl>
23+
<EmbedUntrackedSources>true</EmbedUntrackedSources>
24+
<IncludeSymbols>true</IncludeSymbols>
25+
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
26+
<ContinuousIntegrationBuild Condition="'$(TEAMCITY_VERSION)' != ''">true</ContinuousIntegrationBuild>
2127
</PropertyGroup>
2228

2329
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' ">
24-
<PackageReference Include="System.Runtime.Serialization.Formatters" Version="4.3.0" />
30+
<PackageReference Include="System.Runtime.Serialization.Formatters" Version="4.3.*" />
31+
</ItemGroup>
32+
33+
<ItemGroup>
34+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
2535
</ItemGroup>
2636
</Project>

teamcity.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212

1313
<property name="build.number" value="${CCNetLabel}" if="${property::exists('CCNetLabel')}" />
1414

15-
<target name="clean-configure-test" depends="cleanall init binaries test binaries-zip nuget" />
15+
<target name="clean-configure-test" depends="cleanall init build test binaries-zip" />
1616

1717
</project>

0 commit comments

Comments
 (0)