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

Commit

Permalink
Merge pull request #3 from LikeTheSalad/release/1.5.0
Browse files Browse the repository at this point in the history
Release/1.5.0
  • Loading branch information
LikeTheSalad authored Dec 5, 2023
2 parents 2d2a3d2 + 3fdf890 commit 1b5c210
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ abstract class AgpCompatibilityEntrypoint {

private fun getCurrentAgpVersion(project: Project): AgpVersion? {
return try {
val componentsExtensionType = Class.forName("com.android.build.api.variant.AndroidComponentsExtension")
val componentsExtension = project.extensions.findByType(componentsExtensionType)
val pluginVersionGetter = componentsExtensionType.getDeclaredMethod("getPluginVersion")
val currentVersion = pluginVersionGetter.invoke(componentsExtension)
androidPluginVersionToAgpVersion(currentVersion)
} catch (e: ClassNotFoundException) {
project.extensions.findByName("androidComponents")?.let { componentsExtension ->
val pluginVersionGetter = componentsExtension.javaClass.getDeclaredMethod("getPluginVersion")
val currentVersion = pluginVersionGetter.invoke(componentsExtension)
androidPluginVersionToAgpVersion(currentVersion)
}
} catch (e: NoSuchMethodException) {
null
}
}
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ artifactPublisher {

description = "Gradle plugin that extracts android plugin information"
group = "com.likethesalad.tools"
version = "1.4.0"
version = "1.5.1"

allprojects {
repositories {
Expand Down

0 comments on commit 1b5c210

Please sign in to comment.