bin/nixenvironment in nixenvironment-0.0.43 vs bin/nixenvironment in nixenvironment-0.0.44
- old
+ new
@@ -80,11 +80,11 @@
if need_to_build_ios
begin
read_config_settings
enable_ci_build(options.ci_build)
supplement_config_settings(options.config)
- prebuild(options.config)
+ prebuild(options.config, options.unity_platform)
build(options.config, options.ipa, options.ndsym, options.icon_tagger)
restore_info_plist
rescue
raise # re-rise exception but chdir to root_working_dir in ensure block first if needed
ensure
@@ -97,17 +97,18 @@
end
command :deploy do |c|
c.syntax = 'nixenvironment deploy'
c.description = 'Deploy built artifacts to given server'
- c.option '--unity_platform TARGET PLATFORM', String, 'Select target platform for unity deploy (ios or android)'
c.option '--deliver_deploy', 'Not only verify but also submit the build on iTunes Connect. (resigned_appstore builds only)'
c.action do |args, options|
need_to_deploy_ios = true
- if options.unity_platform and options.unity_platform.length > 0
- need_to_deploy_ios, root_working_dir, need_chdir_to_root_working_dir = unity_deploy(options.unity_platform)
+ unity_platform = %x[ source _last_build_vars.sh && echo ${UNITY_PLATFORM} ].strip!
+
+ if unity_platform and unity_platform.length > 0
+ need_to_deploy_ios, root_working_dir, need_chdir_to_root_working_dir = unity_deploy(unity_platform)
end
if need_to_deploy_ios
begin
read_config_settings
@@ -378,42 +379,43 @@
end
info['Build Configurations'].include?(config)
end
-def save_build_env_vars
+def save_build_env_vars(unity_platform)
app_product = File.join(@config_settings['BUILT_PRODUCTS_DIR'], @config_settings['EXECUTABLE_NAME']) + '.app'
system("
echo \"#!/bin/sh\
### AUTOGENERATED BY Nixenvironment; DO NOT EDIT ###
- PROJECT=#{@config_settings['PROJECT']}
-BUILT_PRODUCTS_DIR=#{@config_settings['BUILT_PRODUCTS_DIR']}
-OBJECTS_NORMAL_DIR=#{@config_settings['OBJECT_FILE_DIR_normal']}
- EXECUTABLE_NAME=#{@config_settings['EXECUTABLE_NAME']}
- APP_PRODUCT=#{app_product}
- APP_DSYM=#{app_product}.dSYM
-APP_INFOPLIST_FILE=#{@config_settings['PRODUCT_SETTINGS_PATH']}
- EMBEDDED_PROFILE=#{app_product}/#{@config_settings['EMBEDDED_PROFILE_NAME']}
- TARGET_NAME=#{@config_settings['TARGET_NAME']}
- CONFIGURATION=#{@config_settings['CONFIGURATION']}
- SDK_NAME=#{@config_settings['SDK_NAME']}
-RESIGNED_BUNDLE_ID=#{@config_settings['RESIGNED_BUNDLE_ID']}
-RESIGNED_BUNDLE_NAME=#{@config_settings['RESIGNED_BUNDLE_NAME']}
+ UNITY_PLATFORM=#{unity_platform}
+ PROJECT=#{@config_settings['PROJECT']}
+ BUILT_PRODUCTS_DIR=#{@config_settings['BUILT_PRODUCTS_DIR']}
+ OBJECTS_NORMAL_DIR=#{@config_settings['OBJECT_FILE_DIR_normal']}
+ EXECUTABLE_NAME=#{@config_settings['EXECUTABLE_NAME']}
+ APP_PRODUCT=#{app_product}
+ APP_DSYM=#{app_product}.dSYM
+ APP_INFOPLIST_FILE=#{@config_settings['PRODUCT_SETTINGS_PATH']}
+ EMBEDDED_PROFILE=#{app_product}/#{@config_settings['EMBEDDED_PROFILE_NAME']}
+ TARGET_NAME=#{@config_settings['TARGET_NAME']}
+ CONFIGURATION=#{@config_settings['CONFIGURATION']}
+ SDK_NAME=#{@config_settings['SDK_NAME']}
+ RESIGNED_BUNDLE_ID=#{@config_settings['RESIGNED_BUNDLE_ID']}
+ RESIGNED_BUNDLE_NAME=#{@config_settings['RESIGNED_BUNDLE_NAME']}
RESIGNED_ENTITLEMENTS_PATH=#{@config_settings['RESIGNED_ENTITLEMENTS_PATH']}\" > _last_build_vars.sh
")
end
-def prebuild(config)
+def prebuild(config, unity_platform)
save_revision = File.join(BUILD_SCRIPTS_PATH, 'SaveRevision.sh')
system("#{save_revision}")
abort unless working_copy_is_clean?
backup_info_plist
- save_build_env_vars
+ save_build_env_vars(unity_platform)
update_info_plist(config)
end
def build(config, ipa, ndsym, icon_tagger)