gym 0.3.4 → 0.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: fd05c4c174ea6781a857114929bd5645ac12beab
4
- data.tar.gz: da82d0a397cd5ea278197a9dd2934021bbe0bed2
3
+ metadata.gz: 39644b5edc2dc15d184e148343a4fd598c05824b
4
+ data.tar.gz: ffbf924fabf2d8ad7fca508f8f771c4bbb80118a
5
5
  SHA512:
6
- metadata.gz: 8b8bb13ec70342708aa130a0bd585be9cd71130bea69abae4f61c14ead0f0e84f06578f756748f628a1c57b85039bbbab43e5a1dcd6ee329d867d17bfc6abc84
7
- data.tar.gz: babf2f1e9f4ad284e1d4e92e13213c87cde7e9677d50803f05bf46914ce5867d94d3d1aac7a29aa70894e9f3cbc80f7b702d7551cd9c585ae29335a8bf06fad4
6
+ metadata.gz: 6c75c8a264274185e95ad63d2aad0079c2645be99de088e47636bc63360742883068f841a79726ac2bb4405eb37f8bddcfcd2de637e48a10f85b541d24c487ff
7
+ data.tar.gz: 628b7f9238b30d12f4d9d38f81ec30603427546bf03881ef6b7d77ae1832d8747b63b65cb01b4658ef522854f57feddd255731b7a8a67d659bbbf3e784b6b44f
data/README.md CHANGED
@@ -89,7 +89,8 @@ gym
89
89
  :bullettrain_side: | Don't remember any complicated build commands, just `gym`
90
90
  :wrench: | Easy and dynamic configuration using parameters and environment variables
91
91
  :floppy_disk: | Store common build settings in a `Gymfile`
92
- :computer: | All archives are stored and accessible in the Xcode Organizer
92
+ :outbox_tray: | All archives are stored and accessible in the Xcode Organizer
93
+ :computer: | Supports both iOS and Mac applications
93
94
 
94
95
  ![/assets/gymScreenshot.png](/assets/gymScreenshot.png)
95
96
 
@@ -17,6 +17,7 @@ module Gym
17
17
  end
18
18
 
19
19
  Gym.project = Project.new(config)
20
+ detect_platform
20
21
  detect_provisioning_profile
21
22
 
22
23
  # Go into the project's folder
@@ -125,6 +126,14 @@ module Gym
125
126
  end
126
127
  end
127
128
 
129
+ # Is it an iOS device or a Mac?
130
+ def self.detect_platform
131
+ return if Gym.config[:destination]
132
+ platform = Gym.project.build_settings("PLATFORM_DISPLAY_NAME") # either `iOS` or `OS X`
133
+
134
+ Gym.config[:destination] = "generic/platform=#{platform}"
135
+ end
136
+
128
137
  # Detects the available configurations (e.g. Debug, Release)
129
138
  def self.detect_configuration
130
139
  config = Gym.config
data/lib/gym/options.rb CHANGED
@@ -83,7 +83,7 @@ module Gym
83
83
  short_option: "-d",
84
84
  env_name: "GYM_DESTINATION",
85
85
  description: "Use a custom destination for building the app",
