Skip to content

Commit

Permalink
rake task to update NH version across solution; update to 4.0.3.4000 …
Browse files Browse the repository at this point in the history
…- all tests pass
  • Loading branch information
chester89 committed Jun 17, 2015
1 parent 4fb107b commit c0f7b74
Show file tree
Hide file tree
Showing 14 changed files with 65 additions and 40 deletions.
1 change: 0 additions & 1 deletion .gitignore
Expand Up @@ -27,4 +27,3 @@ build
*.nupkg
logs/
src/CommonAssemblyInfo.cs
src/FluentNHibernate.nuspec
26 changes: 26 additions & 0 deletions RakeFile
Expand Up @@ -226,6 +226,31 @@ namespace :package do
end
end

task :upgradeNhVersion, :version do |cmd, args|
fail "Please provide version number to work with" if not args.has_key?(:version)
puts "Updating NH version to #{args[:version]}"
puts "Editing packages.config files..."
packages_configs = Rake::FileList['**/packages.config']
packages_configs.each do |pc|
update_xml pc do |xml|
xml.root.elements["package[@id='NHibernate']"].attributes['version'] = args[:version]
end
puts "Upgraded #{pc}"
end

puts "Editing .csproj files..."
project_files = Rake::FileList['**/*.csproj']
project_files.each do |pf|
update_xml pf do |xml|
old_value = xml.root.elements["ItemGroup[1]/Reference[contains(@Include, 'NHibernate')]/HintPath"].text
new_value = old_value.gsub(/(\d+).(\d+).(\d+).(\d+)/, args[:version])
xml.root.elements["ItemGroup[1]/Reference[contains(@Include, 'NHibernate')]/HintPath"].text = new_value
end
puts "Upgraded #{pf}"
end
puts "Done."
end

nugetpack :nupack do |nu|
nu.command = 'tools/nuget/NuGet.exe'
nu.nuspec = NUSPEC
Expand All @@ -244,6 +269,7 @@ def update_xml(xml_path)
#Open up the xml file
xml_file = File.new(xml_path)
xml = REXML::Document.new xml_file
xml.context[:attribute_quote] = :quote

