mirror of
https://github.com/D-Modem/app.git
synced 2026-11-28 17:38:05 -08:00
Robolectric's jars: one configuration for each jar
The SDK 28 tests failed: "Path is not a file: .../robolectric-jars/ android-all-instrumented-9-robolectric-4913185-2-i7.jar". In one configuration, Gradle keeps only the highest version of a module, so it resolved only the SDK 35 jar. Now each jar has its own configuration. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B82eRSYSk1rgeTZ9ZWMcZL Signed-off-by: Neo-Desktop <321592+Neo-Desktop@users.noreply.github.com>
This commit is contained in:
1 parent
21cb0e5412
commit
60cd80c8f9
1 file changed
+9
-7
@@ -209,14 +209,16 @@ val buildHostSsh = tasks.register<Exec>("buildHostSsh") {
|
||||
// A new SDK in a test's @Config: add its jar here. Robolectric's DefaultSdkProvider gives the version
|
||||
// for its release (libs.versions.toml): "<Android version>-robolectric-<build>-i<instrumentation>".
|
||||
// -ProbolectricRepoUrl=<a Maven mirror>: Robolectric downloads them itself from that mirror instead.
|
||||
val robolectricJars = configurations.create("robolectricJars") {
|
||||
isTransitive = false
|
||||
isCanBeConsumed = false
|
||||
}
|
||||
dependencies {
|
||||
// (one configuration for each jar: in one configuration, Gradle keeps only the highest version of a module)
|
||||
val robolectricJars = mapOf(
|
||||
// SDK 28 (Android 9) and SDK 35 (Android 15), Robolectric 4.17's jars
|
||||
robolectricJars("org.robolectric:android-all-instrumented:9-robolectric-4913185-2-i7")
|
||||
robolectricJars("org.robolectric:android-all-instrumented:15-robolectric-13954326-i7")
|
||||
28 to "org.robolectric:android-all-instrumented:9-robolectric-4913185-2-i7",
|
||||
35 to "org.robolectric:android-all-instrumented:15-robolectric-13954326-i7",
|
||||
).map { (sdk, jar) ->
|
||||
configurations.create("robolectricJarsSdk$sdk") {
|
||||
isTransitive = false
|
||||
isCanBeConsumed = false
|
||||
}.also { dependencies.add(it.name, jar) }
|
||||
}
|
||||
val robolectricJarsDir = layout.buildDirectory.dir("robolectric-jars")
|
||||
val syncRobolectricJars = tasks.register<Sync>("syncRobolectricJars") {
|
||||
|
||||
Reference in new issue
Block a user