@callstack/react-native-brownfield 4.3.0 → 5.0.1

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.
@@ -9,6 +9,7 @@ import org.gradle.api.DefaultTask
9
9
  import org.gradle.api.Project
10
10
  import org.gradle.api.file.ConfigurableFileCollection
11
11
  import org.gradle.api.file.DirectoryProperty
12
+ import org.gradle.api.provider.ListProperty
12
13
  import org.gradle.api.provider.Property
13
14
  import org.gradle.api.tasks.CacheableTask
14
15
  import org.gradle.api.tasks.Input
@@ -50,6 +51,9 @@ abstract class ProcessAndCopyJniLibsTask : DefaultTask() {
50
51
  @get:Input
51
52
  abstract val useStrippedSoFiles: Property<Boolean>
52
53
 
54
+ @get:Input
55
+ abstract val extraIgnoredLibs: ListProperty<String>
56
+
53
57
  @get:OutputDirectory
54
58
  abstract val outputDirectory: DirectoryProperty
55
59
 
@@ -125,7 +129,8 @@ abstract class ProcessAndCopyJniLibsTask : DefaultTask() {
125
129
 
126
130
  private fun matchesAllowedLib(name: String): Boolean {
127
131
  val isCodegenLib = name.startsWith("libreact_codegen_") && name.endsWith(".so")
128
- val isIgnoredLib = IGNORE_EMBEDDED_LIBS.any { lib -> name == lib || name.contains(lib) }
132
+ val ignoredLibs = IGNORE_EMBEDDED_LIBS + extraIgnoredLibs.getOrElse(emptyList())
133
+ val isIgnoredLib = ignoredLibs.any { lib -> name == lib || name.contains(lib) }
129
134
  return name == "libappmodules.so" || isCodegenLib || !isIgnoredLib
130
135
  }
131
136
 
@@ -161,6 +166,7 @@ class JNILibsProcessor(val project: Project) {
161
166
  val processJniTask =
162
167
  project.tasks.register("processCustomJniLibsFor$capitalizedVariantName", ProcessAndCopyJniLibsTask::class.java) {
163
168
  it.useStrippedSoFiles.set(projectExt.useStrippedSoFiles)
169
+ it.extraIgnoredLibs.set(projectExt.ignoreEmbeddedLibs)
164
170
 
165
171
  val jniDirs =
166
172
  aarLibraries.map { aarLib ->
@@ -40,4 +40,17 @@ open class Extension {
40
40
  * listOf("type", "alpha")
41
41
  */
42
42
  var missingDimensionStrategies = listOf<String>()
43
+
44
+ /**
45
+ * Additional .so file names to keep out of the AAR, on top of
46
+ * [com.callstack.react.brownfield.processors.IGNORE_EMBEDDED_LIBS].
47
+ *
48
+ * Use this for libraries that stay declared as dependencies of the published AAR: the
49
+ * host App resolves those from Maven, so embedding them as well leaves two copies of
50
+ * the same .so and the host's native library merge fails.
51
+ *
52
+ * Provide in this format:
53
+ * listOf("libdatadog-ndk.so")
54
+ */
55
+ var ignoreEmbeddedLibs = listOf<String>()
43
56
  }
@@ -1,4 +1,4 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.modifyPodfile=modifyPodfile;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _SourceModificationError=require("../errors/SourceModificationError");var _logging=require("../logging");var _engine=require("../template/engine");var BROWNFIELD_EXPO_GTE_55_SWIFT_DEFINES_MARKER_START='# >>> react-native-brownfield Expo SDK 55+ swift defines >>>';var BROWNFIELD_EXPO_GTE_55_SWIFT_DEFINES_MARKER_END='# <<< react-native-brownfield Expo SDK 55+ swift defines <<<';function ensureExpoDefinesForSDK55AndAbove(podfile,expoMajor){if(podfile.includes(BROWNFIELD_EXPO_GTE_55_SWIFT_DEFINES_MARKER_START)){return podfile;}var defaultDeploymentTarget=expoMajor>=56?'16.4':'15.1';var hook=`
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.modifyPodfile=modifyPodfile;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _SourceModificationError=require("../errors/SourceModificationError");var _logging=require("../logging");var _engine=require("../template/engine");var MIN_SUPPORTED_EXPO_SDK_MAJOR_VERSION=56;var BROWNFIELD_EXPO_GTE_55_SWIFT_DEFINES_MARKER_START='# >>> react-native-brownfield Expo SDK 55+ swift defines >>>';var BROWNFIELD_EXPO_GTE_55_SWIFT_DEFINES_MARKER_END='# <<< react-native-brownfield Expo SDK 55+ swift defines <<<';function ensureExpoDefinesForSDK55AndAbove(podfile,expoMajor){if(podfile.includes(BROWNFIELD_EXPO_GTE_55_SWIFT_DEFINES_MARKER_START)){return podfile;}var defaultDeploymentTarget=expoMajor>=56?'16.4':'15.1';var hook=`
2
2
  ${BROWNFIELD_EXPO_GTE_55_SWIFT_DEFINES_MARKER_START}
3
3
  brownfield_ios_deployment_target = podfile_properties['ios.deploymentTarget'] || '${defaultDeploymentTarget}'
4
4
  installer.pods_project.targets.each do |target|
@@ -14,5 +14,5 @@ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault
14
14
  end
15
15
  end
16
16
  ${BROWNFIELD_EXPO_GTE_55_SWIFT_DEFINES_MARKER_END}
17
- `;var postInstallMatch=podfile.match(/(post_install\s+do\s+\|installer\|\s*\n)((?:(?!^\s*end\s*$)[\s\S])*)(^\s*end\s*$)/m);if(postInstallMatch){var _postInstallMatch=(0,_slicedToArray2.default)(postInstallMatch,4),whole=_postInstallMatch[0],start=_postInstallMatch[1],content=_postInstallMatch[2],end=_postInstallMatch[3];var updated=`${start}${content.trimEnd()}\n${hook}\n${end}`;return podfile.replace(whole,updated);}return`${podfile.trimEnd()}\n\npost_install do |installer|\n${hook}\nend\n`;}function modifyPodfile(podfile,frameworkName,expoMajor){if(podfile.includes(`target '${frameworkName}'`)){_logging.Logger.logDebug(`Framework target "${frameworkName}" already in Podfile, skipping modification`);return podfile;}_logging.Logger.logDebug(`Modifying Podfile for framework: ${frameworkName}`);var frameworkTargetBlock=(0,_engine.renderTemplate)('ios','PodfileTargetBlock.rb',{'{{FRAMEWORK_NAME}}':frameworkName});var mainTargetMatch=podfile.match(/(target\s+['"][^'"]+['"]\s+do\s*\n)([\s\S]*?)(^end\s*$)/m);if(!mainTargetMatch){throw new _SourceModificationError.SourceModificationError('Could not find main target in Podfile. Please manually add the framework target.');}var _mainTargetMatch=(0,_slicedToArray2.default)(mainTargetMatch,3),targetStart=_mainTargetMatch[1],targetContent=_mainTargetMatch[2];var insertIndex=podfile.indexOf(mainTargetMatch[0])+targetStart.length+targetContent.length;var modifiedPodfile=podfile.slice(0,insertIndex)+frameworkTargetBlock+podfile.slice(insertIndex);_logging.Logger.logDebug(`Added framework target "${frameworkName}" to Podfile`);if(expoMajor<55){var versionLabel=expoMajor<0?'unknown':expoMajor.toString();throw new _SourceModificationError.SourceModificationError(`Expo SDK ${versionLabel} is not supported. Please use Expo SDK 55 or newer. For older versions, please use the v3.x.x of @callstack/react-native-brownfield.`);}modifiedPodfile=ensureExpoDefinesForSDK55AndAbove(modifiedPodfile,expoMajor);return modifiedPodfile;}
17
+ `;var postInstallMatch=podfile.match(/(post_install\s+do\s+\|installer\|\s*\n)((?:(?!^\s*end\s*$)[\s\S])*)(^\s*end\s*$)/m);if(postInstallMatch){var _postInstallMatch=(0,_slicedToArray2.default)(postInstallMatch,4),whole=_postInstallMatch[0],start=_postInstallMatch[1],content=_postInstallMatch[2],end=_postInstallMatch[3];var updated=`${start}${content.trimEnd()}\n${hook}\n${end}`;return podfile.replace(whole,updated);}return`${podfile.trimEnd()}\n\npost_install do |installer|\n${hook}\nend\n`;}function modifyPodfile(podfile,frameworkName,expoMajor){if(podfile.includes(`target '${frameworkName}'`)){_logging.Logger.logDebug(`Framework target "${frameworkName}" already in Podfile, skipping modification`);return podfile;}_logging.Logger.logDebug(`Modifying Podfile for framework: ${frameworkName}`);var frameworkTargetBlock=(0,_engine.renderTemplate)('ios','PodfileTargetBlock.rb',{'{{FRAMEWORK_NAME}}':frameworkName});var mainTargetMatch=podfile.match(/(target\s+['"][^'"]+['"]\s+do\s*\n)([\s\S]*?)(^end\s*$)/m);if(!mainTargetMatch){throw new _SourceModificationError.SourceModificationError('Could not find main target in Podfile. Please manually add the framework target.');}var _mainTargetMatch=(0,_slicedToArray2.default)(mainTargetMatch,3),targetStart=_mainTargetMatch[1],targetContent=_mainTargetMatch[2];var insertIndex=podfile.indexOf(mainTargetMatch[0])+targetStart.length+targetContent.length;var modifiedPodfile=podfile.slice(0,insertIndex)+frameworkTargetBlock+podfile.slice(insertIndex);_logging.Logger.logDebug(`Added framework target "${frameworkName}" to Podfile`);if(expoMajor<MIN_SUPPORTED_EXPO_SDK_MAJOR_VERSION){var versionLabel=expoMajor<0?'unknown':expoMajor.toString();throw new _SourceModificationError.SourceModificationError(`Expo SDK ${versionLabel} is not supported. Please use Expo SDK ${MIN_SUPPORTED_EXPO_SDK_MAJOR_VERSION} or newer. For older versions, please see the matrix of supported versions: https://oss.callstack.com/react-native-brownfield/docs/getting-started/introduction#expo-version-compatibility`);}modifiedPodfile=ensureExpoDefinesForSDK55AndAbove(modifiedPodfile,expoMajor);return modifiedPodfile;}
18
18
  //# sourceMappingURL=podfileHelpers.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_SourceModificationError","require","_logging","_engine","BROWNFIELD_EXPO_GTE_55_SWIFT_DEFINES_MARKER_START","BROWNFIELD_EXPO_GTE_55_SWIFT_DEFINES_MARKER_END","ensureExpoDefinesForSDK55AndAbove","podfile","expoMajor","includes","defaultDeploymentTarget","hook","postInstallMatch","match","_postInstallMatch","_slicedToArray2","default","whole","start","content","end","updated","trimEnd","replace","modifyPodfile","frameworkName","Logger","logDebug","frameworkTargetBlock","renderTemplate","mainTargetMatch","SourceModificationError","_mainTargetMatch","targetStart","targetContent","insertIndex","indexOf","length","modifiedPodfile","slice","versionLabel","toString"],"sourceRoot":"../../../../src","sources":["expo-config-plugin/ios/podfileHelpers.ts"],"mappings":"4QAAA,IAAAA,wBAAA,CAAAC,OAAA,sCACA,IAAAC,QAAA,CAAAD,OAAA,eACA,IAAAE,OAAA,CAAAF,OAAA,uBAEA,GAAM,CAAAG,iDAAiD,CACrD,8DAA8D,CAChE,GAAM,CAAAC,+CAA+C,CACnD,8DAA8D,CAEhE,QAAS,CAAAC,iCAAiCA,CACxCC,OAAe,CACfC,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c,EAAC,KAAK,CAAE,uBAAuB,CAAE,CAC1E,oBAAoB,CAAEJ,aACxB,CAAC,CAAC,CAGF,GAAM,CAAAK,eAAe,CAAGvB,OAAO,CAACM,KAAK,CACnC,0DACF,CAAC,CAED,GAAI,CAACiB,eAAe,CAAE,CACpB,KAAM,IAAI,CAAAC,gDAAuB,CAC/B,kFACF,CAAC,CACH,CAEA,IAAAC,gBAAA,IAAAjB,eAAA,CAAAC,OAAA,EAAuCc,eAAe,IAA7CG,WAAW,CAAAD,gBAAA,IAAEE,aAAa,CAAAF,gBAAA,IACnC,GAAM,CAAAG,WAAW,CACf5B,OAAO,CAAC6B,OAAO,CAACN,eAAe,CAAC,CAAC,CAAC,CAAC,CACnCG,WAAW,CAACI,MAAM,CAClBH,aAAa,CAACG,MAAM,CAEtB,GAAI,CAAAC,eAAe,CACjB/B,OAAO,CAACgC,KAAK,CAAC,CAAC,CAAEJ,WAAW,CAAC,CAC7BP,oBAAoB,CACpBrB,OAAO,CAACgC,KAAK,CAACJ,WAAW,CAAC,CAE5BT,eAAM,CAACC,QAAQ,CAAC,2BAA2BF,aAAa,cAAc,CAAC,CAEvE,GAAIjB,SAAS,CAAG,EAAE,CAAE,CAClB,GAAM,CAAAgC,YAAY,CAAGhC,SAAS,CAAG,CAAC,CAAG,SAAS,CAAGA,SAAS,CAACiC,QAAQ,CAAC,CAAC,CACrE,KAAM,IAAI,CAAAV,gDAAuB,CAC/B,YAAYS,YAAY,sIAC1B,CAAC,CACH,CAEAF,eAAe,CAAGhC,iCAAiC,CACjDgC,eAAe,CACf9B,SACF,CAAC,CAED,MAAO,CAAA8B,eAAe,CACxB","ignoreList":[]}
1
+ {"version":3,"names":["_SourceModificationError","require","_logging","_engine","MIN_SUPPORTED_EXPO_SDK_MAJOR_VERSION","BROWNFIELD_EXPO_GTE_55_SWIFT_DEFINES_MARKER_START","BROWNFIELD_EXPO_GTE_55_SWIFT_DEFINES_MARKER_END","ensureExpoDefinesForSDK55AndAbove","podfile","expoMajor","includes","defaultDeploymentTarget","hook","postInstallMatch","match","_postInstallMatch","_slicedToArray2","default","whole","start","content","end","updated","trimEnd","replace","modifyPodfile","frameworkName","Logger","logDebug","frameworkTargetBlock","renderTemplate","mainTargetMatch","SourceModificationError","_mainTargetMatch","targetStart","targetContent","insertIndex","indexOf","length","modifiedPodfile","slice","versionLabel","toString"],"sourceRoot":"../../../../src","sources":["expo-config-plugin/ios/podfileHelpers.ts"],"mappings":"4QAAA,IAAAA,wBAAA,CAAAC,OAAA,sCACA,IAAAC,QAAA,CAAAD,OAAA,eACA,IAAAE,OAAA,CAAAF,OAAA,uBAEA,GAAM,CAAAG,oCAAoC,CAAG,EAAE,CAE/C,GAAM,CAAAC,iDAAiD,CACrD,8DAA8D,CAChE,GAAM,CAAAC,+CAA+C,CACnD,8DAA8D,CAEhE,QAAS,CAAAC,iCAAiCA,CACxCC,OAAe,CACfC,SAAiB,CACT,CACR,GAAID,OAAO,CAACE,QAAQ,CAACL,iDAAiD,CAAC,CAAE,CACvE,MAAO,CAAAG,OAAO,CAChB,CAEA,GAAM,CAAAG,uBAAuB,CAAGF,SAAS,EAAI,EAAE,CAAG,MAAM,CAAG,MAAM,CACjE,GAAM,CAAAG,IAAI,CAAG;AACf,MAAMP,iDAAiD;AACvD,wFAAwFM,uBAAuB;AAC/G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAML,+CAA+C;AACrD,CAAC,CAEC,GAAM,CAAAO,gBAAgB,CAAGL,OAAO,CAACM,KAAK,CACpC,oFACF,CAAC,CAED,GAAID,gBAAgB,CAAE,CACpB,IAAAE,iBAAA,IAAAC,eAAA,CAAAC,OAAA,EAAqCJ,gBAAgB,IAA9CK,KAAK,CAAAH,iBAAA,IAAEI,KAAK,CAAAJ,iBAAA,IAAEK,OAAO,CAAAL,iBAAA,IAAEM,GAAG,CAAAN,iBAAA,IACjC,GAAM,CAAAO,OAAO,CAAG,GAAGH,KAAK,GAAGC,OAA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AC,2BAA2BF,aAAa,cAAc,CAAC,CAEvE,GAAIjB,SAAS,CAAGL,oCAAoC,CAAE,CACpD,GAAM,CAAAqC,YAAY,CAAGhC,SAAS,CAAG,CAAC,CAAG,SAAS,CAAGA,SAAS,CAACiC,QAAQ,CAAC,CAAC,CACrE,KAAM,IAAI,CAAAV,gDAAuB,CAC/B,YAAYS,YAAY,0CAA0CrC,oCAAoC,4LACxG,CAAC,CACH,CAEAmC,eAAe,CAAGhC,iCAAiC,CACjDgC,eAAe,CACf9B,SACF,CAAC,CAED,MAAO,CAAA8B,eAAe,CACxB","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.modifyPodfile=modifyPodfile;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _SourceModificationError=require("../errors/SourceModificationError");var _logging=require("../logging");var _engine=require("../template/engine");var BROWNFIELD_EXPO_GTE_55_SWIFT_DEFINES_MARKER_START='# >>> react-native-brownfield Expo SDK 55+ swift defines >>>';var BROWNFIELD_EXPO_GTE_55_SWIFT_DEFINES_MARKER_END='# <<< react-native-brownfield Expo SDK 55+ swift defines <<<';function ensureExpoDefinesForSDK55AndAbove(podfile,expoMajor){if(podfile.includes(BROWNFIELD_EXPO_GTE_55_SWIFT_DEFINES_MARKER_START)){return podfile;}var defaultDeploymentTarget=expoMajor>=56?'16.4':'15.1';var hook=`
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.modifyPodfile=modifyPodfile;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _SourceModificationError=require("../errors/SourceModificationError");var _logging=require("../logging");var _engine=require("../template/engine");var MIN_SUPPORTED_EXPO_SDK_MAJOR_VERSION=56;var BROWNFIELD_EXPO_GTE_55_SWIFT_DEFINES_MARKER_START='# >>> react-native-brownfield Expo SDK 55+ swift defines >>>';var BROWNFIELD_EXPO_GTE_55_SWIFT_DEFINES_MARKER_END='# <<< react-native-brownfield Expo SDK 55+ swift defines <<<';function ensureExpoDefinesForSDK55AndAbove(podfile,expoMajor){if(podfile.includes(BROWNFIELD_EXPO_GTE_55_SWIFT_DEFINES_MARKER_START)){return podfile;}var defaultDeploymentTarget=expoMajor>=56?'16.4':'15.1';var hook=`
2
2
  ${BROWNFIELD_EXPO_GTE_55_SWIFT_DEFINES_MARKER_START}
3
3
  brownfield_ios_deployment_target = podfile_properties['ios.deploymentTarget'] || '${defaultDeploymentTarget}'
4
4
  installer.pods_project.targets.each do |target|
@@ -14,5 +14,5 @@ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault
14
14
  end
15
15
  end
16
16
  ${BROWNFIELD_EXPO_GTE_55_SWIFT_DEFINES_MARKER_END}
17
- `;var postInstallMatch=podfile.match(/(post_install\s+do\s+\|installer\|\s*\n)((?:(?!^\s*end\s*$)[\s\S])*)(^\s*end\s*$)/m);if(postInstallMatch){var _postInstallMatch=(0,_slicedToArray2.default)(postInstallMatch,4),whole=_postInstallMatch[0],start=_postInstallMatch[1],content=_postInstallMatch[2],end=_postInstallMatch[3];var updated=`${start}${content.trimEnd()}\n${hook}\n${end}`;return podfile.replace(whole,updated);}return`${podfile.trimEnd()}\n\npost_install do |installer|\n${hook}\nend\n`;}function modifyPodfile(podfile,frameworkName,expoMajor){if(podfile.includes(`target '${frameworkName}'`)){_logging.Logger.logDebug(`Framework target "${frameworkName}" already in Podfile, skipping modification`);return podfile;}_logging.Logger.logDebug(`Modifying Podfile for framework: ${frameworkName}`);var frameworkTargetBlock=(0,_engine.renderTemplate)('ios','PodfileTargetBlock.rb',{'{{FRAMEWORK_NAME}}':frameworkName});var mainTargetMatch=podfile.match(/(target\s+['"][^'"]+['"]\s+do\s*\n)([\s\S]*?)(^end\s*$)/m);if(!mainTargetMatch){throw new _SourceModificationError.SourceModificationError('Could not find main target in Podfile. Please manually add the framework target.');}var _mainTargetMatch=(0,_slicedToArray2.default)(mainTargetMatch,3),targetStart=_mainTargetMatch[1],targetContent=_mainTargetMatch[2];var insertIndex=podfile.indexOf(mainTargetMatch[0])+targetStart.length+targetContent.length;var modifiedPodfile=podfile.slice(0,insertIndex)+frameworkTargetBlock+podfile.slice(insertIndex);_logging.Logger.logDebug(`Added framework target "${frameworkName}" to Podfile`);if(expoMajor<55){var versionLabel=expoMajor<0?'unknown':expoMajor.toString();throw new _SourceModificationError.SourceModificationError(`Expo SDK ${versionLabel} is not supported. Please use Expo SDK 55 or newer. For older versions, please use the v3.x.x of @callstack/react-native-brownfield.`);}modifiedPodfile=ensureExpoDefinesForSDK55AndAbove(modifiedPodfile,expoMajor);return modifiedPodfile;}
17
+ `;var postInstallMatch=podfile.match(/(post_install\s+do\s+\|installer\|\s*\n)((?:(?!^\s*end\s*$)[\s\S])*)(^\s*end\s*$)/m);if(postInstallMatch){var _postInstallMatch=(0,_slicedToArray2.default)(postInstallMatch,4),whole=_postInstallMatch[0],start=_postInstallMatch[1],content=_postInstallMatch[2],end=_postInstallMatch[3];var updated=`${start}${content.trimEnd()}\n${hook}\n${end}`;return podfile.replace(whole,updated);}return`${podfile.trimEnd()}\n\npost_install do |installer|\n${hook}\nend\n`;}function modifyPodfile(podfile,frameworkName,expoMajor){if(podfile.includes(`target '${frameworkName}'`)){_logging.Logger.logDebug(`Framework target "${frameworkName}" already in Podfile, skipping modification`);return podfile;}_logging.Logger.logDebug(`Modifying Podfile for framework: ${frameworkName}`);var frameworkTargetBlock=(0,_engine.renderTemplate)('ios','PodfileTargetBlock.rb',{'{{FRAMEWORK_NAME}}':frameworkName});var mainTargetMatch=podfile.match(/(target\s+['"][^'"]+['"]\s+do\s*\n)([\s\S]*?)(^end\s*$)/m);if(!mainTargetMatch){throw new _SourceModificationError.SourceModificationError('Could not find main target in Podfile. Please manually add the framework target.');}var _mainTargetMatch=(0,_slicedToArray2.default)(mainTargetMatch,3),targetStart=_mainTargetMatch[1],targetContent=_mainTargetMatch[2];var insertIndex=podfile.indexOf(mainTargetMatch[0])+targetStart.length+targetContent.length;var modifiedPodfile=podfile.slice(0,insertIndex)+frameworkTargetBlock+podfile.slice(insertIndex);_logging.Logger.logDebug(`Added framework target "${frameworkName}" to Podfile`);if(expoMajor<MIN_SUPPORTED_EXPO_SDK_MAJOR_VERSION){var versionLabel=expoMajor<0?'unknown':expoMajor.toString();throw new _SourceModificationError.SourceModificationError(`Expo SDK ${versionLabel} is not supported. Please use Expo SDK ${MIN_SUPPORTED_EXPO_SDK_MAJOR_VERSION} or newer. For older versions, please see the matrix of supported versions: https://oss.callstack.com/react-native-brownfield/docs/getting-started/introduction#expo-version-compatibility`);}modifiedPodfile=ensureExpoDefinesForSDK55AndAbove(modifiedPodfile,expoMajor);return modifiedPodfile;}
18
18
  //# sourceMappingURL=podfileHelpers.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_SourceModificationError","require","_logging","_engine","BROWNFIELD_EXPO_GTE_55_SWIFT_DEFINES_MARKER_START","BROWNFIELD_EXPO_GTE_55_SWIFT_DEFINES_MARKER_END","ensureExpoDefinesForSDK55AndAbove","podfile","expoMajor","includes","defaultDeploymentTarget","hook","postInstallMatch","match","_postInstallMatch","_slicedToArray2","default","whole","start","content","end","updated","trimEnd","replace","modifyPodfile","frameworkName","Logger","logDebug","frameworkTargetBlock","renderTemplate","mainTargetMatch","SourceModificationError","_mainTargetMatch","targetStart","targetContent","insertIndex","indexOf","length","modifiedPodfile","slice","versionLabel","toString"],"sourceRoot":"../../../../src","sources":["expo-config-plugin/ios/podfileHelpers.ts"],"mappings":"4QAAA,IAAAA,wBAAA,CAAAC,OAAA,sCACA,IAAAC,QAAA,CAAAD,OAAA,eACA,IAAAE,OAAA,CAAAF,OAAA,uBAEA,GAAM,CAAAG,iDAAiD,CACrD,8DAA8D,CAChE,GAAM,CAAAC,+CAA+C,CACnD,8DAA8D,CAEhE,QAAS,CAAAC,iCAAiCA,CACxCC,OAAe,C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sBAAc,EAAC,KAAK,CAAE,uBAAuB,CAAE,CAC1E,oBAAoB,CAAEJ,aACxB,CAAC,CAAC,CAGF,GAAM,CAAAK,eAAe,CAAGvB,OAAO,CAACM,KAAK,CACnC,0DACF,CAAC,CAED,GAAI,CAACiB,eAAe,CAAE,CACpB,KAAM,IAAI,CAAAC,gDAAuB,CAC/B,kFACF,CAAC,CACH,CAEA,IAAAC,gBAAA,IAAAjB,eAAA,CAAAC,OAAA,EAAuCc,eAAe,IAA7CG,WAAW,CAAAD,gBAAA,IAAEE,aAAa,CAAAF,gBAAA,IACnC,GAAM,CAAAG,WAAW,CACf5B,OAAO,CAAC6B,OAAO,CAACN,eAAe,CAAC,CAAC,CAAC,CAAC,CACnCG,WAAW,CAACI,MAAM,CAClBH,aAAa,CAACG,MAAM,CAEtB,GAAI,CAAAC,eAAe,CACjB/B,OAAO,CAACgC,KAAK,CAAC,CAAC,CAAEJ,WAAW,CAAC,CAC7BP,oBAAoB,CACpBrB,OAAO,CAACgC,KAAK,CAACJ,WAAW,CAAC,CAE5BT,eAAM,CAACC,QAAQ,CAAC,2BAA2BF,aAAa,cAAc,CAAC,CAEvE,GAAIjB,SAAS,CAAG,EAAE,CAAE,CAClB,GAAM,CAAAgC,YAAY,CAAGhC,SAAS,CAAG,CAAC,CAAG,SAAS,CAAGA,SAAS,CAACiC,QAAQ,CAAC,CAAC,CACrE,KAAM,IAAI,CAAAV,gDAAuB,CAC/B,YAAYS,YAAY,sIAC1B,CAAC,CACH,CAEAF,eAAe,CAAGhC,iCAAiC,CACjDgC,eAAe,CACf9B,SACF,CAAC,CAED,MAAO,CAAA8B,eAAe,CACxB","ignoreList":[]}
1
+ {"version":3,"names":["_SourceModificationError","require","_logging","_engine","MIN_SUPPORTED_EXPO_SDK_MAJOR_VERSION","BROWNFIELD_EXPO_GTE_55_SWIFT_DEFINES_MARKER_START","BROWNFIELD_EXPO_GTE_55_SWIFT_DEFINES_MARKER_END","ensureExpoDefinesForSDK55AndAbove","podfile","expoMajor","includes","defaultDeploymentTarget","hook","postInstallMatch","match","_postInstallMatch","_slicedToArray2","default","whole","start","content","end","updated","trimEnd","replace","modifyPodfile","frameworkName","Logger","logDebug","frameworkTargetBlock","renderTemplate","mainTargetMatch","SourceModificationError","_mainTargetMatch","targetStart","targetContent","insertIndex","indexOf","length","modifiedPodfile","slice","versionLabel","toString"],"sourceRoot":"../../../../src","sources":["expo-config-plugin/ios/podfileHelpers.ts"],"mappings":"4QAAA,IAAAA,wBAAA,CAAAC,OAAA,sCACA,IAAAC,QAAA,CAAAD,OAAA,eACA,IAAAE,OAAA,CAAAF,OAAA,uBAEA,GAAM,CAAAG,oCAAoC,CAAG,EAAE,CAE/C,GAAM,CAAAC,iDAAiD,CACrD,8DAA8D,CAChE,GAAM,CAAAC,+CAA+C,CACnD,8DAA8D,CAEhE,QAAS,CAAAC,iCAAiCA,CACxCC,OAAe,CACfC,SAAiB,CACT,CACR,GAAID,OAAO,CAACE,QAAQ,CAACL,iDAAiD,CAAC,CAAE,CACvE,MAAO,CAAAG,OAAO,CAChB,CAEA,GAAM,CAAAG,uBAAuB,CAAGF,SAAS,EAAI,EAAE,CAAG,MAAM,CAAG,MAAM,CACjE,GAAM,CAAAG,IAAI,CAAG;AACf,MAAMP,iDAAiD;AACvD,wFAAwFM,uBAAuB;AAC/G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAML,+CAA+C;AACrD,CAAC,CAEC,GAAM,CAAAO,gBAAgB,CAAGL,OAAO,CAACM,KAAK,CACpC,oFACF,CAAC,CAED,GAAID,gBAAgB,CAAE,CACpB,IAAAE,iBAAA,IAAAC,eAAA,CAAAC,OAAA,EAAqCJ,gBAAgB,IAA9CK,KAAK,CAAAH,iBAAA,IAAEI,KAAK,CAAAJ,iBAAA,IAAEK,OAAO,CAAAL,iBAAA,IAAEM,GAAG,CAAAN,iBAAA,IACjC,GAAM,CAAAO,OAAO,CAAG,GAAGH,KAAK,GAAGC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,CAAC,2BAA2BF,aAAa,cAAc,CAAC,CAEvE,GAAIjB,SAAS,CAAGL,oCAAoC,CAAE,CACpD,GAAM,CAAAqC,YAAY,CAAGhC,SAAS,CAAG,CAAC,CAAG,SAAS,CAAGA,SAAS,CAACiC,QAAQ,CAAC,CAAC,CACrE,KAAM,IAAI,CAAAV,gDAAuB,CAC/B,YAAYS,YAAY,0CAA0CrC,oCAAoC,4LACxG,CAAC,CACH,CAEAmC,eAAe,CAAGhC,iCAAiC,CACjDgC,eAAe,CACf9B,SACF,CAAC,CAED,MAAO,CAAA8B,eAAe,CACxB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"podfileHelpers.d.ts","sourceRoot":"","sources":["../../../../../../src/expo-config-plugin/ios/podfileHelpers.ts"],"names":[],"mappings":"AAkDA;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,MAAM,GAChB,MAAM,CAqDR"}
1
+ {"version":3,"file":"podfileHelpers.d.ts","sourceRoot":"","sources":["../../../../../../src/expo-config-plugin/ios/podfileHelpers.ts"],"names":[],"mappings":"AAoDA;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,MAAM,GAChB,MAAM,CAqDR"}
@@ -1 +1 @@
1
- {"version":3,"file":"podfileHelpers.d.ts","sourceRoot":"","sources":["../../../../../../src/expo-config-plugin/ios/podfileHelpers.ts"],"names":[],"mappings":"AAkDA;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,MAAM,GAChB,MAAM,CAqDR"}
1
+ {"version":3,"file":"podfileHelpers.d.ts","sourceRoot":"","sources":["../../../../../../src/expo-config-plugin/ios/podfileHelpers.ts"],"names":[],"mappings":"AAoDA;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,MAAM,GAChB,MAAM,CAqDR"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@callstack/react-native-brownfield",
3
- "version": "4.3.0",
3
+ "version": "5.0.1",
4
4
  "license": "MIT",
5
5
  "author": "Michal Chudziak <mike.chudziak@callstack.com>",
6
6
  "bin": {
@@ -92,7 +92,7 @@
92
92
  "@callstack/brownfield-cli": "workspace:^"
93
93
  },
94
94
  "devDependencies": {
95
- "@babel/core": "^7.25.2",
95
+ "@babel/core": "^7.29.6",
96
96
  "@babel/preset-env": "^7.25.3",
97
97
  "@babel/runtime": "^7.25.0",
98
98
  "@expo/config-plugins": "^56.0.8",
@@ -2,6 +2,8 @@ import { SourceModificationError } from '../errors/SourceModificationError';
2
2
  import { Logger } from '../logging';
3
3
  import { renderTemplate } from '../template/engine';
4
4
 
5
+ const MIN_SUPPORTED_EXPO_SDK_MAJOR_VERSION = 56;
6
+
5
7
  const BROWNFIELD_EXPO_GTE_55_SWIFT_DEFINES_MARKER_START =
6
8
  '# >>> react-native-brownfield Expo SDK 55+ swift defines >>>';
7
9
  const BROWNFIELD_EXPO_GTE_55_SWIFT_DEFINES_MARKER_END =
@@ -99,10 +101,10 @@ export function modifyPodfile(
99
101
 
100
102
  Logger.logDebug(`Added framework target "${frameworkName}" to Podfile`);
101
103
 
102
- if (expoMajor < 55) {
104
+ if (expoMajor < MIN_SUPPORTED_EXPO_SDK_MAJOR_VERSION) {
103
105
  const versionLabel = expoMajor < 0 ? 'unknown' : expoMajor.toString();
104
106
  throw new SourceModificationError(
105
- `Expo SDK ${versionLabel} is not supported. Please use Expo SDK 55 or newer. For older versions, please use the v3.x.x of @callstack/react-native-brownfield.`
107
+ `Expo SDK ${versionLabel} is not supported. Please use Expo SDK ${MIN_SUPPORTED_EXPO_SDK_MAJOR_VERSION} or newer. For older versions, please see the matrix of supported versions: https://oss.callstack.com/react-native-brownfield/docs/getting-started/introduction#expo-version-compatibility`
106
108
  );
107
109
  }
108
110