@callstack/react-native-brownfield 5.1.1 → 5.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/gradle-plugin/brownfield/build.gradle.kts +67 -2
- package/gradle-plugin/brownfield/gradle/libs.versions.toml +5 -2
- package/gradle-plugin/brownfield/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/gradle-plugin/brownfield/gradle.properties +1 -1
- package/gradle-plugin/brownfield/src/main/kotlin/com/callstack/react/brownfield/plugin/RNBrownfieldPlugin.kt +35 -4
- package/gradle-plugin/brownfield/src/main/kotlin/com/callstack/react/brownfield/plugin/RNSourceSets.kt +6 -1
- package/gradle-plugin/brownfield/src/main/kotlin/com/callstack/react/brownfield/shared/MergeClassesTask.kt +2 -0
- package/gradle-plugin/brownfield/src/main/kotlin/com/callstack/react/brownfield/utils/Extension.kt +2 -2
- package/gradle-plugin/brownfield/src/test/kotlin/com/callstack/react/brownfield/plugin/AgpCompatibilityMatrixTest.kt +155 -0
- package/lib/commonjs/expo-config-plugin/android/utils/constants.js +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/template/android/build.gradle.kts +1 -2
- package/lib/commonjs/expo-config-plugin/template/android/proguard-rules.pro +1 -1
- package/lib/module/expo-config-plugin/android/utils/constants.js +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/template/android/build.gradle.kts +1 -2
- package/lib/module/expo-config-plugin/template/android/proguard-rules.pro +1 -1
- package/lib/typescript/commonjs/src/expo-config-plugin/android/utils/constants.d.ts +2 -2
- package/lib/typescript/commonjs/src/expo-config-plugin/android/withAndroidModuleFiles.d.ts +11 -1
- package/lib/typescript/commonjs/src/expo-config-plugin/android/withAndroidModuleFiles.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/expo-config-plugin/types/android/BrownfieldPluginAndroidConfig.d.ts +3 -2
- 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/withAndroidModuleFiles.d.ts +11 -1
- package/lib/typescript/module/src/expo-config-plugin/android/withAndroidModuleFiles.d.ts.map +1 -1
- package/lib/typescript/module/src/expo-config-plugin/types/android/BrownfieldPluginAndroidConfig.d.ts +3 -2
- package/lib/typescript/module/src/expo-config-plugin/types/android/BrownfieldPluginAndroidConfig.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/expo-config-plugin/android/utils/constants.ts +1 -1
- package/src/expo-config-plugin/android/withAndroidModuleFiles.ts +31 -2
- package/src/expo-config-plugin/template/android/build.gradle.kts +1 -2
- package/src/expo-config-plugin/template/android/proguard-rules.pro +1 -1
- package/src/expo-config-plugin/types/android/BrownfieldPluginAndroidConfig.ts +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @callstack/react-native-brownfield
|
|
2
2
|
|
|
3
|
+
## 5.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#467](https://github.com/callstack/react-native-brownfield/pull/467) [`31c3939`](https://github.com/callstack/react-native-brownfield/commit/31c39399aad0efb098876d35a4fbbe80835d5dba) Thanks [@hurali97](https://github.com/hurali97)! - agp v9 compliance
|
|
8
|
+
|
|
9
|
+
- [#467](https://github.com/callstack/react-native-brownfield/pull/467) [`31c3939`](https://github.com/callstack/react-native-brownfield/commit/31c39399aad0efb098876d35a4fbbe80835d5dba) Thanks [@hurali97](https://github.com/hurali97)! - add expo sdk 58
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#477](https://github.com/callstack/react-native-brownfield/pull/477) [`9e57d43`](https://github.com/callstack/react-native-brownfield/commit/9e57d4384f93459526a41084ee82355dd43f4ed9) Thanks [@KisaneNeko](https://github.com/KisaneNeko)! - fix: publish dependencies of community libraries (e.g. react-native-screens, lottie-react-native) embedded in Expo brownfield AARs; the published POM now lists them, previously host apps could crash with NoClassDefFoundError
|
|
14
|
+
- Updated dependencies [[`31c3939`](https://github.com/callstack/react-native-brownfield/commit/31c39399aad0efb098876d35a4fbbe80835d5dba)]:
|
|
15
|
+
- @callstack/brownfield-cli@5.2.0
|
|
16
|
+
|
|
3
17
|
## 5.1.1
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -103,18 +103,83 @@ repositories {
|
|
|
103
103
|
google()
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
+
// AGP for GradleRunner.withPluginClasspath(), which only sees runtime dependencies, so TestKit
|
|
107
|
+
// projects can still apply com.android.library
|
|
108
|
+
val testKitPluginClasspath: Configuration by configurations.creating
|
|
109
|
+
|
|
106
110
|
dependencies {
|
|
107
|
-
|
|
108
|
-
|
|
111
|
+
// AGP is provided by the consuming build's buildscript classpath. Keeping it
|
|
112
|
+
// compileOnly stops the published module from pinning AGP (and therefore the
|
|
113
|
+
// minimum Gradle version) for every app that applies this plugin.
|
|
114
|
+
compileOnly(libs.agp)
|
|
115
|
+
compileOnly(libs.common)
|
|
109
116
|
implementation(libs.asm.commons)
|
|
110
117
|
implementation(libs.versioncompare)
|
|
118
|
+
testImplementation(libs.agp)
|
|
119
|
+
testImplementation(libs.common)
|
|
111
120
|
testImplementation(libs.junit.jupiter)
|
|
112
121
|
testImplementation(gradleTestKit())
|
|
113
122
|
testImplementation(kotlin("test"))
|
|
123
|
+
testKitPluginClasspath(libs.agp)
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
tasks.pluginUnderTestMetadata {
|
|
127
|
+
pluginClasspath.from(testKitPluginClasspath)
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* AGP versions the plugin is tested against, oldest first.
|
|
132
|
+
*
|
|
133
|
+
* The first entry is the floor, and it is the same number as `agp` in `gradle/libs.versions.toml`
|
|
134
|
+
* (what the plugin compiles against) and `RNBrownfieldPlugin.MIN_AGP` (what the apply-time gate
|
|
135
|
+
* enforces). The compiler covers "we accidentally used an API newer than the floor"; this matrix
|
|
136
|
+
* covers the other direction — "we used something a newer AGP has since removed or changed".
|
|
137
|
+
*/
|
|
138
|
+
val agpMatrix = listOf(libs.versions.agp.get(), "9.2.1")
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* An AGP below the matrix floor. Not supported, and not built against — it exists only so a test can
|
|
142
|
+
* prove `RNBrownfieldPlugin.MIN_AGP` actually rejects it instead of letting the consumer fail later
|
|
143
|
+
* with an unattributable `NoSuchMethodError`.
|
|
144
|
+
*/
|
|
145
|
+
val belowFloorAgp = "8.9.0"
|
|
146
|
+
|
|
147
|
+
// A TestKit-ready AGP classpath per version above, keyed by version.
|
|
148
|
+
val agpClasspaths =
|
|
149
|
+
(agpMatrix + belowFloorAgp).associateWith { agpVersion ->
|
|
150
|
+
val suffix = agpVersion.replace('.', '_')
|
|
151
|
+
val scope = configurations.dependencyScope("testkitAgp$suffix")
|
|
152
|
+
dependencies.add(scope.name, "com.android.tools.build:gradle:$agpVersion")
|
|
153
|
+
configurations.resolvable("testkitAgp${suffix}Classpath") {
|
|
154
|
+
extendsFrom(scope.get())
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// `withPluginClasspath()` builds the TestKit fixture classpath from the plugin's runtime
|
|
159
|
+
// classpath, which no longer carries AGP now that it is compileOnly. The fixtures apply
|
|
160
|
+
// `com.android.library`, so hand the floor AGP back to them here — test-only, so nothing
|
|
161
|
+
// reaches the published module.
|
|
162
|
+
tasks.named<PluginUnderTestMetadata>("pluginUnderTestMetadata") {
|
|
163
|
+
pluginClasspath.from(agpClasspaths.getValue(agpMatrix.first()))
|
|
114
164
|
}
|
|
115
165
|
|
|
116
166
|
tasks.test {
|
|
117
167
|
useJUnitPlatform()
|
|
168
|
+
|
|
169
|
+
// Tests that want a specific AGP build their own TestKit classpath from these, via
|
|
170
|
+
// `withPluginClasspath(files)` instead of the no-arg `withPluginClasspath()`.
|
|
171
|
+
val mainSourceSet = sourceSets.main.get()
|
|
172
|
+
systemProperty("agp.matrix.versions", agpMatrix.joinToString(","))
|
|
173
|
+
systemProperty("agp.belowFloor.version", belowFloorAgp)
|
|
174
|
+
agpClasspaths.forEach { (agpVersion, agpClasspath) ->
|
|
175
|
+
val pluginClasspath = files(mainSourceSet.output, mainSourceSet.runtimeClasspath, agpClasspath)
|
|
176
|
+
inputs.files(pluginClasspath).withPropertyName("agpMatrix-$agpVersion").withNormalizer(ClasspathNormalizer::class)
|
|
177
|
+
jvmArgumentProviders.add(
|
|
178
|
+
CommandLineArgumentProvider {
|
|
179
|
+
listOf("-Dagp.classpath.$agpVersion=${pluginClasspath.joinToString(File.pathSeparator)}")
|
|
180
|
+
},
|
|
181
|
+
)
|
|
182
|
+
}
|
|
118
183
|
}
|
|
119
184
|
|
|
120
185
|
tasks.named("detekt").configure {
|
|
@@ -2,8 +2,11 @@
|
|
|
2
2
|
kotlinJvm = "2.2.21"
|
|
3
3
|
ktlint = "12.1.1"
|
|
4
4
|
detekt = "1.23.7"
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
# The AGP the plugin compiles against: deliberately the OLDEST supported version, so the
|
|
6
|
+
# compiler rejects any accidental use of a newer AGP API. Newer AGP is covered by the
|
|
7
|
+
# TestKit matrix in build.gradle.kts. Keep in sync with MIN_AGP in RNBrownfieldPlugin.kt.
|
|
8
|
+
agp = "8.12.0"
|
|
9
|
+
common = "31.12.0"
|
|
7
10
|
asm-commons = "9.7"
|
|
8
11
|
versioncompare = "1.5.0"
|
|
9
12
|
junit = "5.11.4"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
distributionBase=GRADLE_USER_HOME
|
|
2
2
|
distributionPath=wrapper/dists
|
|
3
|
-
distributionUrl=https\://services.gradle.org/distributions/gradle-
|
|
3
|
+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip
|
|
4
4
|
networkTimeout=10000
|
|
5
5
|
validateDistributionUrl=true
|
|
6
6
|
zipStoreBase=GRADLE_USER_HOME
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
package com.callstack.react.brownfield.plugin
|
|
2
2
|
|
|
3
|
+
import com.android.build.api.AndroidPluginVersion
|
|
3
4
|
import com.android.build.api.variant.LibraryAndroidComponentsExtension
|
|
4
5
|
import com.android.build.api.variant.LibraryVariant
|
|
5
6
|
import com.callstack.react.brownfield.artifacts.ArtifactsResolver
|
|
@@ -41,6 +42,7 @@ class RNBrownfieldPlugin : Plugin<Project> {
|
|
|
41
42
|
|
|
42
43
|
override fun apply(project: Project) {
|
|
43
44
|
verifyAndroidPluginApplied(project)
|
|
45
|
+
verifyAgpVersion(project)
|
|
44
46
|
|
|
45
47
|
this.project = project
|
|
46
48
|
initializers()
|
|
@@ -92,6 +94,13 @@ class RNBrownfieldPlugin : Plugin<Project> {
|
|
|
92
94
|
}
|
|
93
95
|
|
|
94
96
|
companion object {
|
|
97
|
+
/**
|
|
98
|
+
* Oldest AGP the plugin supports. This is one number that must hold in three places: the
|
|
99
|
+
* `agp` version the plugin compiles against in `gradle/libs.versions.toml`, the floor of the
|
|
100
|
+
* TestKit AGP matrix in `build.gradle.kts`, and this gate. Raise all three together.
|
|
101
|
+
*/
|
|
102
|
+
val MIN_AGP = AndroidPluginVersion(8, 12)
|
|
103
|
+
|
|
95
104
|
const val EXPO_PROJECT_LOCATOR = ":expo"
|
|
96
105
|
}
|
|
97
106
|
|
|
@@ -117,9 +126,8 @@ class RNBrownfieldPlugin : Plugin<Project> {
|
|
|
117
126
|
}
|
|
118
127
|
transitiveDeps.addAll(expoTransitiveDeps)
|
|
119
128
|
}
|
|
120
|
-
//
|
|
121
|
-
|
|
122
|
-
if (!isExpoProject && extension.experimentalIncludeTransitiveDependencies) {
|
|
129
|
+
// Also on Expo: the path above only covers Expo modules, not community libraries.
|
|
130
|
+
if (extension.experimentalIncludeTransitiveDependencies) {
|
|
123
131
|
val rncDiscovery = RncTransitiveDependencyDiscoverer(project).discover(artifacts)
|
|
124
132
|
Logging.log(
|
|
125
133
|
"Merged ${rncDiscovery.dependencies.size} transitive dependencies discovered by the RNC discoverer",
|
|
@@ -134,7 +142,8 @@ class RNBrownfieldPlugin : Plugin<Project> {
|
|
|
134
142
|
// (replacing a stale entry) and so must not be dropped here.
|
|
135
143
|
val hardExcludePredicate: (String, String) -> Boolean = { groupId, artifactId ->
|
|
136
144
|
(expoPublishingHelper?.shouldExcludeDependency(groupId, artifactId) ?: (groupId == project.rootProject.name)) ||
|
|
137
|
-
artifacts.any { it.moduleGroup == groupId && it.moduleName == artifactId }
|
|
145
|
+
artifacts.any { it.moduleGroup == groupId && it.moduleName == artifactId } ||
|
|
146
|
+
expoProjects.any { it.publication?.groupId == groupId && it.publication?.artifactId == artifactId }
|
|
138
147
|
}
|
|
139
148
|
dropHardExcludedDependencies(transitiveDeps, hardExcludePredicate)
|
|
140
149
|
|
|
@@ -191,6 +200,28 @@ class RNBrownfieldPlugin : Plugin<Project> {
|
|
|
191
200
|
}
|
|
192
201
|
}
|
|
193
202
|
|
|
203
|
+
/**
|
|
204
|
+
* Fails fast on AGP versions older than the plugin supports.
|
|
205
|
+
*
|
|
206
|
+
* The plugin compiles against [MIN_AGP] (see `agp` in `gradle/libs.versions.toml`), so anything
|
|
207
|
+
* at or above it is guaranteed to have every AGP symbol the plugin references. Below it, the
|
|
208
|
+
* consumer would instead hit a `NoClassDefFoundError`/`NoSuchMethodError` somewhere deep in
|
|
209
|
+
* configuration, with nothing pointing back at this plugin.
|
|
210
|
+
*/
|
|
211
|
+
private fun verifyAgpVersion(project: Project) {
|
|
212
|
+
val current =
|
|
213
|
+
project.extensions
|
|
214
|
+
.getByType(LibraryAndroidComponentsExtension::class.java)
|
|
215
|
+
.pluginVersion
|
|
216
|
+
if (current < MIN_AGP) {
|
|
217
|
+
throw ProjectConfigurationException(
|
|
218
|
+
"$PROJECT_ID requires Android Gradle Plugin $MIN_AGP or newer, " +
|
|
219
|
+
"but this project resolved AGP $current",
|
|
220
|
+
Throwable("Upgrade the Android Gradle Plugin to $MIN_AGP or newer"),
|
|
221
|
+
)
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
194
225
|
private fun getAarLibraries(
|
|
195
226
|
artifacts: List<UnresolvedArtifactInfo>,
|
|
196
227
|
variantName: String,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
package com.callstack.react.brownfield.plugin
|
|
2
2
|
|
|
3
|
+
import com.android.build.api.dsl.AndroidSourceSet
|
|
3
4
|
import com.android.build.api.dsl.LibraryExtension
|
|
4
5
|
import com.android.build.api.variant.LibraryAndroidComponentsExtension
|
|
5
6
|
import com.callstack.react.brownfield.exceptions.NameSpaceNotFound
|
|
@@ -41,7 +42,11 @@ object RNSourceSets {
|
|
|
41
42
|
val componentsExtension = project.extensions.getByType(LibraryAndroidComponentsExtension::class.java)
|
|
42
43
|
|
|
43
44
|
// Move the non-variant-specific configuration out of the loop
|
|
44
|
-
|
|
45
|
+
// The parameter is typed as the `AndroidSourceSet` supertype on purpose. AGP 9 narrows
|
|
46
|
+
// this container to `AndroidLibrarySourceSet`, and letting Kotlin infer that bakes the
|
|
47
|
+
// AGP 9-only type into the lambda's `execute` signature, which blows up with
|
|
48
|
+
// NoClassDefFoundError on AGP 8 consumers. `AndroidSourceSet` is identical in both.
|
|
49
|
+
androidExtension.sourceSets.named("main") { sourceSet: AndroidSourceSet ->
|
|
45
50
|
// This path is not variant-specific, so it's added once here.
|
|
46
51
|
sourceSet.java.directories.add("${getModuleBuildDir()}/generated/autolinking/src/main/java")
|
|
47
52
|
}
|
|
@@ -11,11 +11,13 @@ import org.gradle.api.tasks.Classpath
|
|
|
11
11
|
import org.gradle.api.tasks.Input
|
|
12
12
|
import org.gradle.api.tasks.OutputDirectory
|
|
13
13
|
import org.gradle.api.tasks.TaskAction
|
|
14
|
+
import org.gradle.api.tasks.UntrackedTask
|
|
14
15
|
import java.io.File
|
|
15
16
|
import java.nio.file.Files
|
|
16
17
|
import java.nio.file.Path
|
|
17
18
|
import java.nio.file.Paths
|
|
18
19
|
|
|
20
|
+
@UntrackedTask(because = "Copies classes into Java and Kotlin compilation directories owned by other tasks")
|
|
19
21
|
abstract class MergeClassesTask : DefaultTask() {
|
|
20
22
|
@get:Classpath
|
|
21
23
|
abstract val inputClassesJars: ConfigurableFileCollection
|
package/gradle-plugin/brownfield/src/main/kotlin/com/callstack/react/brownfield/utils/Extension.kt
CHANGED
|
@@ -58,8 +58,8 @@ open class Extension {
|
|
|
58
58
|
* Whether to publish embedded native modules' third-party dependencies into the generated POM
|
|
59
59
|
* and Gradle Module Metadata, so consuming apps resolve them instead of declaring them by hand.
|
|
60
60
|
*
|
|
61
|
-
* Experimental; behavior may still change.
|
|
62
|
-
*
|
|
61
|
+
* Experimental; behavior may still change. On Expo projects, Expo modules' dependencies are
|
|
62
|
+
* published regardless; this covers the other native modules. Set to `false` to hand-declare them instead.
|
|
63
63
|
*
|
|
64
64
|
* Default is `true`.
|
|
65
65
|
*/
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
package com.callstack.react.brownfield.plugin
|
|
2
|
+
|
|
3
|
+
import org.gradle.testkit.runner.GradleRunner
|
|
4
|
+
import org.junit.jupiter.api.Assumptions.assumeTrue
|
|
5
|
+
import org.junit.jupiter.api.Test
|
|
6
|
+
import org.junit.jupiter.api.io.TempDir
|
|
7
|
+
import org.junit.jupiter.params.ParameterizedTest
|
|
8
|
+
import org.junit.jupiter.params.provider.MethodSource
|
|
9
|
+
import java.io.File
|
|
10
|
+
import kotlin.test.assertTrue
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Configures a minimal android library against every AGP version in the matrix declared in
|
|
14
|
+
* `build.gradle.kts`.
|
|
15
|
+
*
|
|
16
|
+
* The plugin compiles against the OLDEST supported AGP, which is what stops it from reaching for an
|
|
17
|
+
* API newer AGP added. That leaves the opposite direction uncovered: an API the floor has but a
|
|
18
|
+
* newer AGP removed, renamed or narrowed compiles cleanly and only breaks at the consumer. This
|
|
19
|
+
* test is the coverage for that direction, so the newest entry in the matrix is the one earning its
|
|
20
|
+
* keep here.
|
|
21
|
+
*
|
|
22
|
+
* Skipped without an Android SDK, since the plugin requires `com.android.library`.
|
|
23
|
+
*/
|
|
24
|
+
class AgpCompatibilityMatrixTest {
|
|
25
|
+
@ParameterizedTest(name = "configures cleanly on AGP {0}")
|
|
26
|
+
@MethodSource("agpVersions")
|
|
27
|
+
fun `the plugin configures an android library on every supported AGP`(
|
|
28
|
+
agpVersion: String,
|
|
29
|
+
@TempDir projectDir: File,
|
|
30
|
+
) {
|
|
31
|
+
val androidSdk = System.getenv("ANDROID_HOME") ?: System.getenv("ANDROID_SDK_ROOT")
|
|
32
|
+
assumeTrue(
|
|
33
|
+
androidSdk != null && File(androidSdk).isDirectory,
|
|
34
|
+
"no Android SDK available (ANDROID_HOME/ANDROID_SDK_ROOT); skipping AGP-dependent test",
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
writeFixture(projectDir, androidSdk!!)
|
|
38
|
+
|
|
39
|
+
// `--dry-run` still runs configuration in full — variant callbacks, source set wiring, task
|
|
40
|
+
// graph construction — which is where every AGP API the plugin touches is exercised. It just
|
|
41
|
+
// skips the task actions, which would need a real RN app to produce anything meaningful.
|
|
42
|
+
GradleRunner.create()
|
|
43
|
+
.withProjectDir(projectDir)
|
|
44
|
+
.withPluginClasspath(pluginClasspathFor(agpVersion))
|
|
45
|
+
.withArguments("assembleDebug", "--dry-run", "--stacktrace")
|
|
46
|
+
.forwardOutput()
|
|
47
|
+
.build()
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@Test
|
|
51
|
+
fun `the apply-time gate rejects AGP older than the floor`(
|
|
52
|
+
@TempDir projectDir: File,
|
|
53
|
+
) {
|
|
54
|
+
val androidSdk = System.getenv("ANDROID_HOME") ?: System.getenv("ANDROID_SDK_ROOT")
|
|
55
|
+
assumeTrue(
|
|
56
|
+
androidSdk != null && File(androidSdk).isDirectory,
|
|
57
|
+
"no Android SDK available (ANDROID_HOME/ANDROID_SDK_ROOT); skipping AGP-dependent test",
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
writeFixture(projectDir, androidSdk!!)
|
|
61
|
+
|
|
62
|
+
val belowFloor = requireNotNull(System.getProperty("agp.belowFloor.version"))
|
|
63
|
+
val result =
|
|
64
|
+
GradleRunner.create()
|
|
65
|
+
.withProjectDir(projectDir)
|
|
66
|
+
.withPluginClasspath(pluginClasspathFor(belowFloor))
|
|
67
|
+
.withArguments("tasks")
|
|
68
|
+
.buildAndFail()
|
|
69
|
+
|
|
70
|
+
assertTrue(
|
|
71
|
+
result.output.contains("requires Android Gradle Plugin"),
|
|
72
|
+
"expected the plugin's own AGP gate to reject AGP $belowFloor, but the build failed " +
|
|
73
|
+
"for some other reason:\n${result.output}",
|
|
74
|
+
)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
private fun pluginClasspathFor(agpVersion: String): List<File> {
|
|
78
|
+
val raw =
|
|
79
|
+
requireNotNull(System.getProperty("agp.classpath.$agpVersion")) {
|
|
80
|
+
"no TestKit classpath was injected for AGP $agpVersion; check the agpMatrix wiring in build.gradle.kts"
|
|
81
|
+
}
|
|
82
|
+
return raw.split(File.pathSeparator).filter { it.isNotBlank() }.map(::File)
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
private fun writeFixture(
|
|
86
|
+
projectDir: File,
|
|
87
|
+
androidSdk: String,
|
|
88
|
+
) {
|
|
89
|
+
File(projectDir, "settings.gradle.kts").writeText(
|
|
90
|
+
"""
|
|
91
|
+
dependencyResolutionManagement {
|
|
92
|
+
repositories {
|
|
93
|
+
google()
|
|
94
|
+
mavenCentral()
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
rootProject.name = "agp-matrix-consumer"
|
|
98
|
+
include(":app")
|
|
99
|
+
include(":brownfieldlib")
|
|
100
|
+
""".trimIndent(),
|
|
101
|
+
)
|
|
102
|
+
File(projectDir, "local.properties").writeText("sdk.dir=$androidSdk\n")
|
|
103
|
+
// Stands in for the RN app project. It has to be a real `com.android.application` because
|
|
104
|
+
// the brownfield plugin wires into AGP's own app-side tasks; the extra registrations cover
|
|
105
|
+
// the tasks the React Native Gradle plugin would otherwise contribute. Empty registrations
|
|
106
|
+
// are enough: this test is about AGP API compatibility, not about what those tasks produce.
|
|
107
|
+
File(projectDir, "app").mkdirs()
|
|
108
|
+
File(projectDir, "app/build.gradle.kts").writeText(
|
|
109
|
+
"""
|
|
110
|
+
plugins {
|
|
111
|
+
id("com.android.application")
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
android {
|
|
115
|
+
namespace = "com.example.agpmatrix.app"
|
|
116
|
+
compileSdk = 34
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
listOf(
|
|
120
|
+
"generateAutolinkingPackageList",
|
|
121
|
+
"createBundleDebugJsAndAssets",
|
|
122
|
+
"createBundleReleaseJsAndAssets",
|
|
123
|
+
).forEach { name -> tasks.register(name) }
|
|
124
|
+
""".trimIndent(),
|
|
125
|
+
)
|
|
126
|
+
|
|
127
|
+
File(projectDir, "brownfieldlib").mkdirs()
|
|
128
|
+
File(projectDir, "brownfieldlib/build.gradle.kts").writeText(
|
|
129
|
+
"""
|
|
130
|
+
plugins {
|
|
131
|
+
id("com.android.library")
|
|
132
|
+
id("com.callstack.react.brownfield")
|
|
133
|
+
`maven-publish`
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
android {
|
|
137
|
+
namespace = "com.example.agpmatrix"
|
|
138
|
+
compileSdk = 34
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// Contributed by the React Native Gradle plugin in a real consumer; stubbed here for the
|
|
142
|
+
// same reason as the app-side tasks above.
|
|
143
|
+
tasks.register("generateCodegenSchemaFromJavaScript")
|
|
144
|
+
""".trimIndent(),
|
|
145
|
+
)
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
private companion object {
|
|
149
|
+
@JvmStatic
|
|
150
|
+
fun agpVersions(): List<String> =
|
|
151
|
+
requireNotNull(System.getProperty("agp.matrix.versions")) {
|
|
152
|
+
"agp.matrix.versions was not injected; check the agpMatrix wiring in build.gradle.kts"
|
|
153
|
+
}.split(",").filter { it.isNotBlank() }
|
|
154
|
+
}
|
|
155
|
+
}
|
|
@@ -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-alpha10';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
|
-
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
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.EXPO_SDK_OMIT_TARGET_SDK_FROM_MAJOR=void 0;exports.createAndroidModule=createAndroidModule;exports.renderTargetSdkBlock=renderTargetSdkBlock;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 _expoUtils=require("../expoUtils");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);}var EXPO_SDK_OMIT_TARGET_SDK_FROM_MAJOR=exports.EXPO_SDK_OMIT_TARGET_SDK_FROM_MAJOR=58;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 renderTargetSdkBlock(config,expoMajor){if(expoMajor!==undefined&&expoMajor>=EXPO_SDK_OMIT_TARGET_SDK_FROM_MAJOR){return'';}return`\n targetSdk = ${resolveTargetSdkVersionExpression(config)}`;}function createAndroidModule(_ref){var _minifyEnabled,_extraProguardRules;var androidDir=_ref.androidDir,config=_ref.config,rnVersion=_ref.rnVersion,projectRoot=_ref.projectRoot,expoMajor=_ref.expoMajor;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 targetSdkBlock=renderTargetSdkBlock(config,expoMajor);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_BLOCK}}':targetSdkBlock,'{{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',{'{{PACKAGE_NAME}}':android.packageName,'{{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,expoMajor:(0,_expoUtils.getExpoInfo)(dangerousConfig).expoMajor});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","_minifyEnabled","_extraProguardRules","androidDir","rnVersion","projectRoot","moduleDir","join","moduleName","Logger","logDebug","hermesArtifact","getHermesArtifact","compileSdkVersionExpression","
|
|
1
|
+
{"version":3,"names":["fs","_interopRequireWildcard","require","path","_configPlugins","_logging","_engine","_expoUtils","_androidManifest","_expoUpdates","_hermes","_formatHelpers","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","EXPO_SDK_OMIT_TARGET_SDK_FROM_MAJOR","exports","renderMissingDimensionStrategyBlock","missingDimensionStrategies","length","args","formatMissingDimensionStrategies","resolveCompileSdkVersionExpression","config","android","compileSdkVersion","toString","resolveTargetSdkVersionExpression","targetSdkVersion","renderTargetSdkBlock","expoMajor","undefined","createAndroidModule","_ref","_minifyEnabled","_extraProguardRules","androidDir","rnVersion","projectRoot","moduleDir","join","moduleName","Logger","logDebug","hermesArtifact","getHermesArtifact","compileSdkVersionExpression","targetSdkBlock","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","props","withDangerousMod","_ref5","_asyncToGenerator2","dangerousConfig","modRequest","rnPkgPath","resolve","paths","rnPkg","_unused","Error","getExpoInfo","_x","apply","arguments"],"sourceRoot":"../../../../src","sources":["expo-config-plugin/android/withAndroidModuleFiles.ts"],"mappings":"myBAAA,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,UAAA,CAAAL,OAAA,iBACA,IAAAM,gBAAA,CAAAN,OAAA,4BAMA,IAAAO,YAAA,CAAAP,OAAA,yBAIA,IAAAQ,OAAA,CAAAR,OAAA,mBACA,IAAAS,cAAA,CAAAT,OAAA,0BAAyE,SAAAD,wBAAAW,CAAA,CAAAC,CAAA,wBAAAC,OAAA,KAAAC,CAAA,KAAAD,OAAA,GAAAE,CAAA,KAAAF,OAAA,UAAAb,uBAAA,UAAAA,wBAAAW,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,IAA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kCAAkCN,SAAS,EAAE,CAAC,CAChE,CAAE,MAAA2D,OAAA,CAAM,CACN,KAAM,IAAI,CAAAC,KAAK,CACb,gGACF,CAAC,CACH,CAEAjE,mBAAmB,CAAC,CAClBI,UAAU,CAAVA,UAAU,CACVb,MAAM,CAAE+D,KAAK,CACbjD,SAAS,CAATA,SAAS,CACTC,WAAW,CAAEoD,eAAe,CAACC,UAAU,CAACrD,WAAW,CACnDR,SAAS,CAAE,GAAAoE,sBAAW,EAACR,eAAe,CAAC,CAAC5D,SAC1C,CAAC,CAAC,CAEF,MAAO,CAAA4D,eAAe,CACxB,CAAC,kBAAAS,EAAA,SAAAX,KAAA,CAAAY,KAAA,MAAAC,SAAA,SACF,CAAC,CACJ,CAAC","ignoreList":[]}
|
|
@@ -26,6 +26,6 @@
|
|
|
26
26
|
-dontwarn java.lang.invoke.StringConcatFactory
|
|
27
27
|
|
|
28
28
|
# Public API consumed from the Brownfield AAR.
|
|
29
|
-
-keep class
|
|
29
|
+
-keep class {{PACKAGE_NAME}}.ReactNativeHostManager { *; }
|
|
30
30
|
|
|
31
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-alpha10';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
|
-
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
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.EXPO_SDK_OMIT_TARGET_SDK_FROM_MAJOR=void 0;exports.createAndroidModule=createAndroidModule;exports.renderTargetSdkBlock=renderTargetSdkBlock;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 _expoUtils=require("../expoUtils");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);}var EXPO_SDK_OMIT_TARGET_SDK_FROM_MAJOR=exports.EXPO_SDK_OMIT_TARGET_SDK_FROM_MAJOR=58;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 renderTargetSdkBlock(config,expoMajor){if(expoMajor!==undefined&&expoMajor>=EXPO_SDK_OMIT_TARGET_SDK_FROM_MAJOR){return'';}return`\n targetSdk = ${resolveTargetSdkVersionExpression(config)}`;}function createAndroidModule(_ref){var _minifyEnabled,_extraProguardRules;var androidDir=_ref.androidDir,config=_ref.config,rnVersion=_ref.rnVersion,projectRoot=_ref.projectRoot,expoMajor=_ref.expoMajor;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 targetSdkBlock=renderTargetSdkBlock(config,expoMajor);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_BLOCK}}':targetSdkBlock,'{{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',{'{{PACKAGE_NAME}}':android.packageName,'{{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,expoMajor:(0,_expoUtils.getExpoInfo)(dangerousConfig).expoMajor});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","_minifyEnabled","_extraProguardRules","androidDir","rnVersion","projectRoot","moduleDir","join","moduleName","Logger","logDebug","hermesArtifact","getHermesArtifact","compileSdkVersionExpression","
|
|
1
|
+
{"version":3,"names":["fs","_interopRequireWildcard","require","path","_configPlugins","_logging","_engine","_expoUtils","_androidManifest","_expoUpdates","_hermes","_formatHelpers","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","EXPO_SDK_OMIT_TARGET_SDK_FROM_MAJOR","exports","renderMissingDimensionStrategyBlock","missingDimensionStrategies","length","args","formatMissingDimensionStrategies","resolveCompileSdkVersionExpression","config","android","compileSdkVersion","toString","resolveTargetSdkVersionExpression","targetSdkVersion","renderTargetSdkBlock","expoMajor","undefined","createAndroidModule","_ref","_minifyEnabled","_extraProguardRules","androidDir","rnVersion","projectRoot","moduleDir","join","moduleName","Logger","logDebug","hermesArtifact","getHermesArtifact","compileSdkVersionExpression","targetSdkBlock","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","props","withDangerousMod","_ref5","_asyncToGenerator2","dangerousConfig","modRequest","rnPkgPath","resolve","paths","rnPkg","_unused","Error","getExpoInfo","_x","apply","arguments"],"sourceRoot":"../../../../src","sources":["expo-config-plugin/android/withAndroidModuleFiles.ts"],"mappings":"myBAAA,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,UAAA,CAAAL,OAAA,iBACA,IAAAM,gBAAA,CAAAN,OAAA,4BAMA,IAAAO,YAAA,CAAAP,OAAA,yBAIA,IAAAQ,OAAA,CAAAR,OAAA,mBACA,IAAAS,cAAA,CAAAT,OAAA,0BAAyE,SAAAD,wBAAAW,CAAA,CAAAC,CAAA,wBAAAC,OAAA,KAAAC,CAAA,KAAAD,OAAA,GAAAE,CAAA,KAAAF,OAAA,UAAAb,uBAAA,UAAAA,wBAAAW,CAAA,CAAAC,CAAA,MAAAA,CAAA,EAAAD,CAAA,EAAAA,CAAA,CAAAK,UAAA,QAAAL,CAAA,KAAAM,CAAA,CAA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GAAI,CAAAD,SAAiB,CACrB,GAAI,CACF,GAAM,CAAAuD,SAAS,CAAG3G,OAAO,CAAC4G,OAAO,CAAC,2BAA2B,CAAE,CAC7DC,KAAK,CAAE,CAACJ,eAAe,CAACC,UAAU,CAACrD,WAAW,CAChD,CAAC,CAAC,CAEF,GAAM,CAAAyD,KAAK,CAAG9G,OAAO,CAAC2G,SAAS,CAAC,CAEhCvD,SAAS,CAAG0D,KAAK,CAAC1C,OAAO,CAEzBX,eAAM,CAACC,QAAQ,CAAC,kCAAkCN,SAAS,EAAE,CAAC,CAChE,CAAE,MAAA2D,OAAA,CAAM,CACN,KAAM,IAAI,CAAAC,KAAK,CACb,gGACF,CAAC,CACH,CAEAjE,mBAAmB,CAAC,CAClBI,UAAU,CAAVA,UAAU,CACVb,MAAM,CAAE+D,KAAK,CACbjD,SAAS,CAATA,SAAS,CACTC,WAAW,CAAEoD,eAAe,CAACC,UAAU,CAACrD,WAAW,CACnDR,SAAS,CAAE,GAAAoE,sBAAW,EAACR,eAAe,CAAC,CAAC5D,SAC1C,CAAC,CAAC,CAEF,MAAO,CAAA4D,eAAe,CACxB,CAAC,kBAAAS,EAAA,SAAAX,KAAA,CAAAY,KAAA,MAAAC,SAAA,SACF,CAAC,CACJ,CAAC","ignoreList":[]}
|
|
@@ -26,6 +26,6 @@
|
|
|
26
26
|
-dontwarn java.lang.invoke.StringConcatFactory
|
|
27
27
|
|
|
28
28
|
# Public API consumed from the Brownfield AAR.
|
|
29
|
-
-keep class
|
|
29
|
+
-keep class {{PACKAGE_NAME}}.ReactNativeHostManager { *; }
|
|
30
30
|
|
|
31
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-alpha10";
|
|
2
|
+
export declare const brownfieldGradlePluginDependency = "classpath(\"com.callstack.react:brownfield-gradle-plugin:2.0.0-alpha10\")";
|
|
3
3
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import { type ConfigPlugin } from '@expo/config-plugins';
|
|
2
2
|
import type { ResolvedBrownfieldPluginConfigWithAndroid } from '../types';
|
|
3
3
|
import { type AndroidManifestMetaDataEntry, type AndroidStringResourceEntry } from './utils/androidManifest';
|
|
4
|
+
/**
|
|
5
|
+
* Expo SDK 58+ Android library modules should not set `targetSdk`.
|
|
6
|
+
* Keep emitting it for older SDKs that still require the field.
|
|
7
|
+
*/
|
|
8
|
+
export declare const EXPO_SDK_OMIT_TARGET_SDK_FROM_MAJOR = 58;
|
|
4
9
|
export declare function resolveCompileSdkVersionExpression(config: ResolvedBrownfieldPluginConfigWithAndroid): string;
|
|
5
10
|
export declare function resolveTargetSdkVersionExpression(config: ResolvedBrownfieldPluginConfigWithAndroid): string;
|
|
11
|
+
export declare function renderTargetSdkBlock(config: ResolvedBrownfieldPluginConfigWithAndroid, expoMajor?: number): string;
|
|
6
12
|
/**
|
|
7
13
|
* Creates the Android library module directory structure and files
|
|
8
14
|
*/
|
|
9
|
-
export declare function createAndroidModule({ androidDir, config, rnVersion, projectRoot, }: {
|
|
15
|
+
export declare function createAndroidModule({ androidDir, config, rnVersion, projectRoot, expoMajor, }: {
|
|
10
16
|
/**
|
|
11
17
|
* Expo app root (used to detect optional dependencies such as expo-updates)
|
|
12
18
|
*/
|
|
@@ -19,6 +25,10 @@ export declare function createAndroidModule({ androidDir, config, rnVersion, pro
|
|
|
19
25
|
* The resolved RN version
|
|
20
26
|
*/
|
|
21
27
|
rnVersion: string;
|
|
28
|
+
/**
|
|
29
|
+
* Expo SDK major version used to gate Android library `targetSdk`.
|
|
30
|
+
*/
|
|
31
|
+
expoMajor?: number;
|
|
22
32
|
/**
|
|
23
33
|
* The resolved Brownfield plugin configuration
|
|
24
34
|
*/
|
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;
|
|
1
|
+
{"version":3,"file":"withAndroidModuleFiles.d.ts","sourceRoot":"","sources":["../../../../../../src/expo-config-plugin/android/withAndroidModuleFiles.ts"],"names":[],"mappings":"AAGA,OAAO,EAAoB,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAE3E,OAAO,KAAK,EAEV,yCAAyC,EAC1C,MAAM,UAAU,CAAC;AAIlB,OAAO,EACL,KAAK,4BAA4B,EACjC,KAAK,0BAA0B,EAGhC,MAAM,yBAAyB,CAAC;AAQjC;;;GAGG;AACH,eAAO,MAAM,mCAAmC,KAAK,CAAC;AAatD,wBAAgB,kCAAkC,CAChD,MAAM,EAAE,yCAAyC,GAChD,MAAM,CAMR;AAED,wBAAgB,iCAAiC,CAC/C,MAAM,EAAE,yCAAyC,GAChD,MAAM,CAMR;AAED,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,yCAAyC,EACjD,SAAS,CAAC,EAAE,MAAM,GACjB,MAAM,CASR;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,UAAU,EACV,MAAM,EACN,SAAS,EACT,WAAW,EACX,SAAS,GACV,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,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,MAAM,EAAE,yCAAyC,CAAC;CACnD,GAAG,IAAI,CA0FP;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,CAsC1C,CAAC"}
|
|
@@ -18,13 +18,14 @@ export interface BrownfieldPluginAndroidConfig {
|
|
|
18
18
|
*/
|
|
19
19
|
minSdkVersion?: number;
|
|
20
20
|
/**
|
|
21
|
-
* Target SDK version for the Android library
|
|
21
|
+
* Target SDK version for the Android library.
|
|
22
|
+
* Used on Expo SDK versions below 58; ignored on 58 and later.
|
|
22
23
|
* @default inherited from the generated Expo app project when available
|
|
23
24
|
*/
|
|
24
25
|
targetSdkVersion?: number;
|
|
25
26
|
/**
|
|
26
27
|
* Compile SDK version for the Android library
|
|
27
|
-
* @default
|
|
28
|
+
* @default 37 on Expo SDK 58 and later, otherwise 35
|
|
28
29
|
*/
|
|
29
30
|
compileSdkVersion?: number;
|
|
30
31
|
/**
|
|
@@ -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
|
|
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;;;;OAIG;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-alpha10";
|
|
2
|
+
export declare const brownfieldGradlePluginDependency = "classpath(\"com.callstack.react:brownfield-gradle-plugin:2.0.0-alpha10\")";
|
|
3
3
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import { type ConfigPlugin } from '@expo/config-plugins';
|
|
2
2
|
import type { ResolvedBrownfieldPluginConfigWithAndroid } from '../types';
|
|
3
3
|
import { type AndroidManifestMetaDataEntry, type AndroidStringResourceEntry } from './utils/androidManifest';
|
|
4
|
+
/**
|
|
5
|
+
* Expo SDK 58+ Android library modules should not set `targetSdk`.
|
|
6
|
+
* Keep emitting it for older SDKs that still require the field.
|
|
7
|
+
*/
|
|
8
|
+
export declare const EXPO_SDK_OMIT_TARGET_SDK_FROM_MAJOR = 58;
|
|
4
9
|
export declare function resolveCompileSdkVersionExpression(config: ResolvedBrownfieldPluginConfigWithAndroid): string;
|
|
5
10
|
export declare function resolveTargetSdkVersionExpression(config: ResolvedBrownfieldPluginConfigWithAndroid): string;
|
|
11
|
+
export declare function renderTargetSdkBlock(config: ResolvedBrownfieldPluginConfigWithAndroid, expoMajor?: number): string;
|
|
6
12
|
/**
|
|
7
13
|
* Creates the Android library module directory structure and files
|
|
8
14
|
*/
|
|
9
|
-
export declare function createAndroidModule({ androidDir, config, rnVersion, projectRoot, }: {
|
|
15
|
+
export declare function createAndroidModule({ androidDir, config, rnVersion, projectRoot, expoMajor, }: {
|
|
10
16
|
/**
|
|
11
17
|
* Expo app root (used to detect optional dependencies such as expo-updates)
|
|
12
18
|
*/
|
|
@@ -19,6 +25,10 @@ export declare function createAndroidModule({ androidDir, config, rnVersion, pro
|
|
|
19
25
|
* The resolved RN version
|
|
20
26
|
*/
|
|
21
27
|
rnVersion: string;
|
|
28
|
+
/**
|
|
29
|
+
* Expo SDK major version used to gate Android library `targetSdk`.
|
|
30
|
+
*/
|
|
31
|
+
expoMajor?: number;
|
|
22
32
|
/**
|
|
23
33
|
* The resolved Brownfield plugin configuration
|
|
24
34
|
*/
|
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;
|
|
1
|
+
{"version":3,"file":"withAndroidModuleFiles.d.ts","sourceRoot":"","sources":["../../../../../../src/expo-config-plugin/android/withAndroidModuleFiles.ts"],"names":[],"mappings":"AAGA,OAAO,EAAoB,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAE3E,OAAO,KAAK,EAEV,yCAAyC,EAC1C,MAAM,UAAU,CAAC;AAIlB,OAAO,EACL,KAAK,4BAA4B,EACjC,KAAK,0BAA0B,EAGhC,MAAM,yBAAyB,CAAC;AAQjC;;;GAGG;AACH,eAAO,MAAM,mCAAmC,KAAK,CAAC;AAatD,wBAAgB,kCAAkC,CAChD,MAAM,EAAE,yCAAyC,GAChD,MAAM,CAMR;AAED,wBAAgB,iCAAiC,CAC/C,MAAM,EAAE,yCAAyC,GAChD,MAAM,CAMR;AAED,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,yCAAyC,EACjD,SAAS,CAAC,EAAE,MAAM,GACjB,MAAM,CASR;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,UAAU,EACV,MAAM,EACN,SAAS,EACT,WAAW,EACX,SAAS,GACV,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,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,MAAM,EAAE,yCAAyC,CAAC;CACnD,GAAG,IAAI,CA0FP;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,CAsC1C,CAAC"}
|
|
@@ -18,13 +18,14 @@ export interface BrownfieldPluginAndroidConfig {
|
|
|
18
18
|
*/
|
|
19
19
|
minSdkVersion?: number;
|
|
20
20
|
/**
|
|
21
|
-
* Target SDK version for the Android library
|
|
21
|
+
* Target SDK version for the Android library.
|
|
22
|
+
* Used on Expo SDK versions below 58; ignored on 58 and later.
|
|
22
23
|
* @default inherited from the generated Expo app project when available
|
|
23
24
|
*/
|
|
24
25
|
targetSdkVersion?: number;
|
|
25
26
|
/**
|
|
26
27
|
* Compile SDK version for the Android library
|
|
27
|
-
* @default
|
|
28
|
+
* @default 37 on Expo SDK 58 and later, otherwise 35
|
|
28
29
|
*/
|
|
29
30
|
compileSdkVersion?: number;
|
|
30
31
|
/**
|
|
@@ -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
|
|
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;;;;OAIG;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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@callstack/react-native-brownfield",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.2.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Michal Chudziak <mike.chudziak@callstack.com>",
|
|
6
6
|
"bin": {
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
"@expo/config-plugins": ">=54 <100"
|
|
90
90
|
},
|
|
91
91
|
"dependencies": {
|
|
92
|
-
"@callstack/brownfield-cli": "^5.
|
|
92
|
+
"@callstack/brownfield-cli": "^5.2.0"
|
|
93
93
|
},
|
|
94
94
|
"devDependencies": {
|
|
95
95
|
"@babel/core": "^7.29.6",
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const BROWNFIELD_PLUGIN_VERSION = '2.0.0-
|
|
1
|
+
export const BROWNFIELD_PLUGIN_VERSION = '2.0.0-alpha10';
|
|
2
2
|
export const brownfieldGradlePluginDependency = `classpath("com.callstack.react:brownfield-gradle-plugin:${BROWNFIELD_PLUGIN_VERSION}")`;
|
|
@@ -9,6 +9,7 @@ import type {
|
|
|
9
9
|
} from '../types';
|
|
10
10
|
import { Logger } from '../logging';
|
|
11
11
|
import { renderTemplate } from '../template/engine';
|
|
12
|
+
import { getExpoInfo } from '../expoUtils';
|
|
12
13
|
import {
|
|
13
14
|
type AndroidManifestMetaDataEntry,
|
|
14
15
|
type AndroidStringResourceEntry,
|
|
@@ -22,6 +23,12 @@ import {
|
|
|
22
23
|
import { getHermesArtifact } from './utils/hermes';
|
|
23
24
|
import { formatMissingDimensionStrategies } from './utils/formatHelpers';
|
|
24
25
|
|
|
26
|
+
/**
|
|
27
|
+
* Expo SDK 58+ Android library modules should not set `targetSdk`.
|
|
28
|
+
* Keep emitting it for older SDKs that still require the field.
|
|
29
|
+
*/
|
|
30
|
+
export const EXPO_SDK_OMIT_TARGET_SDK_FROM_MAJOR = 58;
|
|
31
|
+
|
|
25
32
|
function renderMissingDimensionStrategyBlock(
|
|
26
33
|
missingDimensionStrategies: string[]
|
|
27
34
|
): string {
|
|
@@ -53,6 +60,20 @@ export function resolveTargetSdkVersionExpression(
|
|
|
53
60
|
return 'resolveRootProjectInt("targetSdkVersion")';
|
|
54
61
|
}
|
|
55
62
|
|
|
63
|
+
export function renderTargetSdkBlock(
|
|
64
|
+
config: ResolvedBrownfieldPluginConfigWithAndroid,
|
|
65
|
+
expoMajor?: number
|
|
66
|
+
): string {
|
|
67
|
+
if (
|
|
68
|
+
expoMajor !== undefined &&
|
|
69
|
+
expoMajor >= EXPO_SDK_OMIT_TARGET_SDK_FROM_MAJOR
|
|
70
|
+
) {
|
|
71
|
+
return '';
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return `\n targetSdk = ${resolveTargetSdkVersionExpression(config)}`;
|
|
75
|
+
}
|
|
76
|
+
|
|
56
77
|
/**
|
|
57
78
|
* Creates the Android library module directory structure and files
|
|
58
79
|
*/
|
|
@@ -61,6 +82,7 @@ export function createAndroidModule({
|
|
|
61
82
|
config,
|
|
62
83
|
rnVersion,
|
|
63
84
|
projectRoot,
|
|
85
|
+
expoMajor,
|
|
64
86
|
}: {
|
|
65
87
|
/**
|
|
66
88
|
* Expo app root (used to detect optional dependencies such as expo-updates)
|
|
@@ -76,6 +98,11 @@ export function createAndroidModule({
|
|
|
76
98
|
*/
|
|
77
99
|
rnVersion: string;
|
|
78
100
|
|
|
101
|
+
/**
|
|
102
|
+
* Expo SDK major version used to gate Android library `targetSdk`.
|
|
103
|
+
*/
|
|
104
|
+
expoMajor?: number;
|
|
105
|
+
|
|
79
106
|
/**
|
|
80
107
|
* The resolved Brownfield plugin configuration
|
|
81
108
|
*/
|
|
@@ -89,7 +116,7 @@ export function createAndroidModule({
|
|
|
89
116
|
const hermesArtifact = getHermesArtifact(rnVersion, projectRoot);
|
|
90
117
|
const compileSdkVersionExpression =
|
|
91
118
|
resolveCompileSdkVersionExpression(config);
|
|
92
|
-
const
|
|
119
|
+
const targetSdkBlock = renderTargetSdkBlock(config, expoMajor);
|
|
93
120
|
const minifyEnabled =
|
|
94
121
|
(android as { minifyEnabled?: boolean }).minifyEnabled ?? false;
|
|
95
122
|
const extraProguardRules =
|
|
@@ -112,7 +139,7 @@ export function createAndroidModule({
|
|
|
112
139
|
content: renderTemplate('android', 'build.gradle.kts', {
|
|
113
140
|
'{{PACKAGE_NAME}}': android.packageName,
|
|
114
141
|
'{{MIN_SDK_VERSION}}': android.minSdkVersion.toString(),
|
|
115
|
-
'{{
|
|
142
|
+
'{{TARGET_SDK_BLOCK}}': targetSdkBlock,
|
|
116
143
|
'{{COMPILE_SDK_VERSION}}': compileSdkVersionExpression,
|
|
117
144
|
'{{GROUP_ID}}': android.groupId,
|
|
118
145
|
'{{ARTIFACT_ID}}': android.artifactId,
|
|
@@ -141,6 +168,7 @@ export function createAndroidModule({
|
|
|
141
168
|
{
|
|
142
169
|
relativePath: 'proguard-rules.pro',
|
|
143
170
|
content: renderTemplate('android', 'proguard-rules.pro', {
|
|
171
|
+
'{{PACKAGE_NAME}}': android.packageName,
|
|
144
172
|
'{{EXTRA_PROGUARD_RULES}}': extraProguardRulesText,
|
|
145
173
|
}),
|
|
146
174
|
},
|
|
@@ -292,6 +320,7 @@ export const withAndroidModuleFiles: ConfigPlugin<
|
|
|
292
320
|
config: props,
|
|
293
321
|
rnVersion,
|
|
294
322
|
projectRoot: dangerousConfig.modRequest.projectRoot,
|
|
323
|
+
expoMajor: getExpoInfo(dangerousConfig).expoMajor,
|
|
295
324
|
});
|
|
296
325
|
|
|
297
326
|
return dangerousConfig;
|
|
@@ -26,6 +26,6 @@
|
|
|
26
26
|
-dontwarn java.lang.invoke.StringConcatFactory
|
|
27
27
|
|
|
28
28
|
# Public API consumed from the Brownfield AAR.
|
|
29
|
-
-keep class
|
|
29
|
+
-keep class {{PACKAGE_NAME}}.ReactNativeHostManager { *; }
|
|
30
30
|
|
|
31
31
|
{{EXTRA_PROGUARD_RULES}}
|
|
@@ -21,14 +21,15 @@ export interface BrownfieldPluginAndroidConfig {
|
|
|
21
21
|
minSdkVersion?: number;
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
|
-
* Target SDK version for the Android library
|
|
24
|
+
* Target SDK version for the Android library.
|
|
25
|
+
* Used on Expo SDK versions below 58; ignored on 58 and later.
|
|
25
26
|
* @default inherited from the generated Expo app project when available
|
|
26
27
|
*/
|
|
27
28
|
targetSdkVersion?: number;
|
|
28
29
|
|
|
29
30
|
/**
|
|
30
31
|
* Compile SDK version for the Android library
|
|
31
|
-
* @default
|
|
32
|
+
* @default 37 on Expo SDK 58 and later, otherwise 35
|
|
32
33
|
*/
|
|
33
34
|
compileSdkVersion?: number;
|
|
34
35
|
|