|
78 | 78 | lane :matchesque do |
79 | 79 | match_dir = clone_match |
80 | 80 |
|
81 | | - # don't forget --- lanes run inside of ./fastlane |
82 | | - gradle_file = 'signing.properties' |
83 | | - keystore_name = 'my-release-key.keystore' |
84 | | - play_store_key = 'play-private-key.json' |
85 | | - |
| 81 | + # we'll be copying files out of the tempdir from the git-clone operation |
86 | 82 | src = "#{match_dir}/android" |
87 | | - |
88 | | - # FastlaneCore::CommandExecutor.execute(command: "pwd", print_all: true, print_command: true) |
89 | | - UI.command "cp #{src}/#{gradle_file} ../android/app/#{gradle_file}" |
90 | | - FileUtils.cp("#{src}/#{gradle_file}", "../android/app/#{gradle_file}") |
91 | | - UI.command "cp #{src}/#{keystore_name} ../android/app/#{keystore_name}" |
92 | | - FileUtils.cp("#{src}/#{keystore_name}", "../android/app/#{keystore_name}") |
93 | | - UI.command "cp #{src}/#{play_store_key} ../fastlane/#{play_store_key}" |
94 | | - FileUtils.cp("#{src}/#{play_store_key}", "../fastlane/#{play_store_key}") |
| 83 | + # don't forget: lanes run inside of ./fastlane, so we go up a level for our basedir |
| 84 | + dest = File.expand_path('..', '.') |
| 85 | + |
| 86 | + # we export this variable so that Gradle knows where to find the .properties file |
| 87 | + signing_props_dest = "#{dest}/android/app/signing.properties" |
| 88 | + ENV['KEYSTORE_FILE'] = signing_props_dest |
| 89 | + |
| 90 | + pairs = [ |
| 91 | + {:from => "#{src}/signing.properties", :to => signing_props_dest}, |
| 92 | + {:from => "#{src}/my-release-key.keystore", :to => "#{dest}/android/app/my-release-key.keystore"}, |
| 93 | + {:from => "#{src}/play-private-key.json", :to => "#{dest}/fastlane/play-private-key.json"}, |
| 94 | + ] |
| 95 | + |
| 96 | + pairs.each do |pair| |
| 97 | + UI.command "cp #{pair[:from]} #{pair[:to]}" |
| 98 | + FileUtils.cp(pair[:from], pair[:to]) |
| 99 | + end |
95 | 100 |
|
96 | 101 | remove_match_clone(dir: match_dir) |
97 | 102 | end |
|
0 commit comments