Skip to content

Commit c0f7b74

Browse files
committed
rake task to update NH version across solution; update to 4.0.3.4000 - all tests pass
1 parent 4fb107b commit c0f7b74

File tree

14 files changed

+65
-40
lines changed

14 files changed

+65
-40
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,3 @@ build
2727
*.nupkg
2828
logs/
2929
src/CommonAssemblyInfo.cs
30-
src/FluentNHibernate.nuspec

RakeFile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,31 @@ namespace :package do
226226
end
227227
end
228228

229+
task :upgradeNhVersion, :version do |cmd, args|
230+
fail "Please provide version number to work with" if not args.has_key?(:version)
231+
puts "Updating NH version to #{args[:version]}"
232+
puts "Editing packages.config files..."
233+
packages_configs = Rake::FileList['**/packages.config']
234+
packages_configs.each do |pc|
235+
update_xml pc do |xml|
236+
xml.root.elements["package[@id='NHibernate']"].attributes['version'] = args[:version]
237+
end
238+
puts "Upgraded #{pc}"
239+
end
240+
241+
puts "Editing .csproj files..."
242+
project_files = Rake::FileList['**/*.csproj']
243+
project_files.each do |pf|
244+
update_xml pf do |xml|
245+
old_value = xml.root.elements["ItemGroup[1]/Reference[contains(@Include, 'NHibernate')]/HintPath"].text
246+
new_value = old_value.gsub(/(\d+).(\d+).(\d+).(\d+)/, args[:version])
247+
xml.root.elements["ItemGroup[1]/Reference[contains(@Include, 'NHibernate')]/HintPath"].text = new_value
248+
end
249+
puts "Upgraded #{pf}"
250+
end
251+
puts "Done."
252+
end
253+
229254
nugetpack :nupack do |nu|
230255
nu.command = 'tools/nuget/NuGet.exe'
231256
nu.nuspec = NUSPEC
@@ -244,6 +269,7 @@ def update_xml(xml_path)
244269
#Open up the xml file
245270
xml_file = File.new(xml_path)
246271
xml = REXML::Document.new xml_file
272+
xml.context[:attribute_quote] = :quote
247273

248274
#Allow caller to make the changes
249275
yield xml

src/Examples.FirstAutomappedProject/Examples.FirstAutomappedProject.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
1+
<?xml version='1.0' encoding='UTF-8'?>
2+
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<PropertyGroup>
44
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
55
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@@ -13,7 +13,7 @@
1313
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
1414
<FileAlignment>512</FileAlignment>
1515
<StartupObject>Examples.FirstAutomappedProject.Program</StartupObject>
16-
<FileUpgradeFlags></FileUpgradeFlags>
16+
<FileUpgradeFlags />
1717
<OldToolsVersion>3.5</OldToolsVersion>
1818
<UpgradeBackupLocation />
1919
<PublishUrl>publish\</PublishUrl>
@@ -73,7 +73,7 @@
7373
</PropertyGroup>
7474
<ItemGroup>
7575
<Reference Include="NHibernate">
76-
<HintPath>..\packages\NHibernate.4.0.2.4000\lib\net40\NHibernate.dll</HintPath>
76+
<HintPath>..\packages\NHibernate.4.0.3.4000\lib\net40\NHibernate.dll</HintPath>
7777
</Reference>
7878
<Reference Include="System" />
7979
<Reference Include="System.Core">
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version='1.0' encoding='UTF-8'?>
22
<packages>
3-
<package id="NHibernate" version="4.0.2.4000" targetFramework="net40" allowedVersions="[4,)"/>
4-
<package id="System.Data.SQLite" version="1.0.66.1" targetFramework="net40" />
3+
<package allowedVersions="[4,)" id="NHibernate" targetFramework="net40" version="4.0.3.4000" />
4+
<package id="System.Data.SQLite" targetFramework="net40" version="1.0.66.1" />
55
</packages>

