Fix binary incompatibility with Android Gradle plugin 3.2.0-alpha06

Remove a non-reflective usage of the ResourceSet class, which has been
moved to a different package between versions. Access it through
reflection instead. This is a workaround. We can introduce a proper
fix once we have a public API in the Android plugin.

The test case that could detect the compatibility issue is
`testAndroidExtensionsManyVariants` (it uses experimental Android
extensions), but we did not run it with 3.2.0-alpha6. This commit
adds a test class with the same tests for 3.2.0-alpha6.

Issue #KT-23192 Fixed
This commit is contained in:
Sergey Igushkin
2018-03-13 20:56:59 +03:00
parent 3a7a34cc4e
commit 0039be6972
3 changed files with 26 additions and 11 deletions
@@ -13,7 +13,15 @@ import java.io.File
class KotlinAndroidGradleIT : AbstractKotlinAndroidGradleTests(gradleVersion = GradleVersionRequired.AtLeast("3.4"), androidGradlePluginVersion = "2.3.0")
class KotlinAndroidWithJackGradleIT : AbstractKotlinAndroidWithJackGradleTests(androidGradlePluginVersion = "2.3.+")
class KotlinAndroid30GradleIT : AbstractKotlinAndroidGradleTests(gradleVersion = GradleVersionRequired.AtLeast("4.1"), androidGradlePluginVersion = "3.0.0-beta1") {
// TODO If we there is a way to fetch the latest Android plugin version, test against the latest version
class KotlinAndroid32GradleIT : KotlinAndroid3GradleIT(GradleVersionRequired.AtLeast("4.5"), "3.2.0-alpha06")
class KotlinAndroid30GradleIT : KotlinAndroid3GradleIT(GradleVersionRequired.AtLeast("4.1"), "3.0.0")
abstract class KotlinAndroid3GradleIT(
gradleVersionRequired: GradleVersionRequired,
androidGradlePluginVersion: String
) : AbstractKotlinAndroidGradleTests(gradleVersionRequired, androidGradlePluginVersion) {
@Test
fun testApplyWithFeaturePlugin() {
@@ -314,5 +322,4 @@ abstract class AbstractKotlinAndroidWithJackGradleTests(
assertContains("Kotlin Gradle plugin does not support the deprecated Jack toolchain")
}
}
}
}
@@ -13,7 +13,7 @@ buildscript {
allprojects {
repositories {
mavenLocal()
mavenCentral()
jcenter()
maven { url 'https://maven.google.com' }
}
}