#Allow caller to make the changes
yield xml
Expand Down
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<?xml version='1.0' encoding='UTF-8'?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
Expand All @@ -13,7 +13,7 @@
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<StartupObject>Examples.FirstAutomappedProject.Program</StartupObject>
<FileUpgradeFlags></FileUpgradeFlags>
<FileUpgradeFlags />
<OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation />
<PublishUrl>publish\</PublishUrl>
Expand Down Expand Up @@ -73,7 +73,7 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="NHibernate">
<HintPath>..\packages\NHibernate.4.0.2.4000\lib\net40\NHibernate.dll</HintPath>
<HintPath>..\packages\NHibernate.4.0.3.4000\lib\net40\NHibernate.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core">
Expand Down
6 changes: 3 additions & 3 deletions src/Examples.FirstAutomappedProject/packages.config
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version='1.0' encoding='UTF-8'?>
<packages>
<package id="NHibernate" version="4.0.2.4000" targetFramework="net40" allowedVersions="[4,)"/>
<package id="System.Data.SQLite" version="1.0.66.1" targetFramework="net40" />
<package allowedVersions="[4,)" id="NHibernate" targetFramework="net40" version="4.0.3.4000" />
<package id="System.Data.SQLite" targetFramework="net40" version="1.0.66.1" />
</packages>
8 changes: 4 additions & 4 deletions src/Examples.FirstProject/Examples.FirstProject.csproj
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<?xml version='1.0' encoding='UTF-8'?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
Expand All @@ -13,7 +13,7 @@
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<StartupObject>Examples.FirstProject.Program</StartupObject>
<FileUpgradeFlags></FileUpgradeFlags>
<FileUpgradeFlags />
<OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation />
<PublishUrl>publish\</PublishUrl>
Expand Down Expand Up @@ -73,7 +73,7 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="NHibernate">
<HintPath>..\packages\NHibernate.4.0.2.4000\lib\net40\NHibernate.dll</HintPath>
<HintPath>..\packages\NHibernate.4.0.3.4000\lib\net40\NHibernate.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core">
Expand Down
6 changes: 3 additions & 3 deletions src/Examples.FirstProject/packages.config
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version='1.0' encoding='UTF-8'?>
<packages>
<package id="NHibernate" version="4.0.2.4000" targetFramework="net40" allowedVersions="[4,)"/>
<package id="System.Data.SQLite" version="1.0.66.1" targetFramework="net40" />
<package allowedVersions="[4,)" id="NHibernate" targetFramework="net40" version="4.0.3.4000" />
<package id="System.Data.SQLite" targetFramework="net40" version="1.0.66.1" />
</packages>
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<?xml version='1.0' encoding='UTF-8'?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
Expand Down Expand Up @@ -33,7 +33,7 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="NHibernate">
<HintPath>..\packages\NHibernate.4.0.2.4000\lib\net40\NHibernate.dll</HintPath>
<HintPath>..\packages\NHibernate.4.0.3.4000\lib\net40\NHibernate.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand Down
4 changes: 2 additions & 2 deletions src/FluentNHibernate.Specs.ExternalFixtures/packages.config
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version='1.0' encoding='UTF-8'?>
<packages>
<package id="NHibernate" version="4.0.2.4000" targetFramework="net40" allowedVersions="[4,)"/>
<package allowedVersions="[4,)" id="NHibernate" targetFramework="net40" version="4.0.3.4000" />
</packages>
6 changes: 3 additions & 3 deletions src/FluentNHibernate.Specs/FluentNHibernate.Specs.csproj
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<?xml version='1.0' encoding='UTF-8'?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
Expand Down Expand Up @@ -46,7 +46,7 @@
<HintPath>..\packages\Machine.Specifications.0.5.15\lib\net40\Machine.Specifications.dll</HintPath>
</Reference>
<Reference Include="NHibernate">
<HintPath>..\packages\NHibernate.4.0.2.4000\lib\net40\NHibernate.dll</HintPath>
<HintPath>..\packages\NHibernate.4.0.3.4000\lib\net40\NHibernate.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core">
Expand Down
6 changes: 3 additions & 3 deletions src/FluentNHibernate.Specs/packages.config
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version='1.0' encoding='UTF-8'?>
<packages>
<package id="NHibernate" version="4.0.2.4000" targetFramework="net40" allowedVersions="[4,)"/>
<package id="Machine.Specifications" version="0.5.15" targetFramework="net40" />
<package allowedVersions="[4,)" id="NHibernate" targetFramework="net40" version="4.0.3.4000" />
<package id="Machine.Specifications" targetFramework="net40" version="0.5.15" />
</packages>
6 changes: 3 additions & 3 deletions src/FluentNHibernate.Testing/FluentNHibernate.Testing.csproj
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<?xml version='1.0' encoding='UTF-8'?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
Expand Down Expand Up @@ -49,7 +49,7 @@
<HintPath>..\packages\Machine.Specifications.0.5.15\lib\net40\Machine.Specifications.dll</HintPath>
</Reference>
<Reference Include="NHibernate">
<HintPath>..\packages\NHibernate.4.0.2.4000\lib\net40\NHibernate.dll</HintPath>
<HintPath>..\packages\NHibernate.4.0.3.4000\lib\net40\NHibernate.dll</HintPath>
</Reference>
<Reference Include="nunit.framework, Version=2.5.7.10213, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
Expand Down
12 changes: 6 additions & 6 deletions src/FluentNHibernate.Testing/packages.config
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version='1.0' encoding='UTF-8'?>
<packages>
<package id="FakeItEasy" version="1.15.0" targetFramework="net40" />
<package id="NHibernate" version="4.0.2.4000" targetFramework="net40" allowedVersions="[4,)"/>
<package id="Machine.Specifications" version="0.5.15" targetFramework="net40" />
<package id="NUnit" version="2.5.7.10213" targetFramework="net40" />
<package id="System.Data.SQLite" version="1.0.66.1" targetFramework="net40" />
<package id="FakeItEasy" targetFramework="net40" version="1.15.0" />
<package allowedVersions="[4,)" id="NHibernate" targetFramework="net40" version="4.0.3.4000" />
<package id="Machine.Specifications" targetFramework="net40" version="0.5.15" />
<package id="NUnit" targetFramework="net40" version="2.5.7.10213" />
<package id="System.Data.SQLite" targetFramework="net40" version="1.0.66.1" />
</packages>
6 changes: 3 additions & 3 deletions src/FluentNHibernate/FluentNHibernate.csproj
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<?xml version='1.0' encoding='UTF-8'?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
Expand Down Expand Up @@ -44,7 +44,7 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="NHibernate">
<HintPath>..\packages\NHibernate.4.0.2.4000\lib\net40\NHibernate.dll</HintPath>
<HintPath>..\packages\NHibernate.4.0.3.4000\lib\net40\NHibernate.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.configuration" />
Expand Down
4 changes: 2 additions & 2 deletions src/FluentNHibernate/packages.config
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version='1.0' encoding='UTF-8'?>
<packages>
<package id="NHibernate" version="4.0.2.4000" targetFramework="net40" allowedVersions="[4,)"/>
<package allowedVersions="[4,)" id="NHibernate" targetFramework="net40" version="4.0.3.4000" />
</packages>

0 comments on commit c0f7b74

Please sign in to comment.