gym 0.2.1 → 0.3.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: ecdf543565a216c0837ae272dbebead624abef24
4
- data.tar.gz: f14774d2d1fa01982560de4cb21d1f78bb4f391f
3
+ metadata.gz: bf26634ab793249948b9e36f367550963d0b07c9
4
+ data.tar.gz: 40851f4916c70e076a92bbc1fa50381f50319a90
5
5
  SHA512:
6
- metadata.gz: f3f8e0538f17a22c9deaf007d008ffb369ec8e1502bcbff5656653710717a46d16885691defab16d04fa986ce46e5f05241193510365d9d8e5245959fd88326e
7
- data.tar.gz: 90b2dd43c1b4da294623218796562a4833bc1c09b4b4ee50fe1124e83bc774a9c7ea26cd2ac6c63c2ee283fa0da757723fe6a8917e15ef815695f0e8e0a6f123
6
+ metadata.gz: e91d31c0692ca53442ecf995b0c2c98628fdf2c108752d83a82013c084effc38792866c3cd6efba15aafc86406c4b11237dc344bec74f62957a098b86adbb782
7
+ data.tar.gz: 3a0bececf832ad42db19978cfa2b78d29393ee89dd823677056bc58435523664dfd9dbd82c1fe82ea938119ad628a82a45cf4d730f6c0c6af4676251aff51bf6
@@ -36,9 +36,10 @@ module Gym
36
36
 
37
37
  options = []
38
38
  options += project_path_array
39
- options << "-configuration '#{config[:configuration]}'" # We need `Release` to export the DSYM file as well
39
+ options << "-configuration '#{config[:configuration]}'" if config[:configuration]
40
40
  options << "-sdk '#{config[:sdk]}'" if config[:sdk]
41
41
  options << "-destination '#{config[:destination]}'" if config[:destination]
42
+ options << "-xcconfig '#{config[:xcconfig]}'" if config[:xcconfig]
42
43
  options << "-archivePath '#{archive_path}'"
43
44
  options << config[:xcargs] if config[:xcargs]
44
45
 
@@ -25,6 +25,7 @@ module Gym
25
25
  end
26
26
 
27
27
  detect_scheme
28
+ detect_configuration
28
29
 
29
30
  config[:output_name] ||= Gym.project.app_name
30
31
 
@@ -96,31 +97,66 @@ module Gym
96
97
 
97
98
  def self.detect_scheme
98
99
  config = Gym.config
100
+ proj_schemes = Gym.project.schemes
101
+
99
102
  if config[:scheme].to_s.length > 0
100
103
  # Verify the scheme is available
101
- unless Gym.project.schemes.include?(config[:scheme].to_s)
104
+ unless proj_schemes.include?(config[:scheme].to_s)
102
105
  Helper.log.error "Couldn't find specified scheme '#{config[:scheme]}'.".red
103
106
  config[:scheme] = nil
104
107
  end
105
108
  end
106
109
 
107
- if config[:scheme].to_s.length == 0
108
- proj_schemes = Gym.project.schemes
109
- if proj_schemes.count == 1
110
- config[:scheme] = proj_schemes.last
111
- elsif proj_schemes.count > 1
112
- if Helper.is_ci?
113
- Helper.log.error "Multiple schemes found but you haven't specified one.".red
114
- Helper.log.error "Since this is a CI, please pass one using the `scheme` option".red
115
- raise "Multiple schemes found".red
116
- else
117
- puts "Select Scheme: "
118
- config[:scheme] = choose(*(proj_schemes))
119
- end
110
+ return if config[:scheme].to_s.length > 0
111
+
112
+ if proj_schemes.count == 1
113
+ config[:scheme] = proj_schemes.last
114
+ elsif proj_schemes.count > 1
115
+ if Helper.is_ci?
116
+ Helper.log.error "Multiple schemes found but you haven't specified one.".red
117
+ Helper.log.error "Since this is a CI, please pass one using the `scheme` option".red
118
+ raise "Multiple schemes found".red
119
+ else
120
+ puts "Select Scheme: "
121
+ config[:scheme] = choose(*(proj_schemes))
122
+ end
123
+ else
124
+ raise "Couldn't find any schemes in this project".red
125
+ end
126
+ end
127
+
128
+ # Detects the available configurations (e.g. Debug, Release)
129
+ def self.detect_configuration
130
+ config = Gym.config
131
+ configurations = Gym.project.configurations
132
+ if config[:configuration]
133
+ # Verify the configuration is available
134
+ unless configurations.include?(config[:configuration])
135
+ Helper.log.error "Couldn't find specified configuration '#{config[:configuration]}'.".red
136
+ config[:configuration] = nil
137
+ end
138
+ end
139
+
140
+ # Usually we want `Release`
141
+ # We prefer `Release` to export the DSYM file as well
142
+ config[:configuration] ||= "Release" if configurations.include?("Release")
143
+
144
+ return if config[:configuration].to_s.length > 0
145
+ return if configurations.count == 0 # this is an optional value anyway
146
+
147
+ if configurations.count == 1
148
+ config[:configuration] = configurations.last
149
+ else
150
+ if Helper.is_ci?
151
+ Helper.log.error "Multiple configurations found but you haven't specified one.".red
152
+ Helper.log.error "Since this is a CI, please pass one using the `configuration` option".red
153
+ raise "Multiple configurations found".red
120
154
  else
