mirror of https://github.com/AMT-Cheif/Stylet.git
Add version task
This commit is contained in:
parent
a90f1d3c2f
commit
fc1198dae6
19
Rakefile
19
Rakefile
|
@ -13,6 +13,8 @@ COVERAGE_FILE = File.join(COVERAGE_DIR, 'coverage.xml')
|
|||
GITLINK_REMOTE = 'https://github.com/canton7/stylet'
|
||||
NUSPEC = 'NuGet/Stylet.nuspec'
|
||||
|
||||
ASSEMBLY_INFO = 'Stylet/Properties/AssemblyInfo.cs'
|
||||
|
||||
directory COVERAGE_DIR
|
||||
|
||||
desc "Build Stylet.sln using the current CONFIG (or Debug)"
|
||||
|
@ -108,6 +110,22 @@ task :package do
|
|||
end
|
||||
end
|
||||
|
||||
desc "Bump version number"
|
||||
task :version, [:version] do |t, args|
|
||||
parts = args[:version].split('.')
|
||||
parts << '0' if parts.length == 3
|
||||
version = parts.join('.')
|
||||
|
||||
content = IO.read(ASSEMBLY_INFO)
|
||||
content[/^\[assembly: AssemblyVersion\(\"(.+?)\"\)\]/, 1] = version
|
||||
content[/^\[assembly: AssemblyFileVersion\(\"(.+?)\"\)\]/, 1] = version
|
||||
File.open(ASSEMBLY_INFO, 'w'){ |f| f.write(content) }
|
||||
|
||||
content = IO.read(NUSPEC)
|
||||
content[/<version>(.+?)<\/version>/, 1] = args[:version]
|
||||
File.open(NUSPEC, 'w'){ |f| f.write(content) }
|
||||
end
|
||||
|
||||
desc "Extract StyletIoC as a standalone file"
|
||||
task :"extract-stylet-ioc" do
|
||||
filenames = Dir['Stylet/StyletIoC/**/*.cs']
|
||||
|
@ -151,3 +169,4 @@ task :"extract-stylet-ioc" do
|
|||
# puts merged_contents
|
||||
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue