Class: Fastlane::Actions::FlintSetupAction
- Inherits:
-
FlintAction
- Object
- Action
- FlintAction
- Fastlane::Actions::FlintSetupAction
- Defined in:
- lib/fastlane/plugin/flint/actions/flint_setup.rb
Class Method Summary collapse
Methods inherited from FlintAction
authors, available_options, description, details, fetch_keystore, is_supported?
Class Method Details
.run(params) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/fastlane/plugin/flint/actions/flint_setup.rb', line 8 def self.run(params) containing = FastlaneCore::Helper.fastlane_enabled_folder_path path = File.join(containing, "Flintfile") if File.exist?(path) FastlaneCore::UI.user_error!("You already have a Flintfile in this directory (#{path})") return 0 end template = File.read("#{Flint::ROOT}/assets/FlintfileTemplate") UI.important("Please create a new, private git repository") UI.important("to store the keystores there") url = UI.input("URL of the Git Repo: ") template.gsub!("[[GIT_URL]]", url) File.write(path, template) UI.success("Successfully created '#{path}'. You can open the file using a code editor.") UI.important("Please mopdify build.gradle file (usually under app/build.gradle):") UI.("Add before `android {` line:") UI.(" // Load keystore") UI.(" def keystorePropertiesFile = rootProject.file(\"keystore.properties\");") UI.(" def keystoreProperties = new Properties()") UI.(" keystoreProperties.load(new FileInputStream(keystorePropertiesFile))") UI.("Add after the closing bracket for `defaultConfig {`:") UI.(" signingConfigs {") UI.(" development {") UI.(" storeFile file(keystoreProperties['storeFile'])") UI.(" storePassword keystoreProperties['storePassword']") UI.(" keyAlias keystoreProperties['keyAlias']") UI.(" keyPassword keystoreProperties['keyPassword']") UI.(" }") UI.(" release {") UI.(" storeFile file(keystoreProperties['storeFile'])") UI.(" storePassword keystoreProperties['storePassword']") UI.(" keyAlias keystoreProperties['keyAlias']") UI.(" keyPassword keystoreProperties['keyPassword']") UI.(" }") UI.(" }") UI.important("This will load the appropriate keystore during release builds") UI.important("You can now run `fastlane flint type:development` and `fastlane flint type:release`") UI.("On the first run for each environment it will create the keystore for you.") UI.("From then on, it will automatically import the existing keystores.") UI.("For more information visit https://docs.fastlane.tools/actions/flint/") end |