fastlane_core 0.20.0 → 0.21.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fastlane_core/project.rb +56 -0
- data/lib/fastlane_core/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8864dafc1405a2f38899dc54cedb5ac96f9e02fd
|
4
|
+
data.tar.gz: 5fdf7b6e3f17cb57bb5fa41cda33a041704fe6dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
|