From 3274d2a7f8f76234e4758ee144ad4165d317aec7 Mon Sep 17 00:00:00 2001 From: Chris Herman Date: Mon, 11 Mar 2024 13:17:05 -0400 Subject: [PATCH] feat(fastlane): update android regex --- packages/plugin-fastlane/src/index.ts | 4 ++-- packages/plugin-fastlane/test/index.test.ts | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/plugin-fastlane/src/index.ts b/packages/plugin-fastlane/src/index.ts index 915f361350..13f7d961b6 100644 --- a/packages/plugin-fastlane/src/index.ts +++ b/packages/plugin-fastlane/src/index.ts @@ -122,8 +122,8 @@ eval_gemfile(plugins_path) if File.exist?(plugins_path) await fsk.update( pathk.project.resolve("android", "app", "build.gradle"), - /(signingConfigs\s*{\s*)/m, - `$1release { + /(signingConfigs[.\s\S]+?release \{)[.\s\S]+?\}/m, + `$1 storeFile file('release.keystore') storePassword System.getenv("STORE_PASSWORD") keyAlias '${config.android.signing.keyAlias}' diff --git a/packages/plugin-fastlane/test/index.test.ts b/packages/plugin-fastlane/test/index.test.ts index 06f4cd202a..5d2bd61435 100644 --- a/packages/plugin-fastlane/test/index.test.ts +++ b/packages/plugin-fastlane/test/index.test.ts @@ -90,8 +90,18 @@ describe("plugin-fastlane", () => { await fs.readFile(path.project.resolve("android", "fastlane", "Fastfile")) ).toString(); + const appBuildGradle = ( + await fs.readFile(path.project.resolve("android", "app", "build.gradle")) + ).toString(); + androidCases.forEach(function (testCase) { expect(result).toMatch(testCase); }); + + expect(appBuildGradle).toContain(`{ + storeFile file('release.keystore') + storePassword System.getenv("STORE_PASSWORD") + keyAlias 'key0' + keyPassword System.getenv("KEY_PASSWORD")`); }); });