@callstack/react-native-brownfield 4.1.0 → 4.3.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/android/build.gradle +1 -0
- package/android/consumer-rules.pro +11 -0
- 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/withAndroidModuleFiles.js +1 -1
- package/lib/commonjs/expo-config-plugin/android/withAndroidModuleFiles.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/template/android/build.gradle.kts +1 -1
- package/lib/commonjs/expo-config-plugin/template/android/proguard-rules.pro +11 -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/withAndroidModuleFiles.js +1 -1
- package/lib/module/expo-config-plugin/android/withAndroidModuleFiles.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/template/android/build.gradle.kts +1 -1
- package/lib/module/expo-config-plugin/template/android/proguard-rules.pro +11 -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/withAndroidModuleFiles.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/withAndroidModuleFiles.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/withAndroidModuleFiles.ts +9 -1
- package/src/expo-config-plugin/android/withBrownfieldAndroid.ts +4 -1
- package/src/expo-config-plugin/template/android/build.gradle.kts +1 -1
- package/src/expo-config-plugin/template/android/proguard-rules.pro +11 -1
- package/src/expo-config-plugin/types/android/BrownfieldPluginAndroidConfig.ts +7 -1
package/android/build.gradle
CHANGED
|
@@ -74,6 +74,7 @@ android {
|
|
|
74
74
|
defaultConfig {
|
|
75
75
|
minSdkVersion getExtOrIntegerDefault("minSdkVersion")
|
|
76
76
|
targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
|
|
77
|
+
consumerProguardFiles "consumer-rules.pro"
|
|
77
78
|
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
|
|
78
79
|
buildConfigField "boolean", "IS_HERMES_ENABLED", isHermesEnabled().toString()
|
|
79
80
|
buildConfigField "String", "RN_VERSION", "\"$reactNativeVersion\""
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
-keep class com.callstack.reactnativebrownfield.ReactNativeBrownfield { *; }
|
|
2
|
+
-keep class com.callstack.reactnativebrownfield.ReactNativeBrownfield$Companion { *; }
|
|
3
|
+
-keep interface com.callstack.reactnativebrownfield.OnJSBundleLoaded { *; }
|
|
4
|
+
-keep interface com.callstack.reactnativebrownfield.OnMessageListener { *; }
|
|
5
|
+
-keep class com.callstack.reactnativebrownfield.ReactNativeFragment { *; }
|
|
6
|
+
-keep class com.callstack.reactnativebrownfield.ReactNativeFragment$Companion { *; }
|
|
7
|
+
-keep class com.callstack.reactnativebrownfield.ReactDelegateWrapper { *; }
|
|
8
|
+
-keep class com.callstack.reactnativebrownfield.ReactNativeBrownfieldPackage { *; }
|
|
9
|
+
-keep class com.callstack.reactnativebrownfield.ReactNativeBrownfieldModule { *; }
|
|
10
|
+
-keep class com.callstack.reactnativebrownfield.constants.ReactNativeFragmentArgNames { *; }
|
|
11
|
+
-keep class com.callstack.reactnativebrownfield.constants.ReactNativeFragmentArgNames$Companion { *; }
|
|
@@ -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","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c,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.createAndroidModule=createAndroidModule;exports.resolveCompileSdkVersionExpression=resolveCompileSdkVersionExpression;exports.resolveTargetSdkVersionExpression=resolveTargetSdkVersionExpression;exports.syncAndroidModuleExpoUpdatesFromAppFiles=syncAndroidModuleExpoUpdatesFromAppFiles;exports.syncAndroidModuleManifest=syncAndroidModuleManifest;exports.syncAndroidModuleStringResources=syncAndroidModuleStringResources;exports.withAndroidModuleFiles=void 0;var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var fs=_interopRequireWildcard(require("node:fs"));var path=_interopRequireWildcard(require("node:path"));var _configPlugins=require("@expo/config-plugins");var _logging=require("../logging");var _engine=require("../template/engine");var _androidManifest=require("./utils/androidManifest");var _expoUpdates=require("./utils/expo-updates");var _hermes=require("./utils/hermes");var _formatHelpers=require("./utils/formatHelpers");function _interopRequireWildcard(e,t){if("function"==typeof WeakMap)var r=new WeakMap(),n=new WeakMap();return(_interopRequireWildcard=function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;var o,i,f={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return f;if(o=t?n:r){if(o.has(e))return o.get(e);o.set(e,f);}for(var _t in e)"default"!==_t&&{}.hasOwnProperty.call(e,_t)&&((i=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,_t))&&(i.get||i.set)?o(f,_t,i):f[_t]=e[_t]);return f;})(e,t);}function renderMissingDimensionStrategyBlock(missingDimensionStrategies){if(missingDimensionStrategies.length<2){return'';}var args=(0,_formatHelpers.formatMissingDimensionStrategies)(missingDimensionStrategies);return` missingDimensionStrategy(${args})`;}function resolveCompileSdkVersionExpression(config){if(config.android.compileSdkVersion!=null){return config.android.compileSdkVersion.toString();}return'resolveRootProjectInt("compileSdkVersion")';}function resolveTargetSdkVersionExpression(config){if(config.android.targetSdkVersion!=null){return config.android.targetSdkVersion.toString();}return'resolveRootProjectInt("targetSdkVersion")';}function createAndroidModule(_ref){var androidDir=_ref.androidDir,config=_ref.config,rnVersion=_ref.rnVersion,projectRoot=_ref.projectRoot;var android=config.android;var moduleDir=path.join(androidDir,android.moduleName);_logging.Logger.logDebug(`Creating Android module in: ${androidDir}`);var hermesArtifact=(0,_hermes.getHermesArtifact)(rnVersion,projectRoot);var compileSdkVersionExpression=resolveCompileSdkVersionExpression(config);var targetSdkVersionExpression=resolveTargetSdkVersionExpression(config);_logging.Logger.logDebug(`Resolved Hermes artifact: ${hermesArtifact.groupId}:${hermesArtifact.artifactId}:${hermesArtifact.version}`);var missingDimensionStrategiesList=(0,_formatHelpers.formatMissingDimensionStrategies)(android.missingDimensionStrategies);var missingDimensionStrategyBlock=renderMissingDimensionStrategyBlock(android.missingDimensionStrategies);var files=[{relativePath:'build.gradle.kts',content:(0,_engine.renderTemplate)('android','build.gradle.kts',{'{{PACKAGE_NAME}}':android.packageName,'{{MIN_SDK_VERSION}}':android.minSdkVersion.toString(),'{{TARGET_SDK_VERSION}}':targetSdkVersionExpression,'{{COMPILE_SDK_VERSION}}':compileSdkVersionExpression,'{{GROUP_ID}}':android.groupId,'{{ARTIFACT_ID}}':android.artifactId,'{{ARTIFACT_VERSION}}':android.version,'{{RN_VERSION}}':rnVersion,'{{HERMES_ARTIFACT}}':`${hermesArtifact.groupId}:${hermesArtifact.artifactId}:${hermesArtifact.version}`,'{{MISSING_DIMENSION_STRATEGIES}}':missingDimensionStrategiesList,'{{MISSING_DIMENSION_STRATEGY_BLOCK}}':missingDimensionStrategyBlock})},{relativePath:'gradle.properties',content:(0,_engine.renderTemplate)('android','gradle.properties',{})},{relativePath:`src/main/java/${config.android.packageName.replace(/\./g,'/')}/ReactNativeHostManager.kt`,content:(0,_engine.renderTemplate)('android','ReactNativeHostManager.post55.kt',{'{{PACKAGE_NAME}}':android.packageName})},{relativePath:'consumer-rules.pro',content:(0,_engine.renderTemplate)('android','consumer-rules.pro',{})},{relativePath:'proguard-rules.pro',content:(0,_engine.renderTemplate)('android','proguard-rules.pro',{})}];for(var file of files){var filePath=path.join(moduleDir,file.relativePath);var fileDir=path.dirname(filePath);if(!fs.existsSync(fileDir)){fs.mkdirSync(fileDir,{recursive:true});}fs.writeFileSync(filePath,file.content,'utf8');_logging.Logger.logDebug(`Created file: ${filePath}`);}syncAndroidModuleExpoUpdatesFromAppFiles({androidDir:androidDir,config:config});_logging.Logger.logDebug(`Android module "${android.moduleName}" created at ${moduleDir}`);}function syncAndroidModuleManifest(_ref2){var androidDir=_ref2.androidDir,config=_ref2.config,expoUpdatesMetaData=_ref2.expoUpdatesMetaData;writeAndroidModuleFile(path.join(androidDir,config.android.moduleName),'src/main/AndroidManifest.xml',(0,_engine.renderTemplate)('android','AndroidManifest.xml',{'{{APPLICATION_BLOCK}}':(0,_androidManifest.renderLibraryManifestApplication)(expoUpdatesMetaData)}));}function syncAndroidModuleStringResources(_ref3){var androidDir=_ref3.androidDir,config=_ref3.config,expoUpdatesStringResources=_ref3.expoUpdatesStringResources;writeAndroidModuleFile(path.join(androidDir,config.android.moduleName),'src/main/res/values/strings.xml',(0,_engine.renderTemplate)('android','strings.xml',{'{{STRING_RESOURCES}}':(0,_androidManifest.renderLibraryStringResources)(expoUpdatesStringResources)}));}function writeAndroidModuleFile(moduleDir,relativePath,content){var filePath=path.join(moduleDir,relativePath);var fileDir=path.dirname(filePath);if(!fs.existsSync(fileDir)){fs.mkdirSync(fileDir,{recursive:true});}fs.writeFileSync(filePath,content,'utf8');_logging.Logger.logDebug(`Created file: ${filePath}`);}function syncAndroidModuleExpoUpdatesFromAppFiles(_ref4){var androidDir=_ref4.androidDir,config=_ref4.config;var appModuleName='app';var expoUpdatesMetaData=(0,_expoUpdates.readExpoUpdatesApplicationMetaData)(androidDir,appModuleName);var expoUpdatesStringResources=(0,_expoUpdates.readExpoUpdatesStringResources)(androidDir,appModuleName,expoUpdatesMetaData);syncAndroidModuleManifest({androidDir:androidDir,config:config,expoUpdatesMetaData:expoUpdatesMetaData});syncAndroidModuleStringResources({androidDir:androidDir,config:config,expoUpdatesStringResources:expoUpdatesStringResources});}var withAndroidModuleFiles=exports.withAndroidModuleFiles=function withAndroidModuleFiles(config,props){return(0,_configPlugins.withDangerousMod)(config,['android',(function(){var _ref5=(0,_asyncToGenerator2.default)(function*(dangerousConfig){var androidDir=path.join(dangerousConfig.modRequest.projectRoot,'android');var rnVersion;try{var rnPkgPath=require.resolve('react-native/package.json',{paths:[dangerousConfig.modRequest.projectRoot]});var rnPkg=require(rnPkgPath);rnVersion=rnPkg.version;_logging.Logger.logDebug(`Resolved react-native version: ${rnVersion}`);}catch(_unused){throw new Error('Could not resolve react-native package version. Please ensure you have installed dependencies.');}createAndroidModule({androidDir:androidDir,config:props,rnVersion:rnVersion,projectRoot:dangerousConfig.modRequest.projectRoot});return dangerousConfig;});return function(_x){return _ref5.apply(this,arguments);};}())]);};
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.createAndroidModule=createAndroidModule;exports.resolveCompileSdkVersionExpression=resolveCompileSdkVersionExpression;exports.resolveTargetSdkVersionExpression=resolveTargetSdkVersionExpression;exports.syncAndroidModuleExpoUpdatesFromAppFiles=syncAndroidModuleExpoUpdatesFromAppFiles;exports.syncAndroidModuleManifest=syncAndroidModuleManifest;exports.syncAndroidModuleStringResources=syncAndroidModuleStringResources;exports.withAndroidModuleFiles=void 0;var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var fs=_interopRequireWildcard(require("node:fs"));var path=_interopRequireWildcard(require("node:path"));var _configPlugins=require("@expo/config-plugins");var _logging=require("../logging");var _engine=require("../template/engine");var _androidManifest=require("./utils/androidManifest");var _expoUpdates=require("./utils/expo-updates");var _hermes=require("./utils/hermes");var _formatHelpers=require("./utils/formatHelpers");function _interopRequireWildcard(e,t){if("function"==typeof WeakMap)var r=new WeakMap(),n=new WeakMap();return(_interopRequireWildcard=function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;var o,i,f={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return f;if(o=t?n:r){if(o.has(e))return o.get(e);o.set(e,f);}for(var _t in e)"default"!==_t&&{}.hasOwnProperty.call(e,_t)&&((i=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,_t))&&(i.get||i.set)?o(f,_t,i):f[_t]=e[_t]);return f;})(e,t);}function renderMissingDimensionStrategyBlock(missingDimensionStrategies){if(missingDimensionStrategies.length<2){return'';}var args=(0,_formatHelpers.formatMissingDimensionStrategies)(missingDimensionStrategies);return` missingDimensionStrategy(${args})`;}function resolveCompileSdkVersionExpression(config){if(config.android.compileSdkVersion!=null){return config.android.compileSdkVersion.toString();}return'resolveRootProjectInt("compileSdkVersion")';}function resolveTargetSdkVersionExpression(config){if(config.android.targetSdkVersion!=null){return config.android.targetSdkVersion.toString();}return'resolveRootProjectInt("targetSdkVersion")';}function createAndroidModule(_ref){var _minifyEnabled,_extraProguardRules;var androidDir=_ref.androidDir,config=_ref.config,rnVersion=_ref.rnVersion,projectRoot=_ref.projectRoot;var android=config.android;var moduleDir=path.join(androidDir,android.moduleName);_logging.Logger.logDebug(`Creating Android module in: ${androidDir}`);var hermesArtifact=(0,_hermes.getHermesArtifact)(rnVersion,projectRoot);var compileSdkVersionExpression=resolveCompileSdkVersionExpression(config);var targetSdkVersionExpression=resolveTargetSdkVersionExpression(config);var minifyEnabled=(_minifyEnabled=android.minifyEnabled)!=null?_minifyEnabled:false;var extraProguardRules=(_extraProguardRules=android.extraProguardRules)!=null?_extraProguardRules:[];var extraProguardRulesText=extraProguardRules.join('\n');_logging.Logger.logDebug(`Resolved Hermes artifact: ${hermesArtifact.groupId}:${hermesArtifact.artifactId}:${hermesArtifact.version}`);var missingDimensionStrategiesList=(0,_formatHelpers.formatMissingDimensionStrategies)(android.missingDimensionStrategies);var missingDimensionStrategyBlock=renderMissingDimensionStrategyBlock(android.missingDimensionStrategies);var files=[{relativePath:'build.gradle.kts',content:(0,_engine.renderTemplate)('android','build.gradle.kts',{'{{PACKAGE_NAME}}':android.packageName,'{{MIN_SDK_VERSION}}':android.minSdkVersion.toString(),'{{TARGET_SDK_VERSION}}':targetSdkVersionExpression,'{{COMPILE_SDK_VERSION}}':compileSdkVersionExpression,'{{GROUP_ID}}':android.groupId,'{{ARTIFACT_ID}}':android.artifactId,'{{ARTIFACT_VERSION}}':android.version,'{{RN_VERSION}}':rnVersion,'{{HERMES_ARTIFACT}}':`${hermesArtifact.groupId}:${hermesArtifact.artifactId}:${hermesArtifact.version}`,'{{IS_MINIFY_ENABLED}}':minifyEnabled.toString(),'{{MISSING_DIMENSION_STRATEGIES}}':missingDimensionStrategiesList,'{{MISSING_DIMENSION_STRATEGY_BLOCK}}':missingDimensionStrategyBlock})},{relativePath:'gradle.properties',content:(0,_engine.renderTemplate)('android','gradle.properties',{})},{relativePath:`src/main/java/${config.android.packageName.replace(/\./g,'/')}/ReactNativeHostManager.kt`,content:(0,_engine.renderTemplate)('android','ReactNativeHostManager.post55.kt',{'{{PACKAGE_NAME}}':android.packageName})},{relativePath:'consumer-rules.pro',content:(0,_engine.renderTemplate)('android','consumer-rules.pro',{})},{relativePath:'proguard-rules.pro',content:(0,_engine.renderTemplate)('android','proguard-rules.pro',{'{{EXTRA_PROGUARD_RULES}}':extraProguardRulesText})}];for(var file of files){var filePath=path.join(moduleDir,file.relativePath);var fileDir=path.dirname(filePath);if(!fs.existsSync(fileDir)){fs.mkdirSync(fileDir,{recursive:true});}fs.writeFileSync(filePath,file.content,'utf8');_logging.Logger.logDebug(`Created file: ${filePath}`);}syncAndroidModuleExpoUpdatesFromAppFiles({androidDir:androidDir,config:config});_logging.Logger.logDebug(`Android module "${android.moduleName}" created at ${moduleDir}`);}function syncAndroidModuleManifest(_ref2){var androidDir=_ref2.androidDir,config=_ref2.config,expoUpdatesMetaData=_ref2.expoUpdatesMetaData;writeAndroidModuleFile(path.join(androidDir,config.android.moduleName),'src/main/AndroidManifest.xml',(0,_engine.renderTemplate)('android','AndroidManifest.xml',{'{{APPLICATION_BLOCK}}':(0,_androidManifest.renderLibraryManifestApplication)(expoUpdatesMetaData)}));}function syncAndroidModuleStringResources(_ref3){var androidDir=_ref3.androidDir,config=_ref3.config,expoUpdatesStringResources=_ref3.expoUpdatesStringResources;writeAndroidModuleFile(path.join(androidDir,config.android.moduleName),'src/main/res/values/strings.xml',(0,_engine.renderTemplate)('android','strings.xml',{'{{STRING_RESOURCES}}':(0,_androidManifest.renderLibraryStringResources)(expoUpdatesStringResources)}));}function writeAndroidModuleFile(moduleDir,relativePath,content){var filePath=path.join(moduleDir,relativePath);var fileDir=path.dirname(filePath);if(!fs.existsSync(fileDir)){fs.mkdirSync(fileDir,{recursive:true});}fs.writeFileSync(filePath,content,'utf8');_logging.Logger.logDebug(`Created file: ${filePath}`);}function syncAndroidModuleExpoUpdatesFromAppFiles(_ref4){var androidDir=_ref4.androidDir,config=_ref4.config;var appModuleName='app';var expoUpdatesMetaData=(0,_expoUpdates.readExpoUpdatesApplicationMetaData)(androidDir,appModuleName);var expoUpdatesStringResources=(0,_expoUpdates.readExpoUpdatesStringResources)(androidDir,appModuleName,expoUpdatesMetaData);syncAndroidModuleManifest({androidDir:androidDir,config:config,expoUpdatesMetaData:expoUpdatesMetaData});syncAndroidModuleStringResources({androidDir:androidDir,config:config,expoUpdatesStringResources:expoUpdatesStringResources});}var withAndroidModuleFiles=exports.withAndroidModuleFiles=function withAndroidModuleFiles(config,props){return(0,_configPlugins.withDangerousMod)(config,['android',(function(){var _ref5=(0,_asyncToGenerator2.default)(function*(dangerousConfig){var androidDir=path.join(dangerousConfig.modRequest.projectRoot,'android');var rnVersion;try{var rnPkgPath=require.resolve('react-native/package.json',{paths:[dangerousConfig.modRequest.projectRoot]});var rnPkg=require(rnPkgPath);rnVersion=rnPkg.version;_logging.Logger.logDebug(`Resolved react-native version: ${rnVersion}`);}catch(_unused){throw new Error('Could not resolve react-native package version. Please ensure you have installed dependencies.');}createAndroidModule({androidDir:androidDir,config:props,rnVersion:rnVersion,projectRoot:dangerousConfig.modRequest.projectRoot});return dangerousConfig;});return function(_x){return _ref5.apply(this,arguments);};}())]);};
|
|
2
2
|
//# sourceMappingURL=withAndroidModuleFiles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["fs","_interopRequireWildcard","require","path","_configPlugins","_logging","_engine","_androidManifest","_expoUpdates","_hermes","_formatHelpers","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","renderMissingDimensionStrategyBlock","missingDimensionStrategies","length","args","formatMissingDimensionStrategies","resolveCompileSdkVersionExpression","config","android","compileSdkVersion","toString","resolveTargetSdkVersionExpression","targetSdkVersion","createAndroidModule","_ref","androidDir","rnVersion","projectRoot","moduleDir","join","moduleName","Logger","logDebug","hermesArtifact","getHermesArtifact","compileSdkVersionExpression","targetSdkVersionExpression","groupId","artifactId","version","missingDimensionStrategiesList","missingDimensionStrategyBlock","files","relativePath","content","renderTemplate","packageName","minSdkVersion","replace","file","filePath","fileDir","dirname","existsSync","mkdirSync","recursive","writeFileSync","syncAndroidModuleExpoUpdatesFromAppFiles","syncAndroidModuleManifest","_ref2","expoUpdatesMetaData","writeAndroidModuleFile","renderLibraryManifestApplication","syncAndroidModuleStringResources","_ref3","expoUpdatesStringResources","renderLibraryStringResources","_ref4","appModuleName","readExpoUpdatesApplicationMetaData","readExpoUpdatesStringResources","withAndroidModuleFiles","exports","props","withDangerousMod","_ref5","_asyncToGenerator2","dangerousConfig","modRequest","rnPkgPath","resolve","paths","rnPkg","_unused","Error","_x","apply","arguments"],"sourceRoot":"../../../../src","sources":["expo-config-plugin/android/withAndroidModuleFiles.ts"],"mappings":"8rBAAA,IAAAA,EAAA,CAAAC,uBAAA,CAAAC,OAAA,aACA,IAAAC,IAAA,CAAAF,uBAAA,CAAAC,OAAA,eAEA,IAAAE,cAAA,CAAAF,OAAA,yBAMA,IAAAG,QAAA,CAAAH,OAAA,eACA,IAAAI,OAAA,CAAAJ,OAAA,uBACA,IAAAK,gBAAA,CAAAL,OAAA,4BAMA,IAAAM,YAAA,CAAAN,OAAA,yBAIA,IAAAO,OAAA,CAAAP,OAAA,mBACA,IAAAQ,cAAA,CAAAR,OAAA,0BAAyE,SAAAD,wBAAAU,CAAA,CAAAC,CAAA,wBAAAC,OAAA,KAAAC,CAAA,KAAAD,OAAA,GAAAE,CAAA,KAAAF,OAAA,UAAAZ,uBAAA,UAAAA,wBAAAU,CAAA,CAAAC,CAAA,MAAAA,CAAA,EAAAD,CAAA,EAAAA,CAAA,CAAAK,UAAA,QAAAL,CAAA,KAAAM,CAAA,CAAAC,CAAA,CAAAC,CAAA,EAAAC,SAAA,MAAAC,OAAA,CAAAV,CAAA,YAAAA,CAAA,mBAAAA,CAAA,qBAAAA,CAAA,QAAAQ,CAAA,IAAAF,CAAA,CAAAL,CAAA,CAAAG,CAAA,CAAAD,CAAA,KAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,SAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,CAAAM,CAAA,EAAAO,GAAA,CAAAb,CAAA,CAAAQ,CAAA,WAAAM,EAAA,IAAAd,CAAA,aAAAc,EAAA,KAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,CAAAc,EAAA,KAAAP,CAAA,EAAAD,CAAA,CAAAW,MAAA,CAAAC,cAAA,GAAAD,MAAA,CAAAE,wBAAA,CAAAnB,CAAA,CAAAc,EAAA,KAAAP,CAAA,CAAAK,GAAA,EAAAL,CAAA,CAAAM,GAAA,EAAAP,CAAA,CAAAE,CAAA,CAAAM,EAAA,CAAAP,CAAA,EAAAC,CAAA,CAAAM,EAAA,EAAAd,CAAA,CAAAc,EAAA,UAAAN,CAAA,IAAAR,CAAA,CAAAC,CAAA,GAEzE,QAAS,CAAAmB,mCAAmCA,CAC1CC,0BAAoC,CAC5B,CACR,GAAIA,0BAA0B,CAACC,MAAM,CAAG,CAAC,CAAE,CACzC,MAAO,EAAE,CACX,CAEA,GAAM,CAAAC,IAAI,CAAG,GAAAC,+CAAgC,EAACH,0BAA0B,CAAC,CACzE,MAAO,oCAAoCE,IAAI,GAAG,CACpD,CAEO,QAAS,CAAAE,kCAAkCA,CAChDC,MAAiD,CACzC,CACR,GAAIA,MAAM,CAACC,OAAO,CAACC,iBAAiB,EAAI,IAAI,CAAE,CAC5C,MAAO,CAAAF,MAAM,CAACC,OAAO,CAACC,iBAAiB,CAACC,QAAQ,CAAC,CAAC,CACpD,CAEA,MAAO,4CAA4C,CACrD,CAEO,QAAS,CAAAC,iCAAiCA,CAC/CJ,MAAiD,CACzC,CACR,GAAIA,MAAM,CAACC,OAAO,CAACI,gBAAgB,EAAI,IAAI,CAAE,CAC3C,MAAO,CAAAL,MAAM,CAACC,OAAO,CAACI,gBAAgB,CAACF,QAAQ,CAAC,CAAC,CACnD,CAEA,MAAO,2CAA2C,CACpD,CAKO,QAAS,CAAAG,mBAAmBA,CAAAC,IAAA,CAwB1B,IAvBP,CAAAC,UAAU,
|
|
1
|
+
{"version":3,"names":["fs","_interopRequireWildcard","require","path","_configPlugins","_logging","_engine","_androidManifest","_expoUpdates","_hermes","_formatHelpers","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","renderMissingDimensionStrategyBlock","missingDimensionStrategies","length","args","formatMissingDimensionStrategies","resolveCompileSdkVersionExpression","config","android","compileSdkVersion","toString","resolveTargetSdkVersionExpression","targetSdkVersion","createAndroidModule","_ref","_minifyEnabled","_extraProguardRules","androidDir","rnVersion","projectRoot","moduleDir","join","moduleName","Logger","logDebug","hermesArtifact","getHermesArtifact","compileSdkVersionExpression","targetSdkVersionExpression","minifyEnabled","extraProguardRules","extraProguardRulesText","groupId","artifactId","version","missingDimensionStrategiesList","missingDimensionStrategyBlock","files","relativePath","content","renderTemplate","packageName","minSdkVersion","replace","file","filePath","fileDir","dirname","existsSync","mkdirSync","recursive","writeFileSync","syncAndroidModuleExpoUpdatesFromAppFiles","syncAndroidModuleManifest","_ref2","expoUpdatesMetaData","writeAndroidModuleFile","renderLibraryManifestApplication","syncAndroidModuleStringResources","_ref3","expoUpdatesStringResources","renderLibraryStringResources","_ref4","appModuleName","readExpoUpdatesApplicationMetaData","readExpoUpdatesStringResources","withAndroidModuleFiles","exports","props","withDangerousMod","_ref5","_asyncToGenerator2","dangerousConfig","modRequest","rnPkgPath","resolve","paths","rnPkg","_unused","Error","_x","apply","arguments"],"sourceRoot":"../../../../src","sources":["expo-config-plugin/android/withAndroidModuleFiles.ts"],"mappings":"8rBAAA,IAAAA,EAAA,CAAAC,uBAAA,CAAAC,OAAA,aACA,IAAAC,IAAA,CAAAF,uBAAA,CAAAC,OAAA,eAEA,IAAAE,cAAA,CAAAF,OAAA,yBAMA,IAAAG,QAAA,CAAAH,OAAA,eACA,IAAAI,OAAA,CAAAJ,OAAA,uBACA,IAAAK,gBAAA,CAAAL,OAAA,4BAMA,IAAAM,YAAA,CAAAN,OAAA,yBAIA,IAAAO,OAAA,CAAAP,OAAA,mBACA,IAAAQ,cAAA,CAAAR,OAAA,0BAAyE,SAAAD,wBAAAU,C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AU,CAACtD,WAAW,CAChD,CAAC,CAAC,CAEF,GAAM,CAAA0D,KAAK,CAAGzG,OAAO,CAACsG,SAAS,CAAC,CAEhCxD,SAAS,CAAG2D,KAAK,CAAC3C,OAAO,CAEzBX,eAAM,CAACC,QAAQ,CAAC,kCAAkCN,SAAS,EAAE,CAAC,CAChE,CAAE,MAAA4D,OAAA,CAAM,CACN,KAAM,IAAI,CAAAC,KAAK,CACb,gGACF,CAAC,CACH,CAEAlE,mBAAmB,CAAC,CAClBI,UAAU,CAAVA,UAAU,CACVV,MAAM,CAAE6D,KAAK,CACblD,SAAS,CAATA,SAAS,CACTC,WAAW,CAAEqD,eAAe,CAACC,UAAU,CAACtD,WAC1C,CAAC,CAAC,CAEF,MAAO,CAAAqD,eAAe,CACxB,CAAC,kBAAAQ,EAAA,SAAAV,KAAA,CAAAW,KAAA,MAAAC,SAAA,SACF,CAAC,CACJ,CAAC","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":[]}
|
|
@@ -18,4 +18,14 @@
|
|
|
18
18
|
|
|
19
19
|
# If you keep the line number information, uncomment this to
|
|
20
20
|
# hide the original source file name.
|
|
21
|
-
#-renamesourcefileattribute SourceFile
|
|
21
|
+
#-renamesourcefileattribute SourceFile
|
|
22
|
+
-dontwarn com.google.android.material.R$attr
|
|
23
|
+
-dontwarn com.google.android.material.R$dimen
|
|
24
|
+
-dontwarn com.google.android.material.R$id
|
|
25
|
+
-dontwarn com.google.android.material.R$style
|
|
26
|
+
-dontwarn java.lang.invoke.StringConcatFactory
|
|
27
|
+
|
|
28
|
+
# Public API consumed from the Brownfield AAR.
|
|
29
|
+
-keep class com.callstack.rnbrownfield.demo.expoapp56.ReactNativeHostManager { *; }
|
|
30
|
+
|
|
31
|
+
{{EXTRA_PROGUARD_RULES}}
|
|
@@ -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,CAAAQ,gBAAgB,CAAGR,QAAQ,CAE/B,GA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A,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.createAndroidModule=createAndroidModule;exports.resolveCompileSdkVersionExpression=resolveCompileSdkVersionExpression;exports.resolveTargetSdkVersionExpression=resolveTargetSdkVersionExpression;exports.syncAndroidModuleExpoUpdatesFromAppFiles=syncAndroidModuleExpoUpdatesFromAppFiles;exports.syncAndroidModuleManifest=syncAndroidModuleManifest;exports.syncAndroidModuleStringResources=syncAndroidModuleStringResources;exports.withAndroidModuleFiles=void 0;var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var fs=_interopRequireWildcard(require("node:fs"));var path=_interopRequireWildcard(require("node:path"));var _configPlugins=require("@expo/config-plugins");var _logging=require("../logging");var _engine=require("../template/engine");var _androidManifest=require("./utils/androidManifest");var _expoUpdates=require("./utils/expo-updates");var _hermes=require("./utils/hermes");var _formatHelpers=require("./utils/formatHelpers");function _interopRequireWildcard(e,t){if("function"==typeof WeakMap)var r=new WeakMap(),n=new WeakMap();return(_interopRequireWildcard=function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;var o,i,f={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return f;if(o=t?n:r){if(o.has(e))return o.get(e);o.set(e,f);}for(var _t in e)"default"!==_t&&{}.hasOwnProperty.call(e,_t)&&((i=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,_t))&&(i.get||i.set)?o(f,_t,i):f[_t]=e[_t]);return f;})(e,t);}function renderMissingDimensionStrategyBlock(missingDimensionStrategies){if(missingDimensionStrategies.length<2){return'';}var args=(0,_formatHelpers.formatMissingDimensionStrategies)(missingDimensionStrategies);return` missingDimensionStrategy(${args})`;}function resolveCompileSdkVersionExpression(config){if(config.android.compileSdkVersion!=null){return config.android.compileSdkVersion.toString();}return'resolveRootProjectInt("compileSdkVersion")';}function resolveTargetSdkVersionExpression(config){if(config.android.targetSdkVersion!=null){return config.android.targetSdkVersion.toString();}return'resolveRootProjectInt("targetSdkVersion")';}function createAndroidModule(_ref){var androidDir=_ref.androidDir,config=_ref.config,rnVersion=_ref.rnVersion,projectRoot=_ref.projectRoot;var android=config.android;var moduleDir=path.join(androidDir,android.moduleName);_logging.Logger.logDebug(`Creating Android module in: ${androidDir}`);var hermesArtifact=(0,_hermes.getHermesArtifact)(rnVersion,projectRoot);var compileSdkVersionExpression=resolveCompileSdkVersionExpression(config);var targetSdkVersionExpression=resolveTargetSdkVersionExpression(config);_logging.Logger.logDebug(`Resolved Hermes artifact: ${hermesArtifact.groupId}:${hermesArtifact.artifactId}:${hermesArtifact.version}`);var missingDimensionStrategiesList=(0,_formatHelpers.formatMissingDimensionStrategies)(android.missingDimensionStrategies);var missingDimensionStrategyBlock=renderMissingDimensionStrategyBlock(android.missingDimensionStrategies);var files=[{relativePath:'build.gradle.kts',content:(0,_engine.renderTemplate)('android','build.gradle.kts',{'{{PACKAGE_NAME}}':android.packageName,'{{MIN_SDK_VERSION}}':android.minSdkVersion.toString(),'{{TARGET_SDK_VERSION}}':targetSdkVersionExpression,'{{COMPILE_SDK_VERSION}}':compileSdkVersionExpression,'{{GROUP_ID}}':android.groupId,'{{ARTIFACT_ID}}':android.artifactId,'{{ARTIFACT_VERSION}}':android.version,'{{RN_VERSION}}':rnVersion,'{{HERMES_ARTIFACT}}':`${hermesArtifact.groupId}:${hermesArtifact.artifactId}:${hermesArtifact.version}`,'{{MISSING_DIMENSION_STRATEGIES}}':missingDimensionStrategiesList,'{{MISSING_DIMENSION_STRATEGY_BLOCK}}':missingDimensionStrategyBlock})},{relativePath:'gradle.properties',content:(0,_engine.renderTemplate)('android','gradle.properties',{})},{relativePath:`src/main/java/${config.android.packageName.replace(/\./g,'/')}/ReactNativeHostManager.kt`,content:(0,_engine.renderTemplate)('android','ReactNativeHostManager.post55.kt',{'{{PACKAGE_NAME}}':android.packageName})},{relativePath:'consumer-rules.pro',content:(0,_engine.renderTemplate)('android','consumer-rules.pro',{})},{relativePath:'proguard-rules.pro',content:(0,_engine.renderTemplate)('android','proguard-rules.pro',{})}];for(var file of files){var filePath=path.join(moduleDir,file.relativePath);var fileDir=path.dirname(filePath);if(!fs.existsSync(fileDir)){fs.mkdirSync(fileDir,{recursive:true});}fs.writeFileSync(filePath,file.content,'utf8');_logging.Logger.logDebug(`Created file: ${filePath}`);}syncAndroidModuleExpoUpdatesFromAppFiles({androidDir:androidDir,config:config});_logging.Logger.logDebug(`Android module "${android.moduleName}" created at ${moduleDir}`);}function syncAndroidModuleManifest(_ref2){var androidDir=_ref2.androidDir,config=_ref2.config,expoUpdatesMetaData=_ref2.expoUpdatesMetaData;writeAndroidModuleFile(path.join(androidDir,config.android.moduleName),'src/main/AndroidManifest.xml',(0,_engine.renderTemplate)('android','AndroidManifest.xml',{'{{APPLICATION_BLOCK}}':(0,_androidManifest.renderLibraryManifestApplication)(expoUpdatesMetaData)}));}function syncAndroidModuleStringResources(_ref3){var androidDir=_ref3.androidDir,config=_ref3.config,expoUpdatesStringResources=_ref3.expoUpdatesStringResources;writeAndroidModuleFile(path.join(androidDir,config.android.moduleName),'src/main/res/values/strings.xml',(0,_engine.renderTemplate)('android','strings.xml',{'{{STRING_RESOURCES}}':(0,_androidManifest.renderLibraryStringResources)(expoUpdatesStringResources)}));}function writeAndroidModuleFile(moduleDir,relativePath,content){var filePath=path.join(moduleDir,relativePath);var fileDir=path.dirname(filePath);if(!fs.existsSync(fileDir)){fs.mkdirSync(fileDir,{recursive:true});}fs.writeFileSync(filePath,content,'utf8');_logging.Logger.logDebug(`Created file: ${filePath}`);}function syncAndroidModuleExpoUpdatesFromAppFiles(_ref4){var androidDir=_ref4.androidDir,config=_ref4.config;var appModuleName='app';var expoUpdatesMetaData=(0,_expoUpdates.readExpoUpdatesApplicationMetaData)(androidDir,appModuleName);var expoUpdatesStringResources=(0,_expoUpdates.readExpoUpdatesStringResources)(androidDir,appModuleName,expoUpdatesMetaData);syncAndroidModuleManifest({androidDir:androidDir,config:config,expoUpdatesMetaData:expoUpdatesMetaData});syncAndroidModuleStringResources({androidDir:androidDir,config:config,expoUpdatesStringResources:expoUpdatesStringResources});}var withAndroidModuleFiles=exports.withAndroidModuleFiles=function withAndroidModuleFiles(config,props){return(0,_configPlugins.withDangerousMod)(config,['android',(function(){var _ref5=(0,_asyncToGenerator2.default)(function*(dangerousConfig){var androidDir=path.join(dangerousConfig.modRequest.projectRoot,'android');var rnVersion;try{var rnPkgPath=require.resolve('react-native/package.json',{paths:[dangerousConfig.modRequest.projectRoot]});var rnPkg=require(rnPkgPath);rnVersion=rnPkg.version;_logging.Logger.logDebug(`Resolved react-native version: ${rnVersion}`);}catch(_unused){throw new Error('Could not resolve react-native package version. Please ensure you have installed dependencies.');}createAndroidModule({androidDir:androidDir,config:props,rnVersion:rnVersion,projectRoot:dangerousConfig.modRequest.projectRoot});return dangerousConfig;});return function(_x){return _ref5.apply(this,arguments);};}())]);};
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.createAndroidModule=createAndroidModule;exports.resolveCompileSdkVersionExpression=resolveCompileSdkVersionExpression;exports.resolveTargetSdkVersionExpression=resolveTargetSdkVersionExpression;exports.syncAndroidModuleExpoUpdatesFromAppFiles=syncAndroidModuleExpoUpdatesFromAppFiles;exports.syncAndroidModuleManifest=syncAndroidModuleManifest;exports.syncAndroidModuleStringResources=syncAndroidModuleStringResources;exports.withAndroidModuleFiles=void 0;var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var fs=_interopRequireWildcard(require("node:fs"));var path=_interopRequireWildcard(require("node:path"));var _configPlugins=require("@expo/config-plugins");var _logging=require("../logging");var _engine=require("../template/engine");var _androidManifest=require("./utils/androidManifest");var _expoUpdates=require("./utils/expo-updates");var _hermes=require("./utils/hermes");var _formatHelpers=require("./utils/formatHelpers");function _interopRequireWildcard(e,t){if("function"==typeof WeakMap)var r=new WeakMap(),n=new WeakMap();return(_interopRequireWildcard=function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;var o,i,f={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return f;if(o=t?n:r){if(o.has(e))return o.get(e);o.set(e,f);}for(var _t in e)"default"!==_t&&{}.hasOwnProperty.call(e,_t)&&((i=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,_t))&&(i.get||i.set)?o(f,_t,i):f[_t]=e[_t]);return f;})(e,t);}function renderMissingDimensionStrategyBlock(missingDimensionStrategies){if(missingDimensionStrategies.length<2){return'';}var args=(0,_formatHelpers.formatMissingDimensionStrategies)(missingDimensionStrategies);return` missingDimensionStrategy(${args})`;}function resolveCompileSdkVersionExpression(config){if(config.android.compileSdkVersion!=null){return config.android.compileSdkVersion.toString();}return'resolveRootProjectInt("compileSdkVersion")';}function resolveTargetSdkVersionExpression(config){if(config.android.targetSdkVersion!=null){return config.android.targetSdkVersion.toString();}return'resolveRootProjectInt("targetSdkVersion")';}function createAndroidModule(_ref){var _minifyEnabled,_extraProguardRules;var androidDir=_ref.androidDir,config=_ref.config,rnVersion=_ref.rnVersion,projectRoot=_ref.projectRoot;var android=config.android;var moduleDir=path.join(androidDir,android.moduleName);_logging.Logger.logDebug(`Creating Android module in: ${androidDir}`);var hermesArtifact=(0,_hermes.getHermesArtifact)(rnVersion,projectRoot);var compileSdkVersionExpression=resolveCompileSdkVersionExpression(config);var targetSdkVersionExpression=resolveTargetSdkVersionExpression(config);var minifyEnabled=(_minifyEnabled=android.minifyEnabled)!=null?_minifyEnabled:false;var extraProguardRules=(_extraProguardRules=android.extraProguardRules)!=null?_extraProguardRules:[];var extraProguardRulesText=extraProguardRules.join('\n');_logging.Logger.logDebug(`Resolved Hermes artifact: ${hermesArtifact.groupId}:${hermesArtifact.artifactId}:${hermesArtifact.version}`);var missingDimensionStrategiesList=(0,_formatHelpers.formatMissingDimensionStrategies)(android.missingDimensionStrategies);var missingDimensionStrategyBlock=renderMissingDimensionStrategyBlock(android.missingDimensionStrategies);var files=[{relativePath:'build.gradle.kts',content:(0,_engine.renderTemplate)('android','build.gradle.kts',{'{{PACKAGE_NAME}}':android.packageName,'{{MIN_SDK_VERSION}}':android.minSdkVersion.toString(),'{{TARGET_SDK_VERSION}}':targetSdkVersionExpression,'{{COMPILE_SDK_VERSION}}':compileSdkVersionExpression,'{{GROUP_ID}}':android.groupId,'{{ARTIFACT_ID}}':android.artifactId,'{{ARTIFACT_VERSION}}':android.version,'{{RN_VERSION}}':rnVersion,'{{HERMES_ARTIFACT}}':`${hermesArtifact.groupId}:${hermesArtifact.artifactId}:${hermesArtifact.version}`,'{{IS_MINIFY_ENABLED}}':minifyEnabled.toString(),'{{MISSING_DIMENSION_STRATEGIES}}':missingDimensionStrategiesList,'{{MISSING_DIMENSION_STRATEGY_BLOCK}}':missingDimensionStrategyBlock})},{relativePath:'gradle.properties',content:(0,_engine.renderTemplate)('android','gradle.properties',{})},{relativePath:`src/main/java/${config.android.packageName.replace(/\./g,'/')}/ReactNativeHostManager.kt`,content:(0,_engine.renderTemplate)('android','ReactNativeHostManager.post55.kt',{'{{PACKAGE_NAME}}':android.packageName})},{relativePath:'consumer-rules.pro',content:(0,_engine.renderTemplate)('android','consumer-rules.pro',{})},{relativePath:'proguard-rules.pro',content:(0,_engine.renderTemplate)('android','proguard-rules.pro',{'{{EXTRA_PROGUARD_RULES}}':extraProguardRulesText})}];for(var file of files){var filePath=path.join(moduleDir,file.relativePath);var fileDir=path.dirname(filePath);if(!fs.existsSync(fileDir)){fs.mkdirSync(fileDir,{recursive:true});}fs.writeFileSync(filePath,file.content,'utf8');_logging.Logger.logDebug(`Created file: ${filePath}`);}syncAndroidModuleExpoUpdatesFromAppFiles({androidDir:androidDir,config:config});_logging.Logger.logDebug(`Android module "${android.moduleName}" created at ${moduleDir}`);}function syncAndroidModuleManifest(_ref2){var androidDir=_ref2.androidDir,config=_ref2.config,expoUpdatesMetaData=_ref2.expoUpdatesMetaData;writeAndroidModuleFile(path.join(androidDir,config.android.moduleName),'src/main/AndroidManifest.xml',(0,_engine.renderTemplate)('android','AndroidManifest.xml',{'{{APPLICATION_BLOCK}}':(0,_androidManifest.renderLibraryManifestApplication)(expoUpdatesMetaData)}));}function syncAndroidModuleStringResources(_ref3){var androidDir=_ref3.androidDir,config=_ref3.config,expoUpdatesStringResources=_ref3.expoUpdatesStringResources;writeAndroidModuleFile(path.join(androidDir,config.android.moduleName),'src/main/res/values/strings.xml',(0,_engine.renderTemplate)('android','strings.xml',{'{{STRING_RESOURCES}}':(0,_androidManifest.renderLibraryStringResources)(expoUpdatesStringResources)}));}function writeAndroidModuleFile(moduleDir,relativePath,content){var filePath=path.join(moduleDir,relativePath);var fileDir=path.dirname(filePath);if(!fs.existsSync(fileDir)){fs.mkdirSync(fileDir,{recursive:true});}fs.writeFileSync(filePath,content,'utf8');_logging.Logger.logDebug(`Created file: ${filePath}`);}function syncAndroidModuleExpoUpdatesFromAppFiles(_ref4){var androidDir=_ref4.androidDir,config=_ref4.config;var appModuleName='app';var expoUpdatesMetaData=(0,_expoUpdates.readExpoUpdatesApplicationMetaData)(androidDir,appModuleName);var expoUpdatesStringResources=(0,_expoUpdates.readExpoUpdatesStringResources)(androidDir,appModuleName,expoUpdatesMetaData);syncAndroidModuleManifest({androidDir:androidDir,config:config,expoUpdatesMetaData:expoUpdatesMetaData});syncAndroidModuleStringResources({androidDir:androidDir,config:config,expoUpdatesStringResources:expoUpdatesStringResources});}var withAndroidModuleFiles=exports.withAndroidModuleFiles=function withAndroidModuleFiles(config,props){return(0,_configPlugins.withDangerousMod)(config,['android',(function(){var _ref5=(0,_asyncToGenerator2.default)(function*(dangerousConfig){var androidDir=path.join(dangerousConfig.modRequest.projectRoot,'android');var rnVersion;try{var rnPkgPath=require.resolve('react-native/package.json',{paths:[dangerousConfig.modRequest.projectRoot]});var rnPkg=require(rnPkgPath);rnVersion=rnPkg.version;_logging.Logger.logDebug(`Resolved react-native version: ${rnVersion}`);}catch(_unused){throw new Error('Could not resolve react-native package version. Please ensure you have installed dependencies.');}createAndroidModule({androidDir:androidDir,config:props,rnVersion:rnVersion,projectRoot:dangerousConfig.modRequest.projectRoot});return dangerousConfig;});return function(_x){return _ref5.apply(this,arguments);};}())]);};
|
|
2
2
|
//# sourceMappingURL=withAndroidModuleFiles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["fs","_interopRequireWildcard","require","path","_configPlugins","_logging","_engine","_androidManifest","_expoUpdates","_hermes","_formatHelpers","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","renderMissingDimensionStrategyBlock","missingDimensionStrategies","length","args","formatMissingDimensionStrategies","resolveCompileSdkVersionExpression","config","android","compileSdkVersion","toString","resolveTargetSdkVersionExpression","targetSdkVersion","createAndroidModule","_ref","androidDir","rnVersion","projectRoot","moduleDir","join","moduleName","Logger","logDebug","hermesArtifact","getHermesArtifact","compileSdkVersionExpression","targetSdkVersionExpression","groupId","artifactId","version","missingDimensionStrategiesList","missingDimensionStrategyBlock","files","relativePath","content","renderTemplate","packageName","minSdkVersion","replace","file","filePath","fileDir","dirname","existsSync","mkdirSync","recursive","writeFileSync","syncAndroidModuleExpoUpdatesFromAppFiles","syncAndroidModuleManifest","_ref2","expoUpdatesMetaData","writeAndroidModuleFile","renderLibraryManifestApplication","syncAndroidModuleStringResources","_ref3","expoUpdatesStringResources","renderLibraryStringResources","_ref4","appModuleName","readExpoUpdatesApplicationMetaData","readExpoUpdatesStringResources","withAndroidModuleFiles","exports","props","withDangerousMod","_ref5","_asyncToGenerator2","dangerousConfig","modRequest","rnPkgPath","resolve","paths","rnPkg","_unused","Error","_x","apply","arguments"],"sourceRoot":"../../../../src","sources":["expo-config-plugin/android/withAndroidModuleFiles.ts"],"mappings":"8rBAAA,IAAAA,EAAA,CAAAC,uBAAA,CAAAC,OAAA,aACA,IAAAC,IAAA,CAAAF,uBAAA,CAAAC,OAAA,eAEA,IAAAE,cAAA,CAAAF,OAAA,yBAMA,IAAAG,QAAA,CAAAH,OAAA,eACA,IAAAI,OAAA,CAAAJ,OAAA,uBACA,IAAAK,gBAAA,CAAAL,OAAA,4BAMA,IAAAM,YAAA,CAAAN,OAAA,yBAIA,IAAAO,OAAA,CAAAP,OAAA,mBACA,IAAAQ,cAAA,CAAAR,OAAA,0BAAyE,SAAAD,wBAAAU,CAAA,CAAAC,CAAA,wBAAAC,OAAA,KAAAC,CAAA,KAAAD,OAAA,GAAAE,CAAA,KAAAF,OAAA,UAAAZ,uBAAA,UAAAA,wBAAAU,CAAA,CAAAC,CAAA,MAAAA,CAAA,EAAAD,CAAA,EAAAA,CAAA,CAAAK,UAAA,QAAAL,CAAA,KAAAM,CAAA,CAAAC,CAAA,CAAAC,CAAA,EAAAC,SAAA,MAAAC,OAAA,CAAAV,CAAA,YAAAA,CAAA,mBAAAA,C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,CAACI,gBAAgB,CAACF,QAAQ,CAAC,CAAC,CACnD,CAEA,MAAO,2CAA2C,CACpD,CAKO,QAAS,CAAAG,mBAAmBA,CAAAC,IAAA,CAwB1B,IAvBP,CAAAC,UAAU,
|
|
1
|
+
{"version":3,"names":["fs","_interopRequireWildcard","require","path","_configPlugins","_logging","_engine","_androidManifest","_expoUpdates","_hermes","_formatHelpers","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","renderMissingDimensionStrategyBlock","missingDimensionStrategies","length","args","formatMissingDimensionStrategies","resolveCompileSdkVersionExpression","config","android","compileSdkVersion","toString","resolveTargetSdkVersionExpression","targetSdkVersion","createAndroidModule","_ref","_minifyEnabled","_extraProguardRules","androidDir","rnVersion","projectRoot","moduleDir","join","moduleName","Logger","logDebug","hermesArtifact","getHermesArtifact","compileSdkVersionExpression","targetSdkVersionExpression","minifyEnabled","extraProguardRules","extraProguardRulesText","groupId","artifactId","version","missingDimensionStrategiesList","missingDimensionStrategyBlock","files","relativePath","content","renderTemplate","packageName","minSdkVersion","replace","file","filePath","fileDir","dirname","existsSync","mkdirSync","recursive","writeFileSync","syncAndroidModuleExpoUpdatesFromAppFiles","syncAndroidModuleManifest","_ref2","expoUpdatesMetaData","writeAndroidModuleFile","renderLibraryManifestApplication","syncAndroidModuleStringResources","_ref3","expoUpdatesStringResources","renderLibraryStringResources","_ref4","appModuleName","readExpoUpdatesApplicationMetaData","readExpoUpdatesStringResources","withAndroidModuleFiles","exports","props","withDangerousMod","_ref5","_asyncToGenerator2","dangerousConfig","modRequest","rnPkgPath","resolve","paths","rnPkg","_unused","Error","_x","apply","arguments"],"sourceRoot":"../../../../src","sources":["expo-config-plugin/android/withAndroidModuleFiles.ts"],"mappings":"8rBAAA,IAAAA,EAAA,CAAAC,uBAAA,CAAAC,OAAA,aACA,IAAAC,IAAA,CAAAF,uBAAA,CAAAC,OAAA,eAEA,IAAAE,c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UAAU,CAAG5C,IAAI,CAACgD,IAAI,CAC1BmD,eAAe,CAACC,UAAU,CAACtD,WAAW,CACtC,SACF,CAAC,CAED,GAAI,CAAAD,SAAiB,CACrB,GAAI,CACF,GAAM,CAAAwD,SAAS,CAAGtG,OAAO,CAACuG,OAAO,CAAC,2BAA2B,CAAE,CAC7DC,KAAK,CAAE,CAACJ,eAAe,CAACC,UAAU,CAACtD,WAAW,CAChD,CAAC,CAAC,CAEF,GAAM,CAAA0D,KAAK,CAAGzG,OAAO,CAACsG,SAAS,CAAC,CAEhCxD,SAAS,CAAG2D,KAAK,CAAC3C,OAAO,CAEzBX,eAAM,CAACC,QAAQ,CAAC,kCAAkCN,SAAS,EAAE,CAAC,CAChE,CAAE,MAAA4D,OAAA,CAAM,CACN,KAAM,IAAI,CAAAC,KAAK,CACb,gGACF,CAAC,CACH,CAEAlE,mBAAmB,CAAC,CAClBI,UAAU,CAAVA,UAAU,CACVV,MAAM,CAAE6D,KAAK,CACblD,SAAS,CAATA,SAAS,CACTC,WAAW,CAAEqD,eAAe,CAACC,UAAU,CAACtD,WAC1C,CAAC,CAAC,CAEF,MAAO,CAAAqD,eAAe,CACxB,CAAC,kBAAAQ,EAAA,SAAAV,KAAA,CAAAW,KAAA,MAAAC,SAAA,SACF,CAAC,CACJ,CAAC","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":[]}
|
|
@@ -18,4 +18,14 @@
|
|
|
18
18
|
|
|
19
19
|
# If you keep the line number information, uncomment this to
|
|
20
20
|
# hide the original source file name.
|
|
21
|
-
#-renamesourcefileattribute SourceFile
|
|
21
|
+
#-renamesourcefileattribute SourceFile
|
|
22
|
+
-dontwarn com.google.android.material.R$attr
|
|
23
|
+
-dontwarn com.google.android.material.R$dimen
|
|
24
|
+
-dontwarn com.google.android.material.R$id
|
|
25
|
+
-dontwarn com.google.android.material.R$style
|
|
26
|
+
-dontwarn java.lang.invoke.StringConcatFactory
|
|
27
|
+
|
|
28
|
+
# Public API consumed from the Brownfield AAR.
|
|
29
|
+
-keep class com.callstack.rnbrownfield.demo.expoapp56.ReactNativeHostManager { *; }
|
|
30
|
+
|
|
31
|
+
{{EXTRA_PROGUARD_RULES}}
|
|
@@ -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/withAndroidModuleFiles.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withAndroidModuleFiles.d.ts","sourceRoot":"","sources":["../../../../../../src/expo-config-plugin/android/withAndroidModuleFiles.ts"],"names":[],"mappings":"AAGA,OAAO,EAAoB,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAE3E,OAAO,KAAK,EAEV,yCAAyC,EAC1C,MAAM,UAAU,CAAC;AAGlB,OAAO,EACL,KAAK,4BAA4B,EACjC,KAAK,0BAA0B,EAGhC,MAAM,yBAAyB,CAAC;AAmBjC,wBAAgB,kCAAkC,CAChD,MAAM,EAAE,yCAAyC,GAChD,MAAM,CAMR;AAED,wBAAgB,iCAAiC,CAC/C,MAAM,EAAE,yCAAyC,GAChD,MAAM,CAMR;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,UAAU,EACV,MAAM,EACN,SAAS,EACT,WAAW,GACZ,EAAE;IACD;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,MAAM,EAAE,yCAAyC,CAAC;CACnD,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"withAndroidModuleFiles.d.ts","sourceRoot":"","sources":["../../../../../../src/expo-config-plugin/android/withAndroidModuleFiles.ts"],"names":[],"mappings":"AAGA,OAAO,EAAoB,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAE3E,OAAO,KAAK,EAEV,yCAAyC,EAC1C,MAAM,UAAU,CAAC;AAGlB,OAAO,EACL,KAAK,4BAA4B,EACjC,KAAK,0BAA0B,EAGhC,MAAM,yBAAyB,CAAC;AAmBjC,wBAAgB,kCAAkC,CAChD,MAAM,EAAE,yCAAyC,GAChD,MAAM,CAMR;AAED,wBAAgB,iCAAiC,CAC/C,MAAM,EAAE,yCAAyC,GAChD,MAAM,CAMR;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,UAAU,EACV,MAAM,EACN,SAAS,EACT,WAAW,GACZ,EAAE;IACD;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,MAAM,EAAE,yCAAyC,CAAC;CACnD,GAAG,IAAI,CAyFP;AAED,wBAAgB,yBAAyB,CAAC,EACxC,UAAU,EACV,MAAM,EACN,mBAAmB,GACpB,EAAE;IACD,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,yCAAyC,CAAC;IAClD,mBAAmB,EAAE,4BAA4B,EAAE,CAAC;CACrD,GAAG,IAAI,CASP;AAED,wBAAgB,gCAAgC,CAAC,EAC/C,UAAU,EACV,MAAM,EACN,0BAA0B,GAC3B,EAAE;IACD,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,yCAAyC,CAAC;IAClD,0BAA0B,EAAE,0BAA0B,EAAE,CAAC;CAC1D,GAAG,IAAI,CAUP;AAkBD,wBAAgB,wCAAwC,CAAC,EACvD,UAAU,EACV,MAAM,GACP,EAAE;IACD,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,yCAAyC,CAAC;CACnD,GAAG,IAAI,CAsBP;AAED;;GAEG;AACH,eAAO,MAAM,sBAAsB,EAAE,YAAY,CAC/C,yCAAyC,CAqC1C,CAAC"}
|
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"}
|
package/lib/typescript/module/src/expo-config-plugin/android/withAndroidModuleFiles.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withAndroidModuleFiles.d.ts","sourceRoot":"","sources":["../../../../../../src/expo-config-plugin/android/withAndroidModuleFiles.ts"],"names":[],"mappings":"AAGA,OAAO,EAAoB,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAE3E,OAAO,KAAK,EAEV,yCAAyC,EAC1C,MAAM,UAAU,CAAC;AAGlB,OAAO,EACL,KAAK,4BAA4B,EACjC,KAAK,0BAA0B,EAGhC,MAAM,yBAAyB,CAAC;AAmBjC,wBAAgB,kCAAkC,CAChD,MAAM,EAAE,yCAAyC,GAChD,MAAM,CAMR;AAED,wBAAgB,iCAAiC,CAC/C,MAAM,EAAE,yCAAyC,GAChD,MAAM,CAMR;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,UAAU,EACV,MAAM,EACN,SAAS,EACT,WAAW,GACZ,EAAE;IACD;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,MAAM,EAAE,yCAAyC,CAAC;CACnD,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"withAndroidModuleFiles.d.ts","sourceRoot":"","sources":["../../../../../../src/expo-config-plugin/android/withAndroidModuleFiles.ts"],"names":[],"mappings":"AAGA,OAAO,EAAoB,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAE3E,OAAO,KAAK,EAEV,yCAAyC,EAC1C,MAAM,UAAU,CAAC;AAGlB,OAAO,EACL,KAAK,4BAA4B,EACjC,KAAK,0BAA0B,EAGhC,MAAM,yBAAyB,CAAC;AAmBjC,wBAAgB,kCAAkC,CAChD,MAAM,EAAE,yCAAyC,GAChD,MAAM,CAMR;AAED,wBAAgB,iCAAiC,CAC/C,MAAM,EAAE,yCAAyC,GAChD,MAAM,CAMR;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,UAAU,EACV,MAAM,EACN,SAAS,EACT,WAAW,GACZ,EAAE;IACD;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,MAAM,EAAE,yCAAyC,CAAC;CACnD,GAAG,IAAI,CAyFP;AAED,wBAAgB,yBAAyB,CAAC,EACxC,UAAU,EACV,MAAM,EACN,mBAAmB,GACpB,EAAE;IACD,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,yCAAyC,CAAC;IAClD,mBAAmB,EAAE,4BAA4B,EAAE,CAAC;CACrD,GAAG,IAAI,CASP;AAED,wBAAgB,gCAAgC,CAAC,EAC/C,UAAU,EACV,MAAM,EACN,0BAA0B,GAC3B,EAAE;IACD,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,yCAAyC,CAAC;IAClD,0BAA0B,EAAE,0BAA0B,EAAE,CAAC;CAC1D,GAAG,IAAI,CAUP;AAkBD,wBAAgB,wCAAwC,CAAC,EACvD,UAAU,EACV,MAAM,GACP,EAAE;IACD,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,yCAAyC,CAAC;CACnD,GAAG,IAAI,CAsBP;AAED;;GAEG;AACH,eAAO,MAAM,sBAAsB,EAAE,YAAY,CAC/C,yCAAyC,CAqC1C,CAAC"}
|
|
@@ -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
|
);
|
|
@@ -90,6 +90,11 @@ export function createAndroidModule({
|
|
|
90
90
|
const compileSdkVersionExpression =
|
|
91
91
|
resolveCompileSdkVersionExpression(config);
|
|
92
92
|
const targetSdkVersionExpression = resolveTargetSdkVersionExpression(config);
|
|
93
|
+
const minifyEnabled =
|
|
94
|
+
(android as { minifyEnabled?: boolean }).minifyEnabled ?? false;
|
|
95
|
+
const extraProguardRules =
|
|
96
|
+
(android as { extraProguardRules?: string[] }).extraProguardRules ?? [];
|
|
97
|
+
const extraProguardRulesText = extraProguardRules.join('\n');
|
|
93
98
|
Logger.logDebug(
|
|
94
99
|
`Resolved Hermes artifact: ${hermesArtifact.groupId}:${hermesArtifact.artifactId}:${hermesArtifact.version}`
|
|
95
100
|
);
|
|
@@ -114,6 +119,7 @@ export function createAndroidModule({
|
|
|
114
119
|
'{{ARTIFACT_VERSION}}': android.version,
|
|
115
120
|
'{{RN_VERSION}}': rnVersion,
|
|
116
121
|
'{{HERMES_ARTIFACT}}': `${hermesArtifact.groupId}:${hermesArtifact.artifactId}:${hermesArtifact.version}`,
|
|
122
|
+
'{{IS_MINIFY_ENABLED}}': minifyEnabled.toString(),
|
|
117
123
|
'{{MISSING_DIMENSION_STRATEGIES}}': missingDimensionStrategiesList,
|
|
118
124
|
'{{MISSING_DIMENSION_STRATEGY_BLOCK}}': missingDimensionStrategyBlock,
|
|
119
125
|
}),
|
|
@@ -134,7 +140,9 @@ export function createAndroidModule({
|
|
|
134
140
|
},
|
|
135
141
|
{
|
|
136
142
|
relativePath: 'proguard-rules.pro',
|
|
137
|
-
content: renderTemplate('android', 'proguard-rules.pro', {
|
|
143
|
+
content: renderTemplate('android', 'proguard-rules.pro', {
|
|
144
|
+
'{{EXTRA_PROGUARD_RULES}}': extraProguardRulesText,
|
|
145
|
+
}),
|
|
138
146
|
},
|
|
139
147
|
];
|
|
140
148
|
|
|
@@ -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;
|
|
@@ -18,4 +18,14 @@
|
|
|
18
18
|
|
|
19
19
|
# If you keep the line number information, uncomment this to
|
|
20
20
|
# hide the original source file name.
|
|
21
|
-
#-renamesourcefileattribute SourceFile
|
|
21
|
+
#-renamesourcefileattribute SourceFile
|
|
22
|
+
-dontwarn com.google.android.material.R$attr
|
|
23
|
+
-dontwarn com.google.android.material.R$dimen
|
|
24
|
+
-dontwarn com.google.android.material.R$id
|
|
25
|
+
-dontwarn com.google.android.material.R$style
|
|
26
|
+
-dontwarn java.lang.invoke.StringConcatFactory
|
|
27
|
+
|
|
28
|
+
# Public API consumed from the Brownfield AAR.
|
|
29
|
+
-keep class com.callstack.rnbrownfield.demo.expoapp56.ReactNativeHostManager { *; }
|
|
30
|
+
|
|
31
|
+
{{EXTRA_PROGUARD_RULES}}
|
|
@@ -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[];
|