Skip to content
This repository was archived by the owner on Jan 6, 2024. It is now read-only.

Commit 1b5c210

Browse files
authoredDec 5, 2023
Merge pull request #3 from LikeTheSalad/release/1.5.0
Release/1.5.0
2 parents 2d2a3d2 + 3fdf890 commit 1b5c210

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed
 

‎agp-compatibility/agp-compatibility-api/src/main/java/com/likethesalad/tools/agpcompat/api/AgpCompatibilityEntrypoint.kt

+6-6
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ abstract class AgpCompatibilityEntrypoint {
3333

3434
private fun getCurrentAgpVersion(project: Project): AgpVersion? {
3535
return try {
36-
val componentsExtensionType = Class.forName("com.android.build.api.variant.AndroidComponentsExtension")
37-
val componentsExtension = project.extensions.findByType(componentsExtensionType)
38-
val pluginVersionGetter = componentsExtensionType.getDeclaredMethod("getPluginVersion")
39-
val currentVersion = pluginVersionGetter.invoke(componentsExtension)
40-
androidPluginVersionToAgpVersion(currentVersion)
41-
} catch (e: ClassNotFoundException) {
36+
project.extensions.findByName("androidComponents")?.let { componentsExtension ->
37+
val pluginVersionGetter = componentsExtension.javaClass.getDeclaredMethod("getPluginVersion")
38+
val currentVersion = pluginVersionGetter.invoke(componentsExtension)
39+
androidPluginVersionToAgpVersion(currentVersion)
40+
}
41+
} catch (e: NoSuchMethodException) {
4242
null
4343
}
4444
}

‎build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ artifactPublisher {
2121

2222
description = "Gradle plugin that extracts android plugin information"
2323
group = "com.likethesalad.tools"
24-
version = "1.4.0"
24+
version = "1.5.1"
2525

2626
allprojects {
2727
repositories {

0 commit comments

Comments
 (0)
This repository has been archived.