bin/nixenvironment in nixenvironment-0.0.54 vs bin/nixenvironment in nixenvironment-0.0.55
- old
+ new
@@ -88,13 +88,10 @@
begin
read_config_settings
if is_unity_platform
@config_settings['ICONS_PATH'] = 'Unity-iPhone/Images.xcassets' unless $icons_path
- elsif @config_settings['WORKSPACE_TO_BUILD'] and @config_settings['WORKSPACE_TO_BUILD'].length > 0
- scheme = @config_settings['WORKSPACE_SCHEME_TO_BUILD']
- abort("Build error! Scheme #{scheme} doesn't exist") unless xcode_project_contains_scheme?(scheme)
end
enable_ci_build(options.ci_build)
supplement_config_settings(options.config)
prebuild(options.config)
@@ -319,29 +316,37 @@
end
def supplement_config_settings(config)
abort("Build error! Configuration #{config} doesn't exist") unless xcode_project_contains_config?(config)
- if @config_settings['PROJECT_TO_BUILD'] and @config_settings['PROJECT_TO_BUILD'].length > 0
- if @config_settings['PROJECT_TARGET_TO_BUILD'] and @config_settings['PROJECT_TARGET_TO_BUILD'].length > 0
- cmd_output = %x[ xcodebuild -project \"#{@config_settings['PROJECT_TO_BUILD']}\"\
- -target \"#{@config_settings['PROJECT_TARGET_TO_BUILD']}\"\
+ project = @config_settings['PROJECT_TO_BUILD']
+ target = @config_settings['PROJECT_TARGET_TO_BUILD']
+ scheme = @config_settings['WORKSPACE_SCHEME_TO_BUILD']
+ workspace = @config_settings['WORKSPACE_TO_BUILD']
+ sdk = @config_settings['SDK']
+
+ if project and project.length > 0
+ if target and target.length > 0
+ cmd_output = %x[ xcodebuild -project \"#{project}\"\
+ -target \"#{target}\"\
-configuration \"#{config}\"\
- -sdk \"#{@config_settings['SDK']}\"\
+ -sdk \"#{sdk}\"\
-showBuildSettings ]
else
- cmd_output = %x[ xcodebuild -project \"#{@config_settings['PROJECT_TO_BUILD']}\"\
- -scheme \"#{@config_settings['WORKSPACE_SCHEME_TO_BUILD']}\"\
+ abort("Build error! Scheme #{scheme} doesn't exist") unless xcode_project_contains_scheme?(scheme)
+ cmd_output = %x[ xcodebuild -project \"#{project}\"\
+ -scheme \"#{scheme}\"\
-configuration \"#{config}\"\
- -sdk \"#{@config_settings['SDK']}\"\
+ -sdk \"#{sdk}\"\
-showBuildSettings ]
end
- elsif @config_settings['WORKSPACE_TO_BUILD'] and @config_settings['WORKSPACE_TO_BUILD'].length > 0
- cmd_output = %x[ xcodebuild -workspace \"#{@config_settings['WORKSPACE_TO_BUILD']}\"\
- -scheme \"#{@config_settings['WORKSPACE_SCHEME_TO_BUILD']}\"\
+ elsif workspace and workspace.length > 0
+ abort("Build error! Scheme #{scheme} doesn't exist") unless xcode_project_contains_scheme?(scheme)
+ cmd_output = %x[ xcodebuild -workspace \"#{workspace}\"\
+ -scheme \"#{scheme}\"\
-configuration \"#{config}\"\
- -sdk \"#{@config_settings['SDK']}\"\
+ -sdk \"#{sdk}\"\
-showBuildSettings ]
@unescaped_watchkit_extension_product_settings_path = unescaped_product_settings_path(' WatchKit Extension', config)
@unescaped_watchkit_app_product_settings_path = unescaped_product_settings_path(' WatchKit App', config)
else
@@ -414,14 +419,14 @@
nil
end
def xcode_project_contains_config?(config)
- xcode_project_info['Build Configurations'].include?(config)
+ xcode_project_info['Build Configurations'] and xcode_project_info['Build Configurations'].include?(config)
end
def xcode_project_contains_scheme?(scheme)
- xcode_project_info['Schemes'].include?(scheme)
+ xcode_project_info['Schemes'] and xcode_project_info['Schemes'].include?(scheme)
end
def xcode_project_info
# Parse information about project
cmd_output = %x[ xcodebuild -list 2>&1 ]