Skip to content

Commit

Permalink
create GeneratedInfoPlistDotEnv.h for Info.plist preprocessing (#457)
Browse files Browse the repository at this point in the history
Co-authored-by: Rafael Mäuer <[email protected]>
  • Loading branch information
rafaelmaeuer and Rafael Mäuer authored May 22, 2020
1 parent 74ae697 commit bc3ca9d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ios/ReactNativeConfig/BuildDotenvConfig.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
path = File.join(m_output_path, 'GeneratedDotEnv.m')
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}"

0 comments on commit bc3ca9d

Please sign in to comment.