121
- raise "Couldn't find any schemes in this project".red
155
+ puts "Select Configuration: "
156
+ config[:configuration] = choose(*(configurations))
122
157
  end
123
158
  end
124
159
  end
160
+
125
161
  end
126
162
  end
@@ -34,14 +34,6 @@ module Gym
34
34
  raise "Project file invalid".red unless File.directory?(v)
35
35
  raise "Project file is not a project file, must end with .xcodeproj".red unless v.include?(".xcodeproj")
36
36
  end),
37
- FastlaneCore::ConfigItem.new(key: :provisioning_profile_path,
38
- short_option: "-e",
39
- env_name: "GYM_PROVISIONING_PROFILE_PATH",
40
- description: "The path to the provisioning profile (found automatically when located in current folder)",
41
- optional: true,
42
- verify_block: proc do |value|
43
- raise "Provisioning profile not found at path '#{File.expand_path(value)}'".red unless File.exist?(value)
44
- end),
45
37
  FastlaneCore::ConfigItem.new(key: :scheme,
46
38
  short_option: "-s",
47
39
  optional: true,
@@ -78,7 +70,7 @@ module Gym
78
70
  short_option: "-q",
79
71
  env_name: "GYM_CONFIGURATION",
80
72
  description: "The configuration to use when building the app. Defaults to 'Release'",
81
- default_value: "Release"),
73
+ optional: true),
82
74
  FastlaneCore::ConfigItem.new(key: :silent,
83
75
  short_option: "-t",
84
76
  env_name: "GYM_SILENT",
@@ -99,7 +91,23 @@ module Gym
99
91
  short_option: "-x",
100
92
  env_name: "GYM_XCARGS",
101
93
  description: "Pass additional arguments to xcodebuild when building the app. Be sure to quote the setting names and values e.g. OTHER_LDFLAGS=\"-ObjC -lstdc++\"",
102
- optional: true)
94
+ optional: true),
95
+ FastlaneCore::ConfigItem.new(key: :xcconfig,
96
+ short_option: "-y",
97
+ env_name: "GYM_XCCONFIG",
98
+ description: "Use an extra XCCONFIG file to build your app",
99
+ optional: true,
100
+ verify_block: proc do |value|
101
+ raise "File not found at path '#{File.expand_path(value)}'".red unless File.exist?(value)
102
+ end),
103
+ FastlaneCore::ConfigItem.new(key: :provisioning_profile_path,
104
+ short_option: "-e",
105
+ env_name: "GYM_PROVISIONING_PROFILE_PATH",
106
+ description: "The path to the provisioning profile (optional)",
107
+ optional: true,
108
+ verify_block: proc do |value|
109
+ raise "Provisioning profile not found at path '#{File.expand_path(value)}'".red unless File.exist?(value)
110
+ end)
103
111
 
104
112
  ]
105
113
  end
@@ -29,6 +29,27 @@ module Gym
29
29
  results
30
30
  end
31
31
 
32
+ # Get all available configurations in an array
33
+ def configurations
34
+ results = []
35
+ splitted = raw_info.split("Configurations:")
36
+ return [] if splitted.count != 2 # probably a CocoaPods project
37
+
38
+ output = splitted.last.split(":").first
39
+ output.split("\n").each_with_index do |current, index|
40
+ current = current.strip
41
+
42
+ if current.length == 0
43
+ next if index == 0
44
+ break # as we want to break on the empty line
45
+ end
46
+
47
+ results << current
48
+ end
49
+
50
+ results
51
+ end
52
+
32
53
  def app_name
33
54
  # WRAPPER_NAME: Example.app
34
55
  # WRAPPER_SUFFIX: .app
@@ -60,7 +81,10 @@ module Gym
60
81
  end
61
82
 
62
83
  def raw_info
63
- # e.g.
84
+ # Examples:
85
+
86
+ # Standard:
87
+ #
64
88
  # Information about project "Example":
65
89
  # Targets:
66
90
  # Example
@@ -76,6 +100,15 @@ module Gym
76
100
  # Example
77
101
  # ExampleUITests
78
102
 
103
+ # CococaPods
104
+ #
105
+ # Example.xcworkspace
106
+ # Information about workspace "Example":
107
+ # Schemes:
108
+ # Example
109
+ # HexColors
110
+ # Pods-Example
111
+
79
112
  return @raw if @raw
80
113
 
81
114
  # Unfortunately since we pass the workspace we also get all the
@@ -1,4 +1,4 @@
1
1
  module Gym
2
- VERSION = "0.2.1"
2
+ VERSION = "0.3.0"
3
3
  DESCRIPTION = "Building your iOS apps has never been easier"
4
4
  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: 0.2.1
4
+ version: 0.3.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: 2015-08-13 00:00:00.000000000 Z
11
+ date: 2015-08-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fastlane_core