fastlane_core 0.20.0 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 198c318bada63eb8b0c957b85a4242f20c22fc2c
4
- data.tar.gz: af7fabd6cb12541ef31d1b90a2f708b5324f5b50
3
+ metadata.gz: 8864dafc1405a2f38899dc54cedb5ac96f9e02fd
4
+ data.tar.gz: 5fdf7b6e3f17cb57bb5fa41cda33a041704fe6dd
5
5
  SHA512:
6
- metadata.gz: 829ca1ec310c39e252ef7f12e3aa7a3ad0cf34bd5c5b03e7a886ea10a1fa17edb42d260616d040a6fd589e37d91ff030fee038f7c51c812876976f33ecba9508
7
- data.tar.gz: 5030dcd70f2316fa458490660eb4cb76f6980da73a2c76e5499a3939e10d792f033689affc4d8921f479be6abd96d4bccec299d04f7cb8e28cdbb374a989a95a
6
+ metadata.gz: e0869c7ee5c3c26ca4b729b57eeb0c070f0514854e8f2a871e4832d91e668ddf6b50ec05db353749aeaf0b35d55a7835fc4707f6968d024d560f7279b0082580
7
+ data.tar.gz: b00441b5e8a242f97945a0124575e20205d78bf54cfb3236242322df7ee1c25ae51c3cc5b894f164cf8e511200906b22a70388ad0986f85acbdaa918d1398e48
@@ -1,6 +1,62 @@
1
1
  module FastlaneCore
2
2
  # Represents an Xcode project
3
3
  class Project
4
+ class << self
5
+ # Project discovery
6
+ def detect_projects(config)
7
+ if config[:workspace].to_s.length > 0 and config[:project].to_s.length > 0
8
+ raise "You can only pass either a workspace or a project path, not both".red
9
+ end
10
+
11
+ return if config[:project].to_s.length > 0
12
+
13
+ if config[:workspace].to_s.length == 0
14
+ workspace = Dir["./*.xcworkspace"]
15
+ if workspace.count > 1
16
+ puts "Select Workspace: "
17
+ config[:workspace] = choose(*(workspace))
18
+ else
19
+ config[:workspace] = workspace.first # this will result in nil if no files were found
20
+ end
21
+ end
22
+
23
+ return if config[:workspace].to_s.length > 0
24
+
25
+ if config[:workspace].to_s.length == 0 and config[:project].to_s.length == 0
26
+ project = Dir["./*.xcodeproj"]
27
+ if project.count > 1
28
+ puts "Select Project: "
29
+ config[:project] = choose(*(project))
30
+ else
31
+ config[:project] = project.first # this will result in nil if no files were found
32
+ end
33
+ end
34
+
35
+ if config[:workspace].nil? and config[:project].nil?
36
+ select_project(config)
37
+ end
38
+ end
39
+
40
+ def select_project(config)
41
+ loop do
42
+ path = ask("Couldn't automatically detect the project file, please provide a path: ".yellow).strip
43
+ if File.directory? path
44
+ if path.end_with? ".xcworkspace"
45
+ config[:workspace] = path
46
+ break
47
+ elsif path.end_with? ".xcodeproj"
48
+ config[:project] = path
49
+ break
50
+ else
51
+ Helper.log.error "Path must end with either .xcworkspace or .xcodeproj"
52
+ end
53
+ else
54
+ Helper.log.error "Couldn't find project at path '#{File.expand_path(path)}'".red
55
+ end
56
+ end
57
+ end
58
+ end
59
+
4
60
  # Path to the project/workspace
5
61
  attr_accessor :path
6
62
 
@@ -1,3 +1,3 @@
1
1
  module FastlaneCore
2
- VERSION = "0.20.0"
2
+ VERSION = "0.21.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.20.0
4
+ version: 0.21.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Krause