Skip to content

Commit 590389f

Browse files
Fix and modernize build scripts
* Update release notes * Purge reference to obsolete site nhforge * Auto-download NuGet and other tooling (excepted Nant) * Build NuGet package
1 parent 7cf829f commit 590389f

File tree

97 files changed

+185
-20562
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+185
-20562
lines changed

Examples/Asp.Net MVC/NHibernate.Validator.Demo.Mvc/Views/Home/Index.aspx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
Go to the <a href="Customer/Manage">example</a>.
1111

1212
To learn more about ASP.NET MVC visit <a href="http://asp.net/mvc" title="ASP.NET MVC Website">http://asp.net/mvc</a>.
13-
To learn more about NHibernate Validator visit <a href="http://nhforge.org" title="NHibernate Forge">NHibernate Forge</a>.
13+
To learn more about NHibernate Validator visit <a href="http://nhibernate.info/">NHibernate</a>.
1414
</p>
1515
</asp:Content>

Examples/Readme.htm

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
1+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
22
<html xmlns="http://www.w3.org/1999/xhtml"><head>
33

44
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
@@ -331,8 +331,8 @@ <h1>NHibernate Validator Quickstart</h1>
331331

332332
<div id="menucontainer">
333333

334-
<!--ul id="menu">
335-
<li><a href="http://nhforge.org">NHibernate Forge</a></li>
334+
<!--ul id="menu">
335+
<li><a href="http://nhibernate.info">NHibernate</a></li>
336336
<li><a href="http://localhost:3507/Home/About">About</a></li>
337337
</ul-->
338338

@@ -345,10 +345,10 @@ <h2>Welcome to the NHibernate Validator Quickstart !</h2>
345345
<p>
346346

347347
The NHibernate Validator Team had prepare examples to you be able to use this validation framework in a easy way.
348-
To learn more about NHibernate Validator visit <a href="http://nhforge.org/" title="NHibernate Forge">NHibernate Forge</a>.
348+
To learn more about NHibernate Validator visit <a href="http://nhibernate.info">NHibernate</a>.
349349
</p>
350350
<p>
351-
Our <a href="http://nhforge.org/wikis/validator/default.aspx" title="NHibernate Validator wiki">wiki</a> and <a href="http://nhforge.org/blogs/" title="NHibernate Forge blog">blog</a>
351+
Our <a href="http://nhibernate.info/doc/validator/nhibernate-validator-1-0-0-documentation.html" title="NHibernate Validator documentation">documentation</a> and <a href="http://nhibernate.info/blog/" title="NHibernate blog">blog</a>
352352
</p>
353353

354354
<h2>
@@ -377,21 +377,21 @@ <h3>
377377
way to add validation errors from model and display them all into the
378378
View. This example cover the easy integration between these frameworks.
379379
Note, you need Asp.Net MVC installed into your machine. <a href="http://www.asp.net/mvc/" title="Download Asp.net MVC">Download Asp.net MVC</a>
380-
</p>
381-
<h3>
382-
4) Entity Validator
383-
</h3>
384-
<p>
385-
Sometimes you need to validate a property which depends of another(s) property(ies). The most common example is when you have to validate a range of dates.
386-
This example cover this funcionality and show to us how to configurate it using attributes, xml and fluent.
387-
</p>
388-
<h3>
389-
5) IoC Integration: Windsor Container
390-
</h3>
391-
<p>
392-
If you want the life-cycle of you object be managed by an IoC container, you can do it easily. This example will show you how to
393-
integrate NHibernate Validator and Windsor Container.
394-
</p>
380+
</p>
381+
<h3>
382+
4) Entity Validator
383+
</h3>
384+
<p>
385+
Sometimes you need to validate a property which depends of another(s) property(ies). The most common example is when you have to validate a range of dates.
386+
This example cover this funcionality and show to us how to configurate it using attributes, xml and fluent.
387+
</p>
388+
<h3>
389+
5) IoC Integration: Windsor Container
390+
</h3>
391+
<p>
392+
If you want the life-cycle of you object be managed by an IoC container, you can do it easily. This example will show you how to
393+
integrate NHibernate Validator and Windsor Container.
394+
</p>
395395

