@callstack/react-native-brownfield 3.13.1 → 3.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/ReactBrownfield.podspec +1 -1
  3. package/app.plugin.js +1 -0
  4. package/gradle-plugin/brownfield/gradle.properties +1 -1
  5. package/gradle-plugin/brownfield/src/main/kotlin/com/callstack/react/brownfield/plugin/ProjectConfigurations.kt +3 -2
  6. package/gradle-plugin/brownfield/src/main/kotlin/com/callstack/react/brownfield/plugin/RNSourceSets.kt +11 -4
  7. package/gradle-plugin/brownfield/src/main/kotlin/com/callstack/react/brownfield/processors/VariantTaskProvider.kt +4 -3
  8. package/gradle-plugin/brownfield/src/main/kotlin/com/callstack/react/brownfield/utils/Utils.kt +14 -0
  9. package/lib/commonjs/expo-config-plugin/android/utils/constants.js +1 -1
  10. package/lib/commonjs/expo-config-plugin/android/utils/gradleHelpers.js +1 -1
  11. package/lib/commonjs/expo-config-plugin/android/utils/gradleHelpers.js.map +1 -1
  12. package/lib/commonjs/expo-config-plugin/android/utils/hermes.js +1 -1
  13. package/lib/commonjs/expo-config-plugin/android/utils/hermes.js.map +1 -1
  14. package/lib/commonjs/expo-config-plugin/android/withAndroidModuleFiles.js +1 -1
  15. package/lib/commonjs/expo-config-plugin/android/withAndroidModuleFiles.js.map +1 -1
  16. package/lib/commonjs/expo-config-plugin/android/withBrownfieldAndroid.js +1 -1
  17. package/lib/commonjs/expo-config-plugin/android/withBrownfieldAndroid.js.map +1 -1
  18. package/lib/commonjs/expo-config-plugin/ios/podfileHelpers.js +4 -2
  19. package/lib/commonjs/expo-config-plugin/ios/podfileHelpers.js.map +1 -1
  20. package/lib/commonjs/expo-config-plugin/ios/withBrownfieldIos.js +1 -1
  21. package/lib/commonjs/expo-config-plugin/ios/withBrownfieldIos.js.map +1 -1
  22. package/lib/commonjs/expo-config-plugin/ios/withFmtFix.js +4 -2
  23. package/lib/commonjs/expo-config-plugin/ios/withFmtFix.js.map +1 -1
  24. package/lib/commonjs/expo-config-plugin/ios/xcodeHelpers.js +2 -2
  25. package/lib/commonjs/expo-config-plugin/ios/xcodeHelpers.js.map +1 -1
  26. package/lib/commonjs/expo-config-plugin/template/android/build.gradle.kts +19 -1
  27. package/lib/commonjs/expo-config-plugin/withBrownfield.js +1 -1
  28. package/lib/commonjs/expo-config-plugin/withBrownfield.js.map +1 -1
  29. package/lib/module/expo-config-plugin/android/utils/constants.js +1 -1
  30. package/lib/module/expo-config-plugin/android/utils/gradleHelpers.js +1 -1
  31. package/lib/module/expo-config-plugin/android/utils/gradleHelpers.js.map +1 -1
  32. package/lib/module/expo-config-plugin/android/utils/hermes.js +1 -1
  33. package/lib/module/expo-config-plugin/android/utils/hermes.js.map +1 -1
  34. package/lib/module/expo-config-plugin/android/withAndroidModuleFiles.js +1 -1
  35. package/lib/module/expo-config-plugin/android/withAndroidModuleFiles.js.map +1 -1
  36. package/lib/module/expo-config-plugin/android/withBrownfieldAndroid.js +1 -1
  37. package/lib/module/expo-config-plugin/android/withBrownfieldAndroid.js.map +1 -1
  38. package/lib/module/expo-config-plugin/ios/podfileHelpers.js +4 -2
  39. package/lib/module/expo-config-plugin/ios/podfileHelpers.js.map +1 -1
  40. package/lib/module/expo-config-plugin/ios/withBrownfieldIos.js +1 -1
  41. package/lib/module/expo-config-plugin/ios/withBrownfieldIos.js.map +1 -1
  42. package/lib/module/expo-config-plugin/ios/withFmtFix.js +4 -2
  43. package/lib/module/expo-config-plugin/ios/withFmtFix.js.map +1 -1
  44. package/lib/module/expo-config-plugin/ios/xcodeHelpers.js +2 -2
  45. package/lib/module/expo-config-plugin/ios/xcodeHelpers.js.map +1 -1
  46. package/lib/module/expo-config-plugin/template/android/build.gradle.kts +19 -1
  47. package/lib/module/expo-config-plugin/withBrownfield.js +1 -1
  48. package/lib/module/expo-config-plugin/withBrownfield.js.map +1 -1
  49. package/lib/typescript/commonjs/src/expo-config-plugin/android/utils/constants.d.ts +2 -2
  50. package/lib/typescript/commonjs/src/expo-config-plugin/android/utils/gradleHelpers.d.ts +6 -2
  51. package/lib/typescript/commonjs/src/expo-config-plugin/android/utils/gradleHelpers.d.ts.map +1 -1
  52. package/lib/typescript/commonjs/src/expo-config-plugin/android/utils/hermes.d.ts +3 -1
  53. package/lib/typescript/commonjs/src/expo-config-plugin/android/utils/hermes.d.ts.map +1 -1
  54. package/lib/typescript/commonjs/src/expo-config-plugin/android/withAndroidModuleFiles.d.ts +2 -0
  55. package/lib/typescript/commonjs/src/expo-config-plugin/android/withAndroidModuleFiles.d.ts.map +1 -1
  56. package/lib/typescript/commonjs/src/expo-config-plugin/android/withBrownfieldAndroid.d.ts.map +1 -1
  57. package/lib/typescript/commonjs/src/expo-config-plugin/ios/podfileHelpers.d.ts.map +1 -1
  58. package/lib/typescript/commonjs/src/expo-config-plugin/ios/withBrownfieldIos.d.ts.map +1 -1
  59. package/lib/typescript/commonjs/src/expo-config-plugin/ios/withFmtFix.d.ts.map +1 -1
  60. package/lib/typescript/commonjs/src/expo-config-plugin/ios/xcodeHelpers.d.ts +6 -0
  61. package/lib/typescript/commonjs/src/expo-config-plugin/ios/xcodeHelpers.d.ts.map +1 -1
  62. package/lib/typescript/commonjs/src/expo-config-plugin/types/android/BrownfieldPluginAndroidConfig.d.ts +9 -3
  63. package/lib/typescript/commonjs/src/expo-config-plugin/types/android/BrownfieldPluginAndroidConfig.d.ts.map +1 -1
  64. package/lib/typescript/commonjs/src/expo-config-plugin/types/ios/BrownfieldPluginIosConfig.d.ts +2 -2
  65. package/lib/typescript/commonjs/src/expo-config-plugin/types/ios/BrownfieldPluginIosConfig.d.ts.map +1 -1
  66. package/lib/typescript/commonjs/src/expo-config-plugin/withBrownfield.d.ts.map +1 -1
  67. package/lib/typescript/module/src/expo-config-plugin/android/utils/constants.d.ts +2 -2
  68. package/lib/typescript/module/src/expo-config-plugin/android/utils/gradleHelpers.d.ts +6 -2
  69. package/lib/typescript/module/src/expo-config-plugin/android/utils/gradleHelpers.d.ts.map +1 -1
  70. package/lib/typescript/module/src/expo-config-plugin/android/utils/hermes.d.ts +3 -1
  71. package/lib/typescript/module/src/expo-config-plugin/android/utils/hermes.d.ts.map +1 -1
  72. package/lib/typescript/module/src/expo-config-plugin/android/withAndroidModuleFiles.d.ts +2 -0
  73. package/lib/typescript/module/src/expo-config-plugin/android/withAndroidModuleFiles.d.ts.map +1 -1
  74. package/lib/typescript/module/src/expo-config-plugin/android/withBrownfieldAndroid.d.ts.map +1 -1
  75. package/lib/typescript/module/src/expo-config-plugin/ios/podfileHelpers.d.ts.map +1 -1
  76. package/lib/typescript/module/src/expo-config-plugin/ios/withBrownfieldIos.d.ts.map +1 -1
  77. package/lib/typescript/module/src/expo-config-plugin/ios/withFmtFix.d.ts.map +1 -1
  78. package/lib/typescript/module/src/expo-config-plugin/ios/xcodeHelpers.d.ts +6 -0
  79. package/lib/typescript/module/src/expo-config-plugin/ios/xcodeHelpers.d.ts.map +1 -1
  80. package/lib/typescript/module/src/expo-config-plugin/types/android/BrownfieldPluginAndroidConfig.d.ts +9 -3
  81. package/lib/typescript/module/src/expo-config-plugin/types/android/BrownfieldPluginAndroidConfig.d.ts.map +1 -1
  82. package/lib/typescript/module/src/expo-config-plugin/types/ios/BrownfieldPluginIosConfig.d.ts +2 -2
  83. package/lib/typescript/module/src/expo-config-plugin/types/ios/BrownfieldPluginIosConfig.d.ts.map +1 -1
  84. package/lib/typescript/module/src/expo-config-plugin/withBrownfield.d.ts.map +1 -1
  85. package/package.json +5 -4
  86. package/src/expo-config-plugin/android/utils/constants.ts +1 -1
  87. package/src/expo-config-plugin/android/utils/gradleHelpers.ts +56 -5
  88. package/src/expo-config-plugin/android/utils/hermes.ts +82 -7
  89. package/src/expo-config-plugin/android/withAndroidModuleFiles.ts +26 -2
  90. package/src/expo-config-plugin/android/withBrownfieldAndroid.ts +4 -2
  91. package/src/expo-config-plugin/ios/podfileHelpers.ts +11 -2
  92. package/src/expo-config-plugin/ios/withBrownfieldIos.ts +9 -2
  93. package/src/expo-config-plugin/ios/withFmtFix.ts +47 -17
  94. package/src/expo-config-plugin/ios/xcodeHelpers.ts +62 -1
  95. package/src/expo-config-plugin/template/android/build.gradle.kts +19 -1
  96. package/src/expo-config-plugin/types/android/BrownfieldPluginAndroidConfig.ts +13 -4
  97. package/src/expo-config-plugin/types/ios/BrownfieldPluginIosConfig.ts +5 -3
  98. package/src/expo-config-plugin/withBrownfield.ts +15 -45
