gym 0.8.5 → 0.9.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: 9d1e45bf84b45491f37433ba661ec72900b7dee8
4
- data.tar.gz: 5bdc9336b0560e5c95409f58ce3bebc8f6c1a889
3
+ metadata.gz: 8f5e3ff1dbe1ecddac3e2dd4e1602d35d6811bdd
4
+ data.tar.gz: 92d74eb24a71df4fd13f26345dfb2f2cdd9cf444
5
5
  SHA512:
6
- metadata.gz: 095e4cc62167a2c4e2be47aef55a52ede3b9347b5251ed8cd0c532b1444460b427979448463bffcba339fdef6ecf310a9a6dc2491f7b7eca946269b38fb897b1
7
- data.tar.gz: 2a38f97e50f3bac747b535dde36813f06c9c7d1f467bf2c0116a358e39885c94bea09463a97305884d9905a9afb7f0ecfd20ac89a45e5edf33cb830e248670ed
6
+ metadata.gz: 2ece0072e1dcb0283d3ddcc147db83a424d24becbaeeae9735e0d2d495a823dabd65c95a3960c2f8fa4ec69db847cb09a62c56f621d399a76b471ad0321b6275
7
+ data.tar.gz: ae7f91cc021f1cc4be8a09195d71a05687d012010d8846680acb440fe0ef4343df73484df2789326b538f0b9fa79c351994dc96a5bd8f1f4c5fce42b41917496
data/lib/gym.rb CHANGED
@@ -1,7 +1,6 @@
1
1
  require 'json'
2
2
  require 'gym/version'
3
3
  require 'gym/manager'
4
- require 'gym/project'
5
4
  require 'gym/generators/build_command_generator'
6
5
  require 'gym/generators/package_command_generator'
7
6
  require 'gym/runner'
@@ -46,10 +46,12 @@ module Gym
46
46
  c.syntax = "gym init"
47
47
  c.description = "Creates a new Gymfile for you"
48
48
  c.action do |_args, options|
49
- raise "Gymfile already exists" if File.exist?(Gym.gymfile_name)
49
+ containing = (File.directory?("fastlane") ? 'fastlane' : '.')
50
+ path = File.join(containing, Gym.gymfile_name)
51
+ raise "Gymfile already exists" if File.exist?(path)
50
52
  template = File.read("#{Helper.gem_path('gym')}/lib/assets/GymfileTemplate")
51
- File.write(Gym.gymfile_name, template)
52
- Helper.log.info "Successfully created '#{Gym.gymfile_name}'. Open the file using a code editor.".green
53
+ File.write(path, template)
54
+ Helper.log.info "Successfully created '#{path}'. Open the file using a code editor.".green
53
55
  end
54
56
  end
55
57
 
@@ -16,7 +16,7 @@ module Gym
16
16
  raise "No project/workspace found in the current directory.".red
17
17
  end
18
18
 
19
- Gym.project = Project.new(config)
19
+ Gym.project = FastlaneCore::Project.new(config)
20
20
  detect_provisioning_profile
21
21
 
22
22
  # Go into the project's folder
@@ -106,36 +106,7 @@ module Gym
106
106
  end
107
107
 
108
108
  def self.detect_scheme
109
- config = Gym.config
110
- proj_schemes = Gym.project.schemes
111
-
112
- if config[:scheme].to_s.length > 0
113
- # Verify the scheme is available
114
- unless proj_schemes.include?(config[:scheme].to_s)
115
- Helper.log.error "Couldn't find specified scheme '#{config[:scheme]}'.".red
116
- config[:scheme] = nil
117
- end
118
- end
119
-
120
- return if config[:scheme].to_s.length > 0
121
-
122
- if proj_schemes.count == 1
123
- config[:scheme] = proj_schemes.last
124
- elsif proj_schemes.count > 1
125
- if Helper.is_ci?
126
- Helper.log.error "Multiple schemes found but you haven't specified one.".red
127
- Helper.log.error "Since this is a CI, please pass one using the `scheme` option".red
128
- raise "Multiple schemes found".red
129
- else
130
- puts "Select Scheme: "
131
- config[:scheme] = choose(*(proj_schemes))
132
- end
133
- else
134
- Helper.log.error "Couldn't find any schemes in this project, make sure that the scheme is shared if you are using a workspace".red
135
- Helper.log.error "Open Xcode, click on `Manage Schemes` and check the `Shared` box for the schemes you want to use".red
136
-
137
- raise "No Schemes found".red
138
- end
109
+ Gym.project.select_scheme
139
110
  end
140
111
 
141
112
  # Is it an iOS device or a Mac?
data/lib/gym/options.rb CHANGED
@@ -65,7 +65,7 @@ module Gym
65
65
  FastlaneCore::ConfigItem.new(key: :buildlog_path,
66
66
  short_option: "-l",
67
67
  env_name: "GYM_BUILDLOG_PATH",
68
- description: "The directory were to store the build log",
68
+ description: "The directory where to store the build log",
69
69
  default_value: "~/Library/Logs/gym"),