396396
<div id="footer">
397397
</div>

Examples/Winforms/NHibernate.Validator.Demo.Winforms/NHibernate.Validator.Demo.Winforms/Form1.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ private void btnSend_Click(object sender, EventArgs e)
3535
//NOTE...IMPORTANT!:
3636
//This is an example of how-to-change-the-configuration.
3737
//You should maintain in your code just 1 (one) ValidatorEngine,
38-
//see SharedEngine: http://nhforge.org/blogs/nhibernate/archive/2009/02/26/diving-in-nhibernate-validator.aspx
38+
//see SharedEngine: http://nhibernate.info/blog/2009/02/26/diving-in-nhibernate-validator.html
3939

4040
ValidatorEngine ve = vvtor.ValidatorEngine;
4141
ve.Clear();

NHibernate.Validator.nuspec

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<metadata>
44
<id>NHibernate.Validator</id>
55
<title>NHibernate Validator</title>
6-
<version>2.0.0.4000</version>
6+
<version>5.0.0.4000</version>
77
<authors>Dario Quintana, Fabio Maulo, Gustavo Ringel, NHibernate community</authors>
88
<owners>Dario Quintana, Fabio Maulo, Gustavo Ringel</owners>
99
<licenseUrl>https://raw.githubusercontent.com/nhibernate/NHibernate-Validator/master/LICENSE.txt</licenseUrl>
@@ -16,10 +16,14 @@
1616
<description>NHibernate Validator is a powerful and extensible framework to validate objects using the .Net Platform. Born as a port of Hibernate Validator 3.0.0 project at december of 2007. Later on, many improvements and changes were made to the Core and API, and now we can say that NHibernate Validator is more than just a port. NHibernate Validator is entirely written in C#. The first release of NHibernate Validator was entirely developed by Dario Quintana, Gustavo Ringel and Fabio Maulo.</description>
1717
<tags>NHibernate Validator Validation NHV</tags>
1818
<dependencies>
19-
<dependency id="NHibernate" version="4.0.1.4000" />
19+
<group targetFramework=".NETFramework4.6.1">
20+
<dependency id="Iesi.Collections" version="4.0.2" exclude="Build,Analyzers" />
21+
<dependency id="NHibernate" version="5.0.0" exclude="Build,Analyzers" />
22+
</group>
2023
</dependencies>
2124
</metadata>
2225
<files>
23-
<file src="Build\NuGetDeploy\**\*" target="lib\Net40" />
26+
<file src="Build\NuGetDeploy\bin\**\*" target="lib\net461" />
27+
<file src="Build\NuGetDeploy\*" target="." />
2428
</files>
2529
</package>

build-common/common-project.xml