86
- default_value: "generic/platform=iOS"),
86
+ optional: true),
87
87
  FastlaneCore::ConfigItem.new(key: :xcargs,
88
88
  short_option: "-x",
89
89
  env_name: "GYM_XCARGS",
data/lib/gym/project.rb CHANGED
@@ -53,7 +53,18 @@ module Gym
53
53
  def app_name
54
54
  # WRAPPER_NAME: Example.app
55
55
  # WRAPPER_SUFFIX: .app
56
- build_settings("WRAPPER_NAME").gsub(build_settings("WRAPPER_SUFFIX"), "")
56
+ name = build_settings("WRAPPER_NAME")
57
+
58
+ return name.gsub(build_settings("WRAPPER_SUFFIX"), "") if name
59
+ nil
60
+ end
61
+
62
+ def mac?
63
+ build_settings("PLATFORM_DISPLAY_NAME") == "OS X"
64
+ end
65
+
66
+ def ios?
67
+ build_settings("PLATFORM_DISPLAY_NAME") == "iOS"
57
68
  end
58
69
 
59
70
  #####################################################
@@ -73,11 +84,13 @@ module Gym
73
84
 
74
85
  begin
75
86
  result = @build_settings.split("\n").find { |c| c.include? key }
76
- result.split(" = ").last
87
+ return result.split(" = ").last
77
88
  rescue => ex
78
89
  Helper.log.error caller.join("\n\t")
79
90
  Helper.log.error "Could not fetch #{key} from project file: #{ex}"
80
91
  end
92
+
93
+ nil
81
94
  end
82
95
 
83
96
  def raw_info
data/lib/gym/runner.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require 'pty'
2
2
  require 'open3'
3
+ require 'fileutils'
3
4
 
4
5
  module Gym
5
6
  class Runner
@@ -8,11 +9,21 @@ module Gym
8
9
  clear_old_files
9
10
  build_app
10
11
  verify_archive
11
- package_app
12
- Gym::XcodebuildFixes.swift_library_fix
13
- Gym::XcodebuildFixes.watchkit_fix
14
- Gym::XcodebuildFixes.clear_patched_package_application
15
- move_results
12
+
13
+ FileUtils.mkdir_p(Gym.config[:output_directory])
14
+
15
+ if Gym.project.ios?
16
+ package_app
17
+ Gym::XcodebuildFixes.swift_library_fix
18
+ Gym::XcodebuildFixes.watchkit_fix
19
+ Gym::XcodebuildFixes.clear_patched_package_application
20
+
21
+ compress_and_move_dsym
22
+ move_ipa
23
+ elsif Gym.project.mac?
24
+ compress_and_move_dsym
25
+ move_mac_app
26
+ end
16
27
  end
17
28
 
18
29
  #####################################################
@@ -88,28 +99,28 @@ module Gym
88
99
  end)
89
100
  end
90
101
 
91
- # Moves over the binary and dsym file to the output directory
92
- # @return (String) The path to the resulting ipa file
93
- def move_results
94
- require 'fileutils'
95
- FileUtils.mkdir_p(Gym.config[:output_directory])
96
- FileUtils.mv(PackageCommandGenerator.ipa_path, Gym.config[:output_directory], force: true)
102
+ def compress_and_move_dsym
103
+ return unless PackageCommandGenerator.dsym_path
97
104
 
98
- if PackageCommandGenerator.dsym_path
99
- # Compress and move the dsym file
100
- containing_directory = File.expand_path("..", PackageCommandGenerator.dsym_path)
101
- file_name = File.basename(PackageCommandGenerator.dsym_path)
105
+ # Compress and move the dsym file
106
+ containing_directory = File.expand_path("..", PackageCommandGenerator.dsym_path)
107
+ file_name = File.basename(PackageCommandGenerator.dsym_path)
102
108
 
103
- output_path = File.expand_path(File.join(Gym.config[:output_directory], Gym.config[:output_name] + ".app.dSYM.zip"))
104
- command = "cd '#{containing_directory}' && zip -r '#{output_path}' '#{file_name}'"
105
- Helper.log.info command.yellow unless Gym.config[:silent]
106
- command_result = `#{command}`
107
- Helper.log.info command_result if $verbose
109
+ output_path = File.expand_path(File.join(Gym.config[:output_directory], Gym.config[:output_name] + ".app.dSYM.zip"))
110
+ command = "cd '#{containing_directory}' && zip -r '#{output_path}' '#{file_name}'"
111
+ Helper.log.info command.yellow unless Gym.config[:silent]
112
+ command_result = `#{command}`
113
+ Helper.log.info command_result if $verbose
108
114
 
109
- puts "" # new line
115
+ puts "" # new line
110
116
 
111
- Helper.log.info "Successfully exported and compressed dSYM file.".green
112
- end
117
+ Helper.log.info "Successfully exported and compressed dSYM file.".green
118
+ end
119
+
120
+ # Moves over the binary and dsym file to the output directory
121
+ # @return (String) The path to the resulting ipa file
122
+ def move_ipa
123
+ FileUtils.mv(PackageCommandGenerator.ipa_path, Gym.config[:output_directory], force: true)
113
124
 
114
125
  ipa_path = File.join(Gym.config[:output_directory], File.basename(PackageCommandGenerator.ipa_path))
115
126
 
@@ -117,5 +128,18 @@ module Gym
117
128
  Helper.log.info ipa_path