@@ -1 +1 @@
1
- {"version":3,"file":"gradleHelpers.d.ts","sourceRoot":"","sources":["../../../../../../../src/expo-config-plugin/android/utils/gradleHelpers.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CA+B9D;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,GACjB,MAAM,CAqBR"}
1
+ {"version":3,"file":"gradleHelpers.d.ts","sourceRoot":"","sources":["../../../../../../../src/expo-config-plugin/android/utils/gradleHelpers.ts"],"names":[],"mappings":"AAMA,KAAK,yBAAyB,GAAG;IAC/B,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,MAAM,EAChB,EAAE,oBAA4B,EAAE,GAAE,yBAA8B,GAC/D,MAAM,CAsCR;AA6BD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,EAAE,oBAA4B,EAAE,GAAE,yBAA8B,GAC/D,MAAM,CA2BR"}
@@ -1,6 +1,8 @@
1
- export declare function getHermesArtifact(rnVersion: string): {
1
+ type HermesArtifact = {
2
2
  groupId: string;
3
3
  artifactId: string;
4
4
  version: string;
5
5
  };
6
+ export declare function getHermesArtifact(rnVersion: string, projectRoot?: string): HermesArtifact;
7
+ export {};
6
8
  //# sourceMappingURL=hermes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"hermes.d.ts","sourceRoot":"","sources":["../../../../../../../src/expo-config-plugin/android/utils/hermes.ts"],"names":[],"mappings":"AAEA,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM;;;;EAgFlD"}
1
+ {"version":3,"file":"hermes.d.ts","sourceRoot":"","sources":["../../../../../../../src/expo-config-plugin/android/utils/hermes.ts"],"names":[],"mappings":"AAKA,KAAK,cAAc,GAAG;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAgEF,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,MAAM,EACjB,WAAW,CAAC,EAAE,MAAM,GACnB,cAAc,CAiFhB"}
@@ -1,6 +1,8 @@
1
1
  import { type ConfigPlugin } from '@expo/config-plugins';
2
2
  import type { ResolvedBrownfieldPluginConfigWithAndroid } from '../types';
3
3
  import { type AndroidManifestMetaDataEntry, type AndroidStringResourceEntry } from './utils/androidManifest';
4
+ export declare function resolveCompileSdkVersionExpression(config: ResolvedBrownfieldPluginConfigWithAndroid): string;
5
+ export declare function resolveTargetSdkVersionExpression(config: ResolvedBrownfieldPluginConfigWithAndroid): string;
4
6
  /**
5
7
  * Creates the Android library module directory structure and files
6
8
  */
@@ -1 +1 @@
1
- {"version":3,"file":"withAndroidModuleFiles.d.ts","sourceRoot":"","sources":["../../../../../../src/expo-config-plugin/android/withAndroidModuleFiles.ts"],"names":[],"mappings":"AAGA,OAAO,EAAoB,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAE3E,OAAO,KAAK,EAEV,yCAAyC,EAC1C,MAAM,UAAU,CAAC;AAIlB,OAAO,EACL,KAAK,4BAA4B,EACjC,KAAK,0BAA0B,EAGhC,MAAM,yBAAyB,CAAC;AAOjC;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,UAAU,EACV,MAAM,EACN,SAAS,EACT,WAAW,EACX,WAAW,GACZ,EAAE;IACD;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,WAAW,EAAE,OAAO,CAAC;IAErB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,MAAM,EAAE,yCAAyC,CAAC;CACnD,GAAG,IAAI,CAsFP;AAED,wBAAgB,yBAAyB,CAAC,EACxC,UAAU,EACV,MAAM,EACN,mBAAmB,GACpB,EAAE;IACD,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,yCAAyC,CAAC;IAClD,mBAAmB,EAAE,4BAA4B,EAAE,CAAC;CACrD,GAAG,IAAI,CASP;AAED,wBAAgB,gCAAgC,CAAC,EAC/C,UAAU,EACV,MAAM,EACN,0BAA0B,GAC3B,EAAE;IACD,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,yCAAyC,CAAC;IAClD,0BAA0B,EAAE,0BAA0B,EAAE,CAAC;CAC1D,GAAG,IAAI,CAUP;AAkBD,wBAAgB,wCAAwC,CAAC,EACvD,UAAU,EACV,MAAM,GACP,EAAE;IACD,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,yCAAyC,CAAC;CACnD,GAAG,IAAI,CAsBP;AAED;;GAEG;AACH,eAAO,MAAM,sBAAsB,EAAE,YAAY,CAC/C,yCAAyC,CAwC1C,CAAC"}
1
+ {"version":3,"file":"withAndroidModuleFiles.d.ts","sourceRoot":"","sources":["../../../../../../src/expo-config-plugin/android/withAndroidModuleFiles.ts"],"names":[],"mappings":"AAGA,OAAO,EAAoB,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAE3E,OAAO,KAAK,EAEV,yCAAyC,EAC1C,MAAM,UAAU,CAAC;AAIlB,OAAO,EACL,KAAK,4BAA4B,EACjC,KAAK,0BAA0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expo-config-plugin/android/withBrownfieldAndroid.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,YAAY,EAClB,MAAM,sBAAsB,CAAC;AAU9B,OAAO,KAAK,EAAE,yCAAyC,EAAE,MAAM,UAAU,CAAC;AAE1E;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB,EAAE,YAAY,CAC9C,yCAAyC,CAwC1C,CAAC"}
1
+ {"version":3,"file":"withBrownfieldAndroid.d.ts","sourceRoot":"","sources":["../../../../../../src/expo-config-plugin/android/withBrownfieldAndroid.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,YAAY,EAClB,MAAM,sBAAsB,CAAC;AAU9B,OAAO,KAAK,EAAE,yCAAyC,EAAE,MAAM,UAAU,CAAC;AAE1E;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB,EAAE,YAAY,CAC9C,yCAAyC,CA0C1C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"podfileHelpers.d.ts","sourceRoot":"","sources":["../../../../../../src/expo-config-plugin/ios/podfileHelpers.ts"],"names":[],"mappings":"AA0FA;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,MAAM,GAChB,MAAM,CAgDR"}
1
+ {"version":3,"file":"podfileHelpers.d.ts","sourceRoot":"","sources":["../../../../../../src/expo-config-plugin/ios/podfileHelpers.ts"],"names":[],"mappings":"AAgGA;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,MAAM,GAChB,MAAM,CAmDR"}
@@ -1 +1 @@
1
- {"version":3,"file":"withBrownfieldIos.d.ts","sourceRoot":"","sources":["../../../../../../src/expo-config-plugin/ios/withBrownfieldIos.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,YAAY,EAClB,MAAM,sBAAsB,CAAC;AAY9B,OAAO,KAAK,EAAE,qCAAqC,EAAE,MAAM,UAAU,CAAC;AAItE;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,EAAE,YAAY,CAC1C,qCAAqC,CAqFtC,CAAC"}
1
+ {"version":3,"file":"withBrownfieldIos.d.ts","sourceRoot":"","sources":["../../../../../../src/expo-config-plugin/ios/withBrownfieldIos.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,YAAY,EAClB,MAAM,sBAAsB,CAAC;AAa9B,OAAO,KAAK,EAAE,qCAAqC,EAAE,MAAM,UAAU,CAAC;AAItE;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,EAAE,YAAY,CAC1C,qCAAqC,CA2FtC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"withFmtFix.d.ts","sourceRoot":"","sources":["../../../../../../src/expo-config-plugin/ios/withFmtFix.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEtE,OAAO,KAAK,EAAE,qCAAqC,EAAE,MAAM,UAAU,CAAC;AAiBtE,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAyC/D;AAED,eAAO,MAAM,UAAU,EAAE,YAAY,CAAC,qCAAqC,CASvE,CAAC"}
1
+ {"version":3,"file":"withFmtFix.d.ts","sourceRoot":"","sources":["../../../../../../src/expo-config-plugin/ios/withFmtFix.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEtE,OAAO,KAAK,EAAE,qCAAqC,EAAE,MAAM,UAAU,CAAC;AAyCtE,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CA+C/D;AAED,eAAO,MAAM,UAAU,EAAE,YAAY,CAAC,qCAAqC,CASvE,CAAC"}
@@ -17,7 +17,9 @@ export type PbxReferenceLike = {
17
17
  } | string;
18
18
  export type PbxNativeTarget = {
19
19
  buildPhases?: PbxReferenceLike[];
20
+ buildConfigurationList?: string;
20
21
  name?: string;
22
+ productReference?: string;
21
23
  };
22
24
  export type PbxResourcesBuildPhase = {
23
25
  isa: 'PBXResourcesBuildPhase';
@@ -56,6 +58,10 @@ export declare function rewriteBundleReactNativePhaseScriptForFrameworkTarget(sh
56
58
  * @param targetUuid The UUID of the framework target
57
59
  */
58
60
  export declare function copyBundleReactNativePhase(project: XcodeProject, targetUuid: string): void;
61
+ export declare function getAppTargetDeploymentTarget(project: Pick<XcodeProject, 'getBuildProperty'>, appTargetName: string | null): string | null;
62
+ export declare function resolveFrameworkDeploymentTarget(project: XcodeProject, modRequest: ModProps<XcodeProject>, { fallbackDeploymentTarget, }: {
63
+ fallbackDeploymentTarget?: string;
64
+ }): string;
59
65
  /**
60
66
  * Adds the "Patch ExpoModulesProvider" shell script phase to the framework target.
61
67
  * Safe to call on every prebuild: skips creation when the phase is already present.
@@ -1 +1 @@
1
- {"version":3,"file":"xcodeHelpers.d.ts","sourceRoot":"","sources":["../../../../../../src/expo-config-plugin/ios/xcodeHelpers.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,QAAQ,EACb,KAAK,YAAY,EAElB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,UAAU,CAAC;AAKlE;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,YAAY,EACrB,UAAU,EAAE,QAAQ,CAAC,YAAY,CAAC,EAClC,OAAO,EAAE,iCAAiC,GACzC;IACD,mBAAmB,EAAE,MAAM,CAAC;IAC5B,mBAAmB,EAAE,OAAO,CAAC;CAC9B,CAoIA;AAED,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,YAAY,EACrB,mBAAmB,EAAE,MAAM,EAC3B,OAAO,EAAE,iCAAiC,QAkB3C;AAED,MAAM,MAAM,gBAAgB,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MA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AAgB,qDAAqD,CACnE,WAAW,EAAE,MAAM,GAClB,MAAM,CAoCR;AAgCD;;;;;GAKG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,YAAY,EACrB,UAAU,EAAE,MAAM,GACjB,IAAI,CA+FN;AAuED,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,IAAI,CAAC,YAAY,EAAE,kBAAkB,CAAC,EAC/C,aAAa,EAAE,MAAM,GAAG,IAAI,GAC3B,MAAM,GAAG,IAAI,CAqBf;AAED,wBAAgB,gCAAgC,CAC9C,OAAO,EAAE,YAAY,EACrB,UAAU,EAAE,QAAQ,CAAC,YAAY,CAAC,EAClC,EACE,wBAAwB,GACzB,EAAE;IACD,wBAAwB,CAAC,EAAE,MAAM,CAAC;CACnC,GACA,MAAM,CAYR;AAED;;;GAGG;AACH,wBAAgB,iCAAiC,CAC/C,UAAU,EAAE,QAAQ,CAAC,YAAY,CAAC,EAClC,OAAO,EAAE,YAAY,EACrB,EACE,aAAa,EACb,mBAAmB,GACpB,EAAE;IACD,aAAa,EAAE,MAAM,CAAC;IACtB,mBAAmB,EAAE,MAAM,CAAC;CAC7B,QAqCF;AAED;;;;;;GAMG;AACH,wBAAgB,6CAA6C,CAC3D,OAAO,EAAE,YAAY,EACrB,mBAAmB,EAAE,MAAM,WAmC5B"}
@@ -19,12 +19,12 @@ export interface BrownfieldPluginAndroidConfig {
19
19
  minSdkVersion?: number;
20
20
  /**
21
21
  * Target SDK version for the Android library
22
- * @default 35
22
+ * @default inherited from the generated Expo app project when available
23
23
  */
24
24
  targetSdkVersion?: number;
25
25
  /**
26
26
  * Compile SDK version for the Android library
27
- * @default 35
27
+ * @default inherited from the generated Expo app project when available
28
28
  */
29
29
  compileSdkVersion?: number;
30
30
  /**
@@ -42,9 +42,15 @@ export interface BrownfieldPluginAndroidConfig {
42
42
  * @default "0.0.1-SNAPSHOT"
43
43
  */
44
44
  version?: string;
45
+ /**
46
+ * Load the Brownfield Gradle plugin from node_modules via includeBuild
47
+ * instead of the Maven classpath dependency.
48
+ * @default false
49
+ */
50
+ useLocalGradlePlugin?: boolean;
45
51
  }
46
52
  /**
47
53
  * Android configuration with resolved defaults (all fields required)
48
54
  */
49
- export type ResolvedBrownfieldPluginAndroidConfig = Required<BrownfieldPluginAndroidConfig>;
55
+ export type ResolvedBrownfieldPluginAndroidConfig = Required<Omit<BrownfieldPluginAndroidConfig, 'compileSdkVersion' | 'targetSdkVersion'>> & Pick<BrownfieldPluginAndroidConfig, 'compileSdkVersion' | 'targetSdkVersion'>;
50
56
  //# sourceMappingURL=BrownfieldPluginAndroidConfig.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BrownfieldPluginAndroidConfig.d.ts","sourceRoot":"","sources":["../../../../../../../src/expo-config-plugin/types/android/BrownfieldPluginAndroidConfig.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC5C;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,MAAM,qCAAqC,GAC/C,QAAQ,CAAC,6BAA6B,CAAC,CAAC"}
1
+ {"version":3,"file":"BrownfieldPluginAndroidConfig.d.ts","sourceRoot":"","sources":["../../../../../../../src/expo-config-plugin/types/android/BrownfieldPluginAndroidConfig.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC5C;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC;AAED;;GAEG;AACH,MAAM,MAAM,qCAAqC,GAAG,QAAQ,CAC1D,IAAI,CAAC,6BAA6B,EAAE,mBAAmB,GAAG,kBAAkB,CAAC,CAC9E,GACC,IAAI,CAAC,6BAA6B,EAAE,mBAAmB,GAAG,kBAAkB,CAAC,CAAC"}
@@ -19,7 +19,7 @@ export interface BrownfieldPluginIosConfig {
19
19
  buildSettings?: Record<string, string | boolean | number>;
20
20
  /**
21
21
  * Minimum iOS deployment target
22
- * @default "15.0"
22
+ * @default inherited from the generated Expo app target when available
23
23
  */
24
24
  deploymentTarget?: string;
25
25
  /**
@@ -32,5 +32,5 @@ export interface BrownfieldPluginIosConfig {
32
32
  /**
33
33
  * iOS configuration with resolved defaults (all fields required)
34
34
  */
35
- export type ResolvedBrownfieldPluginIosConfig = Required<BrownfieldPluginIosConfig>;
35
+ export type ResolvedBrownfieldPluginIosConfig = Required<Omit<BrownfieldPluginIosConfig, 'deploymentTarget'>> & Pick<BrownfieldPluginIosConfig, 'deploymentTarget'>;
36
36
  //# sourceMappingURL=BrownfieldPluginIosConfig.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BrownfieldPluginIosConfig.d.ts","sourceRoot":"","sources":["../../../../../../../src/expo-config-plugin/types/ios/BrownfieldPluginIosConfig.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC,CAAC;IAE1D;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,MAAM,iCAAiC,GAC3C,QAAQ,CAAC,yBAAyB,CAAC,CAAC"}
1
+ {"version":3,"file":"BrownfieldPluginIosConfig.d.ts","sourceRoot":"","sources":["../../../../../../../src/expo-config-plugin/types/ios/BrownfieldPluginIosConfig.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC,CAAC;IAE1D;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,MAAM,iCAAiC,GAAG,QAAQ,CACtD,IAAI,CAAC,yBAAyB,EAAE,kBAAkB,CAAC,CACpD,GACC,IAAI,CAAC,yBAAyB,EAAE,kBAAkB,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"withBrownfield.d.ts","sourceRoot":"","sources":["../../../../../src/expo-config-plugin/withBrownfield.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,YAAY,EAElB,MAAM,sBAAsB,CAAC;AAK9B,OAAO,KAAK,EACV,sBAAsB,EAEvB,MAAM,SAAS,CAAC;;AA8FjB,wBAIE"}
1
+ {"version":3,"file":"withBrownfield.d.ts","sourceRoot":"","sources":["../../../../../src/expo-config-plugin/withBrownfield.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,YAAY,EAElB,MAAM,sBAAsB,CAAC;AAU9B,OAAO,KAAK,EACV,sBAAsB,EAEvB,MAAM,SAAS,CAAC;;AA2DjB,wBAIE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@callstack/react-native-brownfield",
3
- "version": "3.13.1",
3
+ "version": "3.14.0",
4
4
  "license": "MIT",
5
5
  "author": "Michal Chudziak <mike.chudziak@callstack.com>",
6
6
  "bin": {
@@ -63,6 +63,7 @@
63
63
  "files": [
64
64
  "src",
65
65
  "lib",
66
+ "app.plugin.js",
66
67
  "scripts",
67
68
  "gradle-plugin",
68
69
  "android",
@@ -85,16 +86,16 @@
85
86
  "access": "public"
86
87
  },
87
88
  "peerDependencies": {
88
- "@expo/config-plugins": "^54.0.4"
89
+ "@expo/config-plugins": ">=54 <100"
89
90
  },
90
91
  "dependencies": {
91
- "@callstack/brownfield-cli": "^3.13.1"
92
+ "@callstack/brownfield-cli": "^3.14.0"
92
93
  },
93
94
  "devDependencies": {
94
95
  "@babel/core": "^7.25.2",
95
96
  "@babel/preset-env": "^7.25.3",
96
97
  "@babel/runtime": "^7.25.0",
97
- "@expo/config-plugins": "^54.0.4",
98
+ "@expo/config-plugins": "^56.0.8",
98
99
  "@react-native/babel-preset": "0.83.2",
99
100
  "@types/jest": "^30.0.0",
100
101
  "@types/react": "^19.1.1",
@@ -1,2 +1,2 @@
1
- export const BROWNFIELD_PLUGIN_VERSION = '2.0.0-alpha02';
1
+ export const BROWNFIELD_PLUGIN_VERSION = '2.0.0-alpha03';
2
2
  export const brownfieldGradlePluginDependency = `classpath("com.callstack.react:brownfield-gradle-plugin:${BROWNFIELD_PLUGIN_VERSION}")`;
@@ -1,12 +1,29 @@
1
1
  import { brownfieldGradlePluginDependency } from './constants';
2
2
  import { Logger } from '../../logging';
3
3
 
4
+ const LOCAL_GRADLE_PLUGIN_INCLUDE_BUILD =
5
+ 'includeBuild("../node_modules/@callstack/react-native-brownfield/gradle-plugin/brownfield")';
6
+
7
+ type GradleModificationOptions = {
8
+ useLocalGradlePlugin?: boolean;
9
+ };
10
+
4
11
  /**
5
12
  * Modifies the root build.gradle to add the Brownfield Gradle plugin dependency
6
13
  * @param contents The original build.gradle content
7
14
  * @returns The modified build.gradle content
8
15
  */
9
- export function modifyRootBuildGradle(contents: string): string {
16
+ export function modifyRootBuildGradle(
17
+ contents: string,
18
+ { useLocalGradlePlugin = false }: GradleModificationOptions = {}
19
+ ): string {
20
+ if (useLocalGradlePlugin) {
21
+ Logger.logDebug(
22
+ 'Skipping Maven Brownfield Gradle plugin classpath because useLocalGradlePlugin is enabled'
23
+ );
24
+ return contents;
25
+ }
26
+
10
27
  // check if already added
11
28
  if (contents.includes('brownfield-gradle-plugin')) {
12
29
  Logger.logDebug(
@@ -39,6 +56,33 @@ export function modifyRootBuildGradle(contents: string): string {
39
56
  return modifiedContents;
40
57
  }
41
58
 
59
+ function addLocalGradlePluginIncludeBuild(contents: string): string {
60
+ if (contents.includes('gradle-plugin/brownfield')) {
61
+ Logger.logDebug(
62
+ 'Local Brownfield Gradle plugin includeBuild already present, skipping'
63
+ );
64
+ return contents;
65
+ }
66
+
67
+ Logger.logDebug(
68
+ 'Modifying settings.gradle to include local Brownfield Gradle plugin'
69
+ );
70
+
71
+ const pluginManagementMatch = contents.match(/pluginManagement\s*\{/);
72
+
73
+ if (pluginManagementMatch?.index !== undefined) {
74
+ const insertIndex =
75
+ pluginManagementMatch.index + pluginManagementMatch[0].length;
76
+ const insertion = `\n\t${LOCAL_GRADLE_PLUGIN_INCLUDE_BUILD}`;
77
+
78
+ return (
79
+ contents.slice(0, insertIndex) + insertion + contents.slice(insertIndex)
80
+ );
81
+ }
82
+
83
+ return `pluginManagement {\n\t${LOCAL_GRADLE_PLUGIN_INCLUDE_BUILD}\n}\n\n${contents}`;
84
+ }
85
+
42
86
  /**
43
87
  * Modifies settings.gradle to include the Brownfield module
44
88
  * @param contents The original settings.gradle content
@@ -47,16 +91,23 @@ export function modifyRootBuildGradle(contents: string): string {
47
91
  */
48
92
  export function modifySettingsGradle(
49
93
  contents: string,
50
- moduleName: string
94
+ moduleName: string,
95
+ { useLocalGradlePlugin = false }: GradleModificationOptions = {}
51
96
  ): string {
97
+ let modifiedContents = contents;
98
+
99
+ if (useLocalGradlePlugin) {
100
+ modifiedContents = addLocalGradlePluginIncludeBuild(modifiedContents);
101
+ }
102
+
52
103
  const includeStatement = `include ':${moduleName}'`;
53
104
 
54
105
  // check if already included
55
- if (contents.includes(includeStatement)) {
106
+ if (modifiedContents.includes(includeStatement)) {
56
107
  Logger.logDebug(
57
108
  `Module "${moduleName}" already in settings.gradle, skipping`
58
109
  );
59
- return contents;
110
+ return modifiedContents;
60
111
  }
61
112
 
62
113
  Logger.logDebug(
@@ -64,7 +115,7 @@ export function modifySettingsGradle(
64
115
  );
65
116
 
66
117
  // add the include statement at the end
67
- const modifiedContents = contents + `\n${includeStatement}\n`;
118
+ modifiedContents = modifiedContents + `\n${includeStatement}\n`;
68
119
 
69
120
  Logger.logDebug(`Added module "${moduleName}" to settings.gradle`);
70
121
 
@@ -1,6 +1,80 @@
1
+ import * as fs from 'node:fs';
2
+ import * as path from 'node:path';
3
+
1
4
  import { Logger } from '../../logging';
2
5
 
3
- export function getHermesArtifact(rnVersion: string) {
6
+ type HermesArtifact = {
7
+ groupId: string;
8
+ artifactId: string;
9
+ version: string;
10
+ };
11
+
12
+ function parseVersionProperties(contents: string): Record<string, string> {
13
+ return contents
14
+ .split(/\r?\n/)
15
+ .map((line) => line.trim())
16
+ .filter((line) => line.length > 0 && !line.startsWith('#'))
17
+ .reduce<Record<string, string>>((result, line) => {
18
+ const separatorIndex = line.indexOf('=');
19
+ if (separatorIndex === -1) {
20
+ return result;
21
+ }
22
+
23
+ const key = line.slice(0, separatorIndex).trim();
24
+ const value = line.slice(separatorIndex + 1).trim();
25
+
26
+ if (key.length > 0 && value.length > 0) {
27
+ result[key] = value;
28
+ }
29
+
30
+ return result;
31
+ }, {});
32
+ }
33
+
34
+ function resolveHermesArtifactFromInstalledReactNative(
35
+ projectRoot?: string
36
+ ): HermesArtifact | null {
37
+ if (!projectRoot) {
38
+ return null;
39
+ }
40
+
41
+ const versionPropertiesPath = path.join(
42
+ projectRoot,
43
+ 'node_modules',
44
+ 'react-native',
45
+ 'sdks',
46
+ 'hermes-engine',
47
+ 'version.properties'
48
+ );
49
+
50
+ if (!fs.existsSync(versionPropertiesPath)) {
51
+ return null;
52
+ }
53
+
54
+ const properties = parseVersionProperties(
55
+ fs.readFileSync(versionPropertiesPath, 'utf8')
56
+ );
57
+ const resolvedVersion =
58
+ properties.HERMES_V1_VERSION_NAME ?? properties.HERMES_VERSION_NAME;
59
+
60
+ if (!resolvedVersion) {
61
+ Logger.logWarning(
62
+ `Could not resolve Hermes version from '${versionPropertiesPath}'. Falling back to the Brownfield Hermes version map.`
63
+ );
64
+ return null;
65
+ }
66
+
67
+ return {
68
+ groupId: 'com.facebook.hermes',
69
+ artifactId: 'hermes-android',
70
+ version: resolvedVersion,
71
+ };
72
+ }
73
+
74
+ export function getHermesArtifact(
75
+ rnVersion: string,
76
+ projectRoot?: string
77
+ ): HermesArtifact {
4
78
  let [rnMajorVersionString, rnMinorVersionString, rnPatchVersionString] =
5
79
  rnVersion.split('.') as [string?, string?, string?];
6
80
 
@@ -32,13 +106,14 @@ export function getHermesArtifact(rnVersion: string) {
32
106
  );
33
107
  }
34
108
 
35
- // below: 0.84.x
109
+ // above: 0.84.x
36
110
  if (rnMinorVersion >= 84) {
37
- return {
38
- groupId: 'com.facebook.hermes',
39
- artifactId: 'hermes-android',
40
- version: '0.15.1',
41
- };
111
+ const installedReactNativeArtifact =
112
+ resolveHermesArtifactFromInstalledReactNative(projectRoot);
113
+
114
+ if (installedReactNativeArtifact) {
115
+ return installedReactNativeArtifact;
116
+ }
42
117
  }
43
118
 
44
119
  // below: 0.83.x
@@ -22,6 +22,26 @@ import {
22
22
  } from './utils/expo-updates';
23
23
  import { getHermesArtifact } from './utils/hermes';
24
24
 
25
+ export function resolveCompileSdkVersionExpression(
26
+ config: ResolvedBrownfieldPluginConfigWithAndroid
27
+ ): string {
28
+ if (config.android.compileSdkVersion != null) {
29
+ return config.android.compileSdkVersion.toString();
30
+ }
31
+
32
+ return 'resolveRootProjectInt("compileSdkVersion")';
33
+ }
34
+
35
+ export function resolveTargetSdkVersionExpression(
36
+ config: ResolvedBrownfieldPluginConfigWithAndroid
37
+ ): string {
38
+ if (config.android.targetSdkVersion != null) {
39
+ return config.android.targetSdkVersion.toString();
40
+ }
41
+
42
+ return 'resolveRootProjectInt("targetSdkVersion")';
43
+ }
44
+
25
45
  /**
26
46
  * Creates the Android library module directory structure and files
27
47
  */
@@ -63,7 +83,10 @@ export function createAndroidModule({
63
83
 
64
84
  Logger.logDebug(`Creating Android module in: ${androidDir}`);
65
85
 
66
- const hermesArtifact = getHermesArtifact(rnVersion);
86
+ const hermesArtifact = getHermesArtifact(rnVersion, projectRoot);
87
+ const compileSdkVersionExpression =
88
+ resolveCompileSdkVersionExpression(config);
89
+ const targetSdkVersionExpression = resolveTargetSdkVersionExpression(config);
67
90
  Logger.logDebug(
68
91
  `Resolved Hermes artifact: ${hermesArtifact.groupId}:${hermesArtifact.artifactId}:${hermesArtifact.version}`
69
92
  );
@@ -75,7 +98,8 @@ export function createAndroidModule({
75
98
  content: renderTemplate('android', 'build.gradle.kts', {
76
99
  '{{PACKAGE_NAME}}': android.packageName,
77
100
  '{{MIN_SDK_VERSION}}': android.minSdkVersion.toString(),
78
- '{{COMPILE_SDK_VERSION}}': android.compileSdkVersion.toString(),
101
+ '{{TARGET_SDK_VERSION}}': targetSdkVersionExpression,
102
+ '{{COMPILE_SDK_VERSION}}': compileSdkVersionExpression,
79
103
  '{{GROUP_ID}}': android.groupId,
80
104
  '{{ARTIFACT_ID}}': android.artifactId,
81
105
  '{{ARTIFACT_VERSION}}': android.version,
@@ -32,7 +32,8 @@ export const withBrownfieldAndroid: ConfigPlugin<
32
32
  // Step 1: modify root build.gradle to add Brownfield Gradle plugin dependency
33
33
  config = withProjectBuildGradle(config, (gradleConfig) => {
34
34
  gradleConfig.modResults.contents = modifyRootBuildGradle(
35
- gradleConfig.modResults.contents
35
+ gradleConfig.modResults.contents,
36
+ { useLocalGradlePlugin: androidConfig.useLocalGradlePlugin }
36
37
  );
37
38
 
38
39
  return gradleConfig;
@@ -42,7 +43,8 @@ export const withBrownfieldAndroid: ConfigPlugin<
42
43
  config = withSettingsGradle(config, (settingsConfig) => {
43
44
  settingsConfig.modResults.contents = modifySettingsGradle(
44
45
  settingsConfig.modResults.contents,
45
- androidConfig.moduleName
46
+ androidConfig.moduleName,
47
+ { useLocalGradlePlugin: androidConfig.useLocalGradlePlugin }
46
48
  );
47
49
 
48
50
  return settingsConfig;
@@ -53,13 +53,18 @@ ${BROWNFIELD_POD_HOOK_MARKER_END}
53
53
  return modifiedPodfile;
54
54
  }
55
55
 
56
- function ensureExpoDefinesForSDK55AndAbove(podfile: string): string {
56
+ function ensureExpoDefinesForSDK55AndAbove(
57
+ podfile: string,
58
+ expoMajor: number
59
+ ): string {
57
60
  if (podfile.includes(BROWNFIELD_EXPO_GTE_55_SWIFT_DEFINES_MARKER_START)) {
58
61
  return podfile;
59
62
  }
60
63
 
64
+ const defaultDeploymentTarget = expoMajor >= 56 ? '16.4' : '15.1';
61
65
  const hook = `
62
66
  ${BROWNFIELD_EXPO_GTE_55_SWIFT_DEFINES_MARKER_START}
67
+ brownfield_ios_deployment_target = podfile_properties['ios.deploymentTarget'] || '${defaultDeploymentTarget}'
63
68
  installer.pods_project.targets.each do |target|
64
69
  if target.name == 'ReactBrownfield'
65
70
  puts "[Brownfield] Adding definition of EXPO_SDK_GTE_55 to target: #{target.name}"
@@ -68,6 +73,7 @@ function ensureExpoDefinesForSDK55AndAbove(podfile: string): string {
68
73
  conditions = config.build_settings['SWIFT_ACTIVE_COMPILATION_CONDITIONS'] || '$(inherited)'
69
74
  conditions = conditions.to_s
70
75
  config.build_settings['SWIFT_ACTIVE_COMPILATION_CONDITIONS'] = "#{conditions} EXPO_SDK_GTE_55"
76
+ config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = brownfield_ios_deployment_target
71
77
  end
72
78
  end
73
79
  end
@@ -143,7 +149,10 @@ export function modifyPodfile(
143
149
  modifiedPodfile = ensureExpoPhaseOrderingHook(modifiedPodfile);
144
150
  } else {
145
151
  // Expo SDK >= 55
146
- modifiedPodfile = ensureExpoDefinesForSDK55AndAbove(modifiedPodfile);
152
+ modifiedPodfile = ensureExpoDefinesForSDK55AndAbove(
153
+ modifiedPodfile,
154
+ expoMajor
155
+ );
147
156
  }
148
157
 
149
158
  return modifiedPodfile;
@@ -9,6 +9,7 @@ import {
9
9
  addFrameworkTarget,
10
10
  addSourceFilesBuildPhase,
11
11
  copyBundleReactNativePhase,
12
+ resolveFrameworkDeploymentTarget,
12
13
  } from './xcodeHelpers';
13
14
  import { modifyPodfile } from './podfileHelpers';
14
15
  import { injectFmtFixIntoPodfile } from './withFmtFix';
@@ -37,11 +38,17 @@ export const withBrownfieldIos: ConfigPlugin<
37
38
  config = withXcodeProject(config, (xcodeConfig) => {
38
39
  const { modResults: project, modRequest } = xcodeConfig;
39
40
  const hasExpoUpdates = hasExpoUpdatesInstalled(modRequest.projectRoot);
41
+ const iosProps = {
42
+ ...props.ios,
43
+ deploymentTarget: resolveFrameworkDeploymentTarget(project, modRequest, {
44
+ fallbackDeploymentTarget: props.ios.deploymentTarget,
45
+ }),
46
+ };
40
47
 
41
48
  const { frameworkTargetUUID, targetAlreadyExists } = addFrameworkTarget(
42
49
  project,
43
50
  modRequest,
44
- props.ios
51
+ iosProps
45
52
  );
46
53
 
47
54
  // Ensure Expo.plist is present in the framework resources phase when
@@ -90,7 +97,7 @@ export const withBrownfieldIos: ConfigPlugin<
90
97
  );
91
98
  }
92
99
 
93
- addSourceFilesBuildPhase(project, frameworkTargetUUID, props.ios);
100
+ addSourceFilesBuildPhase(project, frameworkTargetUUID, iosProps);
94
101
 
95
102
  return xcodeConfig;
96
103
  });
@@ -4,8 +4,27 @@ import type { ResolvedBrownfieldPluginConfigWithIos } from '../types';
4
4
 
5
5
  const FMT_FIX_MARKER =
6
6
  '# Fix fmt 11.0.2 consteval compilation error with Xcode 26.4+';
7
+ const FMT_FIX_MARKER_START = '# >>> react-native-brownfield fmt fix >>>';
8
+ const FMT_FIX_MARKER_END = '# <<< react-native-brownfield fmt fix <<<';
9
+ const LEGACY_FMT_FIX_BLOCK = new RegExp(
10
+ [
11
+ '\\n?\\s*',
12
+ escapeRegExp(FMT_FIX_MARKER),
13
+ "\\n\\s*fmt_base = File\\.join\\(installer\\.sandbox\\.pod_dir\\('fmt'\\), 'include', 'fmt', 'base\\.h'\\)",
14
+ '\\n\\s*if File\\.exist\\?\\(fmt_base\\)',
15
+ '\\n\\s*content = File\\.read\\(fmt_base\\)',
16
+ "\\n\\s*patched = content\\.gsub\\(/\\^#\\\\s\\*define FMT_USE_CONSTEVAL 1\\$/, '# define FMT_USE_CONSTEVAL 0'\\)",
17
+ '\\n\\s*if patched != content',
18
+ '\\n\\s*File\\.chmod\\(0644, fmt_base\\)',
19
+ '\\n\\s*File\\.write\\(fmt_base, patched\\)',
20
+ '\\n\\s*end',
21
+ '\\n\\s*end\\n?',
22
+ ].join(''),
23
+ 'm'
24
+ );
7
25
 
8
26
  const FMT_FIX_RUBY = `\
27
+ ${FMT_FIX_MARKER_START}
9
28
  ${FMT_FIX_MARKER}
10
29
  fmt_base = File.join(installer.sandbox.pod_dir('fmt'), 'include', 'fmt', 'base.h')
11
30
  if File.exist?(fmt_base)
@@ -15,14 +34,30 @@ const FMT_FIX_RUBY = `\
15
34
  File.chmod(0644, fmt_base)
16
35
  File.write(fmt_base, patched)
17
36
  end
18
- end`;
37
+ end
38
+ ${FMT_FIX_MARKER_END}`;
39
+
40
+ function escapeRegExp(value: string): string {
41
+ return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
42
+ }
19
43
 
20
44
  export function injectFmtFixIntoPodfile(podfile: string): string {
21
- if (podfile.includes(FMT_FIX_MARKER)) {
22
- return podfile;
45
+ const withoutLegacyBlock = podfile.replace(LEGACY_FMT_FIX_BLOCK, '\n');
46
+ const existingBlockPattern = new RegExp(
47
+ `\\n?\\s*${escapeRegExp(FMT_FIX_MARKER_START)}[\\s\\S]*?${escapeRegExp(
48
+ FMT_FIX_MARKER_END
49
+ )}\\n?`,
50
+ 'm'
51
+ );
52
+
53
+ if (existingBlockPattern.test(withoutLegacyBlock)) {
54
+ return withoutLegacyBlock.replace(
55
+ existingBlockPattern,
56
+ `\n${FMT_FIX_RUBY}\n`
57
+ );
23
58
  }
24
59
 
25
- const lines = podfile.split('\n');
60
+ const lines = withoutLegacyBlock.split('\n');
26
61
  const postInstallIndex = lines.findIndex((line) =>
27
62
  /^\s*post_install do \|installer\|/.test(line)
28
63
  );
@@ -31,24 +66,19 @@ export function injectFmtFixIntoPodfile(podfile: string): string {
31
66
  return podfile;
32
67
  }
33
68
 
34
- let depth = 0;
69
+ const baseIndent = lines[postInstallIndex].match(/^(\s*)/)?.[1].length ?? 0;
35
70
  let insertionIndex = -1;
36
71
 
37
- for (let index = postInstallIndex; index < lines.length; index += 1) {
38
- const trimmed = lines[index].trim();
39
-
40
- if (trimmed.endsWith(' do |installer|')) {
41
- depth += 1;
72
+ for (let index = postInstallIndex + 1; index < lines.length; index += 1) {
73
+ const endMatch = lines[index].match(/^(\s*)end\s*$/);
74
+ if (!endMatch) {
42
75
  continue;
43
76
  }
44
77
 
45
- if (trimmed === 'end') {
46
- depth -= 1;
47
-
48
- if (depth === 0) {
49
- insertionIndex = index;
50
- break;
51
- }
78
+ const endIndent = endMatch[1].length;
79
+ if (endIndent === baseIndent) {
80
+ insertionIndex = index;
81
+ break;
52
82
  }
53
83
  }
54
84