gym 1.3.0 → 1.4.0

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: b10cc2e463895aae84301abdfff342aecdfd98ff
4
- data.tar.gz: b7032609daac7cca71fb70ced86a7df2bb5fd555
3
+ metadata.gz: dbcb824805c7ee57886bb0a000719352b185e540
4
+ data.tar.gz: 8a61ea32da66fd658dd42fd19af16b8ff869ca7c
5
5
  SHA512:
6
- metadata.gz: 013a309cb2f63cb0662c895afc71028e12f5e2f34fc4172f95823c49b746f29dc65378010f2fd8fccc0e882ddd6c7615b6f5bc37b4559558e3a7f0490463b60b
7
- data.tar.gz: ff749e5ec91d619bfde150c445717f9a5319ec7c3e301a55b33be74dc230aa99bf4cb18b4dcf7987df05e8226defc3435dcbab2097f7d226abefabb304fc14b3
6
+ metadata.gz: 4a833a0ddf354e75da612a6a834e2aa08346901af5b556faf8db5117fa693d693964cd7ff197915504e134f9e8222aff7f8ce8b5f94f4ae52dc39bbdd0097451
7
+ data.tar.gz: 6c3471f5ae11c9e5dfedbea0e9834d374a4730bda2e29f080d49544ba363fc0e704a5147affec28b0a3530d1584a775ba81c8e421012165d42cdb6d2f0537b54
data/README.md CHANGED
@@ -29,14 +29,14 @@
29
29
  gym
30
30
  ============
31
31
 
