Skip to content

Commit

Permalink
Add fastlane-plugin-xcconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
alfogrillo committed Jul 13, 2023
1 parent 7139f50 commit 6245f9a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
4 changes: 3 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ GEM
rest-client (~> 2.0, >= 2.0.2)
fastlane-plugin-sentry (1.15.0)
os (~> 1.1, >= 1.1.4)
fastlane-plugin-xcconfig (2.0.0)
fastlane-plugin-xcodegen (1.1.0)
fastlane-plugin-brew (~> 0.1.1)
gh_inspector (1.1.3)
Expand Down Expand Up @@ -263,9 +264,10 @@ DEPENDENCIES
fastlane-plugin-browserstack
fastlane-plugin-diawi!
fastlane-plugin-sentry
fastlane-plugin-xcconfig
fastlane-plugin-xcodegen
slather
xcode-install

BUNDLED WITH
2.3.26
2.4.16
20 changes: 9 additions & 11 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ lane :config_nightly do
data["settings"]["BASE_APP_GROUP_IDENTIFIER"] = "io.element.nightly"
data["settings"]["BASE_BUNDLE_IDENTIFIER"] = "io.element.elementx.nightly"

config_maplibre(yaml: data)
config_maplibre()

File.open(target_file_path, 'w') { |f| YAML.dump(data, f) }

Expand All @@ -186,13 +186,7 @@ lane :config_nightly do
end

lane :config_production do
target_file_path = "../project.yml"
data = YAML.load_file target_file_path

config_maplibre(yaml: data)

File.open(target_file_path, 'w') { |f| YAML.dump(data, f) }

config_maplibre()
xcodegen(spec: "project.yml")
end

Expand Down Expand Up @@ -414,9 +408,13 @@ private_lane :create_simulator_if_necessary do |options|
end
end

private_lane :config_maplibre do |options|
yaml = options[:yaml]
private_lane :config_maplibre do
api_key = ENV["MAPLIBRE_API_KEY"]
UI.user_error!("Invalid Map Libre API key.") unless !api_key.to_s.empty?
yaml["settings"]["MAPLIBRE_API_KEY"] = api_key

set_xcconfig_value(
path: './secrets.xcconfig',
name: 'MAPLIBRE_API_KEY',
value: api_key
)
end
1 change: 1 addition & 0 deletions fastlane/Pluginfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ gem 'fastlane-plugin-diawi', git: 'https://github.com/mhtranbn/fastlane-plugin-d
gem 'fastlane-plugin-xcodegen'
gem 'fastlane-plugin-sentry'
gem 'fastlane-plugin-browserstack'
gem 'fastlane-plugin-xcconfig'

0 comments on commit 6245f9a

Please sign in to comment.