Skip to content

Commit

Permalink
Update support with comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Pluu committed May 18, 2024
1 parent 084d373 commit 68c3fa8
Showing 1 changed file with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.kotlin.dsl.extra
import java.io.File
import java.lang.System.getProperty

class AndroidVersionCatalogsLoaderPlugin : Plugin<Project> {
private val modules: MutableMap<String, String> = mutableMapOf()
Expand Down Expand Up @@ -71,15 +70,10 @@ internal class TomlLoader(
}

private fun Project.loadVersionsLine(line: String) {
val result = VERSION_PATTERN.matchEntire(line)
val result = VERSION_PATTERN.find(line)
if (result != null) {
val name = result.groups["NAME"]!!.value
// some versions are overridden by gradle/versions_catalog.gradle
val version = when (name) {
in "android-gradle" -> getProperty("androidGradlePluginVersion")
in "buildconfig" -> getProperty("buildConfigPluginVersion")
else -> result.groups["VERSION"]!!.value
}
val version = result.groups["VERSION"]!!.value
versions[name] = version
}
}
Expand Down

0 comments on commit 68c3fa8

Please # to comment.