Skip to content

Commit e60954e

Browse files
committed
Add a property to force legacy api usage
1 parent 2c735dd commit e60954e

File tree

1 file changed

+4
-0
lines changed
  • gradle-plugin/src/main/kotlin/com/google/devtools/ksp/gradle/utils

1 file changed

+4
-0
lines changed

gradle-plugin/src/main/kotlin/com/google/devtools/ksp/gradle/utils/agpUtils.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ fun checkMinimumAgpVersion(pluginVersion: AndroidPluginVersion) {
3434
fun Project.useLegacyVariantApi(): Boolean {
3535
val agpVersion = project.getAgpVersion() ?: return true
3636

37+
if (providers.gradleProperty("force.legacy.variant.api").orNull == "true") {
38+
return true
39+
}
40+
3741
// Fall back to using the legacy Variant API if the AGP version can't be determined for now.
3842
return agpVersion < AndroidPluginVersion(8, 10, 0).alpha(3)
3943
}

0 commit comments

Comments
 (0)