seagull 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ecc9260e1b3aa34c1b0015a86c624b3a2a2fec2a
4
- data.tar.gz: b5a8bb852559bbd0a715dcb89752c9f933cbf0ce
3
+ metadata.gz: 6b8088508eb222e6dbd12ea9d61609d79374c629
4
+ data.tar.gz: 29105cddf546db9ebf3f78960a378a60dcefd956
5
5
  SHA512:
6
- metadata.gz: a4a6a1dc1bb795feb679b6d0fa38bb99ccdc7d11433713aa9a17ee2001c3c9edab6a0d01b28cfcf1e1d94de8dfa04aa2399592339ab1893fd361ec5d554b1852
7
- data.tar.gz: aafc517eb22bd5bcbc87f849ea2ec5f9af9056f1153ecb2d77c8c37ec69ba4b07d7884d5c701b13b8365608d50c376b42087b15ad2ad9f09fa8144de3bf03cdc
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}.#{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 directoy exists
17
- FileUtils.mkpath(@configuration.deploy.path) unless ::File.directory?(@configuration.deploy.path)
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
- system("/usr/bin/zip --symlinks --recurse-paths #{Shellwords.escape(deploy_path)} #{Shellwords.escape(@configuration.archive_file_name(release_type: @configuration.active_release_type))}")
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 = :seagull, &block)
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
- # Detect some defaults
31
- namespace(@namespace) do
32
- task :clean do
33
- unless @configuration.skip_clean
34
- xctool @configuration.build_arguments, "clean"
35
- end
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
- desc "Build and run tests"
39
- task test: [] do
40
- xctool @configuration.build_arguments(configuration: @configuration.configuration.debug, arch: 'i386', sdk: 'iphonesimulator'), "clean", "test", "-freshInstall", "-freshSimulator"
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
- # File dependencies
44
- @configuration.configuration.to_hash.each do |type, conf|
45
- file @configuration.archive_full_path(type) do
46
- xctool @configuration.build_arguments(configuration: conf), "archive", "-archivePath", Shellwords.escape(@configuration.archive_full_path(type))
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
- file @configuration.ipa_full_path(type) => @configuration.archive_full_path(type) do
50
- xcodebuild "-exportArchive", "-exportFormat", "ipa", "-archivePath", Shellwords.escape(@configuration.archive_full_path(type)), "-exportPath", Shellwords.escape(@configuration.ipa_full_path(type))
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
- file @configuration.dsym_full_path(type) => @configuration.archive_full_path(type) do
54
- dsym_path = File.expand_path(Dir["#{@configuration.archive_full_path(type)}/dSYMS/*"].first)
55
- Dir.chdir dsym_path do
56
- sh("/usr/bin/zip --symlinks --verbose --recurse-paths '#{@configuration.dsym_full_path(type)}' .")
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
- ['beta', 'release'].each do |type|
62
- namespace(type) do
63
- desc "Archive the #{type} version as an XCArchive file"
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
- # Version control
92
- namespace(:version) do
93
- desc "Bumps build number"
94
- task bump: ['git:verify:dirty'] do
95
- sh("agvtool bump -all")
96
- @configuration.reload_version!
97
-
98
- # Edit changelog
99
- Rake::Task["#{@namespace}:changelog:edit"].invoke
100
- Rake::Task["#{@namespace}:version:commit"].invoke
101
- Rake::Task["#{@namespace}:version:tag"].invoke
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
- task :tag do
105
- current_tag = %x{git describe --exact-match `git rev-parse HEAD` 2>/dev/null}.strip
106
- unless current_tag == @configuration.version_tag
107
- sh("git tag -m 'Released version #{@configuration.full_version}' -s '#{@configuration.version_tag}'")
108
- end
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
- task :commit do
112
- ver_files = %x{git status --porcelain}.split("\n").collect{|a| Shellwords.escape(a.gsub(/[ AM\?]+ (.*)/, '\1'))}
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
- namespace(:changelog) do
122
- desc "Edit changelog for current version"
123
- task :edit do
124
- changelog = if File.exists?(@configuration.changelog_file)
125
- File.read(@configuration.changelog_file)
126
- else
127
- ""
128
- end
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
- tag = %x{git describe --exact-match `git rev-parse HEAD` 2>/dev/null}.strip
131
- tag_date = Date.parse(%x{git log -1 --format=%ai #{tag}})
132
-
133
- # Parse current changelog
134
- 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')
135
- changes = parser.parse
136
-
137
- # Write entry to changelog
138
- File.open('CHANGELOG.md', 'w') do |io|
139
- unless @configuration.full_version
140
- io.puts "**#{@configuration.full_version} / #{tag_date.strftime('%Y-%m-%d')}**"
141
- io.puts ""
142
- %w{FIXED SECURITY FEATURE ENHANCEMENT PERFORMANCE}.each do |kw|
143
- io.puts " * **#{kw}** Describe changes here or remove if not required"
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 changelog
153
+ io.puts ""
148
154
  end
149
- sh("#{ENV['EDITOR']} CHANGELOG.md")
155
+ io.puts changelog
150
156
  end
157
+ sh("#{ENV['EDITOR']} CHANGELOG.md")
151
158
  end
152
-
153
- namespace(:git) do
154
- namespace(:verify) do
155
- # Verify GIT tag
156
- task :tag do
157
- current_tag = %x{git describe --exact-match `git rev-parse HEAD` 2>/dev/null}.strip
158
- unless current_tag == @configuration.version_tag
159
- puts ""
160
- puts Term::ANSIColor.red("!!! Current commit is not properly tagged in GIT. Please tag and release version.")
161
- puts ""
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
- fail unless ENV['IGNORE_GIT_TAG']
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
- task verify: ['verify:tag', 'verify:dirty']
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
- def xctool(*args)
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
 
@@ -2,7 +2,7 @@ module Seagull
2
2
  class Version
3
3
  MAJOR = 0
4
4
  MINOR = 1
5
- PATCH = 1
5
+ PATCH = 2
6
6
 
7
7
  STRING = [MAJOR, MINOR, PATCH].join('.')
8
8
  end
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.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-23 00:00:00.000000000 Z
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: