gym 0.2.0 → 0.2.1

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: 397fb653f19ab23011a6adc4e4868b3cf3685a13
4
- data.tar.gz: 4f43ac4c7427a7a1ec0189552a1579029c929d50
3
+ metadata.gz: ecdf543565a216c0837ae272dbebead624abef24
4
+ data.tar.gz: f14774d2d1fa01982560de4cb21d1f78bb4f391f
5
5
  SHA512:
6
- metadata.gz: a54112ec43584b099105130a45079e38328d8ee5c3dcf9e279d9228d3da2bce5dc0af2b176246b93172840303e8965667976f1a9272ded70fdd264525159d274
7
- data.tar.gz: a69f4ca6ec8f5409fedaedc6b36e6bcc788132e5f8ae9bc809d40f923d2144c18526724ab4a48ca7e5c5b296d623f71e02f4f8bea6aa331f844dbee4fc2c632c
6
+ metadata.gz: f3f8e0538f17a22c9deaf007d008ffb369ec8e1502bcbff5656653710717a46d16885691defab16d04fa986ce46e5f05241193510365d9d8e5245959fd88326e
7
+ data.tar.gz: 90b2dd43c1b4da294623218796562a4833bc1c09b4b4ee50fe1124e83bc774a9c7ea26cd2ac6c63c2ee283fa0da757723fe6a8917e15ef815695f0e8e0a6f123
data/README.md CHANGED
@@ -159,12 +159,14 @@ archive | xcpretty
159
159
  After building the archive it is being checked by `gym`. If it's valid, it gets packaged up and signed into an `ipa` file.
160
160
 
161
161
  ```
162
- /usr/bin/xcrun -sdk iphoneos PackageApplication -v \
162
+ /usr/bin/xcrun /path/to/PackageApplication4Gym -v \
163
163
  '/Users/felixkrause/Library/Developer/Xcode/Archives/2015-08-11/ExampleProductName 2015-08-11 18.15.30.xcarchive/Products/Applications/name.app' -o \
164
164
  '/Users/felixkrause/Library/Developer/Xcode/Archives/2015-08-11/ExampleProductName.ipa' \
165
165
  --sign "identity" --embed "provProfile"
166
166
  ```
167
167
 
168
+ Note: the official PackageApplication script is replaced by a custom PackageApplication4Gym script. This script is obtained by applying a [set of patches](https://github.com/fastlane/gym/tree/master/lib/assets/package_application_patches) on the fly to fix some known issues in the official Xcode PackageApplication script.
169
+
168
170
  Afterwards the `ipa` file is moved to the output folder. The `dSYM` file is compressed and moved to the output folder as well.
169
171
 
170
172
  # Tips
@@ -3,6 +3,11 @@ From: Fabio Milano
3
3
  Date: Thu, 13 Aug 2015 15:02:41 +0200
4
4
  Subject: [PATCH] Fixed codesign_args
5
5
 
6
+ Code signatures made in Mavericks and later do not support altering which files are sealed by a code signature.
7
+ The --resource-rules option to codesign isn't supported anymore
8
+
9
+ See https://developer.apple.com/library/mac/technotes/tn2206/_index.html#//apple_ref/doc/uid/DTS40007919-CH1-TNTAG206
10
+
6
11
  ---
7
12
  PackageApplication4Gym | 8 +++++++-
8
13
  1 file changed, 7 insertions(+), 1 deletion(-)
@@ -3,6 +3,14 @@ From: Fabio Milano
3
3
  Date: Thu, 13 Aug 2015 16:03:26 +0200
4
4
  Subject: [PATCH] Added no-strict parameter
5
5
 
6
+ The command line tool “codesign” has changed in 10.9.5 and 10.10, you need to
7
+ pass “--no-strict” option to the command, (the problem has been reported and
8
+ will be fixed). To workaround the problem, please save a copy and modify
9
+ PackageApplication to pass “—no-strict” to codesign, you can locate PackageApplication
10
+ by running the following:- xcrun -sdk iphoneos -f PackageApplication
11
+
12
+ See http://stackoverflow.com/questions/26008449/xcodebuild-codesign-vvvv-saysresource-envelope-is-obsolete
13
+
6
14
  ---
7
15
  PackageApplication4Gym | 4 ++--
8
16
  1 file changed, 2 insertions(+), 2 deletions(-)
data/lib/gym.rb CHANGED
@@ -4,7 +4,6 @@ require 'gym/manager'
4
4
  require 'gym/project'
5
5
  require 'gym/build_command_generator'
6
6
  require 'gym/package_command_generator'
7
- require 'gym/commands_executor'
8
7
  require 'gym/runner'
9
8
  require 'gym/error_handler'
10
9
  require 'gym/options'
data/lib/gym/runner.rb CHANGED
@@ -13,8 +13,6 @@ module Gym
13
13
  move_results
14
14
  end
15
15
 
16
- private
17
-
18
16
  #####################################################
19
17
  # @!group Printing out things
20
18
  #####################################################
@@ -42,6 +40,8 @@ module Gym
42
40
  )
43
41
  end
44
42
 
43
+ private
44
+
45
45
  #####################################################
46
46
  # @!group The individual steps
47
47
  #####################################################
@@ -56,9 +56,12 @@ module Gym
56
56
  def build_app
57
57
  command = BuildCommandGenerator.generate
58
58
  print_command(command, "Generated Build Command") if $verbose
59
- Gym::CommandsExecutor.execute(command: command, print_all: true, error: proc do |output|
60
- ErrorHandler.handle_build_error(output)
61
- end)
59
+ FastlaneCore::CommandExecutor.execute(command: command,
60
+ print_all: true,
61
+ print_command: !Gym.config[:silent],
62
+ error: proc do |output|
63
+ ErrorHandler.handle_build_error(output)
64
+ end)
62
65
 
63
66
  Helper.log.info("Successfully stored the archive. You can find it in the Xcode Organizer.".green)
64
67
  Helper.log.info("Stored the archive in: ".green + BuildCommandGenerator.archive_path) if $verbose
@@ -75,9 +78,12 @@ module Gym
75
78
  command = PackageCommandGenerator.generate
76
79
  print_command(command, "Generated Package Command") if $verbose
77
80
 
78
- Gym::CommandsExecutor.execute(command: command, print_all: false, error: proc do |output|
79
- ErrorHandler.handle_package_error(output)
80
- end)
81
+ FastlaneCore::CommandExecutor.execute(command: command,
82
+ print_all: false,
83
+ print_command: !Gym.config[:silent],
84
+ error: proc do |output|
85
+ ErrorHandler.handle_package_error(output)
86
+ end)
81
87
  end
82
88
 
83
89
  # Determine whether it is a Swift project and, eventually, include all required libraries to copy from Xcode's toolchain directory.
@@ -108,9 +114,12 @@ module Gym
108
114
  command_parts << "> /dev/null" unless $verbose
109
115
  print_command(command_parts, "Fix Swift embedded code if needed") if $verbose
110
116
 
111
- Gym::CommandsExecutor.execute(command: command_parts, print_all: false, error: proc do |output|
112
- ErrorHandler.handle_package_error(output)
113
- end)
117
+ FastlaneCore::CommandExecutor.execute(command: command_parts,
118
+ print_all: false,
119
+ print_command: !Gym.config[:silent],
120
+ error: proc do |output|
121
+ ErrorHandler.handle_package_error(output)
122
+ end)
114
123
  end
115
124
  end
116
125
  end
@@ -136,8 +145,7 @@ module Gym
136
145
 
137
146
  puts "" # new line
138
147
 
139
- Helper.log.info "Successfully exported and compressed dSYM file: ".green
140
- Helper.log.info File.join(Gym.config[:output_directory], File.basename(PackageCommandGenerator.dsym_path))
148
+ Helper.log.info "Successfully exported and compressed dSYM file.".green
141
149
  end
142
150
 
143
151
  ipa_path = File.join(Gym.config[:output_directory], File.basename(PackageCommandGenerator.ipa_path))
data/lib/gym/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Gym
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  DESCRIPTION = "Building your iOS apps has never been easier"
4
4
  end
data/lib/gym/xcode_fix.rb CHANGED
@@ -18,20 +18,26 @@ module Gym
18
18
  path = File.join(Helper.gem_path("gym"), "lib/assets/package_application_patches/PackageApplication_MD5")
19
19
  expected_md5 = File.read(path)
20
20
 
21
- raise "Found an invalid `PackageApplication` script. This is not supported." unless expected_md5 == Digest::MD5.file("#{developer_dir}/Platforms/iPhoneOS.platform/Developer/usr/bin/PackageApplication").hexdigest
21
+ # If that location changes, search it using xcrun --sdk iphoneos -f PackageApplication
22
+ package_application_path = "#{developer_dir}/Platforms/iPhoneOS.platform/Developer/usr/bin/PackageApplication"
23
+
24
+ raise "Unable to patch the `PackageApplication` script bundled in XCode. This is not supported." unless expected_md5 == Digest::MD5.file(package_application_path).hexdigest
22
25
 
23
26
  # Duplicate PackageApplication script to PackageApplication4Gym
24
- FileUtils.copy_file("#{developer_dir}/Platforms/iPhoneOS.platform/Developer/usr/bin/PackageApplication", patched_package_application_path)
27
+ FileUtils.copy_file(package_application_path, patched_package_application_path)
25
28
 
26
29
  # Apply patches to PackageApplication4Gym from patches folder
27
30
  Dir[File.join(Helper.gem_path("gym"), "lib/assets/package_application_patches/*.diff")].each do |patch|
28
31
  Helper.log.info "Applying Package Application patch: #{File.basename(patch)}" unless Gym.config[:silent]
29
32
  command = ["patch #{patched_package_application_path} < #{patch}"]
30
- print_command(command, "Applying Package Application patch: #{File.basename(patch)}") if $verbose
31
-
32
- Gym::CommandsExecutor.execute(command: command, print_all: false, error: proc do |output|
33
- ErrorHandler.handle_build_error(output)
34
- end)
33
+ Runner.new.print_command(command, "Applying Package Application patch: #{File.basename(patch)}") if $verbose
34
+
35
+ FastlaneCore::CommandExecutor.execute(command: command,
36
+ print_all: false,
37
+ print_command: !Gym.config[:silent],
38
+ error: proc do |output|
39
+ ErrorHandler.handle_package_error(output)
40
+ end)
35
41
  end
36
42
  end
37
43
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gym
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Krause
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.13.0
19
+ version: 0.14.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 0.13.0
26
+ version: 0.14.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: xcpretty
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -190,12 +190,11 @@ files:
190
190
  - README.md
191
191
  - bin/gym
192
192
  - lib/assets/GymfileTemplate
193
+ - lib/assets/package_application_patches/0001_codesign_args_patch.diff
194
+ - lib/assets/package_application_patches/0002_no_strict_parameter_patch.diff
193
195
  - lib/assets/package_application_patches/PackageApplication_MD5
194
- - lib/assets/package_application_patches/codesign_args_patch.diff
195
- - lib/assets/package_application_patches/no_strict_parameter_patch.diff
196
196
  - lib/gym.rb
197
197
  - lib/gym/build_command_generator.rb
198
- - lib/gym/commands_executor.rb
199
198
  - lib/gym/commands_generator.rb
200
199
  - lib/gym/detect_values.rb
201
200
  - lib/gym/error_handler.rb
@@ -1,53 +0,0 @@
1
- module Gym
2
- # Executes commands and takes care of error handling and more
3
- module CommandsExecutor
4
- # @param command [String] The command to be executed
5
- # @param print_all [Boolean] Do we want to print out the command output while building?
6
- # If set to false, nothing will be printed
7
- # @param error [Block] A block that's called if an error occurs
8
- # @return [String] All the output as string
9
- def self.execute(command: nil, print_all: false, error: nil)
10
- print_all = true if $verbose
11
-
12
- output = []
13
- command = command.join(" ")
14
- Helper.log.info command.yellow.strip unless Gym.config[:silent]
15
-
16
- puts "\n-----".cyan if print_all
17
-
18
- last_length = 0
19
- begin
20
- PTY.spawn(command) do |stdin, stdout, pid|
21
- stdin.each do |l|
22
- line = l.strip # strip so that \n gets removed
23
- output << line
24
-
25
- next unless print_all
26
-
27
- current_length = line.length
28
- spaces = [last_length - current_length, 0].max
29
- print((line + " " * spaces + "\r").cyan)
30
- last_length = current_length
31
- end
32
- Process.wait(pid)
33
- puts "-----\n".cyan if print_all
34
- end
35
- rescue => ex
36
- # This could happen when the environment is wrong:
37
- # > invalid byte sequence in US-ASCII (ArgumentError)
38
- output << ex.to_s
39
- o = output.join("\n")
40
- puts o
41
- error.call(o)
42
- end
43
-
44
- # Exit status for build command, should be 0 if build succeeded
45
- # Disabled Rubocop, since $CHILD_STATUS just is not the same
46
- if $?.exitstatus != 0 # rubocop:disable Style/SpecialGlobalVars
47
- o = output.join("\n")
48
- puts o # the user has the right to see the raw output
49
- error.call(o)
50
- end
51
- end
52
- end
53
- end