seagull 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/seagull/configuration.rb +11 -1
- data/lib/seagull/deployment_strategies/file.rb +10 -3
- data/lib/seagull/tasks.rb +139 -130
- data/lib/seagull/version.rb +1 -1
- data/seagull.gemspec +2 -0
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6b8088508eb222e6dbd12ea9d61609d79374c629
|
4
|
+
data.tar.gz: 29105cddf546db9ebf3f78960a378a60dcefd956
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e723faa16b6e1fd0ccbfae25db8afc265d447e0cbb4dfc467df81708e749ee67498557823165372afe8b73ebffcd1ed8363377c6ef96114027cdc755faf4b406
|
7
|
+
data.tar.gz: 431b6099e09a506c5b7343490ea9f96c37b87b61d7cbfc14e68074d8a0c5e4cf1438f07778cc3a233d95f04c4ad8fcf9f48e7ee4feef035f4554adf875b53663
|
@@ -108,7 +108,7 @@ module Seagull
|
|
108
108
|
end
|
109
109
|
|
110
110
|
def full_version
|
111
|
-
"#{marketing_version}
|
111
|
+
"#{marketing_version}-#{version}"
|
112
112
|
end
|
113
113
|
|
114
114
|
def version_tag
|
@@ -132,5 +132,15 @@ module Seagull
|
|
132
132
|
|
133
133
|
args.collect{|k,v| "-#{k} #{Shellwords.escape(v)}"}
|
134
134
|
end
|
135
|
+
|
136
|
+
def environment_for(release_type)
|
137
|
+
env = []
|
138
|
+
if release_type == 'release'
|
139
|
+
env << 'CODE_SIGN_IDENTITY=""'
|
140
|
+
env << 'CODE_SIGNING_REQUIRED=NO'
|
141
|
+
end
|
142
|
+
|
143
|
+
env
|
144
|
+
end
|
135
145
|
end
|
136
146
|
end
|
@@ -13,22 +13,29 @@ module Seagull
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def deploy
|
16
|
-
# Make sure destionation
|
17
|
-
|
16
|
+
# Make sure destionation directory exists
|
17
|
+
unless ::File.directory?(@configuration.deploy.path)
|
18
|
+
puts "Creating #{@configuration.deploy.path}"
|
19
|
+
FileUtils.mkpath(@configuration.deploy.path)
|
20
|
+
end
|
18
21
|
|
19
22
|
# Copy xcarchive
|
20
23
|
Dir.chdir(@configuration.archive_path) do
|
21
24
|
deploy_path = ::File.join(@configuration.deploy.path, @configuration.archive_file_name(release_type: @configuration.active_release_type) + ".zip")
|
22
25
|
FileUtils.rm deploy_path if ::File.exists?(deploy_path)
|
23
|
-
|
26
|
+
puts "Creating XCArchive for deployment..."
|
27
|
+
system("/usr/bin/zip --quiet --symlinks --recurse-paths #{Shellwords.escape(deploy_path)} #{Shellwords.escape(@configuration.archive_file_name(release_type: @configuration.active_release_type))}")
|
24
28
|
end
|
25
29
|
|
26
30
|
[
|
27
31
|
@configuration.ipa_full_path(@configuration.active_release_type),
|
28
32
|
@configuration.dsym_full_path(@configuration.active_release_type),
|
29
33
|
].each do |f|
|
34
|
+
puts "Copying #{::File.basename(f)} for deployment..."
|
30
35
|
FileUtils.cp_r f, @configuration.deploy.path
|
31
36
|
end
|
37
|
+
|
38
|
+
puts "Deployed to #{@configuration.deploy.path}/#{@configuration.archive_file_name(release_type: @configuration.active_release_type)}"
|
32
39
|
end
|
33
40
|
|
34
41
|
private
|
data/lib/seagull/tasks.rb
CHANGED
@@ -7,7 +7,7 @@ require 'seagull/configuration'
|
|
7
7
|
|
8
8
|
module Seagull
|
9
9
|
class Tasks < ::Rake::TaskLib
|
10
|
-
def initialize(namespace =
|
10
|
+
def initialize(namespace = '', &block)
|
11
11
|
@configuration = Configuration.new
|
12
12
|
@namespace = namespace
|
13
13
|
|
@@ -27,168 +27,177 @@ module Seagull
|
|
27
27
|
|
28
28
|
private
|
29
29
|
def define
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
30
|
+
if @namespace and !@namespace.empty?
|
31
|
+
namespace(@namespace) do
|
32
|
+
define_tasks
|
33
|
+
end
|
34
|
+
else
|
35
|
+
define_tasks
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
def define_tasks
|
40
|
+
task :clean do
|
41
|
+
unless @configuration.skip_clean
|
42
|
+
xctool @configuration.build_arguments, "clean"
|
36
43
|
end
|
44
|
+
end
|
37
45
|
|
38
|
-
|
39
|
-
|
40
|
-
|
46
|
+
desc "Build and run tests"
|
47
|
+
task test: [] do
|
48
|
+
xctool @configuration.build_arguments(configuration: @configuration.configuration.debug, arch: 'i386', sdk: 'iphonesimulator'), "clean", "test", "-freshInstall", "-freshSimulator"
|
49
|
+
end
|
50
|
+
|
51
|
+
# File dependencies
|
52
|
+
@configuration.configuration.to_hash.each do |type, conf|
|
53
|
+
file @configuration.archive_full_path(type) do
|
54
|
+
xcodebuild @configuration.build_arguments(configuration: conf), "archive", "-archivePath", Shellwords.escape(@configuration.archive_full_path(type)), @configuration.environment_for(type)
|
55
|
+
end
|
56
|
+
|
57
|
+
file @configuration.ipa_full_path(type) => @configuration.archive_full_path(type) do
|
58
|
+
xcodebuild "-exportArchive", "-exportFormat", "ipa", "-archivePath", Shellwords.escape(@configuration.archive_full_path(type)), "-exportPath", Shellwords.escape(@configuration.ipa_full_path(type))
|
41
59
|
end
|
42
60
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
61
|
+
file @configuration.dsym_full_path(type) => @configuration.archive_full_path(type) do
|
62
|
+
dsym_path = File.expand_path(Dir["#{@configuration.archive_full_path(type)}/dSYMS/*"].first)
|
63
|
+
Dir.chdir dsym_path do
|
64
|
+
sh("/usr/bin/zip --symlinks --verbose --recurse-paths '#{@configuration.dsym_full_path(type)}' .")
|
47
65
|
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
['beta', 'release'].each do |type|
|
70
|
+
namespace(type) do
|
71
|
+
desc "Archive the #{type} version as an XCArchive file"
|
72
|
+
task archive: [@configuration.archive_full_path(type)]
|
48
73
|
|
49
|
-
|
50
|
-
|
51
|
-
end
|
74
|
+
desc "Package the #{type} version as an IPA file"
|
75
|
+
task package: [@configuration.ipa_full_path(type), @configuration.dsym_full_path(type)]
|
52
76
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
77
|
+
if @configuration.deployment_strategies
|
78
|
+
desc "Prepare your app for deployment"
|
79
|
+
task prepare: ['git:verify', :package] do
|
80
|
+
@configuration.deployment_strategy(type).prepare
|
57
81
|
end
|
58
|
-
end
|
59
|
-
end
|
60
82
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
task archive: [@configuration.archive_full_path(type)]
|
65
|
-
|
66
|
-
desc "Package the #{type} version as an IPA file"
|
67
|
-
task package: [@configuration.ipa_full_path(type), @configuration.dsym_full_path(type)]
|
68
|
-
|
69
|
-
if @configuration.deployment_strategies
|
70
|
-
desc "Prepare your app for deployment"
|
71
|
-
task prepare: ['git:verify', :package] do
|
72
|
-
@configuration.deployment_strategy(type).prepare
|
73
|
-
end
|
74
|
-
|
75
|
-
desc "Deploy the beta using your chosen deployment strategy"
|
76
|
-
task deploy: [:prepare] do
|
77
|
-
@configuration.deployment_strategy(type).deploy
|
78
|
-
end
|
79
|
-
|
80
|
-
desc "Deploy the last build"
|
81
|
-
task redeploy: [:prepre, :deploy]
|
83
|
+
desc "Deploy the beta using your chosen deployment strategy"
|
84
|
+
task deploy: [:prepare] do
|
85
|
+
@configuration.deployment_strategy(type).deploy
|
82
86
|
end
|
83
|
-
|
87
|
+
|
88
|
+
desc "Deploy the last build"
|
89
|
+
task redeploy: [:prepre, :deploy]
|
84
90
|
end
|
85
91
|
|
86
|
-
desc "Build, package and deploy beta build"
|
87
|
-
task type => ["#{type}:deploy"] do
|
88
|
-
end
|
89
92
|
end
|
90
93
|
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
end
|
94
|
+
desc "Build, package and deploy beta build"
|
95
|
+
task type => ["#{type}:deploy"] do
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
# Version control
|
100
|
+
namespace(:version) do
|
101
|
+
desc "Bumps build number"
|
102
|
+
task bump: ['git:verify:dirty'] do
|
103
|
+
sh("agvtool bump -all")
|
104
|
+
@configuration.reload_version!
|
103
105
|
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
106
|
+
# Edit changelog
|
107
|
+
Rake::Task["changelog:edit"].invoke
|
108
|
+
Rake::Task["version:commit"].invoke
|
109
|
+
Rake::Task["version:tag"].invoke
|
110
|
+
end
|
111
|
+
|
112
|
+
task :tag do
|
113
|
+
current_tag = %x{git describe --exact-match `git rev-parse HEAD` 2>/dev/null}.strip
|
114
|
+
unless current_tag == @configuration.version_tag
|
115
|
+
sh("git tag -m 'Released version #{@configuration.full_version}' -s '#{@configuration.version_tag}'")
|
109
116
|
end
|
117
|
+
end
|
118
|
+
|
119
|
+
task :commit do
|
120
|
+
ver_files = %x{git status --porcelain}.split("\n").collect{|a| Shellwords.escape(a.gsub(/[ AM\?]+ (.*)/, '\1'))}
|
110
121
|
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
Dir.chdir(git_directory) do
|
115
|
-
sh("git add #{ver_files.join(' ')}")
|
116
|
-
sh("git commit -m 'Bumped version to #{@configuration.full_version}' #{ver_files.join(' ')}")
|
117
|
-
end
|
122
|
+
Dir.chdir(git_directory) do
|
123
|
+
sh("git add #{ver_files.join(' ')}")
|
124
|
+
sh("git commit -m 'Bumped version to #{@configuration.full_version}' #{ver_files.join(' ')}")
|
118
125
|
end
|
119
126
|
end
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
127
|
+
end
|
128
|
+
|
129
|
+
namespace(:changelog) do
|
130
|
+
desc "Edit changelog for current version"
|
131
|
+
task :edit do
|
132
|
+
changelog = if File.exists?(@configuration.changelog_file)
|
133
|
+
File.read(@configuration.changelog_file)
|
134
|
+
else
|
135
|
+
""
|
136
|
+
end
|
129
137
|
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
end
|
145
|
-
io.puts ""
|
138
|
+
tag = %x{git describe --exact-match `git rev-parse HEAD` 2>/dev/null}.strip
|
139
|
+
tag_date = Date.parse(%x{git log -1 --format=%ai #{tag}})
|
140
|
+
|
141
|
+
# Parse current changelog
|
142
|
+
parser = Vandamme::Parser.new(changelog: changelog, version_header_exp: '^\*\*?([\w\d\.-]+\.[\w\d\.-]+[a-zA-Z0-9])( \/ (\d{4}-\d{2}-\d{2}|\w+))?\*\*\n?[=-]*', format: 'markdown')
|
143
|
+
changes = parser.parse
|
144
|
+
|
145
|
+
# Write entry to changelog
|
146
|
+
File.open('CHANGELOG.md', 'w') do |io|
|
147
|
+
unless changes.keys.include?(@configuration.full_version)
|
148
|
+
io.puts "**#{@configuration.full_version} / #{tag_date.strftime('%Y-%m-%d')}**"
|
149
|
+
io.puts ""
|
150
|
+
%w{FIXED SECURITY FEATURE ENHANCEMENT PERFORMANCE}.each do |kw|
|
151
|
+
io.puts " * **#{kw}** Describe changes here or remove if not required"
|
146
152
|
end
|
147
|
-
io.puts
|
153
|
+
io.puts ""
|
148
154
|
end
|
149
|
-
|
155
|
+
io.puts changelog
|
150
156
|
end
|
157
|
+
sh("#{ENV['EDITOR']} CHANGELOG.md")
|
151
158
|
end
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
159
|
+
end
|
160
|
+
|
161
|
+
namespace(:git) do
|
162
|
+
namespace(:verify) do
|
163
|
+
# Verify GIT tag
|
164
|
+
task :tag do
|
165
|
+
current_tag = %x{git describe --exact-match `git rev-parse HEAD` 2>/dev/null}.strip
|
166
|
+
unless current_tag == @configuration.version_tag
|
167
|
+
puts ""
|
168
|
+
puts Term::ANSIColor.red("!!! Current commit is not properly tagged in GIT. Please tag and release version.")
|
169
|
+
puts "Or specify IGNORE_GIT_TAG=1 environmental variable to skip this check."
|
170
|
+
puts ""
|
162
171
|
|
163
|
-
|
164
|
-
end
|
165
|
-
end
|
166
|
-
|
167
|
-
# Verify dirty
|
168
|
-
task :dirty do
|
169
|
-
unless %x{git status -s --ignore-submodules=dirty 2> /dev/null}.empty?
|
170
|
-
puts ""
|
171
|
-
puts Term::ANSIColor.red("!!! Current GIT tree is dirty. Please commit changes before building release.")
|
172
|
-
puts ""
|
173
|
-
|
174
|
-
fail unless ENV['IGNORE_GIT_DIRTY']
|
175
|
-
end
|
172
|
+
fail unless ENV['IGNORE_GIT_TAG']
|
176
173
|
end
|
177
174
|
end
|
178
175
|
|
179
|
-
|
176
|
+
# Verify dirty
|
177
|
+
task :dirty do
|
178
|
+
unless %x{git status -s --ignore-submodules=dirty 2> /dev/null}.empty?
|
179
|
+
puts ""
|
180
|
+
puts Term::ANSIColor.red("!!! Current GIT tree is dirty. Please commit changes before building release.")
|
181
|
+
puts "Or specify IGNORE_GIT_DIRTY=1 environmental variable to skip this check."
|
182
|
+
puts ""
|
183
|
+
|
184
|
+
fail unless ENV['IGNORE_GIT_DIRTY']
|
185
|
+
end
|
186
|
+
end
|
180
187
|
end
|
181
188
|
|
182
|
-
|
183
|
-
sh("#{@configuration.xctool_path} #{args.join(" ")}")
|
184
|
-
end
|
185
|
-
|
186
|
-
def xcodebuild(*args)
|
187
|
-
sh("#{@configuration.xcodebuild_path} #{args.join(" ")} | xcpretty -c; exit ${PIPESTATUS[0]}")
|
188
|
-
end
|
189
|
+
task verify: ['verify:tag', 'verify:dirty']
|
189
190
|
end
|
190
191
|
end
|
191
192
|
|
193
|
+
def xctool(*args)
|
194
|
+
sh("#{@configuration.xctool_path} #{args.join(" ")}")
|
195
|
+
end
|
196
|
+
|
197
|
+
def xcodebuild(*args)
|
198
|
+
sh("#{@configuration.xcodebuild_path} #{args.join(" ")} | xcpretty -c; exit ${PIPESTATUS[0]}")
|
199
|
+
end
|
200
|
+
|
192
201
|
def git_directory
|
193
202
|
original_cwd = Dir.pwd
|
194
203
|
|
data/lib/seagull/version.rb
CHANGED
data/seagull.gemspec
CHANGED
@@ -18,6 +18,8 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
+
spec.required_ruby_version = '~> 2.0'
|
22
|
+
|
21
23
|
spec.add_dependency "rake", "~> 10.1"
|
22
24
|
spec.add_dependency "xcpretty", "~> 0.1.3"
|
23
25
|
spec.add_dependency "app_conf", "~> 0.4.2"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: seagull
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mikko Kokkonen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -180,9 +180,9 @@ require_paths:
|
|
180
180
|
- lib
|
181
181
|
required_ruby_version: !ruby/object:Gem::Requirement
|
182
182
|
requirements:
|
183
|
-
- - "
|
183
|
+
- - "~>"
|
184
184
|
- !ruby/object:Gem::Version
|
185
|
-
version: '0'
|
185
|
+
version: '2.0'
|
186
186
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
187
187
|
requirements:
|
188
188
|
- - ">="
|
@@ -195,3 +195,4 @@ signing_key:
|
|
195
195
|
specification_version: 4
|
196
196
|
summary: Manage Xcode projects with total control
|
197
197
|
test_files: []
|
198
|
+
has_rdoc:
|