@callstack/react-native-brownfield 4.1.0 → 4.2.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.
- package/gradle-plugin/brownfield/gradle.properties +1 -1
- package/gradle-plugin/brownfield/src/main/kotlin/com/callstack/react/brownfield/plugin/RNBrownfieldPlugin.kt +4 -5
- package/gradle-plugin/brownfield/src/main/kotlin/com/callstack/react/brownfield/processors/AssetTaskProcessor.kt +51 -4
- package/gradle-plugin/brownfield/src/main/kotlin/com/callstack/react/brownfield/processors/ManifestTaskProcessor.kt +1 -1
- package/gradle-plugin/brownfield/src/main/kotlin/com/callstack/react/brownfield/processors/ResourceTaskProcessor.kt +51 -4
- 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/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/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 +2 -1
- 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 -1
- package/lib/typescript/commonjs/src/expo-config-plugin/types/android/BrownfieldPluginAndroidConfig.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 +2 -1
- 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 -1
- package/lib/typescript/module/src/expo-config-plugin/types/android/BrownfieldPluginAndroidConfig.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/expo-config-plugin/android/utils/constants.ts +1 -1
- package/src/expo-config-plugin/android/utils/gradleHelpers.ts +73 -8
- package/src/expo-config-plugin/android/withBrownfieldAndroid.ts +4 -1
- package/src/expo-config-plugin/types/android/BrownfieldPluginAndroidConfig.ts +7 -1
|
@@ -70,11 +70,6 @@ class RNBrownfieldPlugin : Plugin<Project> {
|
|
|
70
70
|
val androidComponents = project.extensions.getByType(LibraryAndroidComponentsExtension::class.java)
|
|
71
71
|
androidComponents.onVariants { variant ->
|
|
72
72
|
configureTasks(variant, artifacts, variantTaskProvider)
|
|
73
|
-
|
|
74
|
-
val aarLibraries = getAarLibraries(artifacts, variant.name)
|
|
75
|
-
ManifestTaskProcessor.process(variant, project, aarLibraries)
|
|
76
|
-
AssetTaskProcessor.process(variant, aarLibraries)
|
|
77
|
-
ResourceTaskProcessor.process(variant, aarLibraries)
|
|
78
73
|
}
|
|
79
74
|
}
|
|
80
75
|
|
|
@@ -142,6 +137,10 @@ class RNBrownfieldPlugin : Plugin<Project> {
|
|
|
142
137
|
|
|
143
138
|
val aarLibraries = getAarLibraries(artifacts, variantName)
|
|
144
139
|
|
|
140
|
+
ManifestTaskProcessor.process(project, variant, aarLibraries)
|
|
141
|
+
ResourceTaskProcessor.process(project, variant, aarLibraries, explodeTask)
|
|
142
|
+
AssetTaskProcessor.process(project, variant, aarLibraries, explodeTask)
|
|
143
|
+
|
|
145
144
|
/** ======= MERGE CLASSES =========*/
|
|
146
145
|
val mergeClassesTask = variantTaskProvider.mergeClasses(aarLibraries, explodeTask, variantName)
|
|
147
146
|
VariantHelper.getAsmTransformTask(project, capitalizedVariantName).configureEach {
|
|
@@ -1,17 +1,64 @@
|
|
|
1
1
|
package com.callstack.react.brownfield.processors
|
|
2
2
|
|
|
3
3
|
import com.android.build.api.variant.LibraryVariant
|
|
4
|
+
import com.callstack.react.brownfield.shared.ExplodeAarTask
|
|
4
5
|
import com.callstack.react.brownfield.utils.AndroidArchiveLibrary
|
|
6
|
+
import com.callstack.react.brownfield.utils.capitalized
|
|
7
|
+
import org.gradle.api.DefaultTask
|
|
8
|
+
import org.gradle.api.Project
|
|
9
|
+
import org.gradle.api.file.ConfigurableFileCollection
|
|
10
|
+
import org.gradle.api.file.DirectoryProperty
|
|
11
|
+
import org.gradle.api.tasks.CacheableTask
|
|
12
|
+
import org.gradle.api.tasks.InputFiles
|
|
13
|
+
import org.gradle.api.tasks.OutputDirectory
|
|
14
|
+
import org.gradle.api.tasks.PathSensitive
|
|
15
|
+
import org.gradle.api.tasks.PathSensitivity
|
|
16
|
+
import org.gradle.api.tasks.TaskAction
|
|
17
|
+
import org.gradle.api.tasks.TaskProvider
|
|
18
|
+
|
|
19
|
+
@CacheableTask
|
|
20
|
+
abstract class CopyExplodedAssetsTask : DefaultTask() {
|
|
21
|
+
@get:InputFiles
|
|
22
|
+
@get:PathSensitive(PathSensitivity.RELATIVE)
|
|
23
|
+
abstract val inputAssetDirs: ConfigurableFileCollection
|
|
24
|
+
|
|
25
|
+
@get:OutputDirectory
|
|
26
|
+
abstract val outputDirectory: DirectoryProperty
|
|
27
|
+
|
|
28
|
+
@TaskAction
|
|
29
|
+
fun run() {
|
|
30
|
+
val out = outputDirectory.get().asFile
|
|
31
|
+
out.deleteRecursively()
|
|
32
|
+
out.mkdirs()
|
|
33
|
+
inputAssetDirs.forEach { assetDir ->
|
|
34
|
+
if (assetDir.exists()) {
|
|
35
|
+
assetDir.copyRecursively(out, overwrite = true)
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
5
40
|
|
|
6
41
|
object AssetTaskProcessor {
|
|
7
42
|
fun process(
|
|
43
|
+
project: Project,
|
|
8
44
|
variant: LibraryVariant,
|
|
9
45
|
aarLibraries: List<AndroidArchiveLibrary>,
|
|
46
|
+
explodeTask: TaskProvider<ExplodeAarTask>,
|
|
10
47
|
) {
|
|
11
|
-
val
|
|
48
|
+
val capitalized = variant.name.capitalized()
|
|
49
|
+
val assetDirs = aarLibraries.map { it.getAssetsDir() }
|
|
50
|
+
val copyAssetsTask =
|
|
51
|
+
project.tasks.register(
|
|
52
|
+
"copyExplodedAssetsFor$capitalized",
|
|
53
|
+
CopyExplodedAssetsTask::class.java,
|
|
54
|
+
) { task ->
|
|
55
|
+
task.inputAssetDirs.setFrom(assetDirs)
|
|
56
|
+
task.dependsOn(explodeTask)
|
|
57
|
+
}
|
|
12
58
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
59
|
+
variant.sources.assets?.addGeneratedSourceDirectory(
|
|
60
|
+
copyAssetsTask,
|
|
61
|
+
CopyExplodedAssetsTask::outputDirectory,
|
|
62
|
+
)
|
|
16
63
|
}
|
|
17
64
|
}
|
|
@@ -8,8 +8,8 @@ import org.gradle.api.Project
|
|
|
8
8
|
|
|
9
9
|
object ManifestTaskProcessor {
|
|
10
10
|
fun process(
|
|
11
|
-
variant: LibraryVariant,
|
|
12
11
|
project: Project,
|
|
12
|
+
variant: LibraryVariant,
|
|
13
13
|
aarLibraries: List<AndroidArchiveLibrary>,
|
|
14
14
|
) {
|
|
15
15
|
val capitalizedVariantName = variant.name.replaceFirstChar(Char::titlecase)
|
|
@@ -1,17 +1,64 @@
|
|
|
1
1
|
package com.callstack.react.brownfield.processors
|
|
2
2
|
|
|
3
3
|
import com.android.build.api.variant.LibraryVariant
|
|
4
|
+
import com.callstack.react.brownfield.shared.ExplodeAarTask
|
|
4
5
|
import com.callstack.react.brownfield.utils.AndroidArchiveLibrary
|
|
6
|
+
import com.callstack.react.brownfield.utils.capitalized
|
|
7
|
+
import org.gradle.api.DefaultTask
|
|
8
|
+
import org.gradle.api.Project
|
|
9
|
+
import org.gradle.api.file.ConfigurableFileCollection
|
|
10
|
+
import org.gradle.api.file.DirectoryProperty
|
|
11
|
+
import org.gradle.api.tasks.CacheableTask
|
|
12
|
+
import org.gradle.api.tasks.InputFiles
|
|
13
|
+
import org.gradle.api.tasks.OutputDirectory
|
|
14
|
+
import org.gradle.api.tasks.PathSensitive
|
|
15
|
+
import org.gradle.api.tasks.PathSensitivity
|
|
16
|
+
import org.gradle.api.tasks.TaskAction
|
|
17
|
+
import org.gradle.api.tasks.TaskProvider
|
|
18
|
+
|
|
19
|
+
@CacheableTask
|
|
20
|
+
abstract class CopyExplodedResTask : DefaultTask() {
|
|
21
|
+
@get:InputFiles
|
|
22
|
+
@get:PathSensitive(PathSensitivity.RELATIVE)
|
|
23
|
+
abstract val inputResDirs: ConfigurableFileCollection
|
|
24
|
+
|
|
25
|
+
@get:OutputDirectory
|
|
26
|
+
abstract val outputDirectory: DirectoryProperty
|
|
27
|
+
|
|
28
|
+
@TaskAction
|
|
29
|
+
fun run() {
|
|
30
|
+
val out = outputDirectory.get().asFile
|
|
31
|
+
out.deleteRecursively()
|
|
32
|
+
out.mkdirs()
|
|
33
|
+
inputResDirs.forEach { resDir ->
|
|
34
|
+
if (resDir.exists()) {
|
|
35
|
+
resDir.copyRecursively(out, overwrite = true)
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
5
40
|
|
|
6
41
|
object ResourceTaskProcessor {
|
|
7
42
|
fun process(
|
|
43
|
+
project: Project,
|
|
8
44
|
variant: LibraryVariant,
|
|
9
45
|
aarLibraries: List<AndroidArchiveLibrary>,
|
|
46
|
+
explodeTask: TaskProvider<ExplodeAarTask>,
|
|
10
47
|
) {
|
|
11
|
-
val
|
|
48
|
+
val capitalized = variant.name.capitalized()
|
|
49
|
+
val resDirs = aarLibraries.map { it.getResDir() }
|
|
50
|
+
val copyResTask =
|
|
51
|
+
project.tasks.register(
|
|
52
|
+
"copyExplodedResFor$capitalized",
|
|
53
|
+
CopyExplodedResTask::class.java,
|
|
54
|
+
) { task ->
|
|
55
|
+
task.inputResDirs.setFrom(resDirs)
|
|
56
|
+
task.dependsOn(explodeTask)
|
|
57
|
+
}
|
|
12
58
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
59
|
+
variant.sources.res?.addGeneratedSourceDirectory(
|
|
60
|
+
copyResTask,
|
|
61
|
+
CopyExplodedResTask::outputDirectory,
|
|
62
|
+
)
|
|
16
63
|
}
|
|
17
64
|
}
|
|
@@ -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-alpha08';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.modifyAppBuildGradleMissingDimensionStrategy=modifyAppBuildGradleMissingDimensionStrategy;exports.modifyRootBuildGradle=modifyRootBuildGradle;exports.modifySettingsGradle=modifySettingsGradle;var _constants=require("./constants");var _logging=require("../../logging");var _formatHelpers=require("./formatHelpers");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
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:true});exports.modifyAppBuildGradleMissingDimensionStrategy=modifyAppBuildGradleMissingDimensionStrategy;exports.modifyRootBuildGradle=modifyRootBuildGradle;exports.modifySettingsGradle=modifySettingsGradle;var _constants=require("./constants");var _logging=require("../../logging");var _formatHelpers=require("./formatHelpers");var LOCAL_GRADLE_PLUGIN_INCLUDE_BUILD='includeBuild("../node_modules/@callstack/react-native-brownfield/gradle-plugin/brownfield")';var LOCAL_MAVEN_REPOSITORY='mavenLocal()';var BUILD_SCRIPT_BLOCK_NAME='buildscript';var ALL_PROJECTS_BLOCK_NAME='allprojects';function addMavenLocalToBlock(contents,blockName){var blockRepositoriesRegex=new RegExp(`(${blockName}\\s*\\{[\\s\\S]*?repositories\\s*\\{)`,'m');var mavenLocalRegex=new RegExp(`${blockName}\\s*\\{[\\s\\S]*?repositories\\s*\\{[\\s\\S]*?${LOCAL_MAVEN_REPOSITORY}`,'m');if(!blockRepositoriesRegex.test(contents)){return contents;}if(mavenLocalRegex.test(contents)){return contents;}return contents.replace(blockRepositoriesRegex,`$1\n\t\t${LOCAL_MAVEN_REPOSITORY}`);}function addMavenLocalRepositories(contents){var modifiedContents=contents;var initialContents=modifiedContents;modifiedContents=addMavenLocalToBlock(modifiedContents,BUILD_SCRIPT_BLOCK_NAME);modifiedContents=addMavenLocalToBlock(modifiedContents,ALL_PROJECTS_BLOCK_NAME);if(modifiedContents!==initialContents){_logging.Logger.logDebug('Added mavenLocal() to root build.gradle repositories');}return modifiedContents;}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,_ref$useLocalMaven=_ref.useLocalMaven,useLocalMaven=_ref$useLocalMaven===void 0?false:_ref$useLocalMaven;var updatedContents=contents;if(useLocalMaven){updatedContents=addMavenLocalRepositories(updatedContents);}if(useLocalGradlePlugin){_logging.Logger.logDebug('Skipping Maven Brownfield Gradle plugin classpath because useLocalGradlePlugin is enabled');return updatedContents;}if(updatedContents.includes('brownfield-gradle-plugin')){_logging.Logger.logDebug('Brownfield Gradle plugin already in root build.gradle, skipping');return updatedContents;}_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=updatedContents.match(buildscriptDepsRegex);if(!match){throw new Error('Could not locate buildscript block in root build.gradle');}var gradlePluginDependency=useLocalMaven?`classpath("com.callstack.react:brownfield-gradle-plugin:${_constants.BROWNFIELD_PLUGIN_VERSION}-SNAPSHOT")`:_constants.brownfieldGradlePluginDependency;var insertion=`\t${gradlePluginDependency}\n\t`;var modifiedContents=updatedContents.replace(buildscriptDepsRegex,`$1${insertion}$2`);_logging.Logger.logDebug('Added Brownfield Gradle plugin to root build.gradle');return modifiedContents;}function modifyAppBuildGradleMissingDimensionStrategy(contents,missingDimensionStrategies){var _match$1$match$,_match$1$match;if(missingDimensionStrategies.length<2){return contents;}_logging.Logger.logDebug('Modifying app build.gradle to add missingDimensionStrategy');var defaultConfigRegex=/^([ \t]*defaultConfig\s*\{)/m;var match=contents.match(defaultConfigRegex);if(!match){throw new Error('Could not locate defaultConfig block in app build.gradle');}var baseIndent=(_match$1$match$=(_match$1$match=match[1].match(/^[ \t]*/))==null?void 0:_match$1$match[0])!=null?_match$1$match$:'';var indentUnit=baseIndent.includes('\t')?'\t':' ';var args=(0,_formatHelpers.formatMissingDimensionStrategies)(missingDimensionStrategies);var missingStrategyLine=`missingDimensionStrategy(${args})`;if(contents.includes(missingStrategyLine)){_logging.Logger.logDebug('missingDimensionStrategy already present with same arguments, skipping');return contents;}var insertion=`\n${baseIndent}${indentUnit}${missingStrategyLine}`;return contents.replace(defaultConfigRegex,`$1${insertion}`);}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","_formatHelpers","LOCAL_GRADLE_PLUGIN_INCLUDE_BUILD","
|
|
1
|
+
{"version":3,"names":["_constants","require","_logging","_formatHelpers","LOCAL_GRADLE_PLUGIN_INCLUDE_BUILD","LOCAL_MAVEN_REPOSITORY","BUILD_SCRIPT_BLOCK_NAME","ALL_PROJECTS_BLOCK_NAME","addMavenLocalToBlock","contents","blockName","blockRepositoriesRegex","RegExp","mavenLocalRegex","test","replace","addMavenLocalRepositories","modifiedContents","initialContents","Logger","logDebug","modifyRootBuildGradle","_ref","arguments","length","undefined","_ref$useLocalGradlePl","useLocalGradlePlugin","_ref$useLocalMaven","useLocalMaven","updatedContents","includes","buildscriptDepsRegex","match","Error","gradlePluginDependency","BROWNFIELD_PLUGIN_VERSION","brownfieldGradlePluginDependency","insertion","modifyAppBuildGradleMissingDimensionStrategy","missingDimensionStrategies","_match$1$match$","_match$1$match","defaultConfigRegex","baseIndent","indentUnit","args","formatMissingDimensionStrategies","missingStrategyLine","addLocalGradlePluginIncludeBuild","pluginManagementMatch","index","insertIndex","slice","modifySettingsGradle","moduleName","_ref2","_ref2$useLocalGradleP","includeStatement"],"sourceRoot":"../../../../../src","sources":["expo-config-plugin/android/utils/gradleHelpers.ts"],"mappings":"iQAAA,IAAAA,UAAA,CAAAC,OAAA,gBAIA,IAAAC,QAAA,CAAAD,OAAA,kBACA,IAAAE,cAAA,CAAAF,OAAA,oBAEA,GAAM,CAAAG,iCAAiC,CACrC,6FAA6F,CAC/F,GAAM,CAAAC,sBAAsB,CAAG,cAAc,CAO7C,GAAM,CAAAC,uBAAuB,CAAG,aAAa,CAC7C,GAAM,CAAAC,uBAAuB,CAAG,aAAa,CAE7C,QAAS,CAAAC,oBAAoBA,CAACC,QAAgB,CAAEC,SAAiB,CAAU,CACzE,GAAM,CAAAC,sBAAsB,CAAG,GAAI,CAAAC,MAAM,CACvC,IAAIF,SAAS,uCAAuC,C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C1B,MAAM,CAC/D,GAAM,CAAAc,SAAS,CAAG,OAAOlC,iCAAiC,EAAE,CAE5D,MACE,CAAAK,QAAQ,CAAC4C,KAAK,CAAC,CAAC,CAAED,WAAW,CAAC,CAAGd,SAAS,CAAG7B,QAAQ,CAAC4C,KAAK,CAACD,WAAW,CAAC,CAE5E,CAEA,MAAO,yBAAyBhD,iCAAiC,UAAUK,QAAQ,EAAE,CACvF,CAQO,QAAS,CAAA6C,oBAAoBA,CAClC7C,QAAgB,CAChB8C,UAAkB,CAEV,KAAAC,KAAA,CAAAjC,SAAA,CAAAC,MAAA,IAAAD,SAAA,MAAAE,SAAA,CAAAF,SAAA,IADsD,CAAC,CAAC,CAAAkC,qBAAA,CAAAD,KAAA,CAA9D7B,oBAAoB,CAApBA,oBAAoB,CAAA8B,qBAAA,UAAG,KAAK,CAAAA,qBAAA,CAE9B,GAAI,CAAAxC,gBAAgB,CAAGR,QAAQ,CAE/B,GAAIkB,oBAAoB,CAAE,CACxBV,gBAAgB,CAAGgC,gCAAgC,CAAChC,gBAAgB,CAAC,CACvE,CAEA,GAAM,CAAAyC,gBAAgB,CAAG,aAAaH,UAAU,GAAG,CAGnD,GAAItC,gBAAgB,CAACc,QAAQ,CAAC2B,gBAAgB,CAAC,CAAE,CAC/CvC,eAAM,CAACC,QAAQ,CACb,WAAWmC,UAAU,wCACvB,CAAC,CACD,MAAO,CAAAtC,gBAAgB,CACzB,CAEAE,eAAM,CAACC,QAAQ,CACb,gDAAgDmC,UAAU,GAC5D,CAAC,CAGDtC,gBAAgB,CAAGA,gBAAgB,CAAG,KAAKyC,gBAAgB,IAAI,CAE/DvC,eAAM,CAACC,QAAQ,CAAC,iBAAiBmC,UAAU,sBAAsB,CAAC,CAElE,MAAO,CAAAtC,gBAAgB,CACzB","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,{useLocalGradlePlugin:androidConfig.useLocalGradlePlugin});return gradleConfig;});config=(0,_configPlugins.withAppBuildGradle)(config,function(gradleConfig){gradleConfig.modResults.contents=(0,_gradleHelpers.modifyAppBuildGradleMissingDimensionStrategy)(gradleConfig.modResults.contents,androidConfig.missingDimensionStrategies);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;};
|
|
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,useLocalMaven:androidConfig.useLocalMaven});return gradleConfig;});config=(0,_configPlugins.withAppBuildGradle)(config,function(gradleConfig){gradleConfig.modResults.contents=(0,_gradleHelpers.modifyAppBuildGradleMissingDimensionStrategy)(gradleConfig.modResults.contents,androidConfig.missingDimensionStrategies);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","useLocalGradlePlugin","withAppBuildGradle","modifyAppBuildGradleMissingDimensionStrategy","missingDimensionStrategies","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,yBAQA,IAAAC,cAAA,CAAAD,OAAA,0BAKA,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,
|
|
1
|
+
{"version":3,"names":["_configPlugins","require","_gradleHelpers","_withAndroidModuleFiles","withBrownfieldAndroid","exports","config","props","androidConfig","android","withProjectBuildGradle","gradleConfig","modResults","contents","modifyRootBuildGradle","useLocalGradlePlugin","useLocalMaven","withAppBuildGradle","modifyAppBuildGradleMissingDimensionStrategy","missingDimensionStrategies","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,yBAQA,IAAAC,cAAA,CAAAD,OAAA,0BAKA,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,EA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SAAA,SACF,CAAC,CAEF,MAAO,CAAA9B,MAAM,CACf,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-alpha08';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.modifyAppBuildGradleMissingDimensionStrategy=modifyAppBuildGradleMissingDimensionStrategy;exports.modifyRootBuildGradle=modifyRootBuildGradle;exports.modifySettingsGradle=modifySettingsGradle;var _constants=require("./constants");var _logging=require("../../logging");var _formatHelpers=require("./formatHelpers");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
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:true});exports.modifyAppBuildGradleMissingDimensionStrategy=modifyAppBuildGradleMissingDimensionStrategy;exports.modifyRootBuildGradle=modifyRootBuildGradle;exports.modifySettingsGradle=modifySettingsGradle;var _constants=require("./constants");var _logging=require("../../logging");var _formatHelpers=require("./formatHelpers");var LOCAL_GRADLE_PLUGIN_INCLUDE_BUILD='includeBuild("../node_modules/@callstack/react-native-brownfield/gradle-plugin/brownfield")';var LOCAL_MAVEN_REPOSITORY='mavenLocal()';var BUILD_SCRIPT_BLOCK_NAME='buildscript';var ALL_PROJECTS_BLOCK_NAME='allprojects';function addMavenLocalToBlock(contents,blockName){var blockRepositoriesRegex=new RegExp(`(${blockName}\\s*\\{[\\s\\S]*?repositories\\s*\\{)`,'m');var mavenLocalRegex=new RegExp(`${blockName}\\s*\\{[\\s\\S]*?repositories\\s*\\{[\\s\\S]*?${LOCAL_MAVEN_REPOSITORY}`,'m');if(!blockRepositoriesRegex.test(contents)){return contents;}if(mavenLocalRegex.test(contents)){return contents;}return contents.replace(blockRepositoriesRegex,`$1\n\t\t${LOCAL_MAVEN_REPOSITORY}`);}function addMavenLocalRepositories(contents){var modifiedContents=contents;var initialContents=modifiedContents;modifiedContents=addMavenLocalToBlock(modifiedContents,BUILD_SCRIPT_BLOCK_NAME);modifiedContents=addMavenLocalToBlock(modifiedContents,ALL_PROJECTS_BLOCK_NAME);if(modifiedContents!==initialContents){_logging.Logger.logDebug('Added mavenLocal() to root build.gradle repositories');}return modifiedContents;}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,_ref$useLocalMaven=_ref.useLocalMaven,useLocalMaven=_ref$useLocalMaven===void 0?false:_ref$useLocalMaven;var updatedContents=contents;if(useLocalMaven){updatedContents=addMavenLocalRepositories(updatedContents);}if(useLocalGradlePlugin){_logging.Logger.logDebug('Skipping Maven Brownfield Gradle plugin classpath because useLocalGradlePlugin is enabled');return updatedContents;}if(updatedContents.includes('brownfield-gradle-plugin')){_logging.Logger.logDebug('Brownfield Gradle plugin already in root build.gradle, skipping');return updatedContents;}_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=updatedContents.match(buildscriptDepsRegex);if(!match){throw new Error('Could not locate buildscript block in root build.gradle');}var gradlePluginDependency=useLocalMaven?`classpath("com.callstack.react:brownfield-gradle-plugin:${_constants.BROWNFIELD_PLUGIN_VERSION}-SNAPSHOT")`:_constants.brownfieldGradlePluginDependency;var insertion=`\t${gradlePluginDependency}\n\t`;var modifiedContents=updatedContents.replace(buildscriptDepsRegex,`$1${insertion}$2`);_logging.Logger.logDebug('Added Brownfield Gradle plugin to root build.gradle');return modifiedContents;}function modifyAppBuildGradleMissingDimensionStrategy(contents,missingDimensionStrategies){var _match$1$match$,_match$1$match;if(missingDimensionStrategies.length<2){return contents;}_logging.Logger.logDebug('Modifying app build.gradle to add missingDimensionStrategy');var defaultConfigRegex=/^([ \t]*defaultConfig\s*\{)/m;var match=contents.match(defaultConfigRegex);if(!match){throw new Error('Could not locate defaultConfig block in app build.gradle');}var baseIndent=(_match$1$match$=(_match$1$match=match[1].match(/^[ \t]*/))==null?void 0:_match$1$match[0])!=null?_match$1$match$:'';var indentUnit=baseIndent.includes('\t')?'\t':' ';var args=(0,_formatHelpers.formatMissingDimensionStrategies)(missingDimensionStrategies);var missingStrategyLine=`missingDimensionStrategy(${args})`;if(contents.includes(missingStrategyLine)){_logging.Logger.logDebug('missingDimensionStrategy already present with same arguments, skipping');return contents;}var insertion=`\n${baseIndent}${indentUnit}${missingStrategyLine}`;return contents.replace(defaultConfigRegex,`$1${insertion}`);}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","_formatHelpers","LOCAL_GRADLE_PLUGIN_INCLUDE_BUILD","
|
|
1
|
+
{"version":3,"names":["_constants","require","_logging","_formatHelpers","LOCAL_GRADLE_PLUGIN_INCLUDE_BUILD","LOCAL_MAVEN_REPOSITORY","BUILD_SCRIPT_BLOCK_NAME","ALL_PROJECTS_BLOCK_NAME","addMavenLocalToBlock","contents","blockName","blockRepositoriesRegex","RegExp","mavenLocalRegex","test","replace","addMavenLocalRepositories","modifiedContents","initialContents","Logger","logDebug","modifyRootBuildGradle","_ref","arguments","length","undefined","_ref$useLocalGradlePl","useLocalGradlePlugin","_ref$useLocalMaven","useLocalMaven","updatedContents","includes","buildscriptDepsRegex","match","Error","gradlePluginDependency","BROWNFIELD_PLUGIN_VERSION","brownfieldGradlePluginDependency","insertion","modifyAppBuildGradleMissingDimensionStrategy","missingDimensionStrategies","_match$1$match$","_match$1$match","defaultConfigRegex","baseIndent","indentUnit","args","formatMissingDimensionStrategies","missingStrategyLine","addLocalGradlePluginIncludeBuild","pluginManagementMatch","index","insertIndex","slice","modifySettingsGradle","moduleName","_ref2","_ref2$useLocalGradleP","includeStatement"],"sourceRoot":"../../../../../src","sources":["expo-config-plugin/android/utils/gradleHelpers.ts"],"mappings":"iQAAA,IAAAA,UAAA,CAAAC,OAAA,gBAIA,IAAAC,QAAA,CAAAD,OAAA,kBACA,IAAAE,cAAA,CAAAF,OAAA,oBAEA,GAAM,CAAAG,iCAAiC,CACrC,6FAA6F,CAC/F,GAAM,CAAAC,sBAAsB,CAAG,cAAc,CAO7C,GAAM,CAAAC,uBAAuB,CAAG,aAAa,CAC7C,GAAM,CAAAC,uBAAuB,CAAG,aAAa,CAE7C,QAAS,CAAAC,oBAAoBA,CAACC,QAAgB,CAAEC,SAAiB,CAAU,CACzE,GAAM,CAAAC,sBAAsB,CAAG,GAAI,CAAAC,MAAM,CACvC,IAAIF,SAAS,uCAAuC,CACpD,GACF,CAAC,CACD,GAAM,CAAAG,eAAe,CAAG,GAAI,CAAAD,MAAM,CAChC,GAAGF,SAAS,iDAAiDL,sBAAsB,EAAE,CACrF,GACF,CAAC,CAED,GAAI,CAACM,sBAAsB,CAACG,IAAI,CAACL,QAAQ,CAAC,CAAE,CAC1C,MAAO,CAAAA,QAAQ,CACjB,CAEA,GAAII,eAAe,CAACC,IAAI,CAACL,QAAQ,CAAC,CAAE,CAClC,MAAO,CAAAA,QAAQ,CACjB,CAEA,MAAO,CAAAA,QAAQ,CAACM,OAAO,CACrBJ,sBAAsB,CACtB,WAAWN,sBAAsB,EACnC,CAAC,CACH,CAEA,QAAS,CAAAW,yBAAyBA,CAACP,QAAgB,CAAU,CAC3D,GAAI,C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B,oBAAoB,CAApBA,oBAAoB,CAAA8B,qBAAA,UAAG,KAAK,CAAAA,qBAAA,CAE9B,GAAI,CAAAxC,gBAAgB,CAAGR,QAAQ,CAE/B,GAAIkB,oBAAoB,CAAE,CACxBV,gBAAgB,CAAGgC,gCAAgC,CAAChC,gBAAgB,CAAC,CACvE,CAEA,GAAM,CAAAyC,gBAAgB,CAAG,aAAaH,UAAU,GAAG,CAGnD,GAAItC,gBAAgB,CAACc,QAAQ,CAAC2B,gBAAgB,CAAC,CAAE,CAC/CvC,eAAM,CAACC,QAAQ,CACb,WAAWmC,UAAU,wCACvB,CAAC,CACD,MAAO,CAAAtC,gBAAgB,CACzB,CAEAE,eAAM,CAACC,QAAQ,CACb,gDAAgDmC,UAAU,GAC5D,CAAC,CAGDtC,gBAAgB,CAAGA,gBAAgB,CAAG,KAAKyC,gBAAgB,IAAI,CAE/DvC,eAAM,CAACC,QAAQ,CAAC,iBAAiBmC,UAAU,sBAAsB,CAAC,CAElE,MAAO,CAAAtC,gBAAgB,CACzB","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,{useLocalGradlePlugin:androidConfig.useLocalGradlePlugin});return gradleConfig;});config=(0,_configPlugins.withAppBuildGradle)(config,function(gradleConfig){gradleConfig.modResults.contents=(0,_gradleHelpers.modifyAppBuildGradleMissingDimensionStrategy)(gradleConfig.modResults.contents,androidConfig.missingDimensionStrategies);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;};
|
|
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,useLocalMaven:androidConfig.useLocalMaven});return gradleConfig;});config=(0,_configPlugins.withAppBuildGradle)(config,function(gradleConfig){gradleConfig.modResults.contents=(0,_gradleHelpers.modifyAppBuildGradleMissingDimensionStrategy)(gradleConfig.modResults.contents,androidConfig.missingDimensionStrategies);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","useLocalGradlePlugin","withAppBuildGradle","modifyAppBuildGradleMissingDimensionStrategy","missingDimensionStrategies","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,yBAQA,IAAAC,cAAA,CAAAD,OAAA,0BAKA,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,
|
|
1
|
+
{"version":3,"names":["_configPlugins","require","_gradleHelpers","_withAndroidModuleFiles","withBrownfieldAndroid","exports","config","props","androidConfig","android","withProjectBuildGradle","gradleConfig","modResults","contents","modifyRootBuildGradle","useLocalGradlePlugin","useLocalMaven","withAppBuildGradle","modifyAppBuildGradleMissingDimensionStrategy","missingDimensionStrategies","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,yBAQA,IAAAC,cAAA,CAAAD,OAAA,0BAKA,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,CACEE,oBAAoB,CAAEP,aAAa,CAACO,oBAAoB,CACxDC,aAAa,CAAER,aAAa,CAACQ,aAC/B,CACF,CAAC,CAED,MAAO,CAAAL,YAAY,CACrB,CAAC,CAAC,CAGFL,MAAM,CAAG,GAAAW,iCAAkB,EAACX,MAAM,CAAE,SAACK,YAAY,CAAK,CACpDA,YAAY,CAACC,UAAU,CAACC,QAAQ,CAC9B,GAAAK,2DAA4C,EAC1CP,YAAY,CAACC,UAAU,CAACC,QAAQ,CAChCL,aAAa,CAACW,0BAChB,CAAC,CAEH,MAAO,CAAAR,YAAY,CACrB,CAAC,CAAC,CAGFL,MAAM,CAAG,GAAAc,iCAAkB,EAACd,MAAM,CAAE,SAACe,cAAc,CAAK,CACtDA,cAAc,CAACT,UAAU,CAACC,QAAQ,CAAG,GAAAS,mCAAoB,EACvDD,cAAc,CAACT,UAAU,CAACC,QAAQ,CAClCL,aAAa,CAACe,UAAU,CACxB,CAAER,oBAAoB,CAAEP,aAAa,CAACO,oBAAqB,CAC7D,CAAC,CAED,MAAO,CAAAM,cAAc,CACvB,CAAC,CAAC,CAGFf,MAAM,CAAG,GAAAkB,8CAAsB,EAAClB,MAAM,CAAEC,KAAK,CAAC,CAG9CD,MAAM,CAAG,GAAAmB,+BAAgB,EAACnB,MAAM,CAAE,CAChC,SAAS,iBAAAoB,IAAA,IAAAC,kBAAA,CAAAC,OAAA,EACT,UAAOC,eAAe,CAAK,CACzB,GAAAC,gEAAwC,EAAC,CACvCC,UAAU,CAAEF,eAAe,CAACG,UAAU,CAACC,mBAAmB,CAC1D3B,MAAM,CAAEC,KACV,CAAC,CAAC,CAEF,MAAO,CAAAsB,eAAe,CACxB,CAAC,kBAAAK,EAAA,SAAAR,IAAA,CAAAS,KAAA,MAAAC,SAAA,SACF,CAAC,CAEF,MAAO,CAAA9B,MAAM,CACf,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-alpha08";
|
|
2
|
+
export declare const brownfieldGradlePluginDependency = "classpath(\"com.callstack.react:brownfield-gradle-plugin:2.0.0-alpha08\")";
|
|
3
3
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
type GradleModificationOptions = {
|
|
2
2
|
useLocalGradlePlugin?: boolean;
|
|
3
|
+
useLocalMaven?: boolean;
|
|
3
4
|
};
|
|
4
5
|
/**
|
|
5
6
|
* Modifies the root build.gradle to add the Brownfield Gradle plugin dependency
|
|
6
7
|
* @param contents The original build.gradle content
|
|
7
8
|
* @returns The modified build.gradle content
|
|
8
9
|
*/
|
|
9
|
-
export declare function modifyRootBuildGradle(contents: string, { useLocalGradlePlugin }?: GradleModificationOptions): string;
|
|
10
|
+
export declare function modifyRootBuildGradle(contents: string, { useLocalGradlePlugin, useLocalMaven, }?: GradleModificationOptions): string;
|
|
10
11
|
/**
|
|
11
12
|
* Modifies the app build.gradle to add missingDimensionStrategy arguments
|
|
12
13
|
* @param contents The original app build.gradle content
|
|
@@ -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":"AAWA,KAAK,yBAAyB,GAAG;IAC/B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAiDF;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,MAAM,EAChB,EACE,oBAA4B,EAC5B,aAAqB,GACtB,GAAE,yBAA8B,GAChC,MAAM,CAgDR;AAED;;;;;GAKG;AACH,wBAAgB,4CAA4C,CAC1D,QAAQ,EAAE,MAAM,EAChB,0BAA0B,EAAE,MAAM,EAAE,GACnC,MAAM,CA6BR;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,EAKL,KAAK,YAAY,EAClB,MAAM,sBAAsB,CAAC;AAW9B,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,EAKL,KAAK,YAAY,EAClB,MAAM,sBAAsB,CAAC;AAW9B,OAAO,KAAK,EAAE,yCAAyC,EAAE,MAAM,UAAU,CAAC;AAE1E;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB,EAAE,YAAY,CAC9C,yCAAyC,CAwD1C,CAAC"}
|
|
@@ -49,7 +49,12 @@ export interface BrownfieldPluginAndroidConfig {
|
|
|
49
49
|
*/
|
|
50
50
|
useLocalGradlePlugin?: boolean;
|
|
51
51
|
/**
|
|
52
|
-
*
|
|
52
|
+
* Use the local Maven repository for Brownfield dependencies.
|
|
53
|
+
* @default false
|
|
54
|
+
*/
|
|
55
|
+
useLocalMaven?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Missing dimension strategies as dimension + flavor(s), e.g. "type, alpha".
|
|
53
58
|
* @default []
|
|
54
59
|
*/
|
|
55
60
|
missingDimensionStrategies?: string[];
|
|
@@ -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;IAEjB;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAE/B;;;OAGG;IACH,0BAA0B,CAAC,EAAE,MAAM,EAAE,CAAC;CACvC;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"}
|
|
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;IAE/B;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;OAGG;IACH,0BAA0B,CAAC,EAAE,MAAM,EAAE,CAAC;CACvC;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"}
|
|
@@ -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-alpha08";
|
|
2
|
+
export declare const brownfieldGradlePluginDependency = "classpath(\"com.callstack.react:brownfield-gradle-plugin:2.0.0-alpha08\")";
|
|
3
3
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
type GradleModificationOptions = {
|
|
2
2
|
useLocalGradlePlugin?: boolean;
|
|
3
|
+
useLocalMaven?: boolean;
|
|
3
4
|
};
|
|
4
5
|
/**
|
|
5
6
|
* Modifies the root build.gradle to add the Brownfield Gradle plugin dependency
|
|
6
7
|
* @param contents The original build.gradle content
|
|
7
8
|
* @returns The modified build.gradle content
|
|
8
9
|
*/
|
|
9
|
-
export declare function modifyRootBuildGradle(contents: string, { useLocalGradlePlugin }?: GradleModificationOptions): string;
|
|
10
|
+
export declare function modifyRootBuildGradle(contents: string, { useLocalGradlePlugin, useLocalMaven, }?: GradleModificationOptions): string;
|
|
10
11
|
/**
|
|
11
12
|
* Modifies the app build.gradle to add missingDimensionStrategy arguments
|
|
12
13
|
* @param contents The original app build.gradle content
|
|
@@ -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":"AAWA,KAAK,yBAAyB,GAAG;IAC/B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAiDF;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,MAAM,EAChB,EACE,oBAA4B,EAC5B,aAAqB,GACtB,GAAE,yBAA8B,GAChC,MAAM,CAgDR;AAED;;;;;GAKG;AACH,wBAAgB,4CAA4C,CAC1D,QAAQ,EAAE,MAAM,EAChB,0BAA0B,EAAE,MAAM,EAAE,GACnC,MAAM,CA6BR;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,EAKL,KAAK,YAAY,EAClB,MAAM,sBAAsB,CAAC;AAW9B,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,EAKL,KAAK,YAAY,EAClB,MAAM,sBAAsB,CAAC;AAW9B,OAAO,KAAK,EAAE,yCAAyC,EAAE,MAAM,UAAU,CAAC;AAE1E;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB,EAAE,YAAY,CAC9C,yCAAyC,CAwD1C,CAAC"}
|
|
@@ -49,7 +49,12 @@ export interface BrownfieldPluginAndroidConfig {
|
|
|
49
49
|
*/
|
|
50
50
|
useLocalGradlePlugin?: boolean;
|
|
51
51
|
/**
|
|
52
|
-
*
|
|
52
|
+
* Use the local Maven repository for Brownfield dependencies.
|
|
53
|
+
* @default false
|
|
54
|
+
*/
|
|
55
|
+
useLocalMaven?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Missing dimension strategies as dimension + flavor(s), e.g. "type, alpha".
|
|
53
58
|
* @default []
|
|
54
59
|
*/
|
|
55
60
|
missingDimensionStrategies?: string[];
|
|
@@ -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;IAEjB;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAE/B;;;OAGG;IACH,0BAA0B,CAAC,EAAE,MAAM,EAAE,CAAC;CACvC;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"}
|
|
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;IAE/B;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;OAGG;IACH,0BAA0B,CAAC,EAAE,MAAM,EAAE,CAAC;CACvC;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"}
|
package/package.json
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const BROWNFIELD_PLUGIN_VERSION = '2.0.0-
|
|
1
|
+
export const BROWNFIELD_PLUGIN_VERSION = '2.0.0-alpha08';
|
|
2
2
|
export const brownfieldGradlePluginDependency = `classpath("com.callstack.react:brownfield-gradle-plugin:${BROWNFIELD_PLUGIN_VERSION}")`;
|
|
@@ -1,14 +1,66 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
BROWNFIELD_PLUGIN_VERSION,
|
|
3
|
+
brownfieldGradlePluginDependency,
|
|
4
|
+
} from './constants';
|
|
2
5
|
import { Logger } from '../../logging';
|
|
3
6
|
import { formatMissingDimensionStrategies } from './formatHelpers';
|
|
4
7
|
|
|
5
8
|
const LOCAL_GRADLE_PLUGIN_INCLUDE_BUILD =
|
|
6
9
|
'includeBuild("../node_modules/@callstack/react-native-brownfield/gradle-plugin/brownfield")';
|
|
10
|
+
const LOCAL_MAVEN_REPOSITORY = 'mavenLocal()';
|
|
7
11
|
|
|
8
12
|
type GradleModificationOptions = {
|
|
9
13
|
useLocalGradlePlugin?: boolean;
|
|
14
|
+
useLocalMaven?: boolean;
|
|
10
15
|
};
|
|
11
16
|
|
|
17
|
+
const BUILD_SCRIPT_BLOCK_NAME = 'buildscript';
|
|
18
|
+
const ALL_PROJECTS_BLOCK_NAME = 'allprojects';
|
|
19
|
+
|
|
20
|
+
function addMavenLocalToBlock(contents: string, blockName: string): string {
|
|
21
|
+
const blockRepositoriesRegex = new RegExp(
|
|
22
|
+
`(${blockName}\\s*\\{[\\s\\S]*?repositories\\s*\\{)`,
|
|
23
|
+
'm'
|
|
24
|
+
);
|
|
25
|
+
const mavenLocalRegex = new RegExp(
|
|
26
|
+
`${blockName}\\s*\\{[\\s\\S]*?repositories\\s*\\{[\\s\\S]*?${LOCAL_MAVEN_REPOSITORY}`,
|
|
27
|
+
'm'
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
if (!blockRepositoriesRegex.test(contents)) {
|
|
31
|
+
return contents;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (mavenLocalRegex.test(contents)) {
|
|
35
|
+
return contents;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return contents.replace(
|
|
39
|
+
blockRepositoriesRegex,
|
|
40
|
+
`$1\n\t\t${LOCAL_MAVEN_REPOSITORY}`
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function addMavenLocalRepositories(contents: string): string {
|
|
45
|
+
let modifiedContents = contents;
|
|
46
|
+
|
|
47
|
+
const initialContents = modifiedContents;
|
|
48
|
+
modifiedContents = addMavenLocalToBlock(
|
|
49
|
+
modifiedContents,
|
|
50
|
+
BUILD_SCRIPT_BLOCK_NAME
|
|
51
|
+
);
|
|
52
|
+
modifiedContents = addMavenLocalToBlock(
|
|
53
|
+
modifiedContents,
|
|
54
|
+
ALL_PROJECTS_BLOCK_NAME
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
if (modifiedContents !== initialContents) {
|
|
58
|
+
Logger.logDebug('Added mavenLocal() to root build.gradle repositories');
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return modifiedContents;
|
|
62
|
+
}
|
|
63
|
+
|
|
12
64
|
/**
|
|
13
65
|
* Modifies the root build.gradle to add the Brownfield Gradle plugin dependency
|
|
14
66
|
* @param contents The original build.gradle content
|
|
@@ -16,21 +68,30 @@ type GradleModificationOptions = {
|
|
|
16
68
|
*/
|
|
17
69
|
export function modifyRootBuildGradle(
|
|
18
70
|
contents: string,
|
|
19
|
-
{
|
|
71
|
+
{
|
|
72
|
+
useLocalGradlePlugin = false,
|
|
73
|
+
useLocalMaven = false,
|
|
74
|
+
}: GradleModificationOptions = {}
|
|
20
75
|
): string {
|
|
76
|
+
let updatedContents = contents;
|
|
77
|
+
|
|
78
|
+
if (useLocalMaven) {
|
|
79
|
+
updatedContents = addMavenLocalRepositories(updatedContents);
|
|
80
|
+
}
|
|
81
|
+
|
|
21
82
|
if (useLocalGradlePlugin) {
|
|
22
83
|
Logger.logDebug(
|
|
23
84
|
'Skipping Maven Brownfield Gradle plugin classpath because useLocalGradlePlugin is enabled'
|
|
24
85
|
);
|
|
25
|
-
return
|
|
86
|
+
return updatedContents;
|
|
26
87
|
}
|
|
27
88
|
|
|
28
89
|
// check if already added
|
|
29
|
-
if (
|
|
90
|
+
if (updatedContents.includes('brownfield-gradle-plugin')) {
|
|
30
91
|
Logger.logDebug(
|
|
31
92
|
'Brownfield Gradle plugin already in root build.gradle, skipping'
|
|
32
93
|
);
|
|
33
|
-
return
|
|
94
|
+
return updatedContents;
|
|
34
95
|
}
|
|
35
96
|
|
|
36
97
|
Logger.logDebug(
|
|
@@ -40,15 +101,19 @@ export function modifyRootBuildGradle(
|
|
|
40
101
|
// find the buildscript dependencies block
|
|
41
102
|
const buildscriptDepsRegex =
|
|
42
103
|
/(buildscript\s*\{[\s\S]*?dependencies\s*\{[\s\S]*?)(})/m;
|
|
43
|
-
const match =
|
|
104
|
+
const match = updatedContents.match(buildscriptDepsRegex);
|
|
44
105
|
|
|
45
106
|
if (!match) {
|
|
46
107
|
throw new Error('Could not locate buildscript block in root build.gradle');
|
|
47
108
|
}
|
|
48
109
|
|
|
110
|
+
const gradlePluginDependency = useLocalMaven
|
|
111
|
+
? `classpath("com.callstack.react:brownfield-gradle-plugin:${BROWNFIELD_PLUGIN_VERSION}-SNAPSHOT")`
|
|
112
|
+
: brownfieldGradlePluginDependency;
|
|
113
|
+
|
|
49
114
|
// insert before the closing brace of dependencies
|
|
50
|
-
const insertion = `\t${
|
|
51
|
-
const modifiedContents =
|
|
115
|
+
const insertion = `\t${gradlePluginDependency}\n\t`;
|
|
116
|
+
const modifiedContents = updatedContents.replace(
|
|
52
117
|
buildscriptDepsRegex,
|
|
53
118
|
`$1${insertion}$2`
|
|
54
119
|
);
|
|
@@ -35,7 +35,10 @@ export const withBrownfieldAndroid: ConfigPlugin<
|
|
|
35
35
|
config = withProjectBuildGradle(config, (gradleConfig) => {
|
|
36
36
|
gradleConfig.modResults.contents = modifyRootBuildGradle(
|
|
37
37
|
gradleConfig.modResults.contents,
|
|
38
|
-
{
|
|
38
|
+
{
|
|
39
|
+
useLocalGradlePlugin: androidConfig.useLocalGradlePlugin,
|
|
40
|
+
useLocalMaven: androidConfig.useLocalMaven,
|
|
41
|
+
}
|
|
39
42
|
);
|
|
40
43
|
|
|
41
44
|
return gradleConfig;
|
|
@@ -58,7 +58,13 @@ export interface BrownfieldPluginAndroidConfig {
|
|
|
58
58
|
useLocalGradlePlugin?: boolean;
|
|
59
59
|
|
|
60
60
|
/**
|
|
61
|
-
*
|
|
61
|
+
* Use the local Maven repository for Brownfield dependencies.
|
|
62
|
+
* @default false
|
|
63
|
+
*/
|
|
64
|
+
useLocalMaven?: boolean;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Missing dimension strategies as dimension + flavor(s), e.g. "type, alpha".
|
|
62
68
|
* @default []
|
|
63
69
|
*/
|
|
64
70
|
missingDimensionStrategies?: string[];
|