118
129
  ipa_path
119
130
  end
131
+
132
+ # Move the .app from the archive into the output directory
133
+ def move_mac_app
134
+ app_path = Dir[File.join(BuildCommandGenerator.archive_path, "Products/Applications/*.app")].last
135
+ raise "Couldn't find application in '#{BuildCommandGenerator.archive_path}'".red unless app_path
136
+
137
+ FileUtils.mv(app_path, Gym.config[:output_directory], force: true)
138
+ app_path = File.join(Gym.config[:output_directory], File.basename(app_path))
139
+
140
+ Helper.log.info "Successfully exported and signed ipa file:".green
141
+ Helper.log.info app_path
142
+ app_path
143
+ end
120
144
  end
121
145
  end
data/lib/gym/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Gym
2
- VERSION = "0.3.4"
2
+ VERSION = "0.4.0"
3
3
  DESCRIPTION = "Building your iOS apps has never been easier"
4
4
  end
@@ -47,7 +47,8 @@ module Gym
47
47
  def clear_patched_package_application
48
48
  if @patched_package_application_path and File.exist?(@patched_package_application_path)
49
49
  Helper.log.debug "Removing patched PackageApplication file at path '#{@patched_package_application_path}'" if $verbose
50
- File.delete(@patched_package_application_path)
50
+ # force in the unlikely event that the file was deleted (e.g. by a concurrent job)
51
+ FileUtils.rm @patched_package_application_path, force: true
51
52
  end
52
53
  end
53
54
  end
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.3.4
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Krause
@@ -14,168 +14,168 @@ dependencies:
14
14
  name: fastlane_core
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - '>='
18
18
  - !ruby/object:Gem::Version
19
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
26
  version: 0.14.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: xcpretty
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - '>='
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: terminal-table
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - '>='
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: bundler
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - '>='
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ">="
66
+ - - '>='
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: fastlane
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ~>
74
74
  - !ruby/object:Gem::Version
75
75
  version: 1.15.0
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ~>
81
81
  - !ruby/object:Gem::Version
82
82
  version: 1.15.0
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rake
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ">="
87
+ - - '>='
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ">="
94
+ - - '>='
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rubocop
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ">="
101
+ - - '>='
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ">="
108
+ - - '>='
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: rspec
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - "~>"
115
+ - - ~>
116
116
  - !ruby/object:Gem::Version
117
117
  version: 3.1.0
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - "~>"
122
+ - - ~>
123
123
  - !ruby/object:Gem::Version
124
124
  version: 3.1.0
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: pry
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - ">="
129
+ - - '>='
130
130
  - !ruby/object:Gem::Version
131
131
  version: '0'
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - ">="
136
+ - - '>='
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: yard
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
- - - "~>"
143
+ - - ~>
144
144
  - !ruby/object:Gem::Version
145
145
  version: 0.8.7.4
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
- - - "~>"
150
+ - - ~>
151
151
  - !ruby/object:Gem::Version
152
152
  version: 0.8.7.4
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: webmock
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
- - - "~>"
157
+ - - ~>
158
158
  - !ruby/object:Gem::Version
159
159
  version: 1.19.0
160
160
  type: :development
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
- - - "~>"
164
+ - - ~>
165
165
  - !ruby/object:Gem::Version
166
166
  version: 1.19.0
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: coveralls
169
169
  requirement: !ruby/object:Gem::Requirement
170
170
  requirements:
171
- - - ">="
171
+ - - '>='
172
172
  - !ruby/object:Gem::Version
173
173
  version: '0'
174
174
  type: :development
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
- - - ">="
178
+ - - '>='
179
179
  - !ruby/object:Gem::Version
180
180
  version: '0'
181
181
  description: Building your iOS apps has never been easier
@@ -220,12 +220,12 @@ require_paths:
220
220
  - lib
221
221
  required_ruby_version: !ruby/object:Gem::Requirement
222
222
  requirements:
223
- - - ">="
223
+ - - '>='
224
224
  - !ruby/object:Gem::Version
225
225
  version: 2.0.0
226
226
  required_rubygems_version: !ruby/object:Gem::Requirement
227
227
  requirements:
228
- - - ">="
228
+ - - '>='
229
229
  - !ruby/object:Gem::Version
230
230
  version: '0'
231
231
  requirements: []