gym 1.6.2 → 1.6.3

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: 51ccfb15ad789256bd2a6c0deed09836bfefc1b7
4
- data.tar.gz: 7403f758d8fe7b9c82fc40b6929209835ba4a607
3
+ metadata.gz: 378f10d0a08b2c15f6363308f7283df7df4ecfe3
4
+ data.tar.gz: 3e8786dbc86d23826a378d00d73b24e868ab7fc0
5
5
  SHA512:
6
- metadata.gz: e81a226ff214a7eaacaa91f8e72562a7f033d1d34fde6aa4dacd11f4efda4070fc22bfcb8d5167c91f676423694e4a1d9f8f7c10d995b9cd02851ed1ba8c6a5c
7
- data.tar.gz: c7ab8a3465999084474c0bfdea6358eb1f9cdeb1a0d1a78cfad84c8f90204221b1ef27de784afce1ab12e53e30697d3f52436cbe0c15837e3b76ee05fa4a9e28
6
+ metadata.gz: 0fd65c7716687b32d54762e17b9a920d1ba271dd788308584a5a9b2b263e7398654fd50e94e1963f4256525dd3a45205f7faadb0ca9219e227a6138e46d99008
7
+ data.tar.gz: 4cd197f9fb6535496c5b6e287cb5739615c45112467a211f5d538b3ab8d9ac51b8177ec8b964bafcb84078674ca7a9bf513e7c591af5c542b159f298a90e0fc0
data/README.md CHANGED
@@ -49,11 +49,11 @@ Get in contact with the developer on Twitter: [@FastlaneTools](https://twitter.c
49
49
 
50
50
  -------
51
51
 
52
- <h5 align="center"><code>gym</code> is part of <a href="https://fastlane.tools">fastlane</a>: connect all deployment tools into one streamlined workflow.</h5>
52
+ <h5 align="center"><code>gym</code> is part of <a href="https://fastlane.tools">fastlane</a>: The easiest way to automate building and releasing your iOS and Android apps.</h5>
53
53
 
54
54
  # What's gym?
55
55
 
56
- `gym` builds and packages iOS apps for you. It takes care of all the heavy lifting and makes it super easy to generate a signed `ipa` file :muscle:
56
+ `gym` builds and packages iOS and OS X apps for you. It takes care of all the heavy lifting and makes it super easy to generate a signed `ipa` or `app` file :muscle:
57
57
 
58
58
  `gym` is a replacement for [shenzhen](https://github.com/nomad/shenzhen).
59
59
 
@@ -254,7 +254,7 @@ Afterwards the `ipa` file is moved to the output folder. The `dSYM` file is comp
254
254
  # Tips
255
255
  ## [`fastlane`](https://fastlane.tools) Toolchain
256
256
 
257
- - [`fastlane`](https://fastlane.tools): Connect all deployment tools into one streamlined workflow
257
+ - [`fastlane`](https://fastlane.tools): The easiest way to automate building and releasing your iOS and Android apps
258
258
  - [`deliver`](https://github.com/fastlane/fastlane/tree/master/deliver): Upload screenshots, metadata and your app to the App Store
259
259
  - [`snapshot`](https://github.com/fastlane/fastlane/tree/master/snapshot): Automate taking localized screenshots of your iOS app on every device
260
260
  - [`frameit`](https://github.com/fastlane/fastlane/tree/master/frameit): Quickly put your screenshots into the right device frames
data/lib/gym.rb CHANGED
@@ -35,6 +35,7 @@ module Gym
35
35
  require 'gym/xcodebuild_fixes/swift_fix'
36
36
  require 'gym/xcodebuild_fixes/watchkit_fix'
37
37
  require 'gym/xcodebuild_fixes/watchkit2_fix'
38
+ require 'gym/xcodebuild_fixes/generic_archive_fix'
38
39
  require 'gym/xcodebuild_fixes/package_application_fix'
39
40
  end
40
41
  end
@@ -40,7 +40,7 @@ module Gym
40
40
  profile = File.expand_path(profiles.last)
41
41
  elsif profiles.count > 1
42
42
  UI.message "Found more than one provisioning profile in the project directory:"
43
- profile = choose(*(profiles))
43
+ profile = choose(*profiles)
44
44
  end
45
45
 
46
46
  Gym.config[:provisioning_profile_path] = profile
@@ -1,3 +1,4 @@
1
+ # coding: utf-8
1
2
  module Gym
2
3
  # This classes methods are called when something goes wrong in the building process
3
4
  class ErrorHandler
@@ -11,30 +12,30 @@ module Gym
11
12
  print "Invalid code signing settings"
12
13
  print "Your project defines a provisioning profile which doesn't exist on your local machine"
13
14
  print "You can use sigh (https://github.com/fastlane/fastlane/tree/master/sigh) to download and install the provisioning profile"
14
- print "Follow this guide: https://github.com/fastlane/fastlane/blob/master/docs/CodeSigning.md"
15
+ print "Follow this guide: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/CodeSigning.md"
15
16
  when /Provisioning profile does not match bundle identifier/
16
17
  print "Invalid code signing settings"
17
18
  print "Your project defines a provisioning profile that doesn't match the bundle identifier of your app"
18
19
  print "Make sure you use the correct provisioning profile for this app"
19
20
  print "Take a look at the ouptput above for more information"
20
- print "You can follow this guide: https://github.com/fastlane/fastlane/blob/master/docs/CodeSigning.md"
21
+ print "You can follow this guide: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/CodeSigning.md"
21
22
  when /provisioning profiles matching the bundle identifier .(.*)./ # the . around the (.*) are for the strange "
22
23
  print "You don't have the provisioning profile for '#{$1}' installed on the local machine"
23
24
  print "Make sure you have the profile on this computer and it's properly installed"
24
25
  print "You can use sigh (https://github.com/fastlane/fastlane/tree/master/sigh) to download and install the provisioning profile"
25
- print "Follow this guide: https://github.com/fastlane/fastlane/blob/master/docs/CodeSigning.md"
26
+ print "Follow this guide: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/CodeSigning.md"
26
27
  when /matching the bundle identifier .(.*). were found/ # the . around the (.*) are for the strange "
27
28
  print "You don't have a provisioning profile for the bundle identifier '#{$1}' installed on the local machine"
28
29
  print "Make sure you have the profile on this computer and it's properly installed"
29
30
  print "You can use sigh (https://github.com/fastlane/fastlane/tree/master/sigh) to download and install the provisioning profile"
30
- print "Follow this guide: https://github.com/fastlane/fastlane/blob/master/docs/CodeSigning.md"
31
+ print "Follow this guide: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/CodeSigning.md"
31
32
 
32
33
  # Insert more code signing specific errors here
33
34
  when /code signing is required/
34
35
  print "Your project settings define invalid code signing settings"
35
36
  print "To generate an ipa file you need to enable code signing for your project"
36
37
  print "Additionally make sure you have a code signing identity set"
37
- print "Follow this guide: https://github.com/fastlane/fastlane/blob/master/docs/CodeSigning.md"
38
+ print "Follow this guide: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/CodeSigning.md"
38
39
  when /US\-ASCII/
39
40
  print "Your shell environment is not correctly configured"
40
41
  print "Instead of UTF-8 your shell uses US-ASCII"
@@ -98,7 +99,7 @@ module Gym
98
99
  print "Usually it's caused by the `Skip Install` option in Xcode, set it to `NO`"
99
100
  print "For more information visit https://developer.apple.com/library/ios/technotes/tn2215/_index.html"
100
101
  print "Also, make sure to have a valid code signing identity and provisioning profile installed"
101
- print "Follow this guide to setup code signing https://github.com/fastlane/fastlane/blob/master/docs/CodeSigning.md"
102
+ print "Follow this guide to setup code signing https://github.com/fastlane/fastlane/blob/master/fastlane/docs/CodeSigning.md"
102
103
  print "If your intention was only to export an ipa be sure to provide a valid archive at the archive path."
103
104
  UI.user_error!("Archive invalid")
104
105
  end
@@ -40,16 +40,21 @@ module Gym
40
40
  [""]
41
41
  end
42
42
 
43
+ # Place where the IPA file will be created, so it can be safely moved to the destination folder
44
+ def temporary_output_path
45
+ Gym.cache[:temporary_output_path] ||= Dir.mktmpdir('gym_output')
46
+ end
47
+
43
48
  def appfile_path
44
49
  path = Dir.glob("#{BuildCommandGenerator.archive_path}/Products/Applications/*.app").first
45
- path ||= Dir[BuildCommandGenerator.archive_path + "/**/*.app"].last
50
+ path ||= Dir[BuildCommandGenerator.archive_path + "/**/*.app"].first
46
51
 
47
52
  return path
48
53
  end
49
54
 
50
55
  # We export it to the temporary folder and move it over to the actual output once it's finished and valid
51
56
  def ipa_path
52
- File.join(BuildCommandGenerator.build_path, "#{Gym.config[:output_name]}.ipa")
57
+ File.join(temporary_output_path, "#{Gym.config[:output_name]}.ipa")
53
58
  end
54
59
 
55
60
  # The path the the dsym file for this app. Might be nil
@@ -37,23 +37,24 @@ module Gym
37
37
 
38
38
  # We export the ipa into this directory, as we can't specify the ipa file directly
39
39
  def temporary_output_path
40
- Gym.cache[:temporary_output_path] ||= "#{Tempfile.new('gym').path}.gym_output"
40
+ Gym.cache[:temporary_output_path] ||= Dir.mktmpdir('gym_output')
41
41
  end
42
42
 
43
43
  def ipa_path
44
44
  unless Gym.cache[:ipa_path]
45
45
  path = Dir[File.join(temporary_output_path, "*.ipa")].last
46
+ # We need to process generic IPA
46
47
  if path
47
48
  # Try to find IPA file in the output directory, used when app thinning was not set
48
49
  Gym.cache[:ipa_path] = File.join(temporary_output_path, "#{Gym.config[:output_name]}.ipa")
49
- FileUtils.mv(path, Gym.cache[:ipa_path]) if File.expand_path(path).downcase != File.expand_path(Gym.cache[:ipa_path]).downcase
50
+ FileUtils.mv(path, Gym.cache[:ipa_path]) unless File.expand_path(path).casecmp(File.expand_path(Gym.cache[:ipa_path]).downcase).zero?
50
51
  elsif Dir.exist?(apps_path)
51
52
  # Try to find "generic" IPA file inside "Apps" folder, used when app thinning was set
52
53
  files = Dir[File.join(apps_path, "*.ipa")]
53
54
  # Generic IPA file doesn't have suffix so its name is the shortest
54
55
  path = files.min_by(&:length)
55
56
  Gym.cache[:ipa_path] = File.join(temporary_output_path, "#{Gym.config[:output_name]}.ipa")
56
- FileUtils.cp(path, Gym.cache[:ipa_path]) if File.expand_path(path).downcase != File.expand_path(Gym.cache[:ipa_path]).downcase
57
+ FileUtils.cp(path, Gym.cache[:ipa_path]) unless File.expand_path(path).casecmp(File.expand_path(Gym.cache[:ipa_path]).downcase).zero?
57
58
  else
58
59
  ErrorHandler.handle_empty_archive unless path
59
60
  end
@@ -68,7 +69,7 @@ module Gym
68
69
 
69
70
  # The path the config file we use to sign our app
70
71
  def config_path
71
- Gym.cache[:config_path] ||= "#{Tempfile.new('gym').path}_config.plist"
72
+ Gym.cache[:config_path] ||= "#{Tempfile.new('gym_config').path}.plist"
72
73
  return Gym.cache[:config_path]
73
74
  end
74
75
 
@@ -162,7 +163,7 @@ module Gym
162
163
  def print_legacy_information
163
164
  if Gym.config[:provisioning_profile_path]
164
165
  UI.important "You're using Xcode 7, the `provisioning_profile_path` value will be ignored"
165
- UI.important "Please follow the Code Signing Guide: https://github.com/fastlane/fastlane/blob/master/docs/CodeSigning.md"
166
+ UI.important "Please follow the Code Signing Guide: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/CodeSigning.md"
166
167
  end
167
168
  end
168
169
  end
data/lib/gym/runner.rb CHANGED
@@ -16,6 +16,7 @@ module Gym
16
16
  FileUtils.mkdir_p(Gym.config[:output_directory])
17
17
 
18
18
  if Gym.project.ios? || Gym.project.tvos?
19
+ fix_generic_archive # See https://github.com/fastlane/fastlane/pull/4325
19
20
  package_app
20
21
  fix_package
21
22
  compress_and_move_dsym
@@ -72,6 +73,11 @@ module Gym
72
73
  end
73
74
  end
74
75
 
76
+ def fix_generic_archive
77
+ return if ENV["GYM_USE_GENERIC_ARCHIVE_FIX"].nil?
78
+ Gym::XcodebuildFixes.generic_archive_fix
79
+ end
80
+
75
81
  def fix_package
76
82
  return unless Gym.config[:use_legacy_build_api]
77
83
  Gym::XcodebuildFixes.swift_library_fix
@@ -96,7 +102,7 @@ module Gym
96
102
  end)
97
103
 
98
104
  mark_archive_as_built_by_gym(BuildCommandGenerator.archive_path)
99
- UI.success "Successfully stored the archive. You can find it in the Xcode Organizer."
105
+ UI.success "Successfully stored the archive. You can find it in the Xcode Organizer." unless Gym.config[:archive_path].nil?
100
106
  UI.verbose("Stored the archive in: " + BuildCommandGenerator.archive_path)
101
107
  end
102
108
 
@@ -210,8 +216,6 @@ module Gym
210
216
  end
211
217
  end
212
218
 
213
- private
214
-
215
219
  def find_archive_path
216
220
  if Gym.config[:use_legacy_build_api]
217
221
  BuildCommandGenerator.archive_path
data/lib/gym/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Gym
2
- VERSION = "1.6.2"
2
+ VERSION = "1.6.3"
3
3
  DESCRIPTION = "Building your iOS apps has never been easier"
4
4
  end
data/lib/gym/xcode.rb CHANGED
@@ -11,6 +11,7 @@ module Gym
11
11
 
12
12
  # Below Xcode 7 (which offers a new nice API to sign the app)
13
13
  def pre_7?
14
+ UI.user_error!("Unable to locate Xcode. Please make sure to have Xcode installed on your machine") if xcode_version.nil?
14
15
  v = xcode_version
15
16
  is_pre = v.split('.')[0].to_i < 7
16
17
  is_pre
@@ -0,0 +1,32 @@
1
+ require 'shellwords'
2
+
3
+ module Gym
4
+ class XcodebuildFixes
5
+ class << self
6
+ # Determine IPAs for the Watch App which aren't inside of a containing
7
+ # iOS App and removes them.
8
+ #
9
+ # In the future it may be nice to modify the plist file for the archive
10
+ # itself so that it points to the correct IPA as well.
11
+ #
12
+ # This is a workaround for this bug
13
+ # https://github.com/CocoaPods/CocoaPods/issues/4178
14
+ def generic_archive_fix
15
+ UI.verbose "Looking For Orphaned WatchKit2 Applications"
16
+
17
+ Dir.glob("#{BuildCommandGenerator.archive_path}/Products/Applications/*.app").each do |app_path|
18
+ if is_watchkit_app?(app_path)
19
+ UI.verbose "Removing Orphaned WatchKit2 Application #{app_path}"
20
+ FileUtils.rm_rf(app_path)
21
+ end
22
+ end
23
+ end
24
+
25
+ # Does this application have a WatchKit target
26
+ def is_watchkit_app?(app_path)
27
+ plist_path = "#{app_path}/Info.plist"
28
+ `/usr/libexec/PlistBuddy -c 'Print :DTSDKName' #{plist_path.shellescape} 2>&1`.match(/^\s*watchos2\.\d+\s*$/) != nil
29
+ end
30
+ end
31
+ end
32
+ end
@@ -33,7 +33,7 @@ module Gym
33
33
 
34
34
  # Should only be applied if watchkit app is not a watchkit2 app
35
35
  def should_apply_watchkit1_fix?
36
- watchkit? && !(Gym::XcodebuildFixes.watchkit2?)
36
+ watchkit? && !Gym::XcodebuildFixes.watchkit2?
37
37
  end
38
38
  end
39
39
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gym
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.2
4
+ version: 1.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Krause
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-09 00:00:00.000000000 Z
11
+ date: 2016-05-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fastlane_core
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.36.1
19
+ version: 0.43.1
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: 1.0.0
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: 0.36.1
29
+ version: 0.43.1
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: 1.0.0
@@ -134,14 +134,14 @@ dependencies:
134
134
  requirements:
135
135
  - - "~>"
136
136
  - !ruby/object:Gem::Version
137
- version: 0.35.1
137
+ version: 0.38.0
138
138
  type: :development
139
139
  prerelease: false
140
140
  version_requirements: !ruby/object:Gem::Requirement
141
141
  requirements:
142
142
  - - "~>"
143
143
  - !ruby/object:Gem::Version
144
- version: 0.35.1
144
+ version: 0.38.0
145
145
  - !ruby/object:Gem::Dependency
146
146
  name: rspec
147
147
  requirement: !ruby/object:Gem::Requirement
@@ -156,6 +156,20 @@ dependencies:
156
156
  - - "~>"
157
157
  - !ruby/object:Gem::Version
158
158
  version: 3.1.0
159
+ - !ruby/object:Gem::Dependency
160
+ name: rspec_junit_formatter
161
+ requirement: !ruby/object:Gem::Requirement
162
+ requirements:
163
+ - - "~>"
164
+ - !ruby/object:Gem::Version
165
+ version: 0.2.3
166
+ type: :development
167
+ prerelease: false
168
+ version_requirements: !ruby/object:Gem::Requirement
169
+ requirements:
170
+ - - "~>"
171
+ - !ruby/object:Gem::Version
172
+ version: 0.2.3
159
173
  - !ruby/object:Gem::Dependency
160
174
  name: pry
161
175
  requirement: !ruby/object:Gem::Requirement
@@ -245,6 +259,7 @@ files:
245
259
  - lib/gym/version.rb
246
260
  - lib/gym/xcode.rb
247
261
  - lib/gym/xcodebuild_fixes/README.md
262
+ - lib/gym/xcodebuild_fixes/generic_archive_fix.rb
248
263
  - lib/gym/xcodebuild_fixes/package_application_fix.rb
249
264
  - lib/gym/xcodebuild_fixes/swift_fix.rb
250
265
  - lib/gym/xcodebuild_fixes/watchkit2_fix.rb
@@ -269,7 +284,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
269
284
  version: '0'
270
285
  requirements: []
271
286
  rubyforge_project:
272
- rubygems_version: 2.2.2
287
+ rubygems_version: 2.4.0
273
288
  signing_key:
274
289
  specification_version: 4
275
290
  summary: Building your iOS apps has never been easier