32
- [![Twitter: @KauseFx](https://img.shields.io/badge/contact-@KrauseFx-blue.svg?style=flat)](https://twitter.com/KrauseFx)
32
+ [![Twitter: @KauseFx](https://img.shields.io/badge/contact-@FastlaneTools-blue.svg?style=flat)](https://twitter.com/FastlaneTools)
33
33
  [![License](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://github.com/fastlane/gym/blob/master/LICENSE)
34
34
  [![Gem](https://img.shields.io/gem/v/gym.svg?style=flat)](http://rubygems.org/gems/gym)
35
35
  [![Build Status](https://img.shields.io/travis/fastlane/gym/master.svg?style=flat)](https://travis-ci.org/fastlane/gym)
36
36
 
37
37
  ###### Building your app has never been easier
38
38
 
39
- Get in contact with the developer on Twitter: [@KrauseFx](https://twitter.com/KrauseFx)
39
+ Get in contact with the developer on Twitter: [@FastlaneTools](https://twitter.com/FastlaneTools)
40
40
 
41
41
  -------
42
42
  <p align="center">
@@ -204,7 +204,7 @@ After building the archive it is being checked by `gym`. If it's valid, it gets
204
204
  ### Xcode 7 and above
205
205
 
206
206
  ```
207
- /usr/bin/xcrun xcodebuild -exportArchive \
207
+ /usr/bin/xcrun path/to/xcbuild-safe.sh -exportArchive \
208
208
  -exportOptionsPlist '/tmp/gym_config_1442852529.plist' \
209
209
  -archivePath '/Users/fkrause/Library/Developer/Xcode/Archives/2015-09-21/App 2015-09-21 09.21.56.xcarchive' \
210
210
  -exportPath '/tmp/1442852529'
@@ -214,6 +214,8 @@ After building the archive it is being checked by `gym`. If it's valid, it gets
214
214
 
215
215
  Using this method there are no workarounds for WatchKit or Swift required, as it uses the same technique Xcode uses when exporting your binary.
216
216
 
217
+ Note: the [xcbuild-safe.sh script](https://github.com/fastlane/gym/tree/master/lib/assets/wrap_xcodebuild/xcbuild-safe.sh) wraps around xcodebuild to workaround some incompatibilities.
218
+
217
219
  ### Xcode 6 and below
218
220
 
219
221
  ```
@@ -0,0 +1,49 @@
1
+ #!/bin/bash --login
2
+
3
+ # Originally from, http://stackoverflow.com/questions/33041109
4
+ # Modified to work in RVM and non RVM environments
5
+ #
6
+ # Xcode 7 (incl. 7.0.1) seems to have a dependency on the system ruby.
7
+ # xcodebuild is screwed up by using rvm to map to another non-system
8
+ # ruby†. This script is a fix that allows you call xcodebuild in a
9
+ # "safe" rvm environment, but will not (AFAIK) affect the "external"
10
+ # rvm setting.
11
+ #
12
+ # The script is a drop in replacement for your xcodebuild call.
13
+ #
14
+ # xcodebuild arg1 ... argn
15
+ #
16
+ # would become
17
+ #
18
+ # path/to/xcbuild-safe.sh arg1 ... argn
19
+ #
20
+ # -----
21
+ # † Because, you know, that *never* happens when you are building
22
+ # Xcode projects, say with abstruse tools like Rake or CocoaPods.
23
+
24
+ which rvm > /dev/null
25
+
26
+ if [[ $? -eq 0 ]]; then
27
+ echo "RVM detected, forcing to use system ruby"
28
+ # This allows you to use rvm in a script. Otherwise you get a BS
29
+ # error along the lines of "cannot use rvm as function". Jeez.
30
+ [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
31
+
32
+ # Cause rvm to use system ruby. AFAIK, this is effective only for
33
+ # the scope of this script.
34
+ rvm use system
35
+
36
+ # rvm doesn't unset itself properly without doing this
37
+ unset RUBYLIB
38
+ unset RUBYOPT
39
+ unset BUNDLE_BIN_PATH
40
+ unset _ORIGINAL_GEM_PATH
41
+ unset BUNDLE_GEMFILE
42
+ fi
43
+
44
+ # to help troubleshooting
45
+ # env | sort > /tmp/env.wrapper
46
+ # rvm info >> /tmp/env.wrapper
47
+
48
+ set -x # echoes commands
49
+ xcodebuild "$@" # calls xcodebuild with all the arguments passed to this
@@ -10,31 +10,31 @@ module Gym
10
10
  when /Your build settings specify a provisioning profile with the UUID/
11
11
  print "Invalid code signing settings"
12
12
  print "Your project defines a provisioning profile which doesn't exist on your local machine"
13
- print "You can use sigh (https://github.com/KrauseFx/sigh) to download and install the provisioning profile"
14
- print "Follow this guide: https://github.com/KrauseFx/fastlane/blob/master/docs/CodeSigning.md"
13
+ print "You can use sigh (https://github.com/fastlane/sigh) to download and install the provisioning profile"
14
+ print "Follow this guide: https://github.com/fastlane/fastlane/blob/master/docs/CodeSigning.md"
15
15
  when /Provisioning profile does not match bundle identifier/
16
16
  print "Invalid code signing settings"
17
17
  print "Your project defines a provisioning profile that doesn't match the bundle identifier of your app"
18
18
  print "Make sure you use the correct provisioning profile for this app"
19
19
  print "Take a look at the ouptput above for more information"
20
- print "You can follow this guide: https://github.com/KrauseFx/fastlane/blob/master/docs/CodeSigning.md"
20
+ print "You can follow this guide: https://github.com/fastlane/fastlane/blob/master/docs/CodeSigning.md"
21
21
  when /provisioning profiles matching the bundle identifier .(.*)./ # the . around the (.*) are for the strange "
22
22
  print "You don't have the provisioning profile for '#{$1}' installed on the local machine"
23
23
  print "Make sure you have the profile on this computer and it's properly installed"
24
- print "You can use sigh (https://github.com/KrauseFx/sigh) to download and install the provisioning profile"
25
- print "Follow this guide: https://github.com/KrauseFx/fastlane/blob/master/docs/CodeSigning.md"
24
+ print "You can use sigh (https://github.com/fastlane/sigh) to download and install the provisioning profile"
25
+ print "Follow this guide: https://github.com/fastlane/fastlane/blob/master/docs/CodeSigning.md"
26
26
  when /matching the bundle identifier .(.*). were found/ # the . around the (.*) are for the strange "
27
27
  print "You don't have a provisioning profile for the bundle identifier '#{$1}' installed on the local machine"
28
28
  print "Make sure you have the profile on this computer and it's properly installed"
29
- print "You can use sigh (https://github.com/KrauseFx/sigh) to download and install the provisioning profile"
30
- print "Follow this guide: https://github.com/KrauseFx/fastlane/blob/master/docs/CodeSigning.md"
29
+ print "You can use sigh (https://github.com/fastlane/sigh) to download and install the provisioning profile"
30
+ print "Follow this guide: https://github.com/fastlane/fastlane/blob/master/docs/CodeSigning.md"
31
31
 
32
32
  # Insert more code signing specific errors here
33
33
  when /code signing is required/
34
34
  print "Your project settings define invalid code signing settings"
35
35
  print "To generate an ipa file you need to enable code signing for your project"
36
36
  print "Additionally make sure you have a code signing identity set"
37
- print "Follow this guide: https://github.com/KrauseFx/fastlane/blob/master/docs/CodeSigning.md"
37
+ print "Follow this guide: https://github.com/fastlane/fastlane/blob/master/docs/CodeSigning.md"
38
38
  when /US\-ASCII/
39
39
  print "Your shell environment is not correctly configured"
40
40
  print "Instead of UTF-8 your shell uses US-ASCII"
@@ -98,7 +98,7 @@ module Gym
98
98
  print "Usually it's caused by the `Skip Install` option in Xcode, set it to `NO`"
99
99
  print "For more information visit https://developer.apple.com/library/ios/technotes/tn2215/_index.html"
100
100
  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/KrauseFx/fastlane/blob/master/docs/CodeSigning.md"
101
+ print "Follow this guide to setup code signing https://github.com/fastlane/fastlane/blob/master/docs/CodeSigning.md"
102
102
  raise "Archive invalid"
103
103
  end
104
104
 
@@ -3,6 +3,8 @@
3
3
  # because of
4
4
  # `incompatible encoding regexp match (UTF-8 regexp with ASCII-8BIT string) (Encoding::CompatibilityError)`
5
5
 
6
+ require 'tempfile'
7
+
6
8
  module Gym
7
9
  # Responsible for building the fully working xcodebuild command
8
10
  class PackageCommandGeneratorXcode7
@@ -10,7 +12,7 @@ module Gym
10
12
  def generate
11
13
  print_legacy_information unless Helper.fastlane_enabled?
12
14
 
13
- parts = ["/usr/bin/xcrun xcodebuild -exportArchive"]
15
+ parts = ["/usr/bin/xcrun #{XcodebuildFixes.wrap_xcodebuild} -exportArchive"]
14
16
  parts += options
15
17
  parts += pipe
16
18
 
@@ -35,7 +37,7 @@ module Gym
35
37
 
36
38
  # We export the ipa into this directory, as we can't specify the ipa file directly
37
39
  def temporary_output_path
38
- Gym.cache[:temporary_output_path] ||= File.join("/tmp", Time.now.to_i.to_s)
40
+ Gym.cache[:temporary_output_path] ||= "#{Tempfile.new('gym').path}.gym_output"
39
41
  end
40
42
 
41
43
  def ipa_path
@@ -56,7 +58,7 @@ module Gym
56
58
 
57
59
  # The path the config file we use to sign our app
58
60
  def config_path
59
- Gym.cache[:config_path] ||= "/tmp/gym_config_#{Time.now.to_i}.plist"
61
+ Gym.cache[:config_path] ||= "#{Tempfile.new('gym').path}_config.plist"
60
62
  return Gym.cache[:config_path]
61
63
  end
62
64
 
@@ -79,7 +81,7 @@ module Gym
79
81
  def print_legacy_information
80
82
  if Gym.config[:provisioning_profile_path]
81
83
  UI.important "You're using Xcode 7, the `provisioning_profile_path` value will be ignored"
82
- UI.important "Please follow the Code Signing Guide: https://github.com/KrauseFx/fastlane/blob/master/docs/CodeSigning.md"
84
+ UI.important "Please follow the Code Signing Guide: https://github.com/fastlane/fastlane/blob/master/docs/CodeSigning.md"
83
85
  end
84
86
  end
85
87
  end
data/lib/gym/runner.rb CHANGED
@@ -17,7 +17,7 @@ module Gym
17
17
 
18
18
  FileUtils.mkdir_p(Gym.config[:output_directory])
19
19
 
20
- if Gym.project.ios?
20
+ if Gym.project.ios? || Gym.project.tvos?
21
21
  package_app
22
22
  fix_package
23
23
  compress_and_move_dsym
data/lib/gym/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Gym
2
- VERSION = "1.3.0"
2
+ VERSION = "1.4.0"
3
3
  DESCRIPTION = "Building your iOS apps has never been easier"
4
4
  end
@@ -42,6 +42,12 @@ module Gym
42
42
 
43
43
  return @patched_package_application_path # Return path to the patched PackageApplication
44
44
  end
45
+
46
+ # Wrap xcodebuild to work-around ipatool dependecy to system ruby
47
+ def wrap_xcodebuild
48
+ require 'fileutils'
49
+ @wrapped_xcodebuild_path ||= File.join(Helper.gem_path("gym"), "lib/assets/wrap_xcodebuild/xcbuild-safe.sh")
50
+ end
45
51
  end
46
52
  end
47
53
  end
@@ -27,7 +27,7 @@ module Gym
27
27
  # Does this application have a WatchKit target
28
28
  def watchkit2?
29
29
  Dir["#{PackageCommandGenerator.appfile_path}/**/*.plist"].any? do |plist_path|
30
- `/usr/libexec/PlistBuddy -c 'Print DTSDKName' '#{plist_path}' 2>&1`.strip == 'watchos2.0'
30
+ `/usr/libexec/PlistBuddy -c 'Print DTSDKName' '#{plist_path}' 2>&1`.match(/^\s*watchos2\.\d+\s*$/)
31
31
  end
32
32
  end
33
33
  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.3.0
4
+ version: 1.4.0
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-01-09 00:00:00.000000000 Z
11
+ date: 2016-01-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fastlane_core
@@ -229,6 +229,7 @@ files:
229
229
  - lib/assets/package_application_patches/0001_codesign_args_patch.diff
230
230
  - lib/assets/package_application_patches/0002_no_strict_parameter_patch.diff
231
231
  - lib/assets/package_application_patches/PackageApplication_MD5
232
+ - lib/assets/wrap_xcodebuild/xcbuild-safe.sh
232
233
  - lib/gym.rb
233
234
  - lib/gym/commands_generator.rb
234
235
  - lib/gym/detect_values.rb
@@ -268,7 +269,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
268
269
  version: '0'
269
270
  requirements: []
270
271
  rubyforge_project:
271
- rubygems_version: 2.4.6
272
+ rubygems_version: 2.4.0
272
273
  signing_key:
273
274
  specification_version: 4
274
275
  summary: Building your iOS apps has never been easier