nixenvironment 0.0.27 → 0.0.28
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/nixenvironment +63 -56
- data/lib/nixenvironment/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 46e42318b0a0b848a40f1a26874872681c99a5a0
|
4
|
+
data.tar.gz: 2dfab4c22a3cdcaf0bcbf0d1aac369447573c6e1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb885c5e80d09ffdc42ed9f5f9dcc367a16a92f8eae6d9a3fa26813643f254d29dd9ca2047e2b81d207aaebd4b9704af52525e08d3b14ae389fa28c5eca4d7c5
|
7
|
+
data.tar.gz: 1701715645899b4abf0bfd1802f06033dea8e6c9b08cea41d497d417620ef3518a1ec4e63568276d5d2facd22b83c36e3e00e0d86019baa2378df07b8204d300
|
data/bin/nixenvironment
CHANGED
@@ -75,9 +75,9 @@ command :build do |c|
|
|
75
75
|
end
|
76
76
|
|
77
77
|
begin
|
78
|
-
|
78
|
+
read_config_settings
|
79
79
|
enable_ci_build(options.ci_build)
|
80
|
-
|
80
|
+
supplement_config_settings(options.config)
|
81
81
|
prebuild(options.config)
|
82
82
|
build(options.config, options.ipa)
|
83
83
|
restore_info_plist
|
@@ -102,7 +102,7 @@ command :deploy do |c|
|
|
102
102
|
end
|
103
103
|
|
104
104
|
begin
|
105
|
-
|
105
|
+
read_config_settings
|
106
106
|
deploy
|
107
107
|
rescue
|
108
108
|
raise # re-rise exception but chdir to root_working_dir in ensure block first if needed
|
@@ -126,7 +126,7 @@ command :test do |c|
|
|
126
126
|
c.syntax = 'nixenvironment test'
|
127
127
|
c.description = 'Build xctest unit tests and run them in simulator'
|
128
128
|
c.action do |args, options|
|
129
|
-
|
129
|
+
read_config_settings
|
130
130
|
test
|
131
131
|
end
|
132
132
|
end
|
@@ -135,7 +135,7 @@ command :code_coverage do |c|
|
|
135
135
|
c.syntax = 'nixenvironment code_coverage'
|
136
136
|
c.description = 'Generate xctest unit tests code coverage report'
|
137
137
|
c.action do |args, options|
|
138
|
-
|
138
|
+
read_config_settings
|
139
139
|
code_coverage
|
140
140
|
end
|
141
141
|
end
|
@@ -144,7 +144,7 @@ command :code_duplication_report do |c|
|
|
144
144
|
c.syntax = 'nixenvironment code_duplication_report'
|
145
145
|
c.description = 'Generate code duplication report for xctest'
|
146
146
|
c.action do |args, options|
|
147
|
-
|
147
|
+
read_config_settings
|
148
148
|
code_duplication_report
|
149
149
|
end
|
150
150
|
end
|
@@ -203,7 +203,7 @@ def update(ninbas)
|
|
203
203
|
|
204
204
|
system("git fetch -t")
|
205
205
|
tags = IO.popen('git tag').readlines
|
206
|
-
tags.map! { |tag| tag
|
206
|
+
tags.map! { |tag| tag.strip! }
|
207
207
|
|
208
208
|
if tags.size > 0
|
209
209
|
p("Checkout newest #{repo_name} tag...")
|
@@ -224,41 +224,41 @@ def update(ninbas)
|
|
224
224
|
end
|
225
225
|
end
|
226
226
|
|
227
|
-
def
|
227
|
+
def read_config_settings
|
228
228
|
begin
|
229
229
|
@config_settings = YAML.load(File.read(File.join(File.dirname(__FILE__), 'Config')))
|
230
230
|
rescue
|
231
231
|
abort('Config file processing error!')
|
232
232
|
end
|
233
233
|
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
end
|
260
|
-
|
261
|
-
def
|
234
|
+
update_config_settings('PROJECT_TO_BUILD', $project_to_build)
|
235
|
+
update_config_settings('PROJECT_TARGET_TO_BUILD', $project_target_to_build)
|
236
|
+
update_config_settings('PROJECT_TARGET_TO_TEST', $project_target_to_test)
|
237
|
+
update_config_settings('WORKSPACE_TO_BUILD', $workspace_to_build)
|
238
|
+
update_config_settings('WORKSPACE_SCHEME_TO_BUILD', $workspace_scheme_to_build)
|
239
|
+
update_config_settings('WORKSPACE_SCHEME_TO_TEST', $workspace_scheme_to_test)
|
240
|
+
update_config_settings('SDK', $sdk)
|
241
|
+
update_config_settings('SDK_FOR_TESTS', $sdk_for_tests)
|
242
|
+
update_config_settings('EXCLUDE_PATTERN_FOR_CODE_COVERAGE', $exclude_pattern_for_code_coverage)
|
243
|
+
update_config_settings('EXCLUDE_PATTERN_FOR_CODE_DUPLICATION', $exclude_pattern_for_code_duplication)
|
244
|
+
update_config_settings('DEPLOY_HOST', $deploy_host)
|
245
|
+
update_config_settings('DEPLOY_PATH', $deploy_path)
|
246
|
+
update_config_settings('DEPLOY_USERNAME', $deploy_username)
|
247
|
+
update_config_settings('DEPLOY_PASSWORD', $deploy_password)
|
248
|
+
update_config_settings('ICONS_PATH', $icons_path)
|
249
|
+
update_config_settings('XCTEST_DESTINATION_DEVICE', $xctest_destination_device)
|
250
|
+
update_config_settings('CONFIGURATION_FILES_PATH', $configuration_files_path)
|
251
|
+
update_config_settings('CODE_COVERAGE_CONFIGURATION', $code_coverage_configuration)
|
252
|
+
update_config_settings('CODE_COVERAGE_OUTPUT_DIRECTORY', $code_coverage_output_directory)
|
253
|
+
update_config_settings('ENV_VAR_PREFIX', $env_var_prefix)
|
254
|
+
update_config_settings('INFOPLIST_PATH', $infoplist_path)
|
255
|
+
update_config_settings('BUNDLE_ID', $bundle_id)
|
256
|
+
update_config_settings('RESIGNED_BUNDLE_ID', $resigned_bundle_id)
|
257
|
+
update_config_settings('RESIGNED_BUNDLE_NAME', $resigned_bundle_name)
|
258
|
+
update_config_settings('RESIGNED_ENTITLEMENTS_PATH', $resigned_entitlements_path)
|
259
|
+
end
|
260
|
+
|
261
|
+
def update_config_settings(key, value)
|
262
262
|
if value
|
263
263
|
@config_settings[key] = value
|
264
264
|
p("#{key} |SPECIFIED| directly: #{value}")
|
@@ -278,7 +278,7 @@ def enable_ci_build(ci_build)
|
|
278
278
|
end
|
279
279
|
|
280
280
|
def working_copy_is_clean?
|
281
|
-
|
281
|
+
system("
|
282
282
|
LAST_REVISION_FILE=\"_last_revision.sh\"
|
283
283
|
|
284
284
|
source ${LAST_REVISION_FILE}
|
@@ -291,24 +291,10 @@ def working_copy_is_clean?
|
|
291
291
|
echo \"$(git status --porcelain)\"
|
292
292
|
exit 1
|
293
293
|
fi")
|
294
|
-
|
295
|
-
return is_clean
|
296
294
|
end
|
297
295
|
|
298
|
-
def
|
299
|
-
#
|
300
|
-
cmd_output = %x[ xcodebuild -list ]
|
301
|
-
cmd_output = cmd_output.lines.to_a[1..-1].join # TODO: handle if to_a returns 0 or count less than expected
|
302
|
-
info = {}
|
303
|
-
cmd_output.split(/\n\n/).each do |pair|
|
304
|
-
key,value = pair.split(/:/)
|
305
|
-
next unless key and value
|
306
|
-
lines = value.lines.map { |line| line.strip }
|
307
|
-
lines.reject! { |line| line.empty? }
|
308
|
-
info[key.strip] = lines
|
309
|
-
end
|
310
|
-
|
311
|
-
abort("Build error! Configuration #{config} doesn't exist") unless info['Build Configurations'].include?(config)
|
296
|
+
def supplement_config_settings(config)
|
297
|
+
abort("Build error! Configuration #{config} doesn't exist") unless xcode_project_contains_config?(config)
|
312
298
|
|
313
299
|
if @config_settings['PROJECT_TO_BUILD'] and @config_settings['PROJECT_TO_BUILD'].length > 0
|
314
300
|
if @config_settings['PROJECT_TARGET_TO_BUILD'] and @config_settings['PROJECT_TARGET_TO_BUILD'].length > 0
|
@@ -334,6 +320,7 @@ def setup(config)
|
|
334
320
|
abort('Build error! Either PROJECT_TO_BUILD or WORKSPACE_TO_BUILD must be specified!')
|
335
321
|
end
|
336
322
|
|
323
|
+
# Parse build settings
|
337
324
|
env_vars_list = cmd_output.split(/\n/).reject(&:empty?)
|
338
325
|
|
339
326
|
if env_vars_list and env_vars_list.length > 0
|
@@ -342,7 +329,7 @@ def setup(config)
|
|
342
329
|
if key and value
|
343
330
|
stripped_key = key.strip
|
344
331
|
stripped_value = value.strip
|
345
|
-
@config_settings[stripped_key] ||= stripped_value.shellescape #
|
332
|
+
@config_settings[stripped_key] ||= stripped_value.shellescape # Assign new value only if assignee is nil
|
346
333
|
end
|
347
334
|
end
|
348
335
|
end
|
@@ -353,6 +340,26 @@ def setup(config)
|
|
353
340
|
@config_settings['DWARF_DSYM_FOLDER_PATH'] = build_directory
|
354
341
|
end
|
355
342
|
|
343
|
+
def xcode_project_contains_config?(config)
|
344
|
+
# Parse information about project
|
345
|
+
cmd_output = %x[ xcodebuild -list 2>&1 ]
|
346
|
+
abort("Validate configuration error! #{cmd_output}") if cmd_output.include?('error')
|
347
|
+
|
348
|
+
cmd_output = cmd_output.lines[1..-1].join # Get all lines except first in order to ignore description message
|
349
|
+
|
350
|
+
info = {}
|
351
|
+
|
352
|
+
cmd_output.split(/\n\n/).each do |pair|
|
353
|
+
key,value = pair.split(/:/)
|
354
|
+
next unless key and value
|
355
|
+
lines = value.lines.map { |line| line.strip }
|
356
|
+
lines.reject! { |line| line.empty? }
|
357
|
+
info[key.strip] = lines
|
358
|
+
end
|
359
|
+
|
360
|
+
info['Build Configurations'].include?(config)
|
361
|
+
end
|
362
|
+
|
356
363
|
def save_build_env_vars
|
357
364
|
app_product = File.join(@config_settings['BUILT_PRODUCTS_DIR'], @config_settings['EXECUTABLE_NAME']) + '.app'
|
358
365
|
|
@@ -518,7 +525,7 @@ end
|
|
518
525
|
def backup_info_plist
|
519
526
|
p('Backuping Info.plist ...')
|
520
527
|
|
521
|
-
@info_plist_backup_name = @config_settings['INFOPLIST_PATH'] + '.backup'
|
528
|
+
@info_plist_backup_name = @config_settings['INFOPLIST_PATH'] + '.backup' # PRODUCT_SETTINGS_PATH
|
522
529
|
FileUtils.cp(@config_settings['INFOPLIST_PATH'], @info_plist_backup_name)
|
523
530
|
|
524
531
|
p('Info.plist was backuped.')
|
@@ -546,7 +553,7 @@ end
|
|
546
553
|
def restore_info_plist
|
547
554
|
p('Restoring Info.plist ...')
|
548
555
|
|
549
|
-
File.delete(@config_settings['INFOPLIST_PATH'])
|
556
|
+
File.delete(@config_settings['INFOPLIST_PATH']) # PRODUCT_SETTINGS_PATH
|
550
557
|
File.rename(@info_plist_backup_name, @config_settings['INFOPLIST_PATH'])
|
551
558
|
|
552
559
|
p('Info.plist was restored.')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nixenvironment
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.28
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Karen Arzumanian
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-12-
|
11
|
+
date: 2014-12-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|