xcode-utils 1.0.3 → 1.0.4
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 +4 -4
- data/lib/xcutils/uitest.rb +15 -5
- data/lib/xcutils/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 824beca6355db2508531a754f7fe96d92afb45d2d280a1090b8a1be4478cdb62
|
4
|
+
data.tar.gz: ba97f1f06c154c98af3eb78eafbbcb1304dbb51aa1138dfe1a029b338cfa6b76
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 62736a18e603f1dc93ff7b238be891fcb4de37bdcb7ba88cc9df2e8e8c12bc43873e1f188dbdf47b1afc37588160a1dfa65266b002ee041c34f30a45b6980087
|
7
|
+
data.tar.gz: 86bfd627682e38af122e60cc991aca6100c5cc738d017a788812c88627d2827e07b13d7317c767285aaa8558d1dc844660c5dbfac5bdd4e7d0589ada2972103e
|
data/lib/xcutils/uitest.rb
CHANGED
@@ -62,18 +62,18 @@ module XcodeUtils
|
|
62
62
|
puts "🤖 Installing #{@uitest_name} into #{@project_name}".green
|
63
63
|
|
64
64
|
if !Dir.exist?(@project_path)
|
65
|
-
abort "😭 Project #{project_name} does not exist
|
65
|
+
abort "😭 Abort to install. Project #{project_name} does not exist".red
|
66
66
|
end
|
67
67
|
@project = Xcodeproj::Project.open(@project_path)
|
68
68
|
end
|
69
69
|
|
70
70
|
def generate_project_configuration
|
71
|
-
puts "Generating project configuration"
|
71
|
+
puts "Generating project configuration #{@uitest_name} into #{@project_name}"
|
72
72
|
|
73
73
|
configuration_list = @project.root_object.build_configuration_list
|
74
74
|
|
75
75
|
if configuration_list.build_settings(@uitest_name) != nil
|
76
|
-
puts "#{@uitest_name} is already installed in the project #{@project_name}".gray
|
76
|
+
puts "Skip to generate project configuration for #{@uitest_name}. It is already installed in the project #{@project_name}".gray
|
77
77
|
return
|
78
78
|
end
|
79
79
|
|
@@ -89,18 +89,21 @@ module XcodeUtils
|
|
89
89
|
target_main_sb = nil
|
90
90
|
|
91
91
|
target.build_configurations.each { |e|
|
92
|
+
break if e.name == @uitest_name
|
93
|
+
|
92
94
|
puts "Configure build configuration #{e.name} in #{target.name}"
|
93
95
|
|
94
96
|
path = e.build_settings['INFOPLIST_FILE']
|
95
97
|
plist = Plist.parse_xml(path)
|
96
98
|
plist_main_sb = plist['UIMainStoryboardFile']
|
99
|
+
build_settings_main_sb = e.build_settings['MAIN_STORYBOARD_FILE']
|
97
100
|
variable_name = '$(MAIN_STORYBOARD_FILE)'
|
98
101
|
is_not_variable = plist_main_sb != variable_name
|
99
102
|
|
100
|
-
e.build_settings['MAIN_STORYBOARD_FILE'] = is_not_variable ? plist_main_sb : target_main_sb
|
103
|
+
e.build_settings['MAIN_STORYBOARD_FILE'] = is_not_variable ? plist_main_sb : (target_main_sb != nil ? target_main_sb : build_settings_main_sb)
|
101
104
|
|
102
105
|
if target_main_sb.nil?
|
103
|
-
target_main_sb =
|
106
|
+
target_main_sb = build_settings_main_sb
|
104
107
|
end
|
105
108
|
|
106
109
|
plist['UIMainStoryboardFile'] = variable_name
|
@@ -136,6 +139,11 @@ module XcodeUtils
|
|
136
139
|
|
137
140
|
def generate_scheme_file
|
138
141
|
scheme_name = "#{@project_name} #{@uitest_name}"
|
142
|
+
|
143
|
+
if File.exist?(scheme_path(scheme_name))
|
144
|
+
puts "Skip to generate. A scheme file is already exsit, #{scheme_name}".gray
|
145
|
+
return
|
146
|
+
end
|
139
147
|
|
140
148
|
puts "Generating scheme file #{scheme_path(scheme_name)}"
|
141
149
|
|
@@ -153,6 +161,8 @@ module XcodeUtils
|
|
153
161
|
puts "Copying template files into project #{@project_name}"
|
154
162
|
path = File.expand_path('../../../templates', __FILE__)
|
155
163
|
FileUtils.copy_entry path, "./#{@project_name}"
|
164
|
+
else
|
165
|
+
puts "Skip to copy template files. Files are already exsit".gray
|
156
166
|
end
|
157
167
|
|
158
168
|
puts "Adding references for files and resources into project #{@project_name}"
|
data/lib/xcutils/version.rb
CHANGED