Skip to content

Commit 851df5d

Browse files
committed
updating .nuspec file from Rake, update gem versions, get rid of AssemblyInfo.cs
1 parent 4130bad commit 851df5d

File tree

8 files changed

+69
-68
lines changed

8 files changed

+69
-68
lines changed

Gemfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
source 'https://rubygems.org'
22

3-
gem 'rake'
4-
gem 'albacore'
3+
source 'https://rubygems.org'
4+
gem 'albacore', '~>1.0.0.rc2'

Gemfile.lock

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
GEM
2-
remote: http://rubygems.org/
3-
remote: http://gemcutter.org/
2+
remote: https://rubygems.org/
3+
remote: https://rubygems.org/
44
specs:
5-
albacore (0.2.7)
6-
rubyzip (~> 0.9)
7-
rake (0.9.2.2)
8-
rubyzip (0.9.8)
5+
albacore (1.0.0.rc.2)
6+
nokogiri (~> 1.5)
7+
rake
8+
rubyzip (~> 1.0)
9+
mini_portile (0.6.0)
10+
nokogiri (1.6.2.1-x64-mingw32)
11+
mini_portile (= 0.6.0)
12+
rake (10.3.2)
13+
rubyzip (1.1.3)
914

1015
PLATFORMS
11-
x86-mingw32
16+
x64-mingw32
1217

1318
DEPENDENCIES
14-
albacore
15-
rake
19+
albacore (~> 1.0.0.rc2)

RakeFile

Lines changed: 45 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
require 'fileutils'
2+
require 'rexml/document'
23
require 'albacore'
34

45
NH_VERSION = '4.x'
6+
NUSPEC_PATH = 'src/FluentNHibernate.nuspec'
7+
SLN_PATH = 'src/FluentNHibernate.sln'
58

69
# Albacore.configure do |config|
710
# config.log_level = :verbose
@@ -30,7 +33,7 @@ module Platform
3033
end
3134

3235
def get_version
33-
ENV['BUILD_NUMBER'] || '1.4.0.0'
36+
ENV['BUILD_NUMBER'] || '2.0.0.1'
3437
end
3538

3639
task :default => ['ripple:restore', 'source:update_version', 'build:all']
@@ -87,7 +90,7 @@ namespace :source do
8790
WarningLevel: 0
8891
}
8992
msb.targets [:Clean, :Build]
90-
msb.solution = 'src/FluentNHibernate.sln'
93+
msb.solution = SLN_PATH
9194
msb.verbosity = :minimal
9295
msb.parameters = ["/p:TargetFrameworkVersion=v4.0"]
9396
end
@@ -107,7 +110,7 @@ namespace :specs do
107110
nunit :nunit do |nunit|
108111
nunit.command = 'src/packages/NUnit.2.5.7.10213/Tools/nunit-console-x86.exe'
109112
nunit.assemblies 'src/FluentNHibernate.Testing/bin/Release/FluentNHibernate.Testing.dll'
110-
nunit.parameters = [ "/framework:net-4.0" ]
113+
nunit.parameters = [ "/framework:net-4.0" ]
111114
end
112115
end
113116

@@ -170,41 +173,59 @@ namespace :package do
170173
zip.output_path = 'dist'
171174
end
172175

173-
nuspec do |nu|
174-
nu.id = 'FluentNHibernate'
175-
nu.version = get_version()
176-
nu.authors = 'James Gregory and contributors'
177-
nu.description = 'Fluent, XML-less, compile safe, automated, convention-based mappings for NHibernate.'
178-
nu.title = 'Fluent NHibernate'
179-
nu.language = 'en-US'
180-
nu.licenseUrl = 'http://github.com/jagregory/fluent-nhibernate/raw/master/LICENSE.txt'
181-
nu.projectUrl = 'http://fluentnhibernate.org'
182-
nu.dependency 'NHibernate', '4.0'
183-
nu.working_directory = Dir.pwd
184-
nu.output_file = 'fluentnhibernate.nuspec'
185-
nu.file 'FluentNHibernate.dll', 'lib/net40'
186-
nu.file 'FluentNHibernate.pdb', 'lib/net40'
187-
nu.file 'FluentNHibernate.xml', 'lib/net40'
188-
nu.tags = 'orm dal nhibernate conventions'
189-
nu.pretty_formatting = true
176+
task :nuspec do |nu|
177+
puts "Updating #{NUSPEC_PATH}"
178+
update_xml NUSPEC_PATH do |xml|
179+
# Override the version number in the nuspec file with the one from this rake file (set above)
180+
xml.root.elements["metadata/version"].text = get_version
181+
182+
xml.root.elements["metadata/dependencies/dependency[@id='NHibernate']"].attributes['version'] = '4.0'
183+
184+
xml.root.elements["metadata/authors"].text = "James Gregory and contributors"
185+
xml.root.elements["metadata/owners"].text = "jagregory, chester89"
186+
xml.root.elements["metadata/language"].text = "en-US"
187+
xml.root.elements["metadata/description"].text = "Fluent, XML-less, compile safe, automated, convention-based mappings for NHibernate."
188+
xml.root.elements["metadata/licenseUrl"].text = "http://github.com/jagregory/fluent-nhibernate/raw/master/LICENSE.txt"
189+
xml.root.elements["metadata/projectUrl"].text = "http://fluentnhibernate.org"
190+
xml.root.elements["metadata/tags"].text = "orm dal nhibernate conventions"
191+
192+
xml.root.elements["files/file[contains(@src, 'bin\\Release\\FluentNHibernate.*')]"].attributes['target'] = 'lib\net40'
193+
end
190194
end
191195

