create GeneratedInfoPlistDotEnv.h for Info.plist preprocessing (#457)

Co-authored-by: Rafael Mäuer <rafaelmaeuer@gmail.com>
This commit is contained in:
rafaelmaeuer 2020-05-22 16:07:00 +02:00 committed by GitHub
parent 74ae697443
commit bc3ca9d261
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,6 +25,11 @@ EOF
path = File.join(m_output_path, 'GeneratedDotEnv.m') path = File.join(m_output_path, 'GeneratedDotEnv.m')
File.open(path, 'w') { |f| f.puts template } File.open(path, 'w') { |f| f.puts template }
#File.delete('/tmp/envfile') if custom_env # create header file with defines for the Info.plist preprocessor
info_plist_defines_objc = dotenv.map { |k, v| %Q(#define RNC_#{k} #{v}) }.join("\n")
# write it so the Info.plist preprocessor can access it
path = File.join(ENV["BUILD_DIR"], "GeneratedInfoPlistDotEnv.h")
File.open(path, "w") { |f| f.puts info_plist_defines_objc }
puts "Wrote to #{path}" puts "Wrote to #{path}"