src/Examples.FirstProject/Examples.FirstProject.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
1+
<?xml version='1.0' encoding='UTF-8'?>
2+
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<PropertyGroup>
44
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
55
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@@ -13,7 +13,7 @@
1313
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
1414
<FileAlignment>512</FileAlignment>
1515
<StartupObject>Examples.FirstProject.Program</StartupObject>
16-
<FileUpgradeFlags></FileUpgradeFlags>
16+
<FileUpgradeFlags />
1717
<OldToolsVersion>3.5</OldToolsVersion>
1818
<UpgradeBackupLocation />
1919
<PublishUrl>publish\</PublishUrl>
@@ -73,7 +73,7 @@
7373
</PropertyGroup>
7474
<ItemGroup>
7575
<Reference Include="NHibernate">
76-
<HintPath>..\packages\NHibernate.4.0.2.4000\lib\net40\NHibernate.dll</HintPath>
76+
<HintPath>..\packages\NHibernate.4.0.3.4000\lib\net40\NHibernate.dll</HintPath>
7777
</Reference>
7878
<Reference Include="System" />
7979
<Reference Include="System.Core">
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version='1.0' encoding='UTF-8'?>
22
<packages>
3-
<package id="NHibernate" version="4.0.2.4000" targetFramework="net40" allowedVersions="[4,)"/>
4-
<package id="System.Data.SQLite" version="1.0.66.1" targetFramework="net40" />
3+
<package allowedVersions="[4,)" id="NHibernate" targetFramework="net40" version="4.0.3.4000" />
4+
<package id="System.Data.SQLite" targetFramework="net40" version="1.0.66.1" />
55
</packages>

src/FluentNHibernate.Specs.ExternalFixtures/FluentNHibernate.Specs.ExternalFixtures.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
1+
<?xml version='1.0' encoding='UTF-8'?>
2+
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<PropertyGroup>
44
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
55
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@@ -33,7 +33,7 @@
3333
</PropertyGroup>
3434
<ItemGroup>
3535
<Reference Include="NHibernate">
36-
<HintPath>..\packages\NHibernate.4.0.2.4000\lib\net40\NHibernate.dll</HintPath>
36+
<HintPath>..\packages\NHibernate.4.0.3.4000\lib\net40\NHibernate.dll</HintPath>
3737
</Reference>
3838
<Reference Include="System" />
3939
<Reference Include="System.Core" />
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version='1.0' encoding='UTF-8'?>
22
<packages>
3-
<package id="NHibernate" version="4.0.2.4000" targetFramework="net40" allowedVersions="[4,)"/>
3+
<package allowedVersions="[4,)" id="NHibernate" targetFramework="net40" version="4.0.3.4000" />
44
</packages>

src/FluentNHibernate.Specs/FluentNHibernate.Specs.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
1+
<?xml version='1.0' encoding='UTF-8'?>
2+
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<PropertyGroup>
44
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
55
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@@ -46,7 +46,7 @@
4646
<HintPath>..\packages\Machine.Specifications.0.5.15\lib\net40\Machine.Specifications.dll</HintPath>
4747
</Reference>
4848
<Reference Include="NHibernate">
49-
<HintPath>..\packages\NHibernate.4.0.2.4000\lib\net40\NHibernate.dll</HintPath>
49+
<HintPath>..\packages\NHibernate.4.0.3.4000\lib\net40\NHibernate.dll</HintPath>
5050
</Reference>
5151
<Reference Include="System" />
5252
<Reference Include="System.Core">
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version='1.0' encoding='UTF-8'?>
22
<packages>
3-
<package id="NHibernate" version="4.0.2.4000" targetFramework="net40" allowedVersions="[4,)"/>
4-
<package id="Machine.Specifications" version="0.5.15" targetFramework="net40" />
3+
<package allowedVersions="[4,)" id="NHibernate" targetFramework="net40" version="4.0.3.4000" />
4+
<package id="Machine.Specifications" targetFramework="net40" version="0.5.15" />
55
</packages>

0 commit comments

Comments
 (0)