192-
nugetpack do |nu|
196+
nugetpack :nupack do |nu|
193197
nu.command = 'tools/nuget/NuGet.exe'
194-
nu.nuspec = 'src/FluentNHibernate.nuspec'
198+
nu.nuspec = NUSPEC_PATH
195199
nu.base_folder = 'Release'
196200
nu.output = 'dist'
197201
end
198202

199203
desc 'Create nuget spec and package'
200-
task :nuget => [:nugetpack]
204+
task :nuget => [:nuspec, :nupack]
201205

202206
desc 'Package everything (src, bin, docs, nuget)'
203207
task :all => [:source, :binaries, :docs, :nuget]
204208
end
205209

210+
def update_xml(xml_path)
211+
#Open up the xml file
212+
xml_file = File.new(xml_path)
213+
xml = REXML::Document.new xml_file
214+
215+
#Allow caller to make the changes
216+
yield xml
217+
218+
xml_file.close
219+
220+
#Save the changes
221+
xml_file = File.open(xml_path, "w")
222+
formatter = REXML::Formatters::Default.new(5)
223+
formatter.write(xml, xml_file)
224+
xml_file.close
225+
end
226+
206227
task :sln do
207228
Thread.new do
208-
system "devenv src/FluentNHibernate.sln"
229+
system "devenv #{SLN_PATH}"
209230
end
210231
end

src/FluentNHibernate.Testing/FluentNHibernate.Testing.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
<SchemaVersion>2.0</SchemaVersion>
88
<ProjectGuid>{F5DC3221-827E-4CB4-B61C-5F50EB4D32EA}</ProjectGuid>
99
<OutputType>Library</OutputType>
10-
<AppDesignerFolder>Properties</AppDesignerFolder>
1110
<RootNamespace>FluentNHibernate.Testing</RootNamespace>
1211
<AssemblyName>FluentNHibernate.Testing</AssemblyName>
1312
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>

src/FluentNHibernate.Testing/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/FluentNHibernate.nuspec

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
1-
<?xml version="1.0"?>
2-
<package xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
3-
<metadata xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
1+
<?xml version='1.0'?>
2+
<package xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
3+
<metadata xmlns='http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd'>
44
<id>FluentNHibernate</id>
5-
<version>1.4.0.0</version>
5+
<version>2.0.0.1</version>
66
<authors>James Gregory and contributors</authors>
77
<owners>jagregory, chester89</owners>
8-
<licenseUrl>http://github.com/jagregory/fluent-nhibernate/blob/master/LICENSE.txt</licenseUrl>
9-
<projectUrl>http://github.com/jagregory/fluent-nhibernate/</projectUrl>
8+
<licenseUrl>http://github.com/jagregory/fluent-nhibernate/raw/master/LICENSE.txt</licenseUrl>
9+
<projectUrl>http://fluentnhibernate.org</projectUrl>
1010
<dependencies>
11-
<dependency id="NHibernate" version="4.0" />
11+
<dependency id='NHibernate' version='4.0' />
1212
</dependencies>
1313
<requireLicenseAcceptance>false</requireLicenseAcceptance>
1414
<description>Fluent, XML-less, compile safe, automated, convention-based mappings for NHibernate.</description>
15-
<summary>Fluent NHibernate provides a convenient way to configure NHibernate - no XML involved.</summary>
16-
<tags>orm dal nhibernate conventions</tags>
15+
<tags>orm dal nhibernate conventions</tags>
1716
<language>en-US</language>
1817
</metadata>
1918
<files>
20-
<file src="..\src\FluentNHibernate\bin\Release\FluentNHibernate.*" target="lib\net40" />
19+
<file src='..\src\FluentNHibernate\bin\Release\FluentNHibernate.*' target='lib\net40' />
2120
</files>
2221
</package>

src/FluentNHibernate/FluentNHibernate.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
<SchemaVersion>2.0</SchemaVersion>
88
<ProjectGuid>{529145D5-6CC3-4016-89B5-826563024AF1}</ProjectGuid>
99
<OutputType>Library</OutputType>
10-
<AppDesignerFolder>Properties</AppDesignerFolder>
1110
<RootNamespace>FluentNHibernate</RootNamespace>
1211
<AssemblyName>FluentNHibernate</AssemblyName>
1312
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>

src/FluentNHibernate/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)