Lines changed: 4 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -26,75 +26,18 @@
2626
2727
Other predefined targets are:
2828
29-
- common.compile-tests
30-
compile NUnit tests and copy App.config file to the output directory,
31-
if it exists.
32-
33-
- common.compile-dll
34-
compile a DLL, generating the documentation file (.xml) and using Clover
35-
if enabled.
36-
3729
- common.generate-assemblyinfo
3830
generate an AssemblyInfo.cs file from assembly.* NAnt properties.
3931
4032
- common.run-tests
4133
run compiled NUnit tests.
4234
43-
All compile/run targets put the output in bin.dir. Common.compile*
44-
targets use source fileset with id="project.sources", assembly fileset
45-
with id="project.references" and resource fileset with id="project.resources"
46-
to compile the project. The source and resource filesets are optional and
47-
default to **/*.cs files and no files respectively.
35+
All compile/run targets put the output in bin.dir.
4836
]]>
4937
</description>
5038

5139
<include buildfile="common.xml" />
5240

53-
54-
55-
<target name="common.compile-tests"
56-
description="Compile NUnit tests and copy App.config file to the output directory, if it exists.">
57-
58-
<csc
59-
target="library"
60-
define="${current.build.defines}"
61-
debug="${build.debug}"
62-
output="${bin.dir}/${project::get-name()}.dll"
63-
optimize="${build.optimize}"
64-
>
65-
<sources refid="project.sources" />
66-
<references refid="project.references" />
67-
<resources refid="project.resources" />
68-
</csc>
69-
70-
<copy
71-
file="App.config"
72-
tofile="${bin.dir}/${project::get-name()}.dll.config"
73-
if="${file::exists('App.config')}"
74-
/>
75-
76-
</target>
77-
78-
<target name="common.compile-dll"
79-
description="Compile sources into a DLL">
80-
81-
<csc
82-
target="library"
83-
define="${current.build.defines}"
84-
debug="${build.debug}"
85-
output="${bin.dir}/${project::get-name()}.dll"
86-
doc="${bin.dir}/${project::get-name()}.xml"
87-
>
88-
<nowarn>
89-
<warning number="1591" /> <!-- No XML comment for publicly visible member -->
90-
</nowarn>
91-
<sources refid="project.sources" />
92-
<references refid="project.references" />
93-
<resources refid="project.resources" />
94-
</csc>
95-
</target>
96-
97-
9841
<target name="common.set-assembly-attribute-values">
9942
<property overwrite="false" name="assembly.is-cls-compliant" value="true" />
10043
<property overwrite="false" name="assembly.allow-partially-trusted-callers" value="true" />
@@ -104,7 +47,7 @@
10447
<property overwrite="false" name="assembly.title" value="${project::get-name()}" />
10548
<property overwrite="false" name="assembly.version" value="${project.version.numeric}" />
10649
<property overwrite="false" name="assembly.version.informational" value="${project.version.numeric}" />
107-
<property overwrite="false" name="assembly.version.file" value="${project.version.numeric}" />
50+
<property overwrite="false" name="assembly.version.file" value="${project.version.numeric}" />
10851
<property overwrite="false" name="assembly.copyright" value="Licensed under LGPL." />
10952
</target>
11053

@@ -128,7 +71,7 @@
12871
<attribute type="AssemblyCopyrightAttribute" value="${assembly.copyright}" />
12972
<attribute type="AssemblyVersionAttribute" value="${assembly.version}" />
13073
<attribute type="AssemblyInformationalVersionAttribute" value="${assembly.version.informational}" />
131-
<attribute type="AssemblyFileVersionAttribute" value="${assembly.version.file}" />
74+
<attribute type="AssemblyFileVersionAttribute" value="${assembly.version.file}" />
13275
<attribute type="AssemblyDelaySignAttribute" value="false" />
13376
<!--<attribute type="AssemblyKeyFileAttribute" value="..\..\..\..\src\NHibernate.Validator.snk" />-->
13477

@@ -142,10 +85,8 @@
14285
description="Run NUnit tests">
14386
<call target="common.find-nunit" unless="${property::exists('nunit.found')}" />
14487
<exec program="${nunit-console}">
145-
<arg line="${bin.dir}/${project::get-name()}.dll /xml:${testresults.dir}/${project::get-name()}.dll-results.xml " />
88+
<arg line="${bin.dir}/${project::get-name()}.dll --result=${testresults.dir}/${project::get-name()}.dll-results.xml;format=nunit2" />
14689
</exec>
14790
</target>
14891

149-
150-
15192
</project>

build-common/common.xml

Lines changed: 38 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<!--
1515
These are used to set the correct attributes in AssemblyInfo.cs.
1616
-->
17-
<property name="project.company" value="NHibernate Community - www.nhforge.org" />
17+
<property name="project.company" value="NHibernate Community - http://nhibernate.info/" />
1818

1919
<!--
2020
Version number computation
@@ -30,7 +30,7 @@
3030
effectively SP0).
3131
-->
3232

33-
<property name="project.version" value="2.0.0.GA" overwrite="false" />
33+
<property name="project.version" value="5.0.0.GA" overwrite="false" />
3434

3535
<!-- Compute short project version (major.minor) using a regex -->
3636
<regex input="${project.version}" pattern="^(?'shortversion'\d+\.\d+)" />
@@ -100,12 +100,14 @@
100100
<property name="build.debug" value="Full" />
101101
<property name="build.optimize" value="false" />
102102
<property name="build.name" value="NHibernate.Validator-${project.version}-${project.config}" />
103+
<property name="build.release" value="false" />
103104
</target>
104105

105106
<target name="set-release-project-configuration" description="Perform a 'release' build">
106107
<property name="build.debug" value="None" />
107108
<property name="build.optimize" value="true" />
108109
<property name="build.name" value="NHibernate.Validator-${project.version}" />
110+
<property name="build.release" value="true" />
109111
</target>
110112

111113
<target name="set-project-configuration">
@@ -120,24 +122,48 @@
120122
<property name="build.nuget.dir" value="${root.dir}/build/NuGetDeploy" />
121123
<property name="build.dir" value="${build.root.dir}" />
122124
<property name="bin.dir" value="${build.dir}/bin/${nant.settings.currentframework}" dynamic="true" />
123-
<property name="testresults.dir" value="${bin.dir}/test-results" />
125+
<property name="testresults.dir" value="${bin.dir}/test-results" />
124126
<property name="tools.dir" value="${root.dir}/Tools"/>
125127
</target>
126128

127-
128-
129129
<target name="common.init"
130130
depends="set-project-configuration"
131131
description="Initializes build properties">
132+
</target>
132133

133-
<fileset id="project.sources" failonempty="true">
134-
<include name="**/*.cs" />
135-
</fileset>
136-
<resourcefileset id="project.resources" />
134+
<target name="common.get-nuget-package-path">
135+
<xmlpeek
136+
file="${tools.dir}/packages.config"
137+
xpath="/packages/package[@id = '${nuget-package-id}']/@version"
138+
property="nuget-package-version" />
139+
<property name="nuget-package-path" value="${tools.dir}/${nuget-package-id}.${nuget-package-version}/" />
137140
</target>
138141

