@callstack/react-native-brownfield 3.13.0 → 3.13.2
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.
- package/CHANGELOG.md +20 -0
- package/gradle-plugin/brownfield/gradle.properties +1 -1
- package/gradle-plugin/brownfield/src/main/kotlin/com/callstack/react/brownfield/plugin/RNSourceSets.kt +11 -3
- package/gradle-plugin/brownfield/src/main/kotlin/com/callstack/react/brownfield/processors/VariantTaskProvider.kt +4 -3
- package/gradle-plugin/brownfield/src/main/kotlin/com/callstack/react/brownfield/utils/Utils.kt +14 -0
- package/lib/commonjs/expo-config-plugin/android/utils/constants.js +1 -1
- package/lib/commonjs/expo-config-plugin/android/utils/gradleHelpers.js +1 -1
- package/lib/commonjs/expo-config-plugin/android/utils/gradleHelpers.js.map +1 -1
- package/lib/commonjs/expo-config-plugin/android/withBrownfieldAndroid.js +1 -1
- package/lib/commonjs/expo-config-plugin/android/withBrownfieldAndroid.js.map +1 -1
- package/lib/commonjs/expo-config-plugin/withBrownfield.js +1 -1
- package/lib/commonjs/expo-config-plugin/withBrownfield.js.map +1 -1
- package/lib/module/expo-config-plugin/android/utils/constants.js +1 -1
- package/lib/module/expo-config-plugin/android/utils/gradleHelpers.js +1 -1
- package/lib/module/expo-config-plugin/android/utils/gradleHelpers.js.map +1 -1
- package/lib/module/expo-config-plugin/android/withBrownfieldAndroid.js +1 -1
- package/lib/module/expo-config-plugin/android/withBrownfieldAndroid.js.map +1 -1
- package/lib/module/expo-config-plugin/withBrownfield.js +1 -1
- package/lib/module/expo-config-plugin/withBrownfield.js.map +1 -1
- package/lib/typescript/commonjs/src/expo-config-plugin/android/utils/constants.d.ts +2 -2
- package/lib/typescript/commonjs/src/expo-config-plugin/android/utils/gradleHelpers.d.ts +6 -2
- package/lib/typescript/commonjs/src/expo-config-plugin/android/utils/gradleHelpers.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/expo-config-plugin/android/withBrownfieldAndroid.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/expo-config-plugin/types/android/BrownfieldPluginAndroidConfig.d.ts +6 -0
- package/lib/typescript/commonjs/src/expo-config-plugin/types/android/BrownfieldPluginAndroidConfig.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/expo-config-plugin/withBrownfield.d.ts.map +1 -1
- package/lib/typescript/module/src/expo-config-plugin/android/utils/constants.d.ts +2 -2
- package/lib/typescript/module/src/expo-config-plugin/android/utils/gradleHelpers.d.ts +6 -2
- package/lib/typescript/module/src/expo-config-plugin/android/utils/gradleHelpers.d.ts.map +1 -1
- package/lib/typescript/module/src/expo-config-plugin/android/withBrownfieldAndroid.d.ts.map +1 -1
- package/lib/typescript/module/src/expo-config-plugin/types/android/BrownfieldPluginAndroidConfig.d.ts +6 -0
- package/lib/typescript/module/src/expo-config-plugin/types/android/BrownfieldPluginAndroidConfig.d.ts.map +1 -1
- package/lib/typescript/module/src/expo-config-plugin/withBrownfield.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/expo-config-plugin/android/utils/constants.ts +1 -1
- package/src/expo-config-plugin/android/utils/gradleHelpers.ts +56 -5
- package/src/expo-config-plugin/android/withBrownfieldAndroid.ts +4 -2
- package/src/expo-config-plugin/types/android/BrownfieldPluginAndroidConfig.ts +7 -0
- package/src/expo-config-plugin/withBrownfield.ts +15 -45
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @callstack/react-native-brownfield
|
|
2
2
|
|
|
3
|
+
## 3.13.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#401](https://github.com/callstack/react-native-brownfield/pull/401) [`c4410f6`](https://github.com/callstack/react-native-brownfield/commit/c4410f6af4c781cf3513ba55d03fa1b1055a443b) Thanks [@artus9033](https://github.com/artus9033)! - fix: brownfield Gradle Plugin not to depend on \*UpdatesResources task from expo-updates if it is absent
|
|
8
|
+
|
|
9
|
+
- [#398](https://github.com/callstack/react-native-brownfield/pull/398) [`8e90842`](https://github.com/callstack/react-native-brownfield/commit/8e90842291348dcb0542a6787f5cfbb1017532dd) Thanks [@artus9033](https://github.com/artus9033)! - feat: support brownfield unified config file in Expo
|
|
10
|
+
|
|
11
|
+
- [#402](https://github.com/callstack/react-native-brownfield/pull/402) [`3475c3d`](https://github.com/callstack/react-native-brownfield/commit/3475c3db375988ebd63ce01bfd93f4dbb1a55e8d) Thanks [@artus9033](https://github.com/artus9033)! - feat: support local BGP in Expo config plugin
|
|
12
|
+
|
|
13
|
+
- Updated dependencies [[`8e90842`](https://github.com/callstack/react-native-brownfield/commit/8e90842291348dcb0542a6787f5cfbb1017532dd), [`3475c3d`](https://github.com/callstack/react-native-brownfield/commit/3475c3db375988ebd63ce01bfd93f4dbb1a55e8d), [`4088c01`](https://github.com/callstack/react-native-brownfield/commit/4088c01a069306565dd3e279d9132f5dbe861d0b)]:
|
|
14
|
+
- @callstack/brownfield-cli@3.13.2
|
|
15
|
+
|
|
16
|
+
## 3.13.1
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- Updated dependencies [[`89bc23c`](https://github.com/callstack/react-native-brownfield/commit/89bc23c00bb85c036fce6d4ea142fb3ba0846deb)]:
|
|
21
|
+
- @callstack/brownfield-cli@3.13.1
|
|
22
|
+
|
|
3
23
|
## 3.13.0
|
|
4
24
|
|
|
5
25
|
### Minor Changes
|
|
@@ -55,25 +55,33 @@ object RNSourceSets {
|
|
|
55
55
|
isDebuggable = variant.debuggable,
|
|
56
56
|
)
|
|
57
57
|
val capitalizedBundledAssetsVariantName = bundledAssetsVariantName.capitalized()
|
|
58
|
+
val appProject = getAppProject()
|
|
58
59
|
|
|
59
60
|
// 3. Lazily configure the 'variant-specific' source set using .named()
|
|
60
61
|
androidExtension.sourceSets.named(variantName) { sourceSet ->
|
|
61
|
-
// Paths are collected and added, similar to your improved version
|
|
62
62
|
val bundlePathSegments =
|
|
63
63
|
listOf(
|
|
64
64
|
// outputs for RN <= 0.81
|
|
65
65
|
"createBundle${capitalizedBundledAssetsVariantName}JsAndAssets",
|
|
66
66
|
// outputs for RN >= 0.82
|
|
67
67
|
"react/$bundledAssetsVariantName",
|
|
68
|
-
// expo update resources
|
|
69
|
-
"create${capitalizedBundledAssetsVariantName}UpdatesResources",
|
|
70
68
|
)
|
|
69
|
+
val updateResourcesPathSegment = Utils.getExpoUpdatesResourcesTaskName(variant.name)
|
|
71
70
|
|
|
72
71
|
// Add the variant-specific generated asset and resource directories
|
|
73
72
|
val appBuildDir = getAppBuildDir()
|
|
74
73
|
sourceSet.assets.srcDirs(bundlePathSegments.map { "$appBuildDir/generated/assets/$it" })
|
|
75
74
|
sourceSet.res.srcDirs(bundlePathSegments.map { "$appBuildDir/generated/res/$it" })
|
|
76
75
|
sourceSet.jniLibs.srcDirs("libs${variantName.capitalized()}")
|
|
76
|
+
if (Utils.hasExpoUpdates(appProject, variant.name)) {
|
|
77
|
+
val updateResourcesTask = appProject.tasks.named(updateResourcesPathSegment)
|
|
78
|
+
sourceSet.assets.srcDir(
|
|
79
|
+
project.files("$appBuildDir/generated/assets/$updateResourcesPathSegment").builtBy(updateResourcesTask),
|
|
80
|
+
)
|
|
81
|
+
sourceSet.res.srcDir(
|
|
82
|
+
project.files("$appBuildDir/generated/res/$updateResourcesPathSegment").builtBy(updateResourcesTask),
|
|
83
|
+
)
|
|
84
|
+
}
|
|
77
85
|
}
|
|
78
86
|
}
|
|
79
87
|
}
|
|
@@ -95,9 +95,10 @@ class VariantTaskProvider(val project: Project) {
|
|
|
95
95
|
preBuildTask.dependsOn("${appProject.path}:createBundle${capitalizedBundledAssetsVariantName}JsAndAssets")
|
|
96
96
|
|
|
97
97
|
if (Utils.isExpoProject(project)) {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
98
|
+
val updatesResourcesTaskName = Utils.getExpoUpdatesResourcesTaskName(variantName)
|
|
99
|
+
if (Utils.hasExpoUpdates(appProject, variantName)) {
|
|
100
|
+
preBuildTask.dependsOn("${appProject.path}:$updatesResourcesTaskName")
|
|
101
|
+
}
|
|
101
102
|
}
|
|
102
103
|
}
|
|
103
104
|
}
|
package/gradle-plugin/brownfield/src/main/kotlin/com/callstack/react/brownfield/utils/Utils.kt
CHANGED
|
@@ -28,6 +28,20 @@ object Utils {
|
|
|
28
28
|
return project.findProject(EXPO_PROJECT_LOCATOR) != null
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
fun getExpoUpdatesResourcesTaskName(variantName: String): String {
|
|
32
|
+
return "create${variantName.capitalized()}UpdatesResources"
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
fun hasExpoUpdates(
|
|
36
|
+
project: Project,
|
|
37
|
+
variantName: String,
|
|
38
|
+
): Boolean {
|
|
39
|
+
return isExpoProject(project) &&
|
|
40
|
+
project.tasks.names.contains(
|
|
41
|
+
getExpoUpdatesResourcesTaskName(variantName),
|
|
42
|
+
)
|
|
43
|
+
}
|
|
44
|
+
|
|
31
45
|
fun getBundledAssetsVariantName(
|
|
32
46
|
variantName: String?,
|
|
33
47
|
buildTypeName: String?,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:true});exports.brownfieldGradlePluginDependency=exports.BROWNFIELD_PLUGIN_VERSION=void 0;var BROWNFIELD_PLUGIN_VERSION=exports.BROWNFIELD_PLUGIN_VERSION='2.0.0-
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:true});exports.brownfieldGradlePluginDependency=exports.BROWNFIELD_PLUGIN_VERSION=void 0;var BROWNFIELD_PLUGIN_VERSION=exports.BROWNFIELD_PLUGIN_VERSION='2.0.0-alpha03';var brownfieldGradlePluginDependency=exports.brownfieldGradlePluginDependency=`classpath("com.callstack.react:brownfield-gradle-plugin:${BROWNFIELD_PLUGIN_VERSION}")`;
|
|
2
2
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:true});exports.modifyRootBuildGradle=modifyRootBuildGradle;exports.modifySettingsGradle=modifySettingsGradle;var _constants=require("./constants");var _logging=require("../../logging");function modifyRootBuildGradle(contents){if(contents.includes('brownfield-gradle-plugin')){_logging.Logger.logDebug('Brownfield Gradle plugin already in root build.gradle, skipping');return contents;}_logging.Logger.logDebug(`Modifying root build.gradle to add the Gradle Brownfield plugin`);var buildscriptDepsRegex=/(buildscript\s*\{[\s\S]*?dependencies\s*\{[\s\S]*?)(})/m;var match=contents.match(buildscriptDepsRegex);if(!match){throw new Error('Could not locate buildscript block in root build.gradle');}var insertion=`\t${_constants.brownfieldGradlePluginDependency}\n\t`;var modifiedContents=contents.replace(buildscriptDepsRegex,`$1${insertion}$2`);_logging.Logger.logDebug('Added Brownfield Gradle plugin to root build.gradle');return modifiedContents;}function modifySettingsGradle(contents,moduleName){var includeStatement=`include ':${moduleName}'`;if(
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:true});exports.modifyRootBuildGradle=modifyRootBuildGradle;exports.modifySettingsGradle=modifySettingsGradle;var _constants=require("./constants");var _logging=require("../../logging");var LOCAL_GRADLE_PLUGIN_INCLUDE_BUILD='includeBuild("../node_modules/@callstack/react-native-brownfield/gradle-plugin/brownfield")';function modifyRootBuildGradle(contents){var _ref=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref$useLocalGradlePl=_ref.useLocalGradlePlugin,useLocalGradlePlugin=_ref$useLocalGradlePl===void 0?false:_ref$useLocalGradlePl;if(useLocalGradlePlugin){_logging.Logger.logDebug('Skipping Maven Brownfield Gradle plugin classpath because useLocalGradlePlugin is enabled');return contents;}if(contents.includes('brownfield-gradle-plugin')){_logging.Logger.logDebug('Brownfield Gradle plugin already in root build.gradle, skipping');return contents;}_logging.Logger.logDebug(`Modifying root build.gradle to add the Gradle Brownfield plugin`);var buildscriptDepsRegex=/(buildscript\s*\{[\s\S]*?dependencies\s*\{[\s\S]*?)(})/m;var match=contents.match(buildscriptDepsRegex);if(!match){throw new Error('Could not locate buildscript block in root build.gradle');}var insertion=`\t${_constants.brownfieldGradlePluginDependency}\n\t`;var modifiedContents=contents.replace(buildscriptDepsRegex,`$1${insertion}$2`);_logging.Logger.logDebug('Added Brownfield Gradle plugin to root build.gradle');return modifiedContents;}function addLocalGradlePluginIncludeBuild(contents){if(contents.includes('gradle-plugin/brownfield')){_logging.Logger.logDebug('Local Brownfield Gradle plugin includeBuild already present, skipping');return contents;}_logging.Logger.logDebug('Modifying settings.gradle to include local Brownfield Gradle plugin');var pluginManagementMatch=contents.match(/pluginManagement\s*\{/);if((pluginManagementMatch==null?void 0:pluginManagementMatch.index)!==undefined){var insertIndex=pluginManagementMatch.index+pluginManagementMatch[0].length;var insertion=`\n\t${LOCAL_GRADLE_PLUGIN_INCLUDE_BUILD}`;return contents.slice(0,insertIndex)+insertion+contents.slice(insertIndex);}return`pluginManagement {\n\t${LOCAL_GRADLE_PLUGIN_INCLUDE_BUILD}\n}\n\n${contents}`;}function modifySettingsGradle(contents,moduleName){var _ref2=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{},_ref2$useLocalGradleP=_ref2.useLocalGradlePlugin,useLocalGradlePlugin=_ref2$useLocalGradleP===void 0?false:_ref2$useLocalGradleP;var modifiedContents=contents;if(useLocalGradlePlugin){modifiedContents=addLocalGradlePluginIncludeBuild(modifiedContents);}var includeStatement=`include ':${moduleName}'`;if(modifiedContents.includes(includeStatement)){_logging.Logger.logDebug(`Module "${moduleName}" already in settings.gradle, skipping`);return modifiedContents;}_logging.Logger.logDebug(`Modifying settings.gradle to include module "${moduleName}"`);modifiedContents=modifiedContents+`\n${includeStatement}\n`;_logging.Logger.logDebug(`Added module "${moduleName}" to settings.gradle`);return modifiedContents;}
|
|
2
2
|
//# sourceMappingURL=gradleHelpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_constants","require","_logging","modifyRootBuildGradle","contents","
|
|
1
|
+
{"version":3,"names":["_constants","require","_logging","LOCAL_GRADLE_PLUGIN_INCLUDE_BUILD","modifyRootBuildGradle","contents","_ref","arguments","length","undefined","_ref$useLocalGradlePl","useLocalGradlePlugin","Logger","logDebug","includes","buildscriptDepsRegex","match","Error","insertion","brownfieldGradlePluginDependency","modifiedContents","replace","addLocalGradlePluginIncludeBuild","pluginManagementMatch","index","insertIndex","slice","modifySettingsGradle","moduleName","_ref2","_ref2$useLocalGradleP","includeStatement"],"sourceRoot":"../../../../../src","sources":["expo-config-plugin/android/utils/gradleHelpers.ts"],"mappings":"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","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.withBrownfieldAndroid=void 0;var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _configPlugins=require("@expo/config-plugins");var _gradleHelpers=require("./utils/gradleHelpers");var _withAndroidModuleFiles=require("./withAndroidModuleFiles");var withBrownfieldAndroid=exports.withBrownfieldAndroid=function withBrownfieldAndroid(config,props){var androidConfig=props.android;config=(0,_configPlugins.withProjectBuildGradle)(config,function(gradleConfig){gradleConfig.modResults.contents=(0,_gradleHelpers.modifyRootBuildGradle)(gradleConfig.modResults.contents);return gradleConfig;});config=(0,_configPlugins.withSettingsGradle)(config,function(settingsConfig){settingsConfig.modResults.contents=(0,_gradleHelpers.modifySettingsGradle)(settingsConfig.modResults.contents,androidConfig.moduleName);return settingsConfig;});config=(0,_withAndroidModuleFiles.withAndroidModuleFiles)(config,props);config=(0,_configPlugins.withFinalizedMod)(config,['android',(function(){var _ref=(0,_asyncToGenerator2.default)(function*(finalizedConfig){(0,_withAndroidModuleFiles.syncAndroidModuleExpoUpdatesFromAppFiles)({androidDir:finalizedConfig.modRequest.platformProjectRoot,config:props});return finalizedConfig;});return function(_x){return _ref.apply(this,arguments);};}())]);return config;};
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.withBrownfieldAndroid=void 0;var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _configPlugins=require("@expo/config-plugins");var _gradleHelpers=require("./utils/gradleHelpers");var _withAndroidModuleFiles=require("./withAndroidModuleFiles");var withBrownfieldAndroid=exports.withBrownfieldAndroid=function withBrownfieldAndroid(config,props){var androidConfig=props.android;config=(0,_configPlugins.withProjectBuildGradle)(config,function(gradleConfig){gradleConfig.modResults.contents=(0,_gradleHelpers.modifyRootBuildGradle)(gradleConfig.modResults.contents,{useLocalGradlePlugin:androidConfig.useLocalGradlePlugin});return gradleConfig;});config=(0,_configPlugins.withSettingsGradle)(config,function(settingsConfig){settingsConfig.modResults.contents=(0,_gradleHelpers.modifySettingsGradle)(settingsConfig.modResults.contents,androidConfig.moduleName,{useLocalGradlePlugin:androidConfig.useLocalGradlePlugin});return settingsConfig;});config=(0,_withAndroidModuleFiles.withAndroidModuleFiles)(config,props);config=(0,_configPlugins.withFinalizedMod)(config,['android',(function(){var _ref=(0,_asyncToGenerator2.default)(function*(finalizedConfig){(0,_withAndroidModuleFiles.syncAndroidModuleExpoUpdatesFromAppFiles)({androidDir:finalizedConfig.modRequest.platformProjectRoot,config:props});return finalizedConfig;});return function(_x){return _ref.apply(this,arguments);};}())]);return config;};
|
|
2
2
|
//# sourceMappingURL=withBrownfieldAndroid.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_configPlugins","require","_gradleHelpers","_withAndroidModuleFiles","withBrownfieldAndroid","exports","config","props","androidConfig","android","withProjectBuildGradle","gradleConfig","modResults","contents","modifyRootBuildGradle","withSettingsGradle","settingsConfig","modifySettingsGradle","moduleName","withAndroidModuleFiles","withFinalizedMod","_ref","_asyncToGenerator2","default","finalizedConfig","syncAndroidModuleExpoUpdatesFromAppFiles","androidDir","modRequest","platformProjectRoot","_x","apply","arguments"],"sourceRoot":"../../../../src","sources":["expo-config-plugin/android/withBrownfieldAndroid.ts"],"mappings":"mRAAA,IAAAA,cAAA,CAAAC,OAAA,yBAOA,IAAAC,cAAA,CAAAD,OAAA,0BAIA,IAAAE,uBAAA,CAAAF,OAAA,6BAeO,GAAM,CAAAG,qBAEZ,CAAAC,OAAA,CAAAD,qBAAA,CAAG,QAFS,CAAAA,qBAEZA,CAAIE,MAAM,CAAEC,KAAK,CAAK,CACrB,GAAM,CAAAC,aAAa,CAAGD,KAAK,CAACE,OAAO,CAGnCH,MAAM,CAAG,GAAAI,qCAAsB,EAACJ,MAAM,CAAE,SAACK,YAAY,CAAK,CACxDA,YAAY,CAACC,UAAU,CAACC,QAAQ,CAAG,GAAAC,oCAAqB,EACtDH,YAAY,CAACC,UAAU,CAACC,
|
|
1
|
+
{"version":3,"names":["_configPlugins","require","_gradleHelpers","_withAndroidModuleFiles","withBrownfieldAndroid","exports","config","props","androidConfig","android","withProjectBuildGradle","gradleConfig","modResults","contents","modifyRootBuildGradle","useLocalGradlePlugin","withSettingsGradle","settingsConfig","modifySettingsGradle","moduleName","withAndroidModuleFiles","withFinalizedMod","_ref","_asyncToGenerator2","default","finalizedConfig","syncAndroidModuleExpoUpdatesFromAppFiles","androidDir","modRequest","platformProjectRoot","_x","apply","arguments"],"sourceRoot":"../../../../src","sources":["expo-config-plugin/android/withBrownfieldAndroid.ts"],"mappings":"mRAAA,IAAAA,cAAA,CAAAC,OAAA,yBAOA,IAAAC,cAAA,CAAAD,OAAA,0BAIA,IAAAE,uBAAA,CAAAF,OAAA,6BAeO,GAAM,CAAAG,qBAEZ,CAAAC,OAAA,CAAAD,qBAAA,CAAG,QAFS,CAAAA,qBAEZA,CAAIE,MAAM,CAAEC,KAAK,CAAK,CACrB,GAAM,CAAAC,aAAa,CAAGD,KAAK,CAACE,OAAO,CAGnCH,MAAM,CAAG,GAAAI,qCAAsB,EAACJ,MAAM,CAAE,SAACK,YAAY,CAAK,CACxDA,YAAY,CAACC,UAAU,CAACC,QAAQ,CAAG,GAAAC,oCAAqB,EACtDH,YAAY,CAACC,UAAU,CAACC,QAAQ,CAChC,CAAEE,oBAAoB,CAAEP,aAAa,CAACO,oBAAqB,CAC7D,CAAC,CAED,MAAO,CAAAJ,YAAY,CACrB,CAAC,CAAC,CAGFL,MAAM,CAAG,GAAAU,iCAAkB,EAACV,MAAM,CAAE,SAACW,cAAc,CAAK,CACtDA,cAAc,CAACL,UAAU,CAACC,QAAQ,CAAG,GAAAK,mCAAoB,EACvDD,cAAc,CAACL,UAAU,CAACC,QAAQ,CAClCL,aAAa,CAACW,UAAU,CACxB,CAAEJ,oBAAoB,CAAEP,aAAa,CAACO,oBAAqB,CAC7D,CAAC,CAED,MAAO,CAAAE,cAAc,CACvB,CAAC,CAAC,CAGFX,MAAM,CAAG,GAAAc,8CAAsB,EAACd,MAAM,CAAEC,KAAK,CAAC,CAG9CD,MAAM,CAAG,GAAAe,+BAAgB,EAACf,MAAM,CAAE,CAChC,SAAS,iBAAAgB,IAAA,IAAAC,kBAAA,CAAAC,OAAA,EACT,UAAOC,eAAe,CAAK,CACzB,GAAAC,gEAAwC,EAAC,CACvCC,UAAU,CAAEF,eAAe,CAACG,UAAU,CAACC,mBAAmB,CAC1DvB,MAAM,CAAEC,KACV,CAAC,CAAC,CAEF,MAAO,CAAAkB,eAAe,CACxB,CAAC,kBAAAK,EAAA,SAAAR,IAAA,CAAAS,KAAA,MAAAC,SAAA,SACF,CAAC,CAEF,MAAO,CAAA1B,MAAM,CACf,CAAC","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _configPlugins=require("@expo/config-plugins");var _withBrownfieldIos=require("./ios/withBrownfieldIos");var _withBrownfieldAndroid=require("./android/withBrownfieldAndroid");var _logging=require("./logging");function
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _configPlugins=require("@expo/config-plugins");var _expoPluginConfig=require("@callstack/brownfield-cli/expo-plugin-config");var _withBrownfieldIos=require("./ios/withBrownfieldIos");var _withBrownfieldAndroid=require("./android/withBrownfieldAndroid");var _logging=require("./logging");var withBrownfield=function withBrownfield(config){var props=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var pluginProps=props!=null?props:{};var fileConfig=(0,_expoPluginConfig.loadBrownfieldConfig)();(0,_expoPluginConfig.assertNoConfigFilePluginOverlap)(fileConfig,pluginProps);var resolvedConfig=(0,_expoPluginConfig.resolveBrownfieldPluginConfig)(pluginProps,fileConfig,config);_logging.Logger.setIsDebug(resolvedConfig.debug);var plugins=[];if(resolvedConfig.ios){plugins.push([_withBrownfieldIos.withBrownfieldIos,resolvedConfig]);}if(resolvedConfig.android){plugins.push([_withBrownfieldAndroid.withBrownfieldAndroid,resolvedConfig]);}return(0,_configPlugins.withPlugins)(config,plugins);};var _default=exports.default=(0,_configPlugins.createRunOncePlugin)(withBrownfield,process.env.npm_package_name,process.env.npm_package_version);
|
|
2
2
|
//# sourceMappingURL=withBrownfield.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_configPlugins","require","_withBrownfieldIos","_withBrownfieldAndroid","_logging","
|
|
1
|
+
{"version":3,"names":["_configPlugins","require","_expoPluginConfig","_withBrownfieldIos","_withBrownfieldAndroid","_logging","withBrownfield","config","props","arguments","length","undefined","pluginProps","fileConfig","loadBrownfieldConfig","assertNoConfigFilePluginOverlap","resolvedConfig","resolveBrownfieldPluginConfig","Logger","setIsDebug","debug","plugins","ios","push","withBrownfieldIos","android","withBrownfieldAndroid","withPlugins","_default","exports","default","createRunOncePlugin","process","env","npm_package_name","npm_package_version"],"sourceRoot":"../../../src","sources":["expo-config-plugin/withBrownfield.ts"],"mappings":"gFAAA,IAAAA,cAAA,CAAAC,OAAA,yBAOA,IAAAC,iBAAA,CAAAD,OAAA,iDAMA,IAAAE,kBAAA,CAAAF,OAAA,4BACA,IAAAG,sBAAA,CAAAH,OAAA,oCAMA,IAAAI,QAAA,CAAAJ,OAAA,cA8BA,GAAM,CAAAK,cAA2D,CAAG,QAA9D,CAAAA,cAA2DA,CAC/DC,MAAM,CAEH,IADH,CAAAC,KAAK,CAAAC,SAAA,CAAAC,MAAA,IAAAD,SAAA,MAAAE,SAAA,CAAAF,SAAA,IAAG,CAAC,CAAC,CAEV,GAAM,CAAAG,WAAW,CAAGJ,KAAK,OAALA,KAAK,CAAI,CAAC,CAAC,CAC/B,GAAM,CAAAK,UAAU,CAAG,GAAAC,sCAAoB,EAAC,CAAC,CAEzC,GAAAC,iDAA+B,EAACF,UAAU,CAAED,WAAW,CAAC,CAExD,GAAM,CAAAI,cAA8C,CAClD,GAAAC,+CAA6B,EAACL,WAAW,CAAEC,UAAU,CAAEN,MAAM,CAAC,CAEhEW,eAAM,CAACC,UAAU,CAACH,cAAc,CAACI,KAAK,CAAC,CAEvC,GAAM,CAAAC,OAAwC,CAAG,EAAE,CAEnD,GAAIL,cAAc,CAACM,GAAG,CAAE,CACtBD,OAAO,CAACE,IAAI,CAAC,CAACC,oCAAiB,CAAER,cAAc,CAAC,CAAC,CACnD,CAEA,GAAIA,cAAc,CAACS,OAAO,CAAE,CAC1BJ,OAAO,CAACE,IAAI,CAAC,CAACG,4CAAqB,CAAEV,cAAc,CAAC,CAAC,CACvD,CAEA,MAAO,GAAAW,0BAAW,EAACpB,MAAM,CAAEc,OAAO,CAAC,CACrC,CAAC,CAAC,IAAAO,QAAA,CAAAC,OAAA,CAAAC,OAAA,CAEa,GAAAC,kCAAmB,EAChCzB,cAAc,CACd0B,OAAO,CAACC,GAAG,CAACC,gBAAgB,CAC5BF,OAAO,CAACC,GAAG,CAACE,mBACd,CAAC","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:true});exports.brownfieldGradlePluginDependency=exports.BROWNFIELD_PLUGIN_VERSION=void 0;var BROWNFIELD_PLUGIN_VERSION=exports.BROWNFIELD_PLUGIN_VERSION='2.0.0-
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:true});exports.brownfieldGradlePluginDependency=exports.BROWNFIELD_PLUGIN_VERSION=void 0;var BROWNFIELD_PLUGIN_VERSION=exports.BROWNFIELD_PLUGIN_VERSION='2.0.0-alpha03';var brownfieldGradlePluginDependency=exports.brownfieldGradlePluginDependency=`classpath("com.callstack.react:brownfield-gradle-plugin:${BROWNFIELD_PLUGIN_VERSION}")`;
|
|
2
2
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:true});exports.modifyRootBuildGradle=modifyRootBuildGradle;exports.modifySettingsGradle=modifySettingsGradle;var _constants=require("./constants");var _logging=require("../../logging");function modifyRootBuildGradle(contents){if(contents.includes('brownfield-gradle-plugin')){_logging.Logger.logDebug('Brownfield Gradle plugin already in root build.gradle, skipping');return contents;}_logging.Logger.logDebug(`Modifying root build.gradle to add the Gradle Brownfield plugin`);var buildscriptDepsRegex=/(buildscript\s*\{[\s\S]*?dependencies\s*\{[\s\S]*?)(})/m;var match=contents.match(buildscriptDepsRegex);if(!match){throw new Error('Could not locate buildscript block in root build.gradle');}var insertion=`\t${_constants.brownfieldGradlePluginDependency}\n\t`;var modifiedContents=contents.replace(buildscriptDepsRegex,`$1${insertion}$2`);_logging.Logger.logDebug('Added Brownfield Gradle plugin to root build.gradle');return modifiedContents;}function modifySettingsGradle(contents,moduleName){var includeStatement=`include ':${moduleName}'`;if(
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:true});exports.modifyRootBuildGradle=modifyRootBuildGradle;exports.modifySettingsGradle=modifySettingsGradle;var _constants=require("./constants");var _logging=require("../../logging");var LOCAL_GRADLE_PLUGIN_INCLUDE_BUILD='includeBuild("../node_modules/@callstack/react-native-brownfield/gradle-plugin/brownfield")';function modifyRootBuildGradle(contents){var _ref=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref$useLocalGradlePl=_ref.useLocalGradlePlugin,useLocalGradlePlugin=_ref$useLocalGradlePl===void 0?false:_ref$useLocalGradlePl;if(useLocalGradlePlugin){_logging.Logger.logDebug('Skipping Maven Brownfield Gradle plugin classpath because useLocalGradlePlugin is enabled');return contents;}if(contents.includes('brownfield-gradle-plugin')){_logging.Logger.logDebug('Brownfield Gradle plugin already in root build.gradle, skipping');return contents;}_logging.Logger.logDebug(`Modifying root build.gradle to add the Gradle Brownfield plugin`);var buildscriptDepsRegex=/(buildscript\s*\{[\s\S]*?dependencies\s*\{[\s\S]*?)(})/m;var match=contents.match(buildscriptDepsRegex);if(!match){throw new Error('Could not locate buildscript block in root build.gradle');}var insertion=`\t${_constants.brownfieldGradlePluginDependency}\n\t`;var modifiedContents=contents.replace(buildscriptDepsRegex,`$1${insertion}$2`);_logging.Logger.logDebug('Added Brownfield Gradle plugin to root build.gradle');return modifiedContents;}function addLocalGradlePluginIncludeBuild(contents){if(contents.includes('gradle-plugin/brownfield')){_logging.Logger.logDebug('Local Brownfield Gradle plugin includeBuild already present, skipping');return contents;}_logging.Logger.logDebug('Modifying settings.gradle to include local Brownfield Gradle plugin');var pluginManagementMatch=contents.match(/pluginManagement\s*\{/);if((pluginManagementMatch==null?void 0:pluginManagementMatch.index)!==undefined){var insertIndex=pluginManagementMatch.index+pluginManagementMatch[0].length;var insertion=`\n\t${LOCAL_GRADLE_PLUGIN_INCLUDE_BUILD}`;return contents.slice(0,insertIndex)+insertion+contents.slice(insertIndex);}return`pluginManagement {\n\t${LOCAL_GRADLE_PLUGIN_INCLUDE_BUILD}\n}\n\n${contents}`;}function modifySettingsGradle(contents,moduleName){var _ref2=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{},_ref2$useLocalGradleP=_ref2.useLocalGradlePlugin,useLocalGradlePlugin=_ref2$useLocalGradleP===void 0?false:_ref2$useLocalGradleP;var modifiedContents=contents;if(useLocalGradlePlugin){modifiedContents=addLocalGradlePluginIncludeBuild(modifiedContents);}var includeStatement=`include ':${moduleName}'`;if(modifiedContents.includes(includeStatement)){_logging.Logger.logDebug(`Module "${moduleName}" already in settings.gradle, skipping`);return modifiedContents;}_logging.Logger.logDebug(`Modifying settings.gradle to include module "${moduleName}"`);modifiedContents=modifiedContents+`\n${includeStatement}\n`;_logging.Logger.logDebug(`Added module "${moduleName}" to settings.gradle`);return modifiedContents;}
|
|
2
2
|
//# sourceMappingURL=gradleHelpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_constants","require","_logging","modifyRootBuildGradle","contents","
|
|
1
|
+
{"version":3,"names":["_constants","require","_logging","LOCAL_GRADLE_PLUGIN_INCLUDE_BUILD","modifyRootBuildGradle","contents","_ref","arguments","length","undefined","_ref$useLocalGradlePl","useLocalGradlePlugin","Logger","logDebug","includes","buildscriptDepsRegex","match","Error","insertion","brownfieldGradlePluginDependency","modifiedContents","replace","addLocalGradlePluginIncludeBuild","pluginManagementMatch","index","insertIndex","slice","modifySettingsGradle","moduleName","_ref2","_ref2$useLocalGradleP","includeStatement"],"sourceRoot":"../../../../../src","sources":["expo-config-plugin/android/utils/gradleHelpers.ts"],"mappings":"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","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.withBrownfieldAndroid=void 0;var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _configPlugins=require("@expo/config-plugins");var _gradleHelpers=require("./utils/gradleHelpers");var _withAndroidModuleFiles=require("./withAndroidModuleFiles");var withBrownfieldAndroid=exports.withBrownfieldAndroid=function withBrownfieldAndroid(config,props){var androidConfig=props.android;config=(0,_configPlugins.withProjectBuildGradle)(config,function(gradleConfig){gradleConfig.modResults.contents=(0,_gradleHelpers.modifyRootBuildGradle)(gradleConfig.modResults.contents);return gradleConfig;});config=(0,_configPlugins.withSettingsGradle)(config,function(settingsConfig){settingsConfig.modResults.contents=(0,_gradleHelpers.modifySettingsGradle)(settingsConfig.modResults.contents,androidConfig.moduleName);return settingsConfig;});config=(0,_withAndroidModuleFiles.withAndroidModuleFiles)(config,props);config=(0,_configPlugins.withFinalizedMod)(config,['android',(function(){var _ref=(0,_asyncToGenerator2.default)(function*(finalizedConfig){(0,_withAndroidModuleFiles.syncAndroidModuleExpoUpdatesFromAppFiles)({androidDir:finalizedConfig.modRequest.platformProjectRoot,config:props});return finalizedConfig;});return function(_x){return _ref.apply(this,arguments);};}())]);return config;};
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.withBrownfieldAndroid=void 0;var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _configPlugins=require("@expo/config-plugins");var _gradleHelpers=require("./utils/gradleHelpers");var _withAndroidModuleFiles=require("./withAndroidModuleFiles");var withBrownfieldAndroid=exports.withBrownfieldAndroid=function withBrownfieldAndroid(config,props){var androidConfig=props.android;config=(0,_configPlugins.withProjectBuildGradle)(config,function(gradleConfig){gradleConfig.modResults.contents=(0,_gradleHelpers.modifyRootBuildGradle)(gradleConfig.modResults.contents,{useLocalGradlePlugin:androidConfig.useLocalGradlePlugin});return gradleConfig;});config=(0,_configPlugins.withSettingsGradle)(config,function(settingsConfig){settingsConfig.modResults.contents=(0,_gradleHelpers.modifySettingsGradle)(settingsConfig.modResults.contents,androidConfig.moduleName,{useLocalGradlePlugin:androidConfig.useLocalGradlePlugin});return settingsConfig;});config=(0,_withAndroidModuleFiles.withAndroidModuleFiles)(config,props);config=(0,_configPlugins.withFinalizedMod)(config,['android',(function(){var _ref=(0,_asyncToGenerator2.default)(function*(finalizedConfig){(0,_withAndroidModuleFiles.syncAndroidModuleExpoUpdatesFromAppFiles)({androidDir:finalizedConfig.modRequest.platformProjectRoot,config:props});return finalizedConfig;});return function(_x){return _ref.apply(this,arguments);};}())]);return config;};
|
|
2
2
|
//# sourceMappingURL=withBrownfieldAndroid.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_configPlugins","require","_gradleHelpers","_withAndroidModuleFiles","withBrownfieldAndroid","exports","config","props","androidConfig","android","withProjectBuildGradle","gradleConfig","modResults","contents","modifyRootBuildGradle","withSettingsGradle","settingsConfig","modifySettingsGradle","moduleName","withAndroidModuleFiles","withFinalizedMod","_ref","_asyncToGenerator2","default","finalizedConfig","syncAndroidModuleExpoUpdatesFromAppFiles","androidDir","modRequest","platformProjectRoot","_x","apply","arguments"],"sourceRoot":"../../../../src","sources":["expo-config-plugin/android/withBrownfieldAndroid.ts"],"mappings":"mRAAA,IAAAA,cAAA,CAAAC,OAAA,yBAOA,IAAAC,cAAA,CAAAD,OAAA,0BAIA,IAAAE,uBAAA,CAAAF,OAAA,6BAeO,GAAM,CAAAG,qBAEZ,CAAAC,OAAA,CAAAD,qBAAA,CAAG,QAFS,CAAAA,qBAEZA,CAAIE,MAAM,CAAEC,KAAK,CAAK,CACrB,GAAM,CAAAC,aAAa,CAAGD,KAAK,CAACE,OAAO,CAGnCH,MAAM,CAAG,GAAAI,qCAAsB,EAACJ,MAAM,CAAE,SAACK,YAAY,CAAK,CACxDA,YAAY,CAACC,UAAU,CAACC,QAAQ,CAAG,GAAAC,oCAAqB,EACtDH,YAAY,CAACC,UAAU,CAACC,
|
|
1
|
+
{"version":3,"names":["_configPlugins","require","_gradleHelpers","_withAndroidModuleFiles","withBrownfieldAndroid","exports","config","props","androidConfig","android","withProjectBuildGradle","gradleConfig","modResults","contents","modifyRootBuildGradle","useLocalGradlePlugin","withSettingsGradle","settingsConfig","modifySettingsGradle","moduleName","withAndroidModuleFiles","withFinalizedMod","_ref","_asyncToGenerator2","default","finalizedConfig","syncAndroidModuleExpoUpdatesFromAppFiles","androidDir","modRequest","platformProjectRoot","_x","apply","arguments"],"sourceRoot":"../../../../src","sources":["expo-config-plugin/android/withBrownfieldAndroid.ts"],"mappings":"mRAAA,IAAAA,cAAA,CAAAC,OAAA,yBAOA,IAAAC,cAAA,CAAAD,OAAA,0BAIA,IAAAE,uBAAA,CAAAF,OAAA,6BAeO,GAAM,CAAAG,qBAEZ,CAAAC,OAAA,CAAAD,qBAAA,CAAG,QAFS,CAAAA,qBAEZA,CAAIE,MAAM,CAAEC,KAAK,CAAK,CACrB,GAAM,CAAAC,aAAa,CAAGD,KAAK,CAACE,OAAO,CAGnCH,MAAM,CAAG,GAAAI,qCAAsB,EAACJ,MAAM,CAAE,SAACK,YAAY,CAAK,CACxDA,YAAY,CAACC,UAAU,CAACC,QAAQ,CAAG,GAAAC,oCAAqB,EACtDH,YAAY,CAACC,UAAU,CAACC,QAAQ,CAChC,CAAEE,oBAAoB,CAAEP,aAAa,CAACO,oBAAqB,CAC7D,CAAC,CAED,MAAO,CAAAJ,YAAY,CACrB,CAAC,CAAC,CAGFL,MAAM,CAAG,GAAAU,iCAAkB,EAACV,MAAM,CAAE,SAACW,cAAc,CAAK,CACtDA,cAAc,CAACL,UAAU,CAACC,QAAQ,CAAG,GAAAK,mCAAoB,EACvDD,cAAc,CAACL,UAAU,CAACC,QAAQ,CAClCL,aAAa,CAACW,UAAU,CACxB,CAAEJ,oBAAoB,CAAEP,aAAa,CAACO,oBAAqB,CAC7D,CAAC,CAED,MAAO,CAAAE,cAAc,CACvB,CAAC,CAAC,CAGFX,MAAM,CAAG,GAAAc,8CAAsB,EAACd,MAAM,CAAEC,KAAK,CAAC,CAG9CD,MAAM,CAAG,GAAAe,+BAAgB,EAACf,MAAM,CAAE,CAChC,SAAS,iBAAAgB,IAAA,IAAAC,kBAAA,CAAAC,OAAA,EACT,UAAOC,eAAe,CAAK,CACzB,GAAAC,gEAAwC,EAAC,CACvCC,UAAU,CAAEF,eAAe,CAACG,UAAU,CAACC,mBAAmB,CAC1DvB,MAAM,CAAEC,KACV,CAAC,CAAC,CAEF,MAAO,CAAAkB,eAAe,CACxB,CAAC,kBAAAK,EAAA,SAAAR,IAAA,CAAAS,KAAA,MAAAC,SAAA,SACF,CAAC,CAEF,MAAO,CAAA1B,MAAM,CACf,CAAC","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _configPlugins=require("@expo/config-plugins");var _withBrownfieldIos=require("./ios/withBrownfieldIos");var _withBrownfieldAndroid=require("./android/withBrownfieldAndroid");var _logging=require("./logging");function
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _configPlugins=require("@expo/config-plugins");var _expoPluginConfig=require("@callstack/brownfield-cli/expo-plugin-config");var _withBrownfieldIos=require("./ios/withBrownfieldIos");var _withBrownfieldAndroid=require("./android/withBrownfieldAndroid");var _logging=require("./logging");var withBrownfield=function withBrownfield(config){var props=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var pluginProps=props!=null?props:{};var fileConfig=(0,_expoPluginConfig.loadBrownfieldConfig)();(0,_expoPluginConfig.assertNoConfigFilePluginOverlap)(fileConfig,pluginProps);var resolvedConfig=(0,_expoPluginConfig.resolveBrownfieldPluginConfig)(pluginProps,fileConfig,config);_logging.Logger.setIsDebug(resolvedConfig.debug);var plugins=[];if(resolvedConfig.ios){plugins.push([_withBrownfieldIos.withBrownfieldIos,resolvedConfig]);}if(resolvedConfig.android){plugins.push([_withBrownfieldAndroid.withBrownfieldAndroid,resolvedConfig]);}return(0,_configPlugins.withPlugins)(config,plugins);};var _default=exports.default=(0,_configPlugins.createRunOncePlugin)(withBrownfield,process.env.npm_package_name,process.env.npm_package_version);
|
|
2
2
|
//# sourceMappingURL=withBrownfield.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_configPlugins","require","_withBrownfieldIos","_withBrownfieldAndroid","_logging","
|
|
1
|
+
{"version":3,"names":["_configPlugins","require","_expoPluginConfig","_withBrownfieldIos","_withBrownfieldAndroid","_logging","withBrownfield","config","props","arguments","length","undefined","pluginProps","fileConfig","loadBrownfieldConfig","assertNoConfigFilePluginOverlap","resolvedConfig","resolveBrownfieldPluginConfig","Logger","setIsDebug","debug","plugins","ios","push","withBrownfieldIos","android","withBrownfieldAndroid","withPlugins","_default","exports","default","createRunOncePlugin","process","env","npm_package_name","npm_package_version"],"sourceRoot":"../../../src","sources":["expo-config-plugin/withBrownfield.ts"],"mappings":"gFAAA,IAAAA,cAAA,CAAAC,OAAA,yBAOA,IAAAC,iBAAA,CAAAD,OAAA,iDAMA,IAAAE,kBAAA,CAAAF,OAAA,4BACA,IAAAG,sBAAA,CAAAH,OAAA,oCAMA,IAAAI,QAAA,CAAAJ,OAAA,cA8BA,GAAM,CAAAK,cAA2D,CAAG,QAA9D,CAAAA,cAA2DA,CAC/DC,MAAM,CAEH,IADH,CAAAC,KAAK,CAAAC,SAAA,CAAAC,MAAA,IAAAD,SAAA,MAAAE,SAAA,CAAAF,SAAA,IAAG,CAAC,CAAC,CAEV,GAAM,CAAAG,WAAW,CAAGJ,KAAK,OAALA,KAAK,CAAI,CAAC,CAAC,CAC/B,GAAM,CAAAK,UAAU,CAAG,GAAAC,sCAAoB,EAAC,CAAC,CAEzC,GAAAC,iDAA+B,EAACF,UAAU,CAAED,WAAW,CAAC,CAExD,GAAM,CAAAI,cAA8C,CAClD,GAAAC,+CAA6B,EAACL,WAAW,CAAEC,UAAU,CAAEN,MAAM,CAAC,CAEhEW,eAAM,CAACC,UAAU,CAACH,cAAc,CAACI,KAAK,CAAC,CAEvC,GAAM,CAAAC,OAAwC,CAAG,EAAE,CAEnD,GAAIL,cAAc,CAACM,GAAG,CAAE,CACtBD,OAAO,CAACE,IAAI,CAAC,CAACC,oCAAiB,CAAER,cAAc,CAAC,CAAC,CACnD,CAEA,GAAIA,cAAc,CAACS,OAAO,CAAE,CAC1BJ,OAAO,CAACE,IAAI,CAAC,CAACG,4CAAqB,CAAEV,cAAc,CAAC,CAAC,CACvD,CAEA,MAAO,GAAAW,0BAAW,EAACpB,MAAM,CAAEc,OAAO,CAAC,CACrC,CAAC,CAAC,IAAAO,QAAA,CAAAC,OAAA,CAAAC,OAAA,CAEa,GAAAC,kCAAmB,EAChCzB,cAAc,CACd0B,OAAO,CAACC,GAAG,CAACC,gBAAgB,CAC5BF,OAAO,CAACC,GAAG,CAACE,mBACd,CAAC","ignoreList":[]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const BROWNFIELD_PLUGIN_VERSION = "2.0.0-
|
|
2
|
-
export declare const brownfieldGradlePluginDependency = "classpath(\"com.callstack.react:brownfield-gradle-plugin:2.0.0-
|
|
1
|
+
export declare const BROWNFIELD_PLUGIN_VERSION = "2.0.0-alpha03";
|
|
2
|
+
export declare const brownfieldGradlePluginDependency = "classpath(\"com.callstack.react:brownfield-gradle-plugin:2.0.0-alpha03\")";
|
|
3
3
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
+
type GradleModificationOptions = {
|
|
2
|
+
useLocalGradlePlugin?: boolean;
|
|
3
|
+
};
|
|
1
4
|
/**
|
|
2
5
|
* Modifies the root build.gradle to add the Brownfield Gradle plugin dependency
|
|
3
6
|
* @param contents The original build.gradle content
|
|
4
7
|
* @returns The modified build.gradle content
|
|
5
8
|
*/
|
|
6
|
-
export declare function modifyRootBuildGradle(contents: string): string;
|
|
9
|
+
export declare function modifyRootBuildGradle(contents: string, { useLocalGradlePlugin }?: GradleModificationOptions): string;
|
|
7
10
|
/**
|
|
8
11
|
* Modifies settings.gradle to include the Brownfield module
|
|
9
12
|
* @param contents The original settings.gradle content
|
|
10
13
|
* @param moduleName The name of the Brownfield module to include
|
|
11
14
|
* @returns The modified settings.gradle content
|
|
12
15
|
*/
|
|
13
|
-
export declare function modifySettingsGradle(contents: string, moduleName: string): string;
|
|
16
|
+
export declare function modifySettingsGradle(contents: string, moduleName: string, { useLocalGradlePlugin }?: GradleModificationOptions): string;
|
|
17
|
+
export {};
|
|
14
18
|
//# sourceMappingURL=gradleHelpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gradleHelpers.d.ts","sourceRoot":"","sources":["../../../../../../../src/expo-config-plugin/android/utils/gradleHelpers.ts"],"names":[],"mappings":"
|
|
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"}
|
package/lib/typescript/commonjs/src/expo-config-plugin/android/withBrownfieldAndroid.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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,
|
|
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"}
|
|
@@ -42,6 +42,12 @@ 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)
|
|
@@ -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;
|
|
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,GAC/C,QAAQ,CAAC,6BAA6B,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;
|
|
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"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const BROWNFIELD_PLUGIN_VERSION = "2.0.0-
|
|
2
|
-
export declare const brownfieldGradlePluginDependency = "classpath(\"com.callstack.react:brownfield-gradle-plugin:2.0.0-
|
|
1
|
+
export declare const BROWNFIELD_PLUGIN_VERSION = "2.0.0-alpha03";
|
|
2
|
+
export declare const brownfieldGradlePluginDependency = "classpath(\"com.callstack.react:brownfield-gradle-plugin:2.0.0-alpha03\")";
|
|
3
3
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
+
type GradleModificationOptions = {
|
|
2
|
+
useLocalGradlePlugin?: boolean;
|
|
3
|
+
};
|
|
1
4
|
/**
|
|
2
5
|
* Modifies the root build.gradle to add the Brownfield Gradle plugin dependency
|
|
3
6
|
* @param contents The original build.gradle content
|
|
4
7
|
* @returns The modified build.gradle content
|
|
5
8
|
*/
|
|
6
|
-
export declare function modifyRootBuildGradle(contents: string): string;
|
|
9
|
+
export declare function modifyRootBuildGradle(contents: string, { useLocalGradlePlugin }?: GradleModificationOptions): string;
|
|
7
10
|
/**
|
|
8
11
|
* Modifies settings.gradle to include the Brownfield module
|
|
9
12
|
* @param contents The original settings.gradle content
|
|
10
13
|
* @param moduleName The name of the Brownfield module to include
|
|
11
14
|
* @returns The modified settings.gradle content
|
|
12
15
|
*/
|
|
13
|
-
export declare function modifySettingsGradle(contents: string, moduleName: string): string;
|
|
16
|
+
export declare function modifySettingsGradle(contents: string, moduleName: string, { useLocalGradlePlugin }?: GradleModificationOptions): string;
|
|
17
|
+
export {};
|
|
14
18
|
//# sourceMappingURL=gradleHelpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gradleHelpers.d.ts","sourceRoot":"","sources":["../../../../../../../src/expo-config-plugin/android/utils/gradleHelpers.ts"],"names":[],"mappings":"
|
|
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 +1 @@
|
|
|
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,
|
|
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"}
|
|
@@ -42,6 +42,12 @@ 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)
|
|
@@ -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;
|
|
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,GAC/C,QAAQ,CAAC,6BAA6B,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;
|
|
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.
|
|
3
|
+
"version": "3.13.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Michal Chudziak <mike.chudziak@callstack.com>",
|
|
6
6
|
"bin": {
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"@expo/config-plugins": "^54.0.4"
|
|
89
89
|
},
|
|
90
90
|
"dependencies": {
|
|
91
|
-
"@callstack/brownfield-cli": "^3.13.
|
|
91
|
+
"@callstack/brownfield-cli": "^3.13.2"
|
|
92
92
|
},
|
|
93
93
|
"devDependencies": {
|
|
94
94
|
"@babel/core": "^7.25.2",
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const BROWNFIELD_PLUGIN_VERSION = '2.0.0-
|
|
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(
|
|
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 (
|
|
106
|
+
if (modifiedContents.includes(includeStatement)) {
|
|
56
107
|
Logger.logDebug(
|
|
57
108
|
`Module "${moduleName}" already in settings.gradle, skipping`
|
|
58
109
|
);
|
|
59
|
-
return
|
|
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
|
-
|
|
118
|
+
modifiedContents = modifiedContents + `\n${includeStatement}\n`;
|
|
68
119
|
|
|
69
120
|
Logger.logDebug(`Added module "${moduleName}" to settings.gradle`);
|
|
70
121
|
|
|
@@ -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;
|
|
@@ -49,6 +49,13 @@ export interface BrownfieldPluginAndroidConfig {
|
|
|
49
49
|
* @default "0.0.1-SNAPSHOT"
|
|
50
50
|
*/
|
|
51
51
|
version?: string;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Load the Brownfield Gradle plugin from node_modules via includeBuild
|
|
55
|
+
* instead of the Maven classpath dependency.
|
|
56
|
+
* @default false
|
|
57
|
+
*/
|
|
58
|
+
useLocalGradlePlugin?: boolean;
|
|
52
59
|
}
|
|
53
60
|
|
|
54
61
|
/**
|
|
@@ -4,7 +4,12 @@ import {
|
|
|
4
4
|
type ConfigPlugin,
|
|
5
5
|
type StaticPlugin,
|
|
6
6
|
} from '@expo/config-plugins';
|
|
7
|
-
|
|
7
|
+
|
|
8
|
+
import {
|
|
9
|
+
assertNoConfigFilePluginOverlap,
|
|
10
|
+
loadBrownfieldConfig,
|
|
11
|
+
resolveBrownfieldPluginConfig,
|
|
12
|
+
} from '@callstack/brownfield-cli/expo-plugin-config';
|
|
8
13
|
|
|
9
14
|
import { withBrownfieldIos } from './ios/withBrownfieldIos';
|
|
10
15
|
import { withBrownfieldAndroid } from './android/withBrownfieldAndroid';
|
|
@@ -15,49 +20,6 @@ import type {
|
|
|
15
20
|
|
|
16
21
|
import { Logger } from './logging';
|
|
17
22
|
|
|
18
|
-
/**
|
|
19
|
-
* Resolves the plugin configuration using provided config and config defaults.
|
|
20
|
-
* @param config The user-provided Brownfield configuration.
|
|
21
|
-
* @param expoConfig The Expo configuration object.
|
|
22
|
-
* @returns The resolved Brownfield configuration.
|
|
23
|
-
*/
|
|
24
|
-
function resolveConfig(
|
|
25
|
-
config: BrownfieldPluginConfig = {},
|
|
26
|
-
expoConfig: ExpoConfig
|
|
27
|
-
): ResolvedBrownfieldPluginConfig {
|
|
28
|
-
Logger.setIsDebug(config.debug ?? false);
|
|
29
|
-
|
|
30
|
-
const androidPackage = expoConfig.android?.package;
|
|
31
|
-
const androidModuleName = config.android?.moduleName ?? 'brownfieldlib';
|
|
32
|
-
|
|
33
|
-
return {
|
|
34
|
-
ios: expoConfig.ios
|
|
35
|
-
? {
|
|
36
|
-
frameworkName: config.ios?.frameworkName ?? 'BrownfieldLib',
|
|
37
|
-
bundleIdentifier:
|
|
38
|
-
config.ios?.bundleIdentifier ??
|
|
39
|
-
`${expoConfig.ios.bundleIdentifier}.brownfield`,
|
|
40
|
-
buildSettings: config.ios?.buildSettings ?? {},
|
|
41
|
-
deploymentTarget: config.ios?.deploymentTarget ?? '15.0',
|
|
42
|
-
frameworkVersion: config.ios?.frameworkVersion ?? '1',
|
|
43
|
-
}
|
|
44
|
-
: null,
|
|
45
|
-
android: androidPackage
|
|
46
|
-
? {
|
|
47
|
-
moduleName: androidModuleName,
|
|
48
|
-
packageName: config.android?.packageName ?? androidPackage,
|
|
49
|
-
minSdkVersion: config.android?.minSdkVersion ?? 24,
|
|
50
|
-
targetSdkVersion: config.android?.targetSdkVersion ?? 35,
|
|
51
|
-
compileSdkVersion: config.android?.compileSdkVersion ?? 35,
|
|
52
|
-
groupId: config.android?.groupId ?? androidPackage,
|
|
53
|
-
artifactId: config.android?.artifactId ?? androidModuleName,
|
|
54
|
-
version: config.android?.version ?? '0.0.1-SNAPSHOT',
|
|
55
|
-
}
|
|
56
|
-
: null,
|
|
57
|
-
debug: config.debug ?? false,
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
|
|
61
23
|
/**
|
|
62
24
|
* React Native Brownfield - Expo Config Plugin.
|
|
63
25
|
*
|
|
@@ -90,7 +52,15 @@ const withBrownfield: ConfigPlugin<BrownfieldPluginConfig | void> = (
|
|
|
90
52
|
config,
|
|
91
53
|
props = {}
|
|
92
54
|
) => {
|
|
93
|
-
const
|
|
55
|
+
const pluginProps = props ?? {};
|
|
56
|
+
const fileConfig = loadBrownfieldConfig();
|
|
57
|
+
|
|
58
|
+
assertNoConfigFilePluginOverlap(fileConfig, pluginProps);
|
|
59
|
+
|
|
60
|
+
const resolvedConfig: ResolvedBrownfieldPluginConfig =
|
|
61
|
+
resolveBrownfieldPluginConfig(pluginProps, fileConfig, config);
|
|
62
|
+
|
|
63
|
+
Logger.setIsDebug(resolvedConfig.debug);
|
|
94
64
|
|
|
95
65
|
const plugins: (ConfigPlugin | StaticPlugin)[] = [];
|
|
96
66
|
|