-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
62 lines (47 loc) · 1.3 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
require_relative 'build/Bundle.rb'
require_relative 'App/Version.rb'
require 'rspec/core/rake_task'
# Build bundle
task :bundle do |task|
puts "Building a bundle for '#{App::Version}'"
makeDebugifyBundle(App::Version)
end
# Build dmg
task :dmg do |task|
puts "Building a dmg for '#{App::Version}'"
makeDebugifyDmg(App::Version)
end
task :release, [:version_number] do |task, args|
ver = args[:version_number]
if (ver == nil)
newVer = App::Version.increment
newVer.meta = Time.now().strftime("%Y%m%d")
ver = newVer.to_s
end
ver, meta = ver.split('-')
ver = ver.split('.').map{ |n| n.to_i }[0..2]
File.open(VERSION_GEN_PATH, 'w') do |w|
w.write("module App\n")
w.write("module VersionData\n")
w.write("Number = #{ver}\n")
w.write("Meta = \"#{meta}\"\n")
w.write("end\n")
w.write("end\n")
end
original_verbosity = $VERBOSE
$VERBOSE = nil
load(VERSION_GEN_PATH)
load(File.dirname(__FILE__) + '/App/Version.rb')
$VERBOSE = original_verbosity
`git tag #{App::Version.tag}`
Rake::Task[:dmg].invoke
end
RSpec::Core::RakeTask.new(:spec) do |task|
task.pattern = 'spec/**{,/*/**}/*.spec.rb'
task.rspec_opts = ['--color', '--format', 'progress']
end
task :version do |task|
puts App::Version.to_safe_s
puts App::Version
end
task :default => :dmg