139-
<target name="common.find-nunit">
140-
<property name="nunit-console" value="${tools.dir}/NUnit/nunit-console-x86.exe" />
142+
<target name="common.find-nunit" depends="common.nuget-restore">
143+
<property name="nuget-package-id" value="NUnit.ConsoleRunner" />
144+
<call target="common.get-nuget-package-path" />
145+
<property name="nunit-console" value="${nuget-package-path}/tools/nunit3-console.exe" />
141146
</target>
142-
147+
148+
<target name="common.download-nuget" depends="common.init">
149+
<get
150+
src="https://dist.nuget.org/win-x86-commandline/latest/nuget.exe"
151+
dest="${tools.dir}/nuget.exe"
152+
usetimestamp="true"
153+
/>
154+
</target>
155+
156+
<target name="common.nuget-restore" depends="init common.download-nuget">
157+
<exec basedir="${tools.dir}" workingdir="${root.dir}/Tools" program="NuGet.exe">
158+
<arg value="install" />
159+
</exec>
160+
</target>
161+
162+
<target name="common.solution-restore" depends="common.download-nuget">
163+
<exec program="${path::combine(tools.dir, 'nuget.exe')}" verbose="true">
164+
<arg value="restore" />
165+
<arg value="${root.dir}/src/NHibernate.Validator.sln" />
166+
</exec>
167+
</target>
168+
143169
</project>

build.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Tools\Nant\Bin\nant -t:net-4.0
1+
nant
22
pause

0 commit comments

Comments
 (0)