70
70
  FastlaneCore::ConfigItem.new(key: :sdk,
71
71
  short_option: "-k",
data/lib/gym/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Gym
2
- VERSION = "0.8.5"
2
+ VERSION = "0.9.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.8.5
4
+ version: 0.9.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-10-06 00:00:00.000000000 Z
11
+ date: 2015-10-11 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.19.0
19
+ version: 0.20.0
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.19.0
29
+ version: 0.20.0
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: 1.0.0
@@ -240,7 +240,6 @@ files:
240
240
  - lib/gym/generators/package_command_generator_xcode7.rb
241
241
  - lib/gym/manager.rb
242
242
  - lib/gym/options.rb
243
- - lib/gym/project.rb
244
243
  - lib/gym/runner.rb
245
244
  - lib/gym/version.rb
246
245
  - lib/gym/xcode.rb
data/lib/gym/project.rb DELETED
@@ -1,155 +0,0 @@
1
- module Gym
2
- # Represents the Xcode project/workspace
3
- class Project
4
- # Path to the project/workspace
5
- attr_accessor :path
6
-
7
- attr_accessor :is_workspace
8
-
9
- def initialize(options)
10
- self.path = File.expand_path(options[:workspace] || options[:project])
11
- self.is_workspace = (options[:workspace].to_s.length > 0)
12
-
13
- if !path or !File.directory? path
14
- raise "Could not find project at path '#{path}'".red
15
- end
16
- end
17
-
18
- def workspace?
19
- self.is_workspace
20
- end
21
-
22
- # Get all available schemes in an array
23
- def schemes
24
- results = []
25
- output = raw_info.split("Schemes:").last.split(":").first
26
-
27
- if raw_info.include?("There are no schemes in workspace") or raw_info.include?("This project contains no schemes")
28
- return results
29
- end
30
-
31
- output.split("\n").each do |current|
32
- current = current.strip
33
-
34
- next if current.length == 0
35
- results << current
36
- end
37
-
38
- results
39
- end
40
-
41
- # Get all available configurations in an array
42
- def configurations
43
- results = []
44
- splitted = raw_info.split("Configurations:")
45
- return [] if splitted.count != 2 # probably a CocoaPods project
46
-
47
- output = splitted.last.split(":").first
48
- output.split("\n").each_with_index do |current, index|
49
- current = current.strip
50
-
51
- if current.length == 0
52
- next if index == 0
53
- break # as we want to break on the empty line
54
- end
55
-
56
- results << current
57
- end
58
-
59
- results
60
- end
61
-
62
- def app_name
63
- # WRAPPER_NAME: Example.app
64
- # WRAPPER_SUFFIX: .app
65
- name = build_settings(key: "WRAPPER_NAME")
66
-
67
- return name.gsub(build_settings(key: "WRAPPER_SUFFIX"), "") if name
68
- return "App" # default value
69
- end
70
-
71
- def mac?
72
- # Some projects have different values... we have to look for all of them
73
- return true if build_settings(key: "PLATFORM_NAME") == "macosx"
74
- return true if build_settings(key: "PLATFORM_DISPLAY_NAME") == "OS X"
75
- false
76
- end
77
-
78
- def ios?
79
- !mac?
80
- end
81
-
82
- #####################################################
83
- # @!group Raw Access
84
- #####################################################
85
-
86
- # Get the build settings for our project
87
- # this is used to properly get the DerivedData folder
88
- # @param [String] The key of which we want the value for (e.g. "PRODUCT_NAME")
89
- def build_settings(key: nil, optional: true)
90
- unless @build_settings
91
- # We also need to pass the workspace and scheme to this command
92
- command = "xcrun xcodebuild -showBuildSettings #{BuildCommandGenerator.project_path_array.join(' ')}"
93
- Helper.log.info command.yellow unless Gym.config[:silent]
94
- @build_settings = `#{command}`
95
- end
96
-
97
- begin
98
- result = @build_settings.split("\n").find { |c| c.include? key }
99
- return result.split(" = ").last
100
- rescue => ex
101
- return nil if optional # an optional value, we really don't care if something goes wrong
102
-
103
- Helper.log.error caller.join("\n\t")
104
- Helper.log.error "Could not fetch #{key} from project file: #{ex}"
105
- end
106
-
107
- nil
108
- end
109
-
110
- def raw_info
111
- # Examples:
112
-
113
- # Standard:
114
- #
115
- # Information about project "Example":
116
- # Targets:
117
- # Example
118
- # ExampleUITests
119
- #
120
- # Build Configurations:
121
- # Debug
122
- # Release
123
- #
124
- # If no build configuration is specified and -scheme is not passed then "Release" is used.
125
- #
126
- # Schemes:
127
- # Example
128
- # ExampleUITests
129
-
130
- # CococaPods
131
- #
132
- # Example.xcworkspace
133
- # Information about workspace "Example":
134
- # Schemes:
135
- # Example
136
- # HexColors
137
- # Pods-Example
138
-
139
- return @raw if @raw
140
-
141
- # Unfortunately since we pass the workspace we also get all the
142
- # schemes generated by CocoaPods
143
-
144
- options = BuildCommandGenerator.project_path_array.delete_if { |a| a.to_s.include? "scheme" }
145
- command = "xcrun xcodebuild -list #{options.join(' ')}"
146
- Helper.log.info command.yellow unless Gym.config[:silent]
147
-
148
- @raw = `#{command}`.to_s
149
-
150
- raise "Error parsing xcode file using `#{command}`".red if @raw.length == 0
151
-
152
- return @raw
153
- end
154
- end
155
- end