diff --git a/xcode/commonFastfile b/xcode/commonFastfile index 3446ca5..48b8c8a 100644 --- a/xcode/commonFastfile +++ b/xcode/commonFastfile @@ -106,14 +106,14 @@ private_lane :addShield do |options| end end -private_lane lane :uploadFeaturesToProject do |options| +private_lane :uploadFeaturesToProject do |options| app_target_folder_name = options[:appName] || $appName project_features_file_path = File.expand_path "../#{app_target_folder_name}/Resources/Features.json" common_features_file_path = File.expand_path "../common/build_options/Features.yaml" - builder_features_list = options[:features] # [ "Feature1", "Feature2", "Feature3" ] - + builder_features_list = options[:features].split(",").map { |feature_name| feature_name.strip } # [ "Feature1", "Feature2", "Feature3" ] + Touchlane::Features.generate_features_file_in_project(builder_features_list, common_features_file_path, project_features_file_path) end diff --git a/xcode/fastlane/touchlane/lib/touchlane/features.rb b/xcode/fastlane/touchlane/lib/touchlane/features.rb index 3345c01..4806fba 100644 --- a/xcode/fastlane/touchlane/lib/touchlane/features.rb +++ b/xcode/fastlane/touchlane/lib/touchlane/features.rb @@ -16,7 +16,7 @@ module Touchlane # Generate JSON from feature names feature_bodies = builder_features_list.map { |feature_name| { :name => feature_name, :enabled => true} } - features = { :features => features_body } + features = { :features => feature_bodies } features_json = JSON.pretty_generate(features) unless File.exists? project_features_file_path @@ -32,7 +32,7 @@ module Touchlane unless File.exists? path raise "Unable to load features from file at #{path}" else - YAML.load_file(path)["features"] + YAML.load_file(path) end end