-
Notifications
You must be signed in to change notification settings - Fork 1
/
Rakefile
54 lines (45 loc) · 1.35 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
task default: [:install]
desc "Launch the example app"
task :example do
Rake::Task["install"].execute
sh "open example/App.xcworkspace"
end
desc "Use the plugin with the example app"
task :install do
sh "bundle install"
Dir.chdir("example") { sh "make install-dependencies" }
end
desc "Update dependencies"
task :update do
sh "bundle update"
Dir.chdir("example") do
sh "bundle exec pod install"
end
end
desc "Bump versions"
task :bump, [:version] do |t, args|
version = args[:version]
unless version
puts %{Usage: rake "bump[version]"}
next
end
Dir.chdir("example") { sh "xcrun agvtool new-marketing-version #{version}" }
spec = "lib/version.rb"
text = File.read spec
File.write spec, text.gsub(%r(\"\d+\.\d+\.\d+\"), "\"#{version}\"")
puts "Updated #{spec} to #{version}"
changelog = "CHANGELOG.md"
text = File.read changelog
File.write changelog, text.gsub(%r(Next release), "#{version}")
puts "Updated #{changelog} to #{version}"
Rake::Task["install"].execute
end
desc "Publish package"
task :publish do
require "version.rb"
version = CocoaPodsAcknowledgements::AddOns::VERSION
package = "cocoapods-acknowledgements-addons-#{version}.gem"
sh "gem build cocoapods_acknowledgements_addons.gemspec"
sh "gem push #{package}"
sh "gem push --key github --host https://rubygems.pkg.github.com/bcylin #{package}"
end