From b396c20276ab3514638b8f21294888067e9dc2f3 Mon Sep 17 00:00:00 2001 From: Jean-Michel Fayard Date: Sat, 7 Aug 2021 21:21:06 +0200 Subject: [PATCH 001/103] refreshVersionsCatalog generates a Versions Catalog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If your project is using Gradle 7.0, you can use instead [Gradle versions catalog](https://docs.gradle.org/current/userguide/platforms.html) ```bash $ ./gradlew refreshVersionsCatalog > Task :refreshVersionsCatalog new file: gradle/libs.versions.toml modified: settings.gradle.kts modified: versions.properties ``` The generated versions catalog looks like this: ```toml ## Generated by $ ./gradlew refreshVersionsCatalog [libraries] browser = "androidx.browser:browser:_" cardview = "androidx.cardview:cardview:_" okhttp = "com.squareup.okhttp3:okhttp:_" junit = "junit:junit:_" ``` Like with buildSrcLibs, you get type-safe accessors available in the IDE: refreshVersions_–_build_gradle_kts__sample-kotlin_ --- .../core/VersionsCatalogTask.kt | 121 ++++++++++++++++++ .../refreshVersions/core/TomlSectionTest.kt | 62 +++++++++ .../refreshVersions/RefreshVersionsPlugin.kt | 12 +- sample-kotlin/build.gradle.kts | 1 + sample-kotlin/gradle/libs.versions.toml | 45 +++++++ .../gradle/wrapper/gradle-wrapper.properties | 2 +- sample-kotlin/settings.gradle.kts | 3 + sample-kotlin/versions.properties | 12 +- .../buildSrc/src/main/kotlin/Libs.kt | 2 + sample-multi-modules/module1/build.gradle.kts | 1 + sample-multi-modules/settings.gradle.kts | 2 + 11 files changed, 257 insertions(+), 6 deletions(-) create mode 100644 plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/VersionsCatalogTask.kt create mode 100644 plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlSectionTest.kt create mode 100644 sample-kotlin/gradle/libs.versions.toml diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/VersionsCatalogTask.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/VersionsCatalogTask.kt new file mode 100644 index 000000000..bf323e306 --- /dev/null +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/VersionsCatalogTask.kt @@ -0,0 +1,121 @@ +package de.fayard.refreshVersions.core + +import de.fayard.buildSrcLibs.internal.* +import de.fayard.buildSrcLibs.internal.Case +import de.fayard.refreshVersions.core.internal.OutputFile +import org.gradle.api.DefaultTask +import org.gradle.api.GradleException +import org.gradle.api.tasks.TaskAction +import org.gradle.util.GradleVersion + +@Suppress("UnstableApiUsage") +open class VersionsCatalogTask : DefaultTask() { + + @TaskAction + fun addMissingEntries() { + addMissingEntriesInVersionsProperties(project) + } + + @TaskAction + fun taskActionEnableSupport() { + OutputFile.checkWhichFilesExist(project.rootDir) + + if (GradleVersion.current() < GradleVersion.version("7.0")) { + throw GradleException( + """ + |Gradle versions catalogs are only supported in Gradle 7+ + |Upgrade first with this command + | ./gradlew wrapper --gradle-version 7.0 + """.trimMargin() + ) + } + val file = + if (OutputFile.SETTINGS_GRADLE.existed) OutputFile.SETTINGS_GRADLE else OutputFile.SETTINGS_GRADLE_KTS + val settingsText = file.readText(project) + val alreadyConfigured = settingsText.lines().any { it.containsVersionsCatalogDeclaration() } + if (!alreadyConfigured) { + val newText = (""" + |${settingsText} + |// Enable Gradle's version catalog support https://docs.gradle.org/current/userguide/platforms.html + |enableFeaturePreview("VERSION_CATALOGS") + |""".trimMargin()) + file.writeText(newText, project) + file.logFileWasModified() + } + + } + + + @TaskAction + fun taskUpdateVersionsCatalog() { + val catalog = OutputFile.GRADLE_VERSIONS_CATALOG + + val allDependencies = project.findDependencies() + val resolvedUseFqdn: List = computeUseFqdnFor( + libraries = allDependencies, + configured = emptyList(), + byDefault = MEANING_LESS_NAMES + ) + val deps: Deps = allDependencies.checkModeAndNames(resolvedUseFqdn, Case.camelCase) + val currentText = if (catalog.existed) catalog.readText(project) else "" + val newText = versionsCatalog(deps, currentText) + catalog.writeText(newText, project) + catalog.logFileWasModified() + } + + companion object { + internal fun parseTomlInSection(toml: String): Map { + val result = mutableMapOf() + result["root"] = StringBuilder() + var current: StringBuilder = result["root"]!! + val lines = toml.lines() + for ((index, line) in lines.withIndex()) { + val trimmed = line.trim() + val isSectionHeader = trimmed.startsWith("[") && trimmed.endsWith("]") + if (isSectionHeader) { + val sectionName = trimmed.removePrefix("[").removeSuffix("]") + result[sectionName] = StringBuilder() + current = result[sectionName]!! + } else { + current.append(line) + if (index != lines.lastIndex) current.append("\n") + } + } + return result.mapValues { it.value.toString() } + } + + internal fun tomlSectionsToString(sections: Map): String = buildString { + for ((header, content) in sections) { + if (header != "root") append("[$header]\n") + append(content) + } + } + + internal fun versionsCatalog(deps: Deps, currentText: String): String { + val sections = parseTomlInSection(currentText).toMutableMap() + if (sections["root"].isNullOrBlank()) { + sections["root"] = "## Generated by $ ./gradlew refreshVersionsCatalog\n\n" + } + sections["libraries"] = versionsCatalogLibraries(deps) + return tomlSectionsToString(sections) + } + + internal fun versionsCatalogLibraries(deps: Deps) = buildString { + append('\n') + deps.libraries.forEach { + append(deps.names[it]) + append(" = \"") + append(it.groupModuleUnderscore()) + append('"') + append("\n") + append("\n") + } + append("\n") + } + + internal fun String.containsVersionsCatalogDeclaration(): Boolean { + return this.substringBefore("//").contains("enableFeaturePreview.*VERSION_CATALOGS".toRegex()) + } + } +} + diff --git a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlSectionTest.kt b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlSectionTest.kt new file mode 100644 index 000000000..d2c04fcac --- /dev/null +++ b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlSectionTest.kt @@ -0,0 +1,62 @@ +package de.fayard.refreshVersions.core + +import de.fayard.refreshVersions.core.VersionsCatalogTask.Companion.parseTomlInSection +import de.fayard.refreshVersions.core.VersionsCatalogTask.Companion.tomlSectionsToString +import io.kotest.core.spec.style.StringSpec +import io.kotest.matchers.shouldBe + +class TomlSectionTest : StringSpec({ + + val toml = """ + ## This is a great comment + + [versions] + groovy = "2.5.14" + guava = "30.0-jre" + jupiter = "5.7.1" + + [libraries] + guava = { module="com.google.guava:guava", version.ref="guava" } + junit-jupiter = { module="org.junit.jupiter:junit-jupiter-api", version.ref="jupiter" } + junit-engine = { module="org.junit.jupiter:junit-jupiter-engine" } + + groovy-core = { module="org.codehaus.groovy:groovy", version.ref="groovy" } + groovy-json = { module="org.codehaus.groovy:groovy-json", version.ref="groovy" } + + [bundles] + testDependencies = ["junit-jupiter", "junit-engine"] + """.trimIndent() + + val (a, b, c, d) = """ + ## This is a great comment + + --- + groovy = "2.5.14" + guava = "30.0-jre" + jupiter = "5.7.1" + + --- + guava = { module="com.google.guava:guava", version.ref="guava" } + junit-jupiter = { module="org.junit.jupiter:junit-jupiter-api", version.ref="jupiter" } + junit-engine = { module="org.junit.jupiter:junit-jupiter-engine" } + + groovy-core = { module="org.codehaus.groovy:groovy", version.ref="groovy" } + groovy-json = { module="org.codehaus.groovy:groovy-json", version.ref="groovy" } + + --- + testDependencies = ["junit-jupiter", "junit-engine"] + """.trimIndent().split("---\n") + val expected = mapOf("root" to a, "versions" to b, "libraries" to c, "bundles" to d) + + "Parse Toml in Sections" { + parseTomlInSection(toml) shouldBe expected + } + + "Sections to Toml" { + tomlSectionsToString(expected) shouldBe toml + } + +}) + + + diff --git a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsPlugin.kt b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsPlugin.kt index 5137eb37c..56182def6 100644 --- a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsPlugin.kt +++ b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsPlugin.kt @@ -1,9 +1,6 @@ package de.fayard.refreshVersions -import de.fayard.refreshVersions.core.RefreshVersionsCorePlugin -import de.fayard.refreshVersions.core.RefreshVersionsMigrateTask -import de.fayard.refreshVersions.core.bootstrapRefreshVersionsCore -import de.fayard.refreshVersions.core.bootstrapRefreshVersionsCoreForBuildSrc +import de.fayard.refreshVersions.core.* import de.fayard.refreshVersions.core.extensions.gradle.isBuildSrc import de.fayard.refreshVersions.core.internal.RefreshVersionsConfigHolder import de.fayard.refreshVersions.internal.getArtifactNameToConstantMapping @@ -120,6 +117,13 @@ open class RefreshVersionsPlugin : Plugin { println(getArtifactNameToConstantMapping().joinToString("\n")) } } + project.tasks.register( + name = "refreshVersionsCatalog" + ) { + group = "refreshVersions" + description = "Update gradle/libs.versions.toml" + outputs.upToDateWhen { false } + } /* // TODO: Find out whether we want to expose the task or not. project.tasks.register( diff --git a/sample-kotlin/build.gradle.kts b/sample-kotlin/build.gradle.kts index a2afa4a65..192eef857 100644 --- a/sample-kotlin/build.gradle.kts +++ b/sample-kotlin/build.gradle.kts @@ -33,6 +33,7 @@ fun DependencyHandler.testImplementations(deps: List) = deps.forEach { testImplementation(it) } dependencies { + implementations(listOf(AndroidX.browser, AndroidX.cardView)) implementation(AndroidX.core) testImplementations(listOf(KotlinX.coroutines.core, KotlinX.coroutines.jdk8)) diff --git a/sample-kotlin/gradle/libs.versions.toml b/sample-kotlin/gradle/libs.versions.toml new file mode 100644 index 000000000..d94e774cb --- /dev/null +++ b/sample-kotlin/gradle/libs.versions.toml @@ -0,0 +1,45 @@ +## Generated by $ ./gradlew refreshVersionsCatalog + +[libraries] + +browser = "androidx.browser:browser:_" + +cardview = "androidx.cardview:cardview:_" + +androidxCoreCore = "androidx.core:core:_" + +guava = "com.google.guava:guava:_" + +guice = "com.google.inject:guice:_" + +okhttp = "com.squareup.okhttp3:okhttp:_" + +okhttpUrlconnection = "com.squareup.okhttp3:okhttp-urlconnection:_" + +kotestRunnerJunit4 = "io.kotest:kotest-runner-junit4:_" + +junit = "junit:junit:_" + +poi = "org.apache.poi:poi:_" + +poiOoxml = "org.apache.poi:poi-ooxml:_" + +gradleHelloWorldPlugin = "org.gradle:gradle-hello-world-plugin:_" + +orgJetbrainsKotlinJvmGradlePlugin = "org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:_" + +kotlinScriptRuntime = "org.jetbrains.kotlin:kotlin-script-runtime:_" + +kotlinScriptingCompilerEmbeddable = "org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:_" + +kotlinStdlibJdk8 = "org.jetbrains.kotlin:kotlin-stdlib-jdk8:_" + +orgJetbrainsKotlinxBenchmarkGradlePlugin = "org.jetbrains.kotlinx.benchmark:org.jetbrains.kotlinx.benchmark.gradle.plugin:_" + +kotlinxCoroutinesCore = "org.jetbrains.kotlinx:kotlinx-coroutines-core:_" + +kotlinxCoroutinesJdk8 = "org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:_" + +mongoJavaDriver = "org.mongodb:mongo-java-driver:_" + + diff --git a/sample-kotlin/gradle/wrapper/gradle-wrapper.properties b/sample-kotlin/gradle/wrapper/gradle-wrapper.properties index 4d9ca1649..0f80bbf51 100644 --- a/sample-kotlin/gradle/wrapper/gradle-wrapper.properties +++ b/sample-kotlin/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/sample-kotlin/settings.gradle.kts b/sample-kotlin/settings.gradle.kts index 530ae7542..1511decee 100644 --- a/sample-kotlin/settings.gradle.kts +++ b/sample-kotlin/settings.gradle.kts @@ -37,3 +37,6 @@ gradleEnterprise { } rootProject.name = "sample-kotlin" + +// Enable Gradle's version catalog support https://docs.gradle.org/current/userguide/platforms.html +enableFeaturePreview("VERSION_CATALOGS") diff --git a/sample-kotlin/versions.properties b/sample-kotlin/versions.properties index 0cc11ece9..eb286c4cb 100644 --- a/sample-kotlin/versions.properties +++ b/sample-kotlin/versions.properties @@ -1,5 +1,5 @@ #### Dependencies and Plugin versions with their available updates. -#### Generated by `./gradlew refreshVersions` version 0.10.2-SNAPSHOT +#### Generated by `./gradlew refreshVersions` version 0.11.1-SNAPSHOT #### #### Don't manually edit or split the comments that start with four hashtags (####), #### they will be overwritten by refreshVersions. @@ -28,3 +28,13 @@ version.org.apache.poi..poi=4.1.2 version.org.apache.poi..poi-ooxml=4.1.2 version.org.gradle..gradle-hello-world-plugin=0.1 + +version.com.google.guava..guava=15.0 + +version.com.google.inject..guice=2.0 + +version.junit.junit=4.12 + +version.okhttp3=3.10.0 + +version.org.mongodb..mongo-java-driver=3.11.0 diff --git a/sample-multi-modules/buildSrc/src/main/kotlin/Libs.kt b/sample-multi-modules/buildSrc/src/main/kotlin/Libs.kt index 10ab5df69..d0e92aefd 100644 --- a/sample-multi-modules/buildSrc/src/main/kotlin/Libs.kt +++ b/sample-multi-modules/buildSrc/src/main/kotlin/Libs.kt @@ -14,6 +14,8 @@ import kotlin.String object Libs { const val clikt: String = "com.github.ajalt.clikt:clikt:_" + const val okio: String = "com.github.javadev:okio:_" + const val mockito_kotlin: String = "com.nhaarman.mockitokotlin2:mockito-kotlin:_" const val okhttp: String = "com.squareup.okhttp3:okhttp:_" diff --git a/sample-multi-modules/module1/build.gradle.kts b/sample-multi-modules/module1/build.gradle.kts index 5545408c0..8c29d430e 100644 --- a/sample-multi-modules/module1/build.gradle.kts +++ b/sample-multi-modules/module1/build.gradle.kts @@ -16,4 +16,5 @@ dependencies { implementation(kotlin("stdlib")) implementation(Square.okHttp3.okHttp) testImplementation("junit", "junit", "4.12") + implementation("com.github.javadev:okio:1.6.0") } diff --git a/sample-multi-modules/settings.gradle.kts b/sample-multi-modules/settings.gradle.kts index 841fa7db8..4925261c2 100644 --- a/sample-multi-modules/settings.gradle.kts +++ b/sample-multi-modules/settings.gradle.kts @@ -31,3 +31,5 @@ refreshVersions { include("module1") include("module2") + +enableFeaturePreview("VERSION_CATALOGS") From 12b57e6a39c9d624dd22da696c090b2a5d7c0d8f Mon Sep 17 00:00:00 2001 From: Jean-Michel Fayard Date: Sat, 12 Feb 2022 14:23:36 +0100 Subject: [PATCH 002/103] refreshVersionsCatalog works again --- .../fayard/buildSrcLibs/BuildSrcLibsTask.kt | 5 +++ .../buildSrcLibs/internal/KotlinPoetry.kt | 13 +++++--- .../core/VersionsCatalogTask.kt | 8 +++-- .../core}/internal/DependencyNotations.kt | 31 ++++++++++++------- .../de/fayard/refreshVersions}/CaseTest.kt | 4 ++- 5 files changed, 43 insertions(+), 18 deletions(-) rename plugins/{buildSrcLibs/src/main/kotlin/de/fayard/buildSrcLibs => core/src/main/kotlin/de/fayard/refreshVersions/core}/internal/DependencyNotations.kt (84%) rename plugins/{buildSrcLibs/src/test/kotlin => core/src/test/kotlin/de/fayard/refreshVersions}/CaseTest.kt (87%) diff --git a/plugins/buildSrcLibs/src/main/kotlin/de/fayard/buildSrcLibs/BuildSrcLibsTask.kt b/plugins/buildSrcLibs/src/main/kotlin/de/fayard/buildSrcLibs/BuildSrcLibsTask.kt index c39a7fbcf..e04502c0c 100644 --- a/plugins/buildSrcLibs/src/main/kotlin/de/fayard/buildSrcLibs/BuildSrcLibsTask.kt +++ b/plugins/buildSrcLibs/src/main/kotlin/de/fayard/buildSrcLibs/BuildSrcLibsTask.kt @@ -3,7 +3,12 @@ package de.fayard.buildSrcLibs import com.squareup.kotlinpoet.FileSpec import de.fayard.buildSrcLibs.internal.* import de.fayard.refreshVersions.core.addMissingEntriesInVersionsProperties +import de.fayard.refreshVersions.core.internal.Case +import de.fayard.refreshVersions.core.internal.MEANING_LESS_NAMES import de.fayard.refreshVersions.core.internal.OutputFile +import de.fayard.refreshVersions.core.internal.checkModeAndNames +import de.fayard.refreshVersions.core.internal.computeUseFqdnFor +import de.fayard.refreshVersions.core.internal.findDependencies import org.gradle.api.DefaultTask import org.gradle.api.tasks.TaskAction diff --git a/plugins/buildSrcLibs/src/main/kotlin/de/fayard/buildSrcLibs/internal/KotlinPoetry.kt b/plugins/buildSrcLibs/src/main/kotlin/de/fayard/buildSrcLibs/internal/KotlinPoetry.kt index 8affc4d5a..4a31ec512 100644 --- a/plugins/buildSrcLibs/src/main/kotlin/de/fayard/buildSrcLibs/internal/KotlinPoetry.kt +++ b/plugins/buildSrcLibs/src/main/kotlin/de/fayard/buildSrcLibs/internal/KotlinPoetry.kt @@ -1,9 +1,15 @@ package de.fayard.buildSrcLibs.internal -import com.squareup.kotlinpoet.* +import com.squareup.kotlinpoet.CodeBlock +import com.squareup.kotlinpoet.FileSpec +import com.squareup.kotlinpoet.KModifier +import com.squareup.kotlinpoet.PropertySpec +import com.squareup.kotlinpoet.TypeSpec +import de.fayard.refreshVersions.core.internal.Deps +import de.fayard.refreshVersions.core.internal.Library internal fun kotlinpoet( - deps: Deps + deps: Deps, ): FileSpec { val libraries: List = deps.libraries val indent = " " @@ -36,11 +42,10 @@ internal fun kotlinpoet( } - internal fun constStringProperty( name: String, initializer: CodeBlock, - kdoc: CodeBlock? = null + kdoc: CodeBlock? = null, ): PropertySpec = PropertySpec.builder(name, String::class) .addModifiers(KModifier.CONST) .initializer(initializer) diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/VersionsCatalogTask.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/VersionsCatalogTask.kt index bf323e306..38d0dfab9 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/VersionsCatalogTask.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/VersionsCatalogTask.kt @@ -1,7 +1,11 @@ package de.fayard.refreshVersions.core -import de.fayard.buildSrcLibs.internal.* -import de.fayard.buildSrcLibs.internal.Case +import de.fayard.refreshVersions.core.internal.Case +import de.fayard.refreshVersions.core.internal.Deps +import de.fayard.refreshVersions.core.internal.MEANING_LESS_NAMES +import de.fayard.refreshVersions.core.internal.checkModeAndNames +import de.fayard.refreshVersions.core.internal.computeUseFqdnFor +import de.fayard.refreshVersions.core.internal.findDependencies import de.fayard.refreshVersions.core.internal.OutputFile import org.gradle.api.DefaultTask import org.gradle.api.GradleException diff --git a/plugins/buildSrcLibs/src/main/kotlin/de/fayard/buildSrcLibs/internal/DependencyNotations.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/DependencyNotations.kt similarity index 84% rename from plugins/buildSrcLibs/src/main/kotlin/de/fayard/buildSrcLibs/internal/DependencyNotations.kt rename to plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/DependencyNotations.kt index 94e5a8f16..542aab78d 100644 --- a/plugins/buildSrcLibs/src/main/kotlin/de/fayard/buildSrcLibs/internal/DependencyNotations.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/DependencyNotations.kt @@ -1,13 +1,14 @@ -package de.fayard.buildSrcLibs.internal +package de.fayard.refreshVersions.core.internal import org.gradle.api.Project import org.gradle.api.artifacts.ExternalDependency -internal enum class Case { +@InternalRefreshVersionsApi +enum class Case { camelCase, snake_case; //, PascalCase, `kebab-case` companion object { - internal fun toCamelCase(input: String): String = buildString { + @InternalRefreshVersionsApi fun toCamelCase(input: String): String = buildString { var wasWordBreak = false val wordBreaks = setOf(' ', '-', '_') for (c in input) { @@ -28,13 +29,15 @@ internal enum class Case { * * Found many inspiration for bad libs here https://developer.android.com/jetpack/androidx/migrate * **/ -internal val MEANING_LESS_NAMES: MutableList = mutableListOf( +@InternalRefreshVersionsApi +val MEANING_LESS_NAMES: MutableList = mutableListOf( "common", "core", "testing", "runtime", "extensions", "compiler", "migration", "db", "rules", "runner", "monitor", "loader", "media", "print", "io", "collection", "gradle", "android" ) -internal fun computeUseFqdnFor( +@InternalRefreshVersionsApi +fun computeUseFqdnFor( libraries: List, configured: List, byDefault: List = MEANING_LESS_NAMES @@ -45,7 +48,8 @@ internal fun computeUseFqdnFor( return (configured + byDefault + ambiguities + depsFromGroups - groups).distinct().sorted() } -internal fun escapeLibsKt(name: String): String { +@InternalRefreshVersionsApi +fun escapeLibsKt(name: String): String { val escapedChars = listOf('-', '.', ':') return buildString { for (c in name) { @@ -54,7 +58,8 @@ internal fun escapeLibsKt(name: String): String { } } -internal fun Project.findDependencies(): List { +@InternalRefreshVersionsApi +fun Project.findDependencies(): List { val allDependencies = mutableListOf() allprojects { (configurations + buildscript.configurations) @@ -74,7 +79,8 @@ internal fun Project.findDependencies(): List { } -internal data class Library( +@InternalRefreshVersionsApi +data class Library( val group: String = "", val module: String = "", val version: String = "" @@ -97,17 +103,20 @@ internal data class Library( override fun toString() = groupModuleVersion() } -internal class Deps( +@InternalRefreshVersionsApi +class Deps( val libraries: List, val names: Map ) -internal enum class VersionMode { +@InternalRefreshVersionsApi +enum class VersionMode { GROUP, GROUP_MODULE, MODULE } -internal fun List.checkModeAndNames(useFdqnByDefault: List, case: Case): Deps { +@InternalRefreshVersionsApi +fun List.checkModeAndNames(useFdqnByDefault: List, case: Case): Deps { val dependencies = this val modes: Map = diff --git a/plugins/buildSrcLibs/src/test/kotlin/CaseTest.kt b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/CaseTest.kt similarity index 87% rename from plugins/buildSrcLibs/src/test/kotlin/CaseTest.kt rename to plugins/core/src/test/kotlin/de/fayard/refreshVersions/CaseTest.kt index cee04c0cf..0f45bb2aa 100644 --- a/plugins/buildSrcLibs/src/test/kotlin/CaseTest.kt +++ b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/CaseTest.kt @@ -1,4 +1,6 @@ -import de.fayard.buildSrcLibs.internal.Case +package de.fayard.refreshVersions + +import de.fayard.refreshVersions.core.internal.Case import io.kotest.core.spec.style.StringSpec import io.kotest.inspectors.forAll import io.kotest.matchers.shouldBe From 7fd805ae65c6bbdae7e0866e2560be65ce2ad1de Mon Sep 17 00:00:00 2001 From: Jean-Michel Fayard Date: Sat, 12 Feb 2022 15:47:53 +0100 Subject: [PATCH 003/103] Versions Catalog are stable in Gradle 7.4 --- .../core/VersionsCatalogTask.kt | 42 ++++++------------- 1 file changed, 13 insertions(+), 29 deletions(-) diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/VersionsCatalogTask.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/VersionsCatalogTask.kt index 38d0dfab9..93d97e5f4 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/VersionsCatalogTask.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/VersionsCatalogTask.kt @@ -16,37 +16,22 @@ import org.gradle.util.GradleVersion open class VersionsCatalogTask : DefaultTask() { @TaskAction - fun addMissingEntries() { - addMissingEntriesInVersionsProperties(project) - } - - @TaskAction - fun taskActionEnableSupport() { - OutputFile.checkWhichFilesExist(project.rootDir) - - if (GradleVersion.current() < GradleVersion.version("7.0")) { + fun checkGradleVersion() { + if (currentGradleVersion < versionWithVersionsCatalog) { throw GradleException( """ - |Gradle versions catalogs are only supported in Gradle 7+ - |Upgrade first with this command - | ./gradlew wrapper --gradle-version 7.0 + |Gradle versions catalogs are not supported in $currentGradleVersion + |Upgrade Gradle with this command + | ./gradlew wrapper --gradle-version $versionWithVersionsCatalog """.trimMargin() ) } - val file = - if (OutputFile.SETTINGS_GRADLE.existed) OutputFile.SETTINGS_GRADLE else OutputFile.SETTINGS_GRADLE_KTS - val settingsText = file.readText(project) - val alreadyConfigured = settingsText.lines().any { it.containsVersionsCatalogDeclaration() } - if (!alreadyConfigured) { - val newText = (""" - |${settingsText} - |// Enable Gradle's version catalog support https://docs.gradle.org/current/userguide/platforms.html - |enableFeaturePreview("VERSION_CATALOGS") - |""".trimMargin()) - file.writeText(newText, project) - file.logFileWasModified() - } + } + + @TaskAction + fun addMissingEntries() { + addMissingEntriesInVersionsProperties(project) } @@ -68,6 +53,9 @@ open class VersionsCatalogTask : DefaultTask() { } companion object { + val currentGradleVersion = GradleVersion.current() + val versionWithVersionsCatalog = GradleVersion.version("7.4") + internal fun parseTomlInSection(toml: String): Map { val result = mutableMapOf() result["root"] = StringBuilder() @@ -116,10 +104,6 @@ open class VersionsCatalogTask : DefaultTask() { } append("\n") } - - internal fun String.containsVersionsCatalogDeclaration(): Boolean { - return this.substringBefore("//").contains("enableFeaturePreview.*VERSION_CATALOGS".toRegex()) - } } } From 1cff52cb0e09c132212c3be1efac88e0b38f17f8 Mon Sep 17 00:00:00 2001 From: Jean-Michel Fayard Date: Sat, 12 Feb 2022 16:16:48 +0100 Subject: [PATCH 004/103] versions catalog: use kebab-case --- .../core/VersionsCatalogTask.kt | 2 +- .../core/internal/DependencyNotations.kt | 54 +++++++++---------- .../de/fayard/refreshVersions/CaseTest.kt | 16 +++--- 3 files changed, 34 insertions(+), 38 deletions(-) diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/VersionsCatalogTask.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/VersionsCatalogTask.kt index 93d97e5f4..da27e87e8 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/VersionsCatalogTask.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/VersionsCatalogTask.kt @@ -45,7 +45,7 @@ open class VersionsCatalogTask : DefaultTask() { configured = emptyList(), byDefault = MEANING_LESS_NAMES ) - val deps: Deps = allDependencies.checkModeAndNames(resolvedUseFqdn, Case.camelCase) + val deps: Deps = allDependencies.checkModeAndNames(resolvedUseFqdn, Case.`kebab-case`) val currentText = if (catalog.existed) catalog.readText(project) else "" val newText = versionsCatalog(deps, currentText) catalog.writeText(newText, project) diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/DependencyNotations.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/DependencyNotations.kt index 542aab78d..7aa289213 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/DependencyNotations.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/DependencyNotations.kt @@ -1,26 +1,23 @@ package de.fayard.refreshVersions.core.internal +import de.fayard.refreshVersions.core.internal.Case.* import org.gradle.api.Project import org.gradle.api.artifacts.ExternalDependency +@Suppress("EnumEntryName") @InternalRefreshVersionsApi -enum class Case { - camelCase, snake_case; //, PascalCase, `kebab-case` +enum class Case( + val convert: (String) -> String +) { + snake_case({ it }), + `kebab-case`({ + it.map { c-> + if (c in separators) '-' else c + }.joinToString(separator = "") + }); companion object { - @InternalRefreshVersionsApi fun toCamelCase(input: String): String = buildString { - var wasWordBreak = false - val wordBreaks = setOf(' ', '-', '_') - for (c in input) { - when { - c in wordBreaks -> { - } - wasWordBreak -> append(c.toUpperCase()) - else -> append(c) - } - wasWordBreak = c in wordBreaks - } - } + val separators = setOf('.', '-', '_') } } @@ -89,16 +86,18 @@ data class Library( fun groupModuleVersion() = "$group:$module:$version" fun groupModuleUnderscore() = "$group:$module:_" fun groupModule() = "$group:$module" - fun versionNameCamelCase(mode: VersionMode): String = - Case.toCamelCase(versionNameSnakeCase(mode)) - - fun versionNameSnakeCase(mode: VersionMode): String = escapeLibsKt( - when (mode) { - VersionMode.MODULE -> module - VersionMode.GROUP -> group - VersionMode.GROUP_MODULE -> "${group}_$module" - } - ) + + @Suppress("LocalVariableName") + fun versionName(mode: VersionMode, case: Case): String { + val name_with_underscores = escapeLibsKt( + when (mode) { + VersionMode.MODULE -> module + VersionMode.GROUP -> group + VersionMode.GROUP_MODULE -> "${group}_$module" + } + ) + return case.convert(name_with_underscores) + } override fun toString() = groupModuleVersion() } @@ -130,10 +129,7 @@ fun List.checkModeAndNames(useFdqnByDefault: List, case: Case): val versionNames = dependencies.associateWith { d -> val mode = modes.getValue(d) - when (case) { - Case.camelCase -> d.versionNameCamelCase(mode) - Case.snake_case -> d.versionNameSnakeCase(mode) - } + d.versionName(mode, case) } val sortedDependencies = dependencies.sortedBy { d: Library -> d.groupModule() } return Deps(sortedDependencies, versionNames) diff --git a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/CaseTest.kt b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/CaseTest.kt index 0f45bb2aa..b1b25444a 100644 --- a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/CaseTest.kt +++ b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/CaseTest.kt @@ -7,17 +7,17 @@ import io.kotest.matchers.shouldBe class CaseTest : StringSpec({ val transformations = listOf( - "hoplite_yaml" to "hopliteYaml", + "hoplite_yaml" to "hoplite-yaml", "picnic" to "picnic", - "h2_ok" to "h2Ok", - "mockito_kotlin" to "mockitoKotlin", - "retrofit2_kotlinx_serialization_converter" to "retrofit2KotlinxSerializationConverter", - "dagger_compiler" to "daggerCompiler" + "h2_ok" to "h2-ok", + "mockito_kotlin" to "mockito-kotlin", + "retrofit2_kotlinx_serialization_converter" to "retrofit2-kotlinx-serialization-converter", + "dagger_compiler" to "dagger-compiler" ) - "From snake_case to camelCase" { - transformations.forAll { (snake, caml) -> - Case.toCamelCase(snake) shouldBe caml + "From snake_case to dot.case" { + transformations.forAll { (snake, dot) -> + Case.`kebab-case`.convert(snake) shouldBe dot } } From 9b7402d9576ea29b68303bd720fc51303eddc2c4 Mon Sep 17 00:00:00 2001 From: Jean-Michel Fayard Date: Sat, 12 Feb 2022 16:34:30 +0100 Subject: [PATCH 005/103] versions catalog: filter out built-in dependencies --- .../refreshVersions/RefreshVersionsPlugin.kt | 1 + .../internal}/VersionsCatalogTask.kt | 21 ++++++++++++++----- .../refreshVersions}/TomlSectionTest.kt | 6 +++--- 3 files changed, 20 insertions(+), 8 deletions(-) rename plugins/{core/src/main/kotlin/de/fayard/refreshVersions/core => dependencies/src/main/kotlin/de/fayard/refreshVersions/internal}/VersionsCatalogTask.kt (85%) rename plugins/{core/src/test/kotlin/de/fayard/refreshVersions/core => dependencies/src/test/kotlin/de/fayard/refreshVersions}/TomlSectionTest.kt (89%) diff --git a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsPlugin.kt b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsPlugin.kt index 8a5f1e293..c01819997 100644 --- a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsPlugin.kt +++ b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsPlugin.kt @@ -11,6 +11,7 @@ import org.gradle.api.initialization.Settings import org.gradle.api.invocation.Gradle import org.gradle.kotlin.dsl.* import java.io.InputStream +import de.fayard.refreshVersions.internal.VersionsCatalogTask open class RefreshVersionsPlugin : Plugin { diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/VersionsCatalogTask.kt b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/internal/VersionsCatalogTask.kt similarity index 85% rename from plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/VersionsCatalogTask.kt rename to plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/internal/VersionsCatalogTask.kt index da27e87e8..585e2bba7 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/VersionsCatalogTask.kt +++ b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/internal/VersionsCatalogTask.kt @@ -1,12 +1,14 @@ -package de.fayard.refreshVersions.core +package de.fayard.refreshVersions.internal +import de.fayard.refreshVersions.core.addMissingEntriesInVersionsProperties import de.fayard.refreshVersions.core.internal.Case import de.fayard.refreshVersions.core.internal.Deps +import de.fayard.refreshVersions.core.internal.Library import de.fayard.refreshVersions.core.internal.MEANING_LESS_NAMES +import de.fayard.refreshVersions.core.internal.OutputFile import de.fayard.refreshVersions.core.internal.checkModeAndNames import de.fayard.refreshVersions.core.internal.computeUseFqdnFor import de.fayard.refreshVersions.core.internal.findDependencies -import de.fayard.refreshVersions.core.internal.OutputFile import org.gradle.api.DefaultTask import org.gradle.api.GradleException import org.gradle.api.tasks.TaskAction @@ -39,13 +41,22 @@ open class VersionsCatalogTask : DefaultTask() { fun taskUpdateVersionsCatalog() { val catalog = OutputFile.GRADLE_VERSIONS_CATALOG - val allDependencies = project.findDependencies() + val builtInDependencies = getArtifactNameToConstantMapping() + .map { Library(it.group, it.artifact, "_") } + .toSet() + + val allDependencies: List = project.findDependencies() + + val nonBuiltInDependencies = allDependencies + .filter { it.copy(version = "_") !in builtInDependencies } + val resolvedUseFqdn: List = computeUseFqdnFor( - libraries = allDependencies, + libraries = nonBuiltInDependencies, configured = emptyList(), byDefault = MEANING_LESS_NAMES ) - val deps: Deps = allDependencies.checkModeAndNames(resolvedUseFqdn, Case.`kebab-case`) + + val deps: Deps = nonBuiltInDependencies.checkModeAndNames(resolvedUseFqdn, Case.`kebab-case`) val currentText = if (catalog.existed) catalog.readText(project) else "" val newText = versionsCatalog(deps, currentText) catalog.writeText(newText, project) diff --git a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlSectionTest.kt b/plugins/dependencies/src/test/kotlin/de/fayard/refreshVersions/TomlSectionTest.kt similarity index 89% rename from plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlSectionTest.kt rename to plugins/dependencies/src/test/kotlin/de/fayard/refreshVersions/TomlSectionTest.kt index d2c04fcac..b0d89e5f1 100644 --- a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlSectionTest.kt +++ b/plugins/dependencies/src/test/kotlin/de/fayard/refreshVersions/TomlSectionTest.kt @@ -1,7 +1,7 @@ -package de.fayard.refreshVersions.core +package de.fayard.refreshVersions -import de.fayard.refreshVersions.core.VersionsCatalogTask.Companion.parseTomlInSection -import de.fayard.refreshVersions.core.VersionsCatalogTask.Companion.tomlSectionsToString +import de.fayard.refreshVersions.internal.VersionsCatalogTask.Companion.parseTomlInSection +import de.fayard.refreshVersions.internal.VersionsCatalogTask.Companion.tomlSectionsToString import io.kotest.core.spec.style.StringSpec import io.kotest.matchers.shouldBe From f4b3f040a8d50c6c3725d1ec8da8b4fc24c5cbbc Mon Sep 17 00:00:00 2001 From: Jean-Michel Fayard Date: Sat, 12 Feb 2022 17:16:07 +0100 Subject: [PATCH 006/103] sample-kotlin --- mkdocs.yml | 2 +- .../RefreshVersionsMigrateTask.kt | 10 ++++++ sample-kotlin/gradle/libs.versions.toml | 34 ++++--------------- .../gradle/wrapper/gradle-wrapper.properties | 2 +- sample-kotlin/settings.gradle.kts | 3 -- sample-kotlin/versions.properties | 12 ++++++- 6 files changed, 30 insertions(+), 33 deletions(-) diff --git a/mkdocs.yml b/mkdocs.yml index 24e0d61cf..0bea128f4 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -20,7 +20,7 @@ extra: gradlePluginPortal: https://plugins.gradle.org/plugin/de.fayard.refreshVersions slack: https://app.slack.com/client/T09229ZC6/CP5659EL9 version: - gradle: 7.3.3 + gradle: 7.4 refreshVersions: '0.40.1' snapshot: '0.40.2-SNAPSHOT' keyboard_shortcuts: diff --git a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsMigrateTask.kt b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsMigrateTask.kt index 52f3621ed..69514e8a4 100644 --- a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsMigrateTask.kt +++ b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsMigrateTask.kt @@ -5,12 +5,22 @@ import de.fayard.refreshVersions.core.addMissingEntriesInVersionsProperties import de.fayard.refreshVersions.core.internal.associateShortestByMavenCoordinate import de.fayard.refreshVersions.internal.getArtifactNameToConstantMapping import org.gradle.api.DefaultTask +import org.gradle.api.artifacts.VersionCatalogsExtension import org.gradle.api.tasks.TaskAction +import org.gradle.kotlin.dsl.getByType import org.intellij.lang.annotations.Language import java.io.File open class RefreshVersionsMigrateTask : DefaultTask() { + @TaskAction + fun versionsCatalog() { + // TODO: doesn't work + // https://gradle-community.slack.com/archives/CA745PZHN/p1644681759879269 + val versionCatalog = extensions.getByType().named("libs") + println("Library aliases: ${versionCatalog.dependencyAliases}") + } + @TaskAction fun refreshVersionsMissingEntries() { addMissingEntriesInVersionsProperties(project) diff --git a/sample-kotlin/gradle/libs.versions.toml b/sample-kotlin/gradle/libs.versions.toml index d94e774cb..4ce8b906c 100644 --- a/sample-kotlin/gradle/libs.versions.toml +++ b/sample-kotlin/gradle/libs.versions.toml @@ -2,44 +2,24 @@ [libraries] -browser = "androidx.browser:browser:_" - -cardview = "androidx.cardview:cardview:_" - -androidxCoreCore = "androidx.core:core:_" - guava = "com.google.guava:guava:_" guice = "com.google.inject:guice:_" -okhttp = "com.squareup.okhttp3:okhttp:_" - -okhttpUrlconnection = "com.squareup.okhttp3:okhttp-urlconnection:_" - -kotestRunnerJunit4 = "io.kotest:kotest-runner-junit4:_" - -junit = "junit:junit:_" +okhttp-urlconnection = "com.squareup.okhttp3:okhttp-urlconnection:_" poi = "org.apache.poi:poi:_" -poiOoxml = "org.apache.poi:poi-ooxml:_" - -gradleHelloWorldPlugin = "org.gradle:gradle-hello-world-plugin:_" - -orgJetbrainsKotlinJvmGradlePlugin = "org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:_" - -kotlinScriptRuntime = "org.jetbrains.kotlin:kotlin-script-runtime:_" - -kotlinScriptingCompilerEmbeddable = "org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:_" +poi-ooxml = "org.apache.poi:poi-ooxml:_" -kotlinStdlibJdk8 = "org.jetbrains.kotlin:kotlin-stdlib-jdk8:_" +gradle-hello-world-plugin = "org.gradle:gradle-hello-world-plugin:_" -orgJetbrainsKotlinxBenchmarkGradlePlugin = "org.jetbrains.kotlinx.benchmark:org.jetbrains.kotlinx.benchmark.gradle.plugin:_" +org-jetbrains-kotlin-jvm-gradle-plugin = "org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:_" -kotlinxCoroutinesCore = "org.jetbrains.kotlinx:kotlinx-coroutines-core:_" +kotlin-scripting-compiler-embeddable = "org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:_" -kotlinxCoroutinesJdk8 = "org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:_" +org-jetbrains-kotlinx-benchmark-gradle-plugin = "org.jetbrains.kotlinx.benchmark:org.jetbrains.kotlinx.benchmark.gradle.plugin:_" -mongoJavaDriver = "org.mongodb:mongo-java-driver:_" +mongo-java-driver = "org.mongodb:mongo-java-driver:_" diff --git a/sample-kotlin/gradle/wrapper/gradle-wrapper.properties b/sample-kotlin/gradle/wrapper/gradle-wrapper.properties index 28ff446a2..41dfb8790 100644 --- a/sample-kotlin/gradle/wrapper/gradle-wrapper.properties +++ b/sample-kotlin/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/sample-kotlin/settings.gradle.kts b/sample-kotlin/settings.gradle.kts index aca2d8703..1effe00d4 100644 --- a/sample-kotlin/settings.gradle.kts +++ b/sample-kotlin/settings.gradle.kts @@ -60,6 +60,3 @@ gradleEnterprise { } rootProject.name = "sample-kotlin" - -// Enable Gradle's version catalog support https://docs.gradle.org/current/userguide/platforms.html -enableFeaturePreview("VERSION_CATALOGS") diff --git a/sample-kotlin/versions.properties b/sample-kotlin/versions.properties index 18e3d4e8c..f478fdb62 100644 --- a/sample-kotlin/versions.properties +++ b/sample-kotlin/versions.properties @@ -1,5 +1,5 @@ #### Dependencies and Plugin versions with their available updates. -#### Generated by `./gradlew refreshVersions` version 0.40.1-SNAPSHOT +#### Generated by `./gradlew refreshVersions` version 0.40.2-SNAPSHOT #### Revision of dependency notations removals: 9 #### #### Don't manually edit or split the comments that start with four hashtags (####), @@ -19,6 +19,16 @@ version.com.example..dummy-library-for-testing=0.1.0-alpha01 ## # available=0.1.0-alpha02 ## # available=0.1.0-alpha03 +version.org.mongodb..mongo-java-driver=3.11.0 + +version.okhttp3=3.10.0 + +version.junit.junit=4.12 + +version.com.google.inject..guice=2.0 + +version.com.google.guava..guava=15.0 + ## unused version.unused=42 From 0cdc91282016367ab28a604fdff668480867f570 Mon Sep 17 00:00:00 2001 From: Jean-Michel Fayard Date: Sat, 12 Feb 2022 17:26:56 +0100 Subject: [PATCH 007/103] pr: self-review --- .../de/fayard/refreshVersions/CaseTest.kt | 6 +- .../refreshVersions/RefreshVersionsPlugin.kt | 1 - .../{internal => }/VersionsCatalogTask.kt | 53 +----------------- .../fayard/refreshVersions/internal/Toml.kt | 55 +++++++++++++++++++ .../fayard/refreshVersions/TomlSectionTest.kt | 4 +- .../buildSrc/src/main/kotlin/Libs.kt | 2 - sample-multi-modules/module1/build.gradle.kts | 1 - sample-multi-modules/settings.gradle.kts | 2 - 8 files changed, 63 insertions(+), 61 deletions(-) rename plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/{internal => }/VersionsCatalogTask.kt (54%) create mode 100644 plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/internal/Toml.kt diff --git a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/CaseTest.kt b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/CaseTest.kt index b1b25444a..ecbe31d0b 100644 --- a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/CaseTest.kt +++ b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/CaseTest.kt @@ -15,9 +15,9 @@ class CaseTest : StringSpec({ "dagger_compiler" to "dagger-compiler" ) - "From snake_case to dot.case" { - transformations.forAll { (snake, dot) -> - Case.`kebab-case`.convert(snake) shouldBe dot + "From snake_case to kebab-case" { + transformations.forAll { (snake, kebab) -> + Case.`kebab-case`.convert(snake) shouldBe kebab } } diff --git a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsPlugin.kt b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsPlugin.kt index c01819997..8a5f1e293 100644 --- a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsPlugin.kt +++ b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsPlugin.kt @@ -11,7 +11,6 @@ import org.gradle.api.initialization.Settings import org.gradle.api.invocation.Gradle import org.gradle.kotlin.dsl.* import java.io.InputStream -import de.fayard.refreshVersions.internal.VersionsCatalogTask open class RefreshVersionsPlugin : Plugin { diff --git a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/internal/VersionsCatalogTask.kt b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/VersionsCatalogTask.kt similarity index 54% rename from plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/internal/VersionsCatalogTask.kt rename to plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/VersionsCatalogTask.kt index 585e2bba7..3950ba06c 100644 --- a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/internal/VersionsCatalogTask.kt +++ b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/VersionsCatalogTask.kt @@ -1,4 +1,4 @@ -package de.fayard.refreshVersions.internal +package de.fayard.refreshVersions import de.fayard.refreshVersions.core.addMissingEntriesInVersionsProperties import de.fayard.refreshVersions.core.internal.Case @@ -9,6 +9,8 @@ import de.fayard.refreshVersions.core.internal.OutputFile import de.fayard.refreshVersions.core.internal.checkModeAndNames import de.fayard.refreshVersions.core.internal.computeUseFqdnFor import de.fayard.refreshVersions.core.internal.findDependencies +import de.fayard.refreshVersions.internal.Toml.versionsCatalog +import de.fayard.refreshVersions.internal.getArtifactNameToConstantMapping import org.gradle.api.DefaultTask import org.gradle.api.GradleException import org.gradle.api.tasks.TaskAction @@ -66,55 +68,6 @@ open class VersionsCatalogTask : DefaultTask() { companion object { val currentGradleVersion = GradleVersion.current() val versionWithVersionsCatalog = GradleVersion.version("7.4") - - internal fun parseTomlInSection(toml: String): Map { - val result = mutableMapOf() - result["root"] = StringBuilder() - var current: StringBuilder = result["root"]!! - val lines = toml.lines() - for ((index, line) in lines.withIndex()) { - val trimmed = line.trim() - val isSectionHeader = trimmed.startsWith("[") && trimmed.endsWith("]") - if (isSectionHeader) { - val sectionName = trimmed.removePrefix("[").removeSuffix("]") - result[sectionName] = StringBuilder() - current = result[sectionName]!! - } else { - current.append(line) - if (index != lines.lastIndex) current.append("\n") - } - } - return result.mapValues { it.value.toString() } - } - - internal fun tomlSectionsToString(sections: Map): String = buildString { - for ((header, content) in sections) { - if (header != "root") append("[$header]\n") - append(content) - } - } - - internal fun versionsCatalog(deps: Deps, currentText: String): String { - val sections = parseTomlInSection(currentText).toMutableMap() - if (sections["root"].isNullOrBlank()) { - sections["root"] = "## Generated by $ ./gradlew refreshVersionsCatalog\n\n" - } - sections["libraries"] = versionsCatalogLibraries(deps) - return tomlSectionsToString(sections) - } - - internal fun versionsCatalogLibraries(deps: Deps) = buildString { - append('\n') - deps.libraries.forEach { - append(deps.names[it]) - append(" = \"") - append(it.groupModuleUnderscore()) - append('"') - append("\n") - append("\n") - } - append("\n") - } } } diff --git a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/internal/Toml.kt b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/internal/Toml.kt new file mode 100644 index 000000000..02d3048de --- /dev/null +++ b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/internal/Toml.kt @@ -0,0 +1,55 @@ +package de.fayard.refreshVersions.internal + +import de.fayard.refreshVersions.core.internal.Deps + +internal object Toml { + + fun parseTomlInSection(toml: String): Map { + val result = mutableMapOf() + result["root"] = StringBuilder() + var current: StringBuilder = result["root"]!! + val lines = toml.lines() + for ((index, line) in lines.withIndex()) { + val trimmed = line.trim() + val isSectionHeader = trimmed.startsWith("[") && trimmed.endsWith("]") + if (isSectionHeader) { + val sectionName = trimmed.removePrefix("[").removeSuffix("]") + result[sectionName] = StringBuilder() + current = result[sectionName]!! + } else { + current.append(line) + if (index != lines.lastIndex) current.append("\n") + } + } + return result.mapValues { it.value.toString() } + } + + fun tomlSectionsToString(sections: Map): String = buildString { + for ((header, content) in sections) { + if (header != "root") append("[$header]\n") + append(content) + } + } + + fun versionsCatalog(deps: Deps, currentText: String): String { + val sections = parseTomlInSection(currentText).toMutableMap() + if (sections["root"].isNullOrBlank()) { + sections["root"] = "## Generated by $ ./gradlew refreshVersionsCatalog\n\n" + } + sections["libraries"] = versionsCatalogLibraries(deps) + return tomlSectionsToString(sections) + } + + fun versionsCatalogLibraries(deps: Deps) = buildString { + append('\n') + deps.libraries.forEach { + append(deps.names[it]) + append(" = \"") + append(it.groupModuleUnderscore()) + append('"') + append("\n") + append("\n") + } + append("\n") + } +} diff --git a/plugins/dependencies/src/test/kotlin/de/fayard/refreshVersions/TomlSectionTest.kt b/plugins/dependencies/src/test/kotlin/de/fayard/refreshVersions/TomlSectionTest.kt index b0d89e5f1..4c38376ff 100644 --- a/plugins/dependencies/src/test/kotlin/de/fayard/refreshVersions/TomlSectionTest.kt +++ b/plugins/dependencies/src/test/kotlin/de/fayard/refreshVersions/TomlSectionTest.kt @@ -1,7 +1,7 @@ package de.fayard.refreshVersions -import de.fayard.refreshVersions.internal.VersionsCatalogTask.Companion.parseTomlInSection -import de.fayard.refreshVersions.internal.VersionsCatalogTask.Companion.tomlSectionsToString +import de.fayard.refreshVersions.VersionsCatalogTask.Companion.parseTomlInSection +import de.fayard.refreshVersions.VersionsCatalogTask.Companion.tomlSectionsToString import io.kotest.core.spec.style.StringSpec import io.kotest.matchers.shouldBe diff --git a/sample-multi-modules/buildSrc/src/main/kotlin/Libs.kt b/sample-multi-modules/buildSrc/src/main/kotlin/Libs.kt index f7e24d13f..ea3482728 100644 --- a/sample-multi-modules/buildSrc/src/main/kotlin/Libs.kt +++ b/sample-multi-modules/buildSrc/src/main/kotlin/Libs.kt @@ -14,8 +14,6 @@ import kotlin.String object Libs { const val clikt: String = "com.github.ajalt.clikt:clikt:_" - const val okio: String = "com.github.javadev:okio:_" - const val mockito_kotlin: String = "com.nhaarman.mockitokotlin2:mockito-kotlin:_" const val okhttp: String = "com.squareup.okhttp3:okhttp:_" diff --git a/sample-multi-modules/module1/build.gradle.kts b/sample-multi-modules/module1/build.gradle.kts index 3b158c10b..71507d78b 100644 --- a/sample-multi-modules/module1/build.gradle.kts +++ b/sample-multi-modules/module1/build.gradle.kts @@ -15,5 +15,4 @@ useDependency() dependencies { implementation(Square.okHttp3.okHttp) testImplementation("junit", "junit", "4.12") - implementation("com.github.javadev:okio:1.6.0") } diff --git a/sample-multi-modules/settings.gradle.kts b/sample-multi-modules/settings.gradle.kts index e0faa0713..8ed92ae7e 100644 --- a/sample-multi-modules/settings.gradle.kts +++ b/sample-multi-modules/settings.gradle.kts @@ -32,5 +32,3 @@ refreshVersions { include("module1") include("module2") - -enableFeaturePreview("VERSION_CATALOGS") From 6515c49119c81f8ca058274fba3120dbf3d10cf5 Mon Sep 17 00:00:00 2001 From: Jean-Michel Fayard Date: Sat, 12 Feb 2022 17:34:20 +0100 Subject: [PATCH 008/103] ci: fix test --- .../kotlin/de/fayard/refreshVersions/TomlSectionTest.kt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/plugins/dependencies/src/test/kotlin/de/fayard/refreshVersions/TomlSectionTest.kt b/plugins/dependencies/src/test/kotlin/de/fayard/refreshVersions/TomlSectionTest.kt index 4c38376ff..3c0211eb5 100644 --- a/plugins/dependencies/src/test/kotlin/de/fayard/refreshVersions/TomlSectionTest.kt +++ b/plugins/dependencies/src/test/kotlin/de/fayard/refreshVersions/TomlSectionTest.kt @@ -1,7 +1,6 @@ package de.fayard.refreshVersions -import de.fayard.refreshVersions.VersionsCatalogTask.Companion.parseTomlInSection -import de.fayard.refreshVersions.VersionsCatalogTask.Companion.tomlSectionsToString +import de.fayard.refreshVersions.internal.Toml import io.kotest.core.spec.style.StringSpec import io.kotest.matchers.shouldBe @@ -49,11 +48,11 @@ class TomlSectionTest : StringSpec({ val expected = mapOf("root" to a, "versions" to b, "libraries" to c, "bundles" to d) "Parse Toml in Sections" { - parseTomlInSection(toml) shouldBe expected + Toml.parseTomlInSection(toml) shouldBe expected } "Sections to Toml" { - tomlSectionsToString(expected) shouldBe toml + Toml.tomlSectionsToString(expected) shouldBe toml } }) From 92b393d66db1ad0bba99599f8aa0ebbac7379d33 Mon Sep 17 00:00:00 2001 From: Jean-Michel Fayard Date: Sat, 12 Feb 2022 18:04:00 +0100 Subject: [PATCH 009/103] ./gradlew refreshVersionsMigrate completed --- .../RefreshVersionsMigrateTask.kt | 38 +++++++++++++------ .../refreshVersions/VersionsCatalogTask.kt | 6 +++ 2 files changed, 32 insertions(+), 12 deletions(-) diff --git a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsMigrateTask.kt b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsMigrateTask.kt index 69514e8a4..29a8b51e7 100644 --- a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsMigrateTask.kt +++ b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsMigrateTask.kt @@ -5,6 +5,8 @@ import de.fayard.refreshVersions.core.addMissingEntriesInVersionsProperties import de.fayard.refreshVersions.core.internal.associateShortestByMavenCoordinate import de.fayard.refreshVersions.internal.getArtifactNameToConstantMapping import org.gradle.api.DefaultTask +import org.gradle.api.UnknownDomainObjectException +import org.gradle.api.artifacts.MinimalExternalModuleDependency import org.gradle.api.artifacts.VersionCatalogsExtension import org.gradle.api.tasks.TaskAction import org.gradle.kotlin.dsl.getByType @@ -13,14 +15,6 @@ import java.io.File open class RefreshVersionsMigrateTask : DefaultTask() { - @TaskAction - fun versionsCatalog() { - // TODO: doesn't work - // https://gradle-community.slack.com/archives/CA745PZHN/p1644681759879269 - val versionCatalog = extensions.getByType().named("libs") - println("Library aliases: ${versionCatalog.dependencyAliases}") - } - @TaskAction fun refreshVersionsMissingEntries() { addMissingEntriesInVersionsProperties(project) @@ -28,11 +22,13 @@ open class RefreshVersionsMigrateTask : DefaultTask() { @TaskAction fun migrateBuild() { - val dependencyMapping = getArtifactNameToConstantMapping() + val versionsCatalogMapping: Map = getVersionsCatalogMapping() + + val dependencyMapping: Map = getArtifactNameToConstantMapping() .associateShortestByMavenCoordinate() findFilesWithDependencyNotations(project.rootDir).forEach { buildFile -> - migrateFileIfNeeded(buildFile, dependencyMapping) + migrateFileIfNeeded(buildFile, versionsCatalogMapping + dependencyMapping) } println() println(""" @@ -41,6 +37,24 @@ open class RefreshVersionsMigrateTask : DefaultTask() { $ANSI_GREEN./gradlew refreshVersions$ANSI_RESET """.trimIndent()) } + + private fun getVersionsCatalogMapping(): Map { + val versionCatalog = try { + project.extensions.getByType().named("libs") + } catch (e: UnknownDomainObjectException) { + println("w: refreshVersionsMigrate ignoring error $e") + return emptyMap() + } + + return versionCatalog.dependencyAliases.mapNotNull { alias -> + versionCatalog.findDependency(alias) + .orElse(null) + ?.orNull + ?.let { dependency: MinimalExternalModuleDependency -> + ModuleId.Maven(dependency.module.group, dependency.module.name) to "libs.$alias" + } + }.toMap() + } } //TODO: Don't replace random versions in build.gradle(.kts) files to avoid breaking plugins. @@ -75,9 +89,9 @@ internal fun migrateFileIfNeeded(file: File, dependencyMapping: Map Date: Sat, 12 Feb 2022 22:13:49 +0100 Subject: [PATCH 010/103] Polish refreshVersionsCatalog --- ...gTask.kt => RefreshVersionsCatalogTask.kt} | 21 +++++++------------ .../RefreshVersionsMigrateTask.kt | 2 +- .../refreshVersions/RefreshVersionsPlugin.kt | 2 +- 3 files changed, 10 insertions(+), 15 deletions(-) rename plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/{VersionsCatalogTask.kt => RefreshVersionsCatalogTask.kt} (84%) diff --git a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/VersionsCatalogTask.kt b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt similarity index 84% rename from plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/VersionsCatalogTask.kt rename to plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt index d95cd5334..3431918b0 100644 --- a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/VersionsCatalogTask.kt +++ b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt @@ -17,30 +17,25 @@ import org.gradle.api.tasks.TaskAction import org.gradle.util.GradleVersion @Suppress("UnstableApiUsage") -open class VersionsCatalogTask : DefaultTask() { +open class RefreshVersionsCatalogTask : DefaultTask() { @TaskAction - fun checkGradleVersion() { + fun refreshVersionsCatalogAction() { + // Check Gradle version if (currentGradleVersion < versionWithVersionsCatalog) { throw GradleException( """ |Gradle versions catalogs are not supported in $currentGradleVersion |Upgrade Gradle with this command - | ./gradlew wrapper --gradle-version $versionWithVersionsCatalog + | ./gradlew wrapper --gradle-version ${versionWithVersionsCatalog.version} """.trimMargin() ) } - } - - @TaskAction - fun addMissingEntries() { + // Update versions.properties addMissingEntriesInVersionsProperties(project) - } - - @TaskAction - fun taskUpdateVersionsCatalog() { + // Generate gradle/libs.versions.toml val catalog = OutputFile.GRADLE_VERSIONS_CATALOG val builtInDependencies = getArtifactNameToConstantMapping() @@ -72,8 +67,8 @@ open class VersionsCatalogTask : DefaultTask() { } companion object { - val currentGradleVersion = GradleVersion.current() - val versionWithVersionsCatalog = GradleVersion.version("7.4") + val currentGradleVersion: GradleVersion = GradleVersion.current() + val versionWithVersionsCatalog: GradleVersion = GradleVersion.version("7.4") } } diff --git a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsMigrateTask.kt b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsMigrateTask.kt index 29a8b51e7..39c9707bc 100644 --- a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsMigrateTask.kt +++ b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsMigrateTask.kt @@ -42,7 +42,7 @@ open class RefreshVersionsMigrateTask : DefaultTask() { val versionCatalog = try { project.extensions.getByType().named("libs") } catch (e: UnknownDomainObjectException) { - println("w: refreshVersionsMigrate ignoring error $e") + // File gradle/libs.versions.toml does not exist return emptyMap() } diff --git a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsPlugin.kt b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsPlugin.kt index 8a5f1e293..2acd2da7a 100644 --- a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsPlugin.kt +++ b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsPlugin.kt @@ -177,7 +177,7 @@ open class RefreshVersionsPlugin : Plugin { println(getArtifactNameToConstantMapping().joinToString("\n")) } } - project.tasks.register( + project.tasks.register( name = "refreshVersionsCatalog" ) { group = "refreshVersions" From 7728fd272e2f86099fa23b3e46f3f5ddaea34fc7 Mon Sep 17 00:00:00 2001 From: Jean-Michel Fayard Date: Fri, 25 Feb 2022 12:03:18 +0100 Subject: [PATCH 011/103] feat(VersionsCatalog): parse TOML lines --- .../refreshVersions/core}/internal/Toml.kt | 7 +- .../refreshVersions/core/internal/TomlLine.kt | 120 +++++++++++ .../de/fayard/refreshVersions/TomlLineTest.kt | 189 ++++++++++++++++++ .../fayard/refreshVersions/TomlSectionTest.kt | 2 +- .../toml-happy-path/available-versions.txt | 0 .../toml-happy-path/expected.libs.toml | 0 .../toml-happy-path/initial.libs.toml | 48 +++++ .../RefreshVersionsCatalogTask.kt | 2 +- 8 files changed, 362 insertions(+), 6 deletions(-) rename plugins/{dependencies/src/main/kotlin/de/fayard/refreshVersions => core/src/main/kotlin/de/fayard/refreshVersions/core}/internal/Toml.kt (93%) create mode 100644 plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlLine.kt create mode 100644 plugins/core/src/test/kotlin/de/fayard/refreshVersions/TomlLineTest.kt rename plugins/{dependencies => core}/src/test/kotlin/de/fayard/refreshVersions/TomlSectionTest.kt (97%) create mode 100644 plugins/core/src/test/resources/toml-happy-path/available-versions.txt create mode 100644 plugins/core/src/test/resources/toml-happy-path/expected.libs.toml create mode 100644 plugins/core/src/test/resources/toml-happy-path/initial.libs.toml diff --git a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/internal/Toml.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/Toml.kt similarity index 93% rename from plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/internal/Toml.kt rename to plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/Toml.kt index 02d3048de..3ccb02fc3 100644 --- a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/internal/Toml.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/Toml.kt @@ -1,8 +1,7 @@ -package de.fayard.refreshVersions.internal +package de.fayard.refreshVersions.core.internal -import de.fayard.refreshVersions.core.internal.Deps - -internal object Toml { +@InternalRefreshVersionsApi +object Toml { fun parseTomlInSection(toml: String): Map { val result = mutableMapOf() diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlLine.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlLine.kt new file mode 100644 index 000000000..dcf14d4b4 --- /dev/null +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlLine.kt @@ -0,0 +1,120 @@ +package de.fayard.refreshVersions.core.internal + +import de.fayard.refreshVersions.core.internal.TomlLine.Kind.* +import de.fayard.refreshVersions.core.internal.TomlLine.Section.* + +data class TomlLine( + val section: Section, + val text: String, +) { + + @Suppress("EnumEntryName") + enum class Section { versions, libraries, bundles, plugins, others } + + enum class Kind { Ignore, Available, Libs, LibsUnderscore, LibsVersionRef, Version, Plugin, PluginVersionRef } + + val textWithoutComment = text.substringBefore("#") + + val key = textWithoutComment.substringBefore("=", missingDelimiterValue = "").trim() + val hasKey = key.isNotBlank() + + val unparsedValue: String = if (hasKey.not()) "" else textWithoutComment.substringAfter("=").trim() + + private val quote = "\"" + fun String.unquote() = trim().removePrefix(quote).removeSuffix(quote) + + val value = if (unparsedValue.startsWith(quote)) unparsedValue.unquote() else "" + + val kind: Kind = this.guessTomlLineKind() + + val map: Map = parseTomlMap(kind) + + val versionRef get() = map["version.ref"] + val module get() = "$group:$name" + val version: String? by map + val group: String? by map + val name: String? by map + val id: String? by map + + override fun toString(): String = "TomlLine(section=$section, kind=$kind, key=$key, value=$value, map=$map)\n$text" +} + +private fun TomlLine.parseTomlMap(kind: TomlLine.Kind): Map { + + + val splitSemicolon = value.split(":") + + val map: MutableMap = when { + unparsedValue.startsWith("{").not() -> mutableMapOf() + else -> unparsedValue + .removePrefix("{").removeSuffix("}") + .split(",") + .associate { entry -> + val (key, value) = entry.split("=") + key.unquote() to value.unquote() + }.toMutableMap() + } + + return when(kind) { + Ignore -> emptyMap() + Available -> emptyMap() + LibsUnderscore -> emptyMap() + Version -> emptyMap() + Plugin, PluginVersionRef -> when { + value.isNotBlank() -> { + val (id, version) = splitSemicolon + mapOf("id" to id, "version" to version) + } + else -> map + } + Libs, LibsVersionRef -> when { + value.isNotBlank() -> { + val (group, name, version) = splitSemicolon + lineMap(group, name, version, null) + } + else -> { + map["module"]?.also { module -> + val (group, name) = module.split(":") + map.remove("module") + map["group"] = group + map["name"] = name + } + map + } + } + } +} + +private fun lineMap(group: String, name: String, version: String?, versionRef: String?) = + listOfNotNull("group" to group, "name" to name, version?.let { "version" to it }, versionRef?.let { "version.ref" to it }) + .toMap() + +private fun TomlLine.guessTomlLineKind(): TomlLine.Kind { + val hasVersionRef = textWithoutComment.contains("version.ref") + val containsAvailable = text.contains("# available") + + return when (section) { + bundles -> Ignore + others -> Ignore + versions -> when { + containsAvailable -> Available + hasKey -> Version + else -> Ignore + } + libraries -> { + when { + containsAvailable -> Available + hasKey.not() -> Ignore + textWithoutComment.endsWith(":_\"") -> LibsUnderscore + hasVersionRef -> LibsVersionRef + else -> Libs + } + } + plugins -> when { + containsAvailable -> Available + hasKey.not() -> Ignore + hasVersionRef -> PluginVersionRef + else -> Plugin + } + } +} diff --git a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/TomlLineTest.kt b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/TomlLineTest.kt new file mode 100644 index 000000000..cc7678809 --- /dev/null +++ b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/TomlLineTest.kt @@ -0,0 +1,189 @@ +package de.fayard.refreshVersions + +import de.fayard.refreshVersions.core.internal.Toml +import de.fayard.refreshVersions.core.internal.TomlLine +import de.fayard.refreshVersions.core.internal.TomlLine.Kind.Available +import de.fayard.refreshVersions.core.internal.TomlLine.Kind.Ignore +import de.fayard.refreshVersions.core.internal.TomlLine.Kind.Libs +import de.fayard.refreshVersions.core.internal.TomlLine.Kind.LibsUnderscore +import de.fayard.refreshVersions.core.internal.TomlLine.Kind.LibsVersionRef +import de.fayard.refreshVersions.core.internal.TomlLine.Kind.Plugin +import de.fayard.refreshVersions.core.internal.TomlLine.Kind.PluginVersionRef +import de.fayard.refreshVersions.core.internal.TomlLine.Kind.Version +import io.kotest.core.spec.style.FunSpec +import io.kotest.inspectors.forAll +import io.kotest.matchers.shouldBe +import java.io.File + +class TomlLineTest : FunSpec({ + + + test("Parsing kind for libraries") { + + val lines = """ + groovy-core = { module = "org.codehaus.groovy:groovy", version.ref = "groovy" } + groovy-json = { module = "org.codehaus.groovy:groovy-json", version.ref = "groovy" } + groovy-nio = { module = "org.codehaus.groovy:groovy-nio", version.ref = "groovy" } + + # another comment + + refreshVersionsLib = "de.fayard:lib:_" + + my-lib = "com.mycompany:mylib:1.4" + ## # available:1.5" + + my-other-lib = { module = "com.mycompany:other", version = "1.4" } + + my-other-lib2 = { group = "com.mycompany", name = "alternate", version = "1.4" } + ## + """.trimIndent().lines() + + val expectedKinds: List = listOf( + LibsVersionRef, LibsVersionRef, LibsVersionRef, + Ignore, Ignore, Ignore, + LibsUnderscore, Ignore, + Libs, Available, Ignore, + Libs, Ignore, + Libs, Ignore, + ) + + val testCases = lines.zip(expectedKinds) + + testCases.forAll { (line, expectedKind) -> + TomlLine(TomlLine.Section.libraries, line).kind shouldBe expectedKind + } + } + + test("Parsing kind for versions") { + + val lines = """ + # some comment + + groovy = "3.0.5" + ## available: "1.5" + ## available: "1.6" + + checkstyle = "8.37" + common = "3.4" + """.trimIndent().lines() + + val expectedKinds: List = listOf( + Ignore, Ignore, + Version, Available, Available, Ignore, + Version, Version, + ) + + val testCases = lines.zip(expectedKinds) + + testCases.forAll { (line, expectedKind) -> + TomlLine(TomlLine.Section.versions, line).kind shouldBe expectedKind + } + } + + test("Parsing kind for plugins") { + + val lines = """ + short-notation = "some.plugin.id:1.4" + ## # available:"1.5" + + # yet another comment + long-notation = { id = "some.plugin.id", version = "1.4" } + reference-notation = { id = "some.plugin.id", version.ref = "common" } + """.trimIndent().lines() + + val expectedKinds: List = listOf( + Plugin, Available, Ignore, Ignore, + Plugin, PluginVersionRef + ) + + val testCases = lines.zip(expectedKinds) + + testCases.forAll { (line, expectedKind) -> + TomlLine(TomlLine.Section.plugins, line).kind shouldBe expectedKind + } + } + + test("Parsing libraries values") { + fun map(group: String, name: String, version: String?, versionRef: String?) = + listOfNotNull("group" to group, "name" to name, version?.let { "version" to it }, versionRef?.let { "version.ref" to it }) + .toMap() + + val lines = """ + ## # available:1.5" + # comment + refreshVersionsLib = "de.fayard:lib:_" + my-lib = "com.mycompany:mylib:1.4" + my-other-lib = { module = "com.mycompany:other", version = "1.4" } + my-other-lib2 = { group = "com.mycompany", name = "alternate", version = "1.4" } + groovy-nio = { module = "org.codehaus.groovy:groovy-nio", version.ref = "groovy" } + groovy-io = { group = "org.codehaus.groovy", name = "io", version.ref = "groovy" } + """.trimIndent().lines() + + val expected = listOf( + emptyMap(), + emptyMap(), + emptyMap(), + map("com.mycompany", "mylib", "1.4", null), + map("com.mycompany", "other", "1.4", null), + map("com.mycompany", "alternate", "1.4", null), + map("org.codehaus.groovy", "groovy-nio", null, "groovy"), + map("org.codehaus.groovy", "io", null, "groovy"), + ) + + val testCases = lines.zip(expected) + + testCases.forAll { (line, map) -> + TomlLine(TomlLine.Section.libraries, line).map shouldBe map + } + + } + + test("Parsing plugins values") { + fun map(id: String, version: String?, versionRef: String?) = + listOfNotNull("id" to id, version?.let { "version" to it }, versionRef?.let { "version.ref" to it }) + .toMap() + + val lines = """ + # yet another comment + ## # available:"1.5" + + short-notation = "some.plugin.id:1.4" + long-notation = { id = "some.plugin.id", version = "1.4" } + reference-notation = { id = "some.plugin.id", version.ref = "common" } + """.trimIndent().lines() + + val expected = listOf( + emptyMap(), + emptyMap(), + emptyMap(), + map("some.plugin.id", "1.4", null), + map("some.plugin.id", "1.4", null), + map("some.plugin.id", null, "common"), + ) + + val testCases = lines.zip(expected) + + testCases.forAll { (line, map) -> + TomlLine(TomlLine.Section.plugins, line).map shouldBe map + } + } + + test("Parse whole file") { + val fileText = File("src/test/resources/toml-happy-path/initial.libs.toml").readText() + Toml.parseTomlInSection(fileText).forEach { (key, text) -> + val section = try { + TomlLine.Section.valueOf(key) + } catch (e: IllegalArgumentException) { + TomlLine.Section.others + } + text.lines().forAll { text -> + val line = TomlLine(section, text) + println(line) + } + } + } + + +}) + + diff --git a/plugins/dependencies/src/test/kotlin/de/fayard/refreshVersions/TomlSectionTest.kt b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/TomlSectionTest.kt similarity index 97% rename from plugins/dependencies/src/test/kotlin/de/fayard/refreshVersions/TomlSectionTest.kt rename to plugins/core/src/test/kotlin/de/fayard/refreshVersions/TomlSectionTest.kt index 3c0211eb5..a6ee8a1bd 100644 --- a/plugins/dependencies/src/test/kotlin/de/fayard/refreshVersions/TomlSectionTest.kt +++ b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/TomlSectionTest.kt @@ -1,6 +1,6 @@ package de.fayard.refreshVersions -import de.fayard.refreshVersions.internal.Toml +import de.fayard.refreshVersions.core.internal.Toml import io.kotest.core.spec.style.StringSpec import io.kotest.matchers.shouldBe diff --git a/plugins/core/src/test/resources/toml-happy-path/available-versions.txt b/plugins/core/src/test/resources/toml-happy-path/available-versions.txt new file mode 100644 index 000000000..e69de29bb diff --git a/plugins/core/src/test/resources/toml-happy-path/expected.libs.toml b/plugins/core/src/test/resources/toml-happy-path/expected.libs.toml new file mode 100644 index 000000000..e69de29bb diff --git a/plugins/core/src/test/resources/toml-happy-path/initial.libs.toml b/plugins/core/src/test/resources/toml-happy-path/initial.libs.toml new file mode 100644 index 000000000..a16aca682 --- /dev/null +++ b/plugins/core/src/test/resources/toml-happy-path/initial.libs.toml @@ -0,0 +1,48 @@ +# See https://docs.gradle.org/current/userguide/platforms.html#sub:conventional-dependencies-toml + +key = "some key" + +[versions] +# some comment + +groovy = "3.0.5" +## available: "1.5" +## available: "1.6" + +checkstyle = "8.37" +common = "3.4" + +[libraries] +groovy-core = { module = "org.codehaus.groovy:groovy", version.ref = "groovy" } +groovy-json = { module = "org.codehaus.groovy:groovy-json", version.ref = "groovy" } +groovy-nio = { module = "org.codehaus.groovy:groovy-nio", version.ref = "groovy" } + +# another comment + +refreshVersionsLib = "de.fayard:lib:_" + +my-lib = "com.mycompany:mylib:1.4" +## # available:1.5" + +my-other-lib = { module = "com.mycompany:other", version = "1.4" } + +my-other-lib2 = { group = "com.mycompany", name = "alternate", version = "1.4" } +## # available = "1.5" } + +[bundles] + +groovy = ["groovy-core", "groovy-json", "groovy-nio"] + +[plugins] + +short-notation = "some.plugin.id:1.4" +## # available:"1.5" + +# yet another comment + +long-notation = { id = "some.plugin.id", version = "1.4" } +## # available:"1.5" } +## # available:"1.6" } + +reference-notation = { id = "some.plugin.id", version.ref = "common" } + diff --git a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt index 3431918b0..ded592a8d 100644 --- a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt +++ b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt @@ -9,7 +9,7 @@ import de.fayard.refreshVersions.core.internal.OutputFile import de.fayard.refreshVersions.core.internal.checkModeAndNames import de.fayard.refreshVersions.core.internal.computeUseFqdnFor import de.fayard.refreshVersions.core.internal.findDependencies -import de.fayard.refreshVersions.internal.Toml.versionsCatalog +import de.fayard.refreshVersions.core.internal.Toml.versionsCatalog import de.fayard.refreshVersions.internal.getArtifactNameToConstantMapping import org.gradle.api.DefaultTask import org.gradle.api.GradleException From e28ff07560834ea01b80032b29a55d16091bd9af Mon Sep 17 00:00:00 2001 From: Jean-Michel Fayard Date: Fri, 25 Feb 2022 18:28:26 +0100 Subject: [PATCH 012/103] feat(VersionsCatalog): Implement Toml Updater --- .../refreshVersions/core/internal/TomlLine.kt | 39 ++++++--- .../core/internal/TomlUpdater.kt | 83 +++++++++++++++++++ .../de/fayard/refreshVersions/TomlLineTest.kt | 34 ++++---- .../fayard/refreshVersions/TomlUpdaterTest.kt | 63 ++++++++++++++ .../toml-happy-path/available-versions.txt | 0 .../toml-happy-path/dependencies.txt | 7 ++ .../toml-happy-path/expected.libs.toml | 54 ++++++++++++ .../toml-happy-path/initial.libs.toml | 12 +-- 8 files changed, 254 insertions(+), 38 deletions(-) create mode 100644 plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlUpdater.kt create mode 100644 plugins/core/src/test/kotlin/de/fayard/refreshVersions/TomlUpdaterTest.kt delete mode 100644 plugins/core/src/test/resources/toml-happy-path/available-versions.txt create mode 100644 plugins/core/src/test/resources/toml-happy-path/dependencies.txt diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlLine.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlLine.kt index dcf14d4b4..97dcc4a74 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlLine.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlLine.kt @@ -9,9 +9,13 @@ data class TomlLine( ) { @Suppress("EnumEntryName") - enum class Section { versions, libraries, bundles, plugins, others } + enum class Section { versions, libraries, bundles, plugins, others ; + companion object { + fun from(name: String): Section = values().firstOrNull { it.name == name } ?: others + } + } - enum class Kind { Ignore, Available, Libs, LibsUnderscore, LibsVersionRef, Version, Plugin, PluginVersionRef } + enum class Kind { Ignore, Delete, Libs, LibsUnderscore, LibsVersionRef, Version, Plugin, PluginVersionRef } val textWithoutComment = text.substringBefore("#") @@ -27,14 +31,22 @@ data class TomlLine( val kind: Kind = this.guessTomlLineKind() - val map: Map = parseTomlMap(kind) + val map: Map = parseTomlMap(kind).withDefault { "" } val versionRef get() = map["version.ref"] + val module get() = "$group:$name" - val version: String? by map - val group: String? by map - val name: String? by map - val id: String? by map + + val version: String get() = + if (section == versions) value else map["version"]!! + + val group: String get() = + if (section == plugins) id else map["group"]!! + + val name: String get() = + if (section == plugins) "$id.gradle.plugin" else map["name"]!! + + val id: String by map override fun toString(): String = "TomlLine(section=$section, kind=$kind, key=$key, value=$value, map=$map)\n$text" } @@ -57,7 +69,7 @@ private fun TomlLine.parseTomlMap(kind: TomlLine.Kind): Map { return when(kind) { Ignore -> emptyMap() - Available -> emptyMap() + Delete -> emptyMap() LibsUnderscore -> emptyMap() Version -> emptyMap() Plugin, PluginVersionRef -> when { @@ -90,20 +102,24 @@ private fun lineMap(group: String, name: String, version: String?, versionRef: S .toMap() private fun TomlLine.guessTomlLineKind(): TomlLine.Kind { + when { + text.contains("# available") -> return Delete + text.startsWith("## unused") -> return Delete + text.startsWith("## error") -> return Delete + text.startsWith("## warning") -> return Delete + } + val hasVersionRef = textWithoutComment.contains("version.ref") - val containsAvailable = text.contains("# available") return when (section) { bundles -> Ignore others -> Ignore versions -> when { - containsAvailable -> Available hasKey -> Version else -> Ignore } libraries -> { when { - containsAvailable -> Available hasKey.not() -> Ignore textWithoutComment.endsWith(":_\"") -> LibsUnderscore hasVersionRef -> LibsVersionRef @@ -111,7 +127,6 @@ private fun TomlLine.guessTomlLineKind(): TomlLine.Kind { } } plugins -> when { - containsAvailable -> Available hasKey.not() -> Ignore hasVersionRef -> PluginVersionRef else -> Plugin diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlUpdater.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlUpdater.kt new file mode 100644 index 000000000..2e2f704bc --- /dev/null +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlUpdater.kt @@ -0,0 +1,83 @@ +package de.fayard.refreshVersions.core.internal + +import de.fayard.refreshVersions.core.internal.TomlLine.Kind.* +import java.io.File +import de.fayard.refreshVersions.core.Version as MavenVersion + +internal class TomlUpdater(val toml: String, val dependenciesUpdates: List) { + val sectionsMap = Toml.parseTomlInSection(toml) + + val sections = sectionsMap.mapValues { (key, text) -> + val section = TomlLine.Section.from(key) + text.lines().map { TomlLine(section, it) } + } + + fun updateNewVersions(actual: File) { + if (toml.isBlank()) return + + val newSectionsText = sections.mapValues { (key, lines) -> + updateNewVersions(lines).joinToString(separator = "\n") { it.text } + } + actual.writeText(Toml.tomlSectionsToString(newSectionsText)) + } + + fun updateNewVersions(lines: List): List { + return lines.flatMap { line -> + val noop = listOf(line) + when (line.kind) { + Ignore, LibsUnderscore, LibsVersionRef, PluginVersionRef -> noop + Delete -> emptyList() + Version -> { + linesForUpdate(line, findLineReferencing(line)) + } + Libs, Plugin -> { + val update = dependenciesUpdates.firstOrNull { dc -> + dc.moduleId.name == line.name && dc.moduleId.group == line.group + } + linesForUpdate(line, update) + } + } + } + } + + fun findLineReferencing(version: TomlLine): DependencyWithVersionCandidates? { + val libOrPlugin = sections.values.flatten().firstOrNull { line -> + println(line) + line.versionRef == version.key + }?: return null + + return dependenciesUpdates.firstOrNull { (moduleId) -> + val nameOk = moduleId.name == libOrPlugin.name + nameOk && moduleId.group == libOrPlugin.group + } + } + + fun linesForUpdate(line: TomlLine, update: DependencyWithVersionCandidates?): List { + val result = mutableListOf(line) + val versions = update?.versionsCandidates ?: return result + val version = line.version + + val isObject = line.unparsedValue.endsWith("}") + + fun suffix(v: MavenVersion) = when { + isObject -> """ = "${v.value}" }""" + line.section == TomlLine.Section.versions -> """ = "${v.value}"""" + else -> """:${v.value}"""" + } + + val nbSpaces = line.text.indexOf(version ?: "oops") - + if (isObject) 17 else 14 + val space = List(Math.max(0, nbSpaces)) { " " }.joinToString("") + + versions.mapTo(result) { v: MavenVersion -> + TomlLine(line.section, "##${space}# available${suffix(v)}") + } + return result + } +} + + +internal fun TomlUpdater(file: File, dependenciesUpdates: List): TomlUpdater { + val text: String = if (file.canRead()) file.readText() else "" + return TomlUpdater(text, dependenciesUpdates) +} diff --git a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/TomlLineTest.kt b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/TomlLineTest.kt index cc7678809..9b74b7fff 100644 --- a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/TomlLineTest.kt +++ b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/TomlLineTest.kt @@ -1,8 +1,7 @@ package de.fayard.refreshVersions -import de.fayard.refreshVersions.core.internal.Toml import de.fayard.refreshVersions.core.internal.TomlLine -import de.fayard.refreshVersions.core.internal.TomlLine.Kind.Available +import de.fayard.refreshVersions.core.internal.TomlLine.Kind.Delete import de.fayard.refreshVersions.core.internal.TomlLine.Kind.Ignore import de.fayard.refreshVersions.core.internal.TomlLine.Kind.Libs import de.fayard.refreshVersions.core.internal.TomlLine.Kind.LibsUnderscore @@ -12,8 +11,8 @@ import de.fayard.refreshVersions.core.internal.TomlLine.Kind.PluginVersionRef import de.fayard.refreshVersions.core.internal.TomlLine.Kind.Version import io.kotest.core.spec.style.FunSpec import io.kotest.inspectors.forAll +import io.kotest.inspectors.forAny import io.kotest.matchers.shouldBe -import java.io.File class TomlLineTest : FunSpec({ @@ -42,7 +41,7 @@ class TomlLineTest : FunSpec({ LibsVersionRef, LibsVersionRef, LibsVersionRef, Ignore, Ignore, Ignore, LibsUnderscore, Ignore, - Libs, Available, Ignore, + Libs, Delete, Ignore, Libs, Ignore, Libs, Ignore, ) @@ -69,7 +68,7 @@ class TomlLineTest : FunSpec({ val expectedKinds: List = listOf( Ignore, Ignore, - Version, Available, Available, Ignore, + Version, Delete, Delete, Ignore, Version, Version, ) @@ -92,7 +91,7 @@ class TomlLineTest : FunSpec({ """.trimIndent().lines() val expectedKinds: List = listOf( - Plugin, Available, Ignore, Ignore, + Plugin, Delete, Ignore, Ignore, Plugin, PluginVersionRef ) @@ -168,22 +167,17 @@ class TomlLineTest : FunSpec({ } } - test("Parse whole file") { - val fileText = File("src/test/resources/toml-happy-path/initial.libs.toml").readText() - Toml.parseTomlInSection(fileText).forEach { (key, text) -> - val section = try { - TomlLine.Section.valueOf(key) - } catch (e: IllegalArgumentException) { - TomlLine.Section.others - } - text.lines().forAll { text -> - val line = TomlLine(section, text) - println(line) - } + test("Parsing for warning or error messages") { + val lines = """ + ## error: something happened + ## warning: just a warning + ## unused + """.trimIndent().lines() + + lines.forAny { + TomlLine(TomlLine.Section.libraries, it).kind shouldBe Delete } } - - }) diff --git a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/TomlUpdaterTest.kt b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/TomlUpdaterTest.kt new file mode 100644 index 000000000..68531270c --- /dev/null +++ b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/TomlUpdaterTest.kt @@ -0,0 +1,63 @@ +package de.fayard.refreshVersions + +import de.fayard.refreshVersions.core.ModuleId +import de.fayard.refreshVersions.core.internal.DependencyWithVersionCandidates +import de.fayard.refreshVersions.core.internal.TomlUpdater +import io.kotest.core.spec.style.FunSpec +import io.kotest.matchers.shouldBe +import java.io.File +import de.fayard.refreshVersions.core.Version as MavenVersion + +class TomlUpdaterTest : FunSpec({ + + val folders = listOf("toml-happy-path") + + folders.forEach { folder -> + test("Test for folder $folder") { + val input = FolderInput(folder) + val expectedText = input.expected.readText() + + TomlUpdater(input.initial, input.dependenciesUpdates).updateNewVersions(input.actual) + expectedText shouldBe input.actual.readText() + + // check idempotent + TomlUpdater(input.expected, input.dependenciesUpdates).updateNewVersions(input.expected) + expectedText shouldBe input.actual.readText() + + // delete actual file if successfull + input.actual.delete() + } + } +}) + + +private data class FolderInput( + val folder: String, + val initial: File, + val expected: File, + val actual: File, + val dependenciesUpdates: List +) + +private fun FolderInput(folder: String): FolderInput { + val file = File("src/test/resources/$folder") + require(file.canRead()) { "Invalid folder ${file.absolutePath}" } + val dependencies = file.resolve("dependencies.txt") + .readText().lines() + .map { line -> + val (group, name, version, available) = line.split(":") + DependencyWithVersionCandidates( + moduleId = ModuleId.Maven(group, name), + currentVersion = version, + versionsCandidates = available.split(",").map { MavenVersion(it) }, + failures = emptyList() + ) + } + return FolderInput( + folder = folder, + initial = file.resolve("initial.libs.toml"), + actual = file.resolve("actual.libs.toml"), + expected = file.resolve("expected.libs.toml"), + dependenciesUpdates = dependencies + ) +} diff --git a/plugins/core/src/test/resources/toml-happy-path/available-versions.txt b/plugins/core/src/test/resources/toml-happy-path/available-versions.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/plugins/core/src/test/resources/toml-happy-path/dependencies.txt b/plugins/core/src/test/resources/toml-happy-path/dependencies.txt new file mode 100644 index 000000000..835555ca2 --- /dev/null +++ b/plugins/core/src/test/resources/toml-happy-path/dependencies.txt @@ -0,0 +1,7 @@ +org.codehaus.groovy:groovy:3.0.5:3.1.0,3.2.0 +com.mycompany:mylib-ok:1.4:2.0 +com.mycompany:mylib-ko:1.4: +com.mycompany:other:1.4:1.5,1.6 +com.mycompany:alternate:1.4:1.5 +some.plugin.id:some.plugin.id.gradle.plugin:1.4:1.5,1.6,1.7 +other.plugin.id:other.plugin.id.gradle.plugin:3.4:3.5,3.6 \ No newline at end of file diff --git a/plugins/core/src/test/resources/toml-happy-path/expected.libs.toml b/plugins/core/src/test/resources/toml-happy-path/expected.libs.toml index e69de29bb..7179405c4 100644 --- a/plugins/core/src/test/resources/toml-happy-path/expected.libs.toml +++ b/plugins/core/src/test/resources/toml-happy-path/expected.libs.toml @@ -0,0 +1,54 @@ +# See https://docs.gradle.org/current/userguide/platforms.html#sub:conventional-dependencies-toml + +key = "some key" + +[versions] +# some comment + +groovy = "3.0.5" +### available = "3.1.0" +### available = "3.2.0" + +checkstyle = "8.37" +common = "3.4" +### available = "3.5" +### available = "3.6" + +[libraries] +groovy-core = { module = "org.codehaus.groovy:groovy", version.ref = "groovy" } +groovy-json = { module = "org.codehaus.groovy:groovy-json", version.ref = "groovy" } +groovy-nio = { module = "org.codehaus.groovy:groovy-nio", version.ref = "groovy" } + +# another comment + +refreshVersionsLib = "de.fayard:lib:_" + +my-lib = "com.mycompany:mylib:1.4" + +my-other-lib = { module = "com.mycompany:other", version = "1.4" } +## # available = "1.5" } +## # available = "1.6" } + +my-other-lib2 = { group = "com.mycompany", name = "alternate", version = "1.4" } +## # available = "1.5" } + +[bundles] + +groovy = ["groovy-core", "groovy-json", "groovy-nio"] + +[plugins] + +short-notation = "some.plugin.id:1.4" +## # available:1.5" +## # available:1.6" +## # available:1.7" + +# yet another comment + +long-notation = { id = "some.plugin.id", version = "1.4" } +## # available = "1.5" } +## # available = "1.6" } +## # available = "1.7" } + +reference-notation = { id = "other.plugin.id", version.ref = "common" } + diff --git a/plugins/core/src/test/resources/toml-happy-path/initial.libs.toml b/plugins/core/src/test/resources/toml-happy-path/initial.libs.toml index a16aca682..8a2e89c72 100644 --- a/plugins/core/src/test/resources/toml-happy-path/initial.libs.toml +++ b/plugins/core/src/test/resources/toml-happy-path/initial.libs.toml @@ -6,8 +6,8 @@ key = "some key" # some comment groovy = "3.0.5" -## available: "1.5" -## available: "1.6" +### available="1.5" +### available="1.6" checkstyle = "8.37" common = "3.4" @@ -27,7 +27,7 @@ my-lib = "com.mycompany:mylib:1.4" my-other-lib = { module = "com.mycompany:other", version = "1.4" } my-other-lib2 = { group = "com.mycompany", name = "alternate", version = "1.4" } -## # available = "1.5" } +## # available="1.5" } [bundles] @@ -41,8 +41,8 @@ short-notation = "some.plugin.id:1.4" # yet another comment long-notation = { id = "some.plugin.id", version = "1.4" } -## # available:"1.5" } -## # available:"1.6" } +## # available="1.5" } +## # available="1.6" } -reference-notation = { id = "some.plugin.id", version.ref = "common" } +reference-notation = { id = "other.plugin.id", version.ref = "common" } From f40b9e16ceb8a3d89a86ed7d6ffbcdb53b0e4d4c Mon Sep 17 00:00:00 2001 From: Jean-Michel Fayard Date: Fri, 25 Feb 2022 18:58:12 +0100 Subject: [PATCH 013/103] feat(VersionsCatalog): Enable in task refreshVersions --- .../core/RefreshVersionsTask.kt | 30 ++++++++++++++++++- .../core/internal/InternalExtensions.kt | 9 ++++-- .../core/internal/NewRefreshVersionsImpl.kt | 5 ++-- .../core/internal/TomlUpdater.kt | 10 +++++-- 4 files changed, 45 insertions(+), 9 deletions(-) diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsTask.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsTask.kt index 4e9e74cb8..6980f2c41 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsTask.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsTask.kt @@ -8,11 +8,15 @@ import de.fayard.refreshVersions.core.internal.versions.writeWithNewVersions import kotlinx.coroutines.async import kotlinx.coroutines.runBlocking import org.gradle.api.DefaultTask +import org.gradle.api.UnknownDomainObjectException import org.gradle.api.artifacts.Dependency +import org.gradle.api.artifacts.MinimalExternalModuleDependency +import org.gradle.api.artifacts.VersionCatalogsExtension import org.gradle.api.tasks.Input import org.gradle.api.tasks.Optional import org.gradle.api.tasks.TaskAction import org.gradle.api.tasks.options.Option +import org.gradle.kotlin.dsl.getByType import org.gradle.util.GradleVersion /** @@ -65,7 +69,8 @@ open class RefreshVersionsTask : DefaultTask() { httpClient = httpClient, project = project, versionMap = RefreshVersionsConfigHolder.readVersionsMap(), - versionKeyReader = RefreshVersionsConfigHolder.versionKeyReader + versionKeyReader = RefreshVersionsConfigHolder.versionKeyReader, + versionsCatalogMapping = getVersionsCatalogMapping(), ) } VersionsPropertiesModel.writeWithNewVersions(result.dependenciesUpdates) @@ -74,6 +79,8 @@ open class RefreshVersionsTask : DefaultTask() { settingsPluginsUpdates = result.settingsPluginsUpdates, buildSrcSettingsPluginsUpdates = result.buildSrcSettingsPluginsUpdates ) + val libsToml = project.file("gradle/libs.versions.toml") + TomlUpdater(libsToml, result.dependenciesUpdates).updateNewVersions(libsToml) warnAboutRefreshVersionsIfSettingIfAny() warnAboutHardcodedVersionsIfAny(result.dependenciesWithHardcodedVersions) @@ -83,6 +90,9 @@ open class RefreshVersionsTask : DefaultTask() { logger.log(problem) } OutputFile.VERSIONS_PROPERTIES.logFileWasModified() + if (libsToml.canRead()) { + OutputFile.GRADLE_VERSIONS_CATALOG.logFileWasModified() + } } } @@ -154,4 +164,22 @@ open class RefreshVersionsTask : DefaultTask() { //TODO: Replace issue link above with stable link to explanation in documentation. } } + + private fun getVersionsCatalogMapping(): Set { + val versionCatalog = try { + project.extensions.getByType().named("libs") + } catch (e: UnknownDomainObjectException) { + // File gradle/libs.versions.toml does not exist + return emptySet() + } + + return versionCatalog.dependencyAliases.mapNotNull { alias -> + versionCatalog.findDependency(alias) + .orElse(null) + ?.orNull + ?.let { dependency: MinimalExternalModuleDependency -> + ModuleId.Maven(dependency.module.group, dependency.module.name) + } + }.toSet() + } } diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/InternalExtensions.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/InternalExtensions.kt index ea5ac3496..675ed8bb7 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/InternalExtensions.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/InternalExtensions.kt @@ -8,13 +8,15 @@ import org.gradle.api.artifacts.ExternalDependency @InternalRefreshVersionsApi fun Dependency.hasHardcodedVersion( versionMap: Map, - versionKeyReader: ArtifactVersionKeyReader -): Boolean = isManageableVersion(versionMap, versionKeyReader).not() + versionKeyReader: ArtifactVersionKeyReader, + versionsCatalogMapping: Set = emptySet(), +): Boolean = isManageableVersion(versionMap, versionKeyReader, versionsCatalogMapping).not() @InternalRefreshVersionsApi fun Dependency.isManageableVersion( versionMap: Map, - versionKeyReader: ArtifactVersionKeyReader + versionKeyReader: ArtifactVersionKeyReader, + versionsCatalogMapping: Set, ): Boolean { return when { version == versionPlaceholder -> true @@ -29,6 +31,7 @@ fun Dependency.isManageableVersion( else -> false } } + ModuleId.Maven(group ?: "", name) in versionsCatalogMapping -> true else -> false } } diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/NewRefreshVersionsImpl.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/NewRefreshVersionsImpl.kt index ad0987e17..275813275 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/NewRefreshVersionsImpl.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/NewRefreshVersionsImpl.kt @@ -24,7 +24,8 @@ internal suspend fun lookupVersionCandidates( httpClient: OkHttpClient, project: Project, versionMap: Map, - versionKeyReader: ArtifactVersionKeyReader + versionKeyReader: ArtifactVersionKeyReader, + versionsCatalogMapping: Set ): VersionCandidatesLookupResult { require(project.isRootProject) @@ -34,7 +35,7 @@ internal suspend fun lookupVersionCandidates( val dependenciesWithHardcodedVersions = mutableListOf() val dependenciesWithDynamicVersions = mutableListOf() val dependencyFilter: (Dependency) -> Boolean = { dependency -> - dependency.isManageableVersion(versionMap, versionKeyReader).also { manageable -> + dependency.isManageableVersion(versionMap, versionKeyReader, versionsCatalogMapping).also { manageable -> if (manageable) return@also if (dependency.version != null) { // null version means it's expected to be added by a BoM or a plugin, so we ignore them. diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlUpdater.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlUpdater.kt index 2e2f704bc..e86a9f97f 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlUpdater.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlUpdater.kt @@ -1,6 +1,7 @@ package de.fayard.refreshVersions.core.internal import de.fayard.refreshVersions.core.internal.TomlLine.Kind.* +import org.gradle.util.GradleVersion import java.io.File import de.fayard.refreshVersions.core.Version as MavenVersion @@ -13,6 +14,10 @@ internal class TomlUpdater(val toml: String, val dependenciesUpdates: List @@ -42,9 +47,8 @@ internal class TomlUpdater(val toml: String, val dependenciesUpdates: List - println(line) line.versionRef == version.key - }?: return null + } ?: return null return dependenciesUpdates.firstOrNull { (moduleId) -> val nameOk = moduleId.name == libOrPlugin.name @@ -61,7 +65,7 @@ internal class TomlUpdater(val toml: String, val dependenciesUpdates: List """ = "${v.value}" }""" - line.section == TomlLine.Section.versions -> """ = "${v.value}"""" + line.section == TomlLine.Section.versions -> """ = "${v.value}"""" else -> """:${v.value}"""" } From 5ded7bdc3177437c4fa5a75fb4e684c5464bfaf0 Mon Sep 17 00:00:00 2001 From: Jean-Michel Fayard Date: Fri, 25 Feb 2022 20:22:04 +0100 Subject: [PATCH 014/103] feat(VersionsCatalog): refreshVersionsCatalog --versions --all --- .../fayard/buildSrcLibs/BuildSrcLibsTask.kt | 5 ++-- .../core/internal/DependencyNotations.kt | 8 +++--- .../refreshVersions/core/internal/Toml.kt | 20 +++++++++----- .../RefreshVersionsCatalogTask.kt | 27 ++++++++++++++----- 4 files changed, 39 insertions(+), 21 deletions(-) diff --git a/plugins/buildSrcLibs/src/main/kotlin/de/fayard/buildSrcLibs/BuildSrcLibsTask.kt b/plugins/buildSrcLibs/src/main/kotlin/de/fayard/buildSrcLibs/BuildSrcLibsTask.kt index e04502c0c..992883b66 100644 --- a/plugins/buildSrcLibs/src/main/kotlin/de/fayard/buildSrcLibs/BuildSrcLibsTask.kt +++ b/plugins/buildSrcLibs/src/main/kotlin/de/fayard/buildSrcLibs/BuildSrcLibsTask.kt @@ -7,7 +7,7 @@ import de.fayard.refreshVersions.core.internal.Case import de.fayard.refreshVersions.core.internal.MEANING_LESS_NAMES import de.fayard.refreshVersions.core.internal.OutputFile import de.fayard.refreshVersions.core.internal.checkModeAndNames -import de.fayard.refreshVersions.core.internal.computeUseFqdnFor +import de.fayard.refreshVersions.core.internal.computeAliases import de.fayard.refreshVersions.core.internal.findDependencies import org.gradle.api.DefaultTask import org.gradle.api.tasks.TaskAction @@ -50,8 +50,7 @@ open class BuildSrcLibsTask : DefaultTask() { val outputDir = project.file(OutputFile.OUTPUT_DIR.path) val allDependencies = project.findDependencies() - val resolvedUseFqdn = computeUseFqdnFor( - libraries = allDependencies, + val resolvedUseFqdn = allDependencies.computeAliases( configured = emptyList(), byDefault = MEANING_LESS_NAMES ) diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/DependencyNotations.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/DependencyNotations.kt index 7aa289213..df088383b 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/DependencyNotations.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/DependencyNotations.kt @@ -1,6 +1,5 @@ package de.fayard.refreshVersions.core.internal -import de.fayard.refreshVersions.core.internal.Case.* import org.gradle.api.Project import org.gradle.api.artifacts.ExternalDependency @@ -34,14 +33,13 @@ val MEANING_LESS_NAMES: MutableList = mutableListOf( ) @InternalRefreshVersionsApi -fun computeUseFqdnFor( - libraries: List, +fun List.computeAliases( configured: List, byDefault: List = MEANING_LESS_NAMES ): List { val groups = (configured + byDefault).filter { it.contains(".") }.distinct() - val depsFromGroups = libraries.filter { it.group in groups }.map { it.module } - val ambiguities = libraries.groupBy { it.module }.filter { it.value.size > 1 }.map { it.key } + val depsFromGroups = filter { it.group in groups }.map { it.module } + val ambiguities = groupBy { it.module }.filter { it.value.size > 1 }.map { it.key } return (configured + byDefault + ambiguities + depsFromGroups - groups).distinct().sorted() } diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/Toml.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/Toml.kt index 3ccb02fc3..535b77f7e 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/Toml.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/Toml.kt @@ -1,5 +1,7 @@ package de.fayard.refreshVersions.core.internal +import de.fayard.refreshVersions.core.ModuleId + @InternalRefreshVersionsApi object Toml { @@ -30,21 +32,27 @@ object Toml { } } - fun versionsCatalog(deps: Deps, currentText: String): String { + fun versionsCatalog(deps: Deps, currentText: String, withVersions: Boolean): String { val sections = parseTomlInSection(currentText).toMutableMap() if (sections["root"].isNullOrBlank()) { sections["root"] = "## Generated by $ ./gradlew refreshVersionsCatalog\n\n" } - sections["libraries"] = versionsCatalogLibraries(deps) + sections["libraries"] = versionsCatalogLibraries(deps, withVersions) return tomlSectionsToString(sections) } - fun versionsCatalogLibraries(deps: Deps) = buildString { + fun versionsCatalogLibraries(deps: Deps, withVersions: Boolean) = buildString { + val versionsMap = RefreshVersionsConfigHolder.readVersionsMap() + val versionKeyReader: ArtifactVersionKeyReader = RefreshVersionsConfigHolder.versionKeyReader + append('\n') - deps.libraries.forEach { - append(deps.names[it]) + deps.libraries.forEach { lib -> + val versionKey = getVersionPropertyName(ModuleId.Maven(lib.group, lib.name), versionKeyReader) + val version = versionsMap[versionKey] ?: "_" + + append(deps.names[lib]) append(" = \"") - append(it.groupModuleUnderscore()) + append(lib.groupModule() + ":" + if (withVersions) version else "_") append('"') append("\n") append("\n") diff --git a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt index ded592a8d..2c5794074 100644 --- a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt +++ b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt @@ -7,18 +7,28 @@ import de.fayard.refreshVersions.core.internal.Library import de.fayard.refreshVersions.core.internal.MEANING_LESS_NAMES import de.fayard.refreshVersions.core.internal.OutputFile import de.fayard.refreshVersions.core.internal.checkModeAndNames -import de.fayard.refreshVersions.core.internal.computeUseFqdnFor +import de.fayard.refreshVersions.core.internal.computeAliases import de.fayard.refreshVersions.core.internal.findDependencies import de.fayard.refreshVersions.core.internal.Toml.versionsCatalog import de.fayard.refreshVersions.internal.getArtifactNameToConstantMapping import org.gradle.api.DefaultTask import org.gradle.api.GradleException +import org.gradle.api.tasks.Input import org.gradle.api.tasks.TaskAction +import org.gradle.api.tasks.options.Option import org.gradle.util.GradleVersion @Suppress("UnstableApiUsage") open class RefreshVersionsCatalogTask : DefaultTask() { + @Input + @Option(option = "versions", description = "Add the versions in gradle/libs.versions.toml") + var withVersions: Boolean = false + + @Input + @Option(option = "all", description = "Add all libraries in gradle/libs.versions.toml") + var withAllLibraries: Boolean = false + @TaskAction fun refreshVersionsCatalogAction() { // Check Gradle version @@ -44,18 +54,21 @@ open class RefreshVersionsCatalogTask : DefaultTask() { val allDependencies: List = project.findDependencies() - val nonBuiltInDependencies = allDependencies - .filter { it.copy(version = "_") !in builtInDependencies } + val dependenciesToUse = if (withAllLibraries) { + allDependencies + } else { + allDependencies.filter { it.copy(version = "_") !in builtInDependencies } + } - val resolvedUseFqdn: List = computeUseFqdnFor( - libraries = nonBuiltInDependencies, + val versionCatalogAliases: List = dependenciesToUse.computeAliases( configured = emptyList(), byDefault = MEANING_LESS_NAMES ) - val deps: Deps = nonBuiltInDependencies.checkModeAndNames(resolvedUseFqdn, Case.`kebab-case`) + val deps: Deps = dependenciesToUse.checkModeAndNames(versionCatalogAliases, Case.`kebab-case`) + val currentText = if (catalog.existed) catalog.readText(project) else "" - val newText = versionsCatalog(deps, currentText) + val newText = versionsCatalog(deps, currentText, withVersions) catalog.writeText(newText, project) catalog.logFileWasModified() From ed6a4a932c40d6f716b4595ec632e147627288a6 Mon Sep 17 00:00:00 2001 From: Jean-Michel Fayard Date: Fri, 25 Feb 2022 21:03:02 +0100 Subject: [PATCH 015/103] ci: fix test --- .../de/fayard/refreshVersions/core/RefreshVersionsTask.kt | 4 +++- .../de/fayard/refreshVersions/core/internal/TomlUpdater.kt | 4 ---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsTask.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsTask.kt index 6980f2c41..9e26903dd 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsTask.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsTask.kt @@ -80,7 +80,9 @@ open class RefreshVersionsTask : DefaultTask() { buildSrcSettingsPluginsUpdates = result.buildSrcSettingsPluginsUpdates ) val libsToml = project.file("gradle/libs.versions.toml") - TomlUpdater(libsToml, result.dependenciesUpdates).updateNewVersions(libsToml) + if (GradleVersion.current() >= GradleVersion.version("7.4")) { + TomlUpdater(libsToml, result.dependenciesUpdates).updateNewVersions(libsToml) + } warnAboutRefreshVersionsIfSettingIfAny() warnAboutHardcodedVersionsIfAny(result.dependenciesWithHardcodedVersions) diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlUpdater.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlUpdater.kt index e86a9f97f..3c86c1274 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlUpdater.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlUpdater.kt @@ -14,10 +14,6 @@ internal class TomlUpdater(val toml: String, val dependenciesUpdates: List From 9d084a84fc491e71e0e855fcf970fd50cebeb791 Mon Sep 17 00:00:00 2001 From: Jean-Michel Fayard Date: Fri, 25 Feb 2022 21:03:46 +0100 Subject: [PATCH 016/103] tests: move tests to the right package --- .../kotlin/de/fayard/refreshVersions/{ => core}/CaseTest.kt | 2 +- .../de/fayard/refreshVersions/{ => core}/TomlLineTest.kt | 2 +- .../de/fayard/refreshVersions/{ => core}/TomlSectionTest.kt | 2 +- .../de/fayard/refreshVersions/{ => core}/TomlUpdaterTest.kt | 5 ++--- 4 files changed, 5 insertions(+), 6 deletions(-) rename plugins/core/src/test/kotlin/de/fayard/refreshVersions/{ => core}/CaseTest.kt (94%) rename plugins/core/src/test/kotlin/de/fayard/refreshVersions/{ => core}/TomlLineTest.kt (99%) rename plugins/core/src/test/kotlin/de/fayard/refreshVersions/{ => core}/TomlSectionTest.kt (97%) rename plugins/core/src/test/kotlin/de/fayard/refreshVersions/{ => core}/TomlUpdaterTest.kt (93%) diff --git a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/CaseTest.kt b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/CaseTest.kt similarity index 94% rename from plugins/core/src/test/kotlin/de/fayard/refreshVersions/CaseTest.kt rename to plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/CaseTest.kt index ecbe31d0b..4a3e8bb0a 100644 --- a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/CaseTest.kt +++ b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/CaseTest.kt @@ -1,4 +1,4 @@ -package de.fayard.refreshVersions +package de.fayard.refreshVersions.core import de.fayard.refreshVersions.core.internal.Case import io.kotest.core.spec.style.StringSpec diff --git a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/TomlLineTest.kt b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlLineTest.kt similarity index 99% rename from plugins/core/src/test/kotlin/de/fayard/refreshVersions/TomlLineTest.kt rename to plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlLineTest.kt index 9b74b7fff..0ff8c604f 100644 --- a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/TomlLineTest.kt +++ b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlLineTest.kt @@ -1,4 +1,4 @@ -package de.fayard.refreshVersions +package de.fayard.refreshVersions.core import de.fayard.refreshVersions.core.internal.TomlLine import de.fayard.refreshVersions.core.internal.TomlLine.Kind.Delete diff --git a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/TomlSectionTest.kt b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlSectionTest.kt similarity index 97% rename from plugins/core/src/test/kotlin/de/fayard/refreshVersions/TomlSectionTest.kt rename to plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlSectionTest.kt index a6ee8a1bd..bb77fdd37 100644 --- a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/TomlSectionTest.kt +++ b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlSectionTest.kt @@ -1,4 +1,4 @@ -package de.fayard.refreshVersions +package de.fayard.refreshVersions.core import de.fayard.refreshVersions.core.internal.Toml import io.kotest.core.spec.style.StringSpec diff --git a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/TomlUpdaterTest.kt b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlUpdaterTest.kt similarity index 93% rename from plugins/core/src/test/kotlin/de/fayard/refreshVersions/TomlUpdaterTest.kt rename to plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlUpdaterTest.kt index 68531270c..8eae24575 100644 --- a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/TomlUpdaterTest.kt +++ b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlUpdaterTest.kt @@ -1,6 +1,5 @@ -package de.fayard.refreshVersions +package de.fayard.refreshVersions.core -import de.fayard.refreshVersions.core.ModuleId import de.fayard.refreshVersions.core.internal.DependencyWithVersionCandidates import de.fayard.refreshVersions.core.internal.TomlUpdater import io.kotest.core.spec.style.FunSpec @@ -40,7 +39,7 @@ private data class FolderInput( ) private fun FolderInput(folder: String): FolderInput { - val file = File("src/test/resources/$folder") + val file = testResources.resolve(folder) require(file.canRead()) { "Invalid folder ${file.absolutePath}" } val dependencies = file.resolve("dependencies.txt") .readText().lines() From 499f1b46d494adb7900866901c211bc39067f8cc Mon Sep 17 00:00:00 2001 From: Jean-Michel Fayard Date: Fri, 25 Feb 2022 22:20:50 +0100 Subject: [PATCH 017/103] pr: self-review --- .../refreshVersions/core/internal/TomlLine.kt | 8 +++----- .../refreshVersions/core/internal/TomlUpdater.kt | 14 ++++++-------- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlLine.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlLine.kt index 97dcc4a74..f10d8b0f1 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlLine.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlLine.kt @@ -3,19 +3,19 @@ package de.fayard.refreshVersions.core.internal import de.fayard.refreshVersions.core.internal.TomlLine.Kind.* import de.fayard.refreshVersions.core.internal.TomlLine.Section.* -data class TomlLine( +internal data class TomlLine( val section: Section, val text: String, ) { @Suppress("EnumEntryName") - enum class Section { versions, libraries, bundles, plugins, others ; + internal enum class Section { versions, libraries, bundles, plugins, others ; companion object { fun from(name: String): Section = values().firstOrNull { it.name == name } ?: others } } - enum class Kind { Ignore, Delete, Libs, LibsUnderscore, LibsVersionRef, Version, Plugin, PluginVersionRef } + internal enum class Kind { Ignore, Delete, Libs, LibsUnderscore, LibsVersionRef, Version, Plugin, PluginVersionRef } val textWithoutComment = text.substringBefore("#") @@ -52,8 +52,6 @@ data class TomlLine( } private fun TomlLine.parseTomlMap(kind: TomlLine.Kind): Map { - - val splitSemicolon = value.split(":") val map: MutableMap = when { diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlUpdater.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlUpdater.kt index 3c86c1274..370c5a3b8 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlUpdater.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlUpdater.kt @@ -1,14 +1,13 @@ package de.fayard.refreshVersions.core.internal import de.fayard.refreshVersions.core.internal.TomlLine.Kind.* -import org.gradle.util.GradleVersion import java.io.File import de.fayard.refreshVersions.core.Version as MavenVersion internal class TomlUpdater(val toml: String, val dependenciesUpdates: List) { - val sectionsMap = Toml.parseTomlInSection(toml) + private val sectionsMap: Map = Toml.parseTomlInSection(toml) - val sections = sectionsMap.mapValues { (key, text) -> + private val sections: Map> = sectionsMap.mapValues { (key, text) -> val section = TomlLine.Section.from(key) text.lines().map { TomlLine(section, it) } } @@ -22,7 +21,7 @@ internal class TomlUpdater(val toml: String, val dependenciesUpdates: List): List { + private fun updateNewVersions(lines: List): List { return lines.flatMap { line -> val noop = listOf(line) when (line.kind) { @@ -41,18 +40,17 @@ internal class TomlUpdater(val toml: String, val dependenciesUpdates: List line.versionRef == version.key } ?: return null return dependenciesUpdates.firstOrNull { (moduleId) -> - val nameOk = moduleId.name == libOrPlugin.name - nameOk && moduleId.group == libOrPlugin.group + (moduleId.name == libOrPlugin.name) && (moduleId.group == libOrPlugin.group) } } - fun linesForUpdate(line: TomlLine, update: DependencyWithVersionCandidates?): List { + private fun linesForUpdate(line: TomlLine, update: DependencyWithVersionCandidates?): List { val result = mutableListOf(line) val versions = update?.versionsCandidates ?: return result val version = line.version From cb4ff90b845065e366d77fc1b6705001bca6b88b Mon Sep 17 00:00:00 2001 From: Jean-Michel Fayard Date: Fri, 25 Feb 2022 22:57:49 +0100 Subject: [PATCH 018/103] feat: dependencies from versions catalog are not hard-coded --- .../core/internal/NewRefreshVersionsImpl.kt | 7 ++++++- .../refreshVersions/core/internal/UsedPluginsHolder.kt | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/NewRefreshVersionsImpl.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/NewRefreshVersionsImpl.kt index 275813275..a68b231fb 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/NewRefreshVersionsImpl.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/NewRefreshVersionsImpl.kt @@ -95,9 +95,11 @@ internal suspend fun lookupVersionCandidates( val dependenciesWithVersionCandidates = dependenciesWithVersionCandidatesAsync.awaitAll() + val dependenciesFromVersionsCatalog = versionsCatalogMapping.map(ModuleId.Maven::toDependency) + return@coroutineScope VersionCandidatesLookupResult( dependenciesUpdates = dependenciesWithVersionCandidates, - dependenciesWithHardcodedVersions = dependenciesWithHardcodedVersions, + dependenciesWithHardcodedVersions = dependenciesWithHardcodedVersions - dependenciesFromVersionsCatalog, dependenciesWithDynamicVersions = dependenciesWithDynamicVersions, gradleUpdates = gradleUpdatesAsync.await(), settingsPluginsUpdates = settingsPluginsUpdatesAsync.await().settings, @@ -107,6 +109,9 @@ internal suspend fun lookupVersionCandidates( } } +private fun ModuleId.toDependency() = + UsedPluginsHolder.ConfigurationLessDependency("$group:$name:_") + private suspend fun lookupAvailableGradleVersions(httpClient: OkHttpClient): List = coroutineScope { val checker = GradleUpdateChecker(httpClient) val currentGradleVersion = GradleVersion.current() diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/UsedPluginsHolder.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/UsedPluginsHolder.kt index 093accfce..88baae33a 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/UsedPluginsHolder.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/UsedPluginsHolder.kt @@ -48,7 +48,7 @@ internal object UsedPluginsHolder { mutableListOf() } - private class ConfigurationLessDependency(val dependencyNotation: String) : AbstractDependency() { + internal class ConfigurationLessDependency(val dependencyNotation: String) : AbstractDependency() { override fun getGroup() = group override fun getName() = name From 9732622d4b27406970f8888b2f53b217683a2581 Mon Sep 17 00:00:00 2001 From: Jean-Michel Fayard Date: Sat, 26 Feb 2022 21:16:07 +0100 Subject: [PATCH 019/103] refactor: helpers for TomlLine --- .../refreshVersions/core/internal/TomlLine.kt | 23 +++++++++++++++++++ .../refreshVersions/core/TomlLineTest.kt | 17 ++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlLine.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlLine.kt index f10d8b0f1..aeb4602f8 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlLine.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlLine.kt @@ -2,6 +2,7 @@ package de.fayard.refreshVersions.core.internal import de.fayard.refreshVersions.core.internal.TomlLine.Kind.* import de.fayard.refreshVersions.core.internal.TomlLine.Section.* +import org.gradle.api.artifacts.Dependency internal data class TomlLine( val section: Section, @@ -49,8 +50,30 @@ internal data class TomlLine( val id: String by map override fun toString(): String = "TomlLine(section=$section, kind=$kind, key=$key, value=$value, map=$map)\n$text" + + internal companion object { + val newLine = TomlLine(TomlLine.Section.others, "") + } +} + +internal fun List.toText(): String + = joinToString("\n", postfix = "\n", prefix = "\n") { it.text } + +internal fun TomlLine(section: TomlLine.Section, key: String, value: String): TomlLine = + TomlLine(section, """$key = "$value"""" ) + +internal fun TomlLine(section: TomlLine.Section, key: String, dependency: Dependency): TomlLine = + TomlLine(section, key, """${dependency.group}:${dependency.name}:${dependency.version}""") + +internal fun TomlLine(section: TomlLine.Section, key: String, map: Map): TomlLine { + require((map.keys - validKeys).isEmpty()) { "Map $map has invalid keys. Valid: $validKeys"} + val formatMap = map.entries + .joinToString(", ") { (key, value) -> """$key = "$value"""" } + return TomlLine(section, "$key = { $formatMap }") } +private val validKeys = listOf("module", "group", "name", "version.ref", "version", "id") + private fun TomlLine.parseTomlMap(kind: TomlLine.Kind): Map { val splitSemicolon = value.split(":") diff --git a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlLineTest.kt b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlLineTest.kt index 0ff8c604f..197c5b406 100644 --- a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlLineTest.kt +++ b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlLineTest.kt @@ -9,6 +9,9 @@ import de.fayard.refreshVersions.core.internal.TomlLine.Kind.LibsVersionRef import de.fayard.refreshVersions.core.internal.TomlLine.Kind.Plugin import de.fayard.refreshVersions.core.internal.TomlLine.Kind.PluginVersionRef import de.fayard.refreshVersions.core.internal.TomlLine.Kind.Version +import de.fayard.refreshVersions.core.internal.UsedPluginsHolder +import de.fayard.refreshVersions.core.internal.UsedPluginsHolder.ConfigurationLessDependency +import io.kotest.assertions.assertSoftly import io.kotest.core.spec.style.FunSpec import io.kotest.inspectors.forAll import io.kotest.inspectors.forAny @@ -178,6 +181,20 @@ class TomlLineTest : FunSpec({ TomlLine(TomlLine.Section.libraries, it).kind shouldBe Delete } } + + test("Constructors for TomlLine") { + assertSoftly { + TomlLine(TomlLine.Section.plugins, "org-jetbrains-kotlin-jvm", mapOf("id" to "org.jetbrains.kotlin.jvm", "version" to "1.6.10")) + .text shouldBe """org-jetbrains-kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version = "1.6.10" }""" + + TomlLine(TomlLine.Section.libraries, "my-lib", "com.example:name:1.0") + .text shouldBe """my-lib = "com.example:name:1.0"""" + + val d = ConfigurationLessDependency("com.example:name:1.0") + TomlLine(TomlLine.Section.libraries, "my-lib", d) + .text shouldBe """my-lib = "com.example:name:1.0"""" + } + } }) From 3f6450b2ac9368cc661c4290ec68677bc6b8e152 Mon Sep 17 00:00:00 2001 From: Jean-Michel Fayard Date: Sat, 26 Feb 2022 21:16:35 +0100 Subject: [PATCH 020/103] feat(refreshVersionsCatalog): add plugins --- .../refreshVersions/core/internal/Toml.kt | 43 +++-- .../core/internal/UsedPluginsHolder.kt | 3 +- .../RefreshVersionsCatalogTask.kt | 7 +- sample-kotlin/gradle/libs.versions.toml | 40 +++- sample-kotlin/gradlew.bat | 178 +++++++++--------- 5 files changed, 155 insertions(+), 116 deletions(-) diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/Toml.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/Toml.kt index 535b77f7e..ecb781f2c 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/Toml.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/Toml.kt @@ -1,6 +1,7 @@ package de.fayard.refreshVersions.core.internal import de.fayard.refreshVersions.core.ModuleId +import org.gradle.api.artifacts.Dependency @InternalRefreshVersionsApi object Toml { @@ -27,36 +28,50 @@ object Toml { fun tomlSectionsToString(sections: Map): String = buildString { for ((header, content) in sections) { - if (header != "root") append("[$header]\n") - append(content) + if (header != "root") append("\n[$header]\n\n") + append(content.trim()) + append("\n") } } - fun versionsCatalog(deps: Deps, currentText: String, withVersions: Boolean): String { + fun versionsCatalog(deps: Deps, currentText: String, withVersions: Boolean, plugins: List): String { val sections = parseTomlInSection(currentText).toMutableMap() if (sections["root"].isNullOrBlank()) { sections["root"] = "## Generated by $ ./gradlew refreshVersionsCatalog\n\n" } - sections["libraries"] = versionsCatalogLibraries(deps, withVersions) + sections["plugins"] = addPlugins(plugins).toText() + sections["libraries"] = versionsCatalogLibraries(deps, withVersions).toText() return tomlSectionsToString(sections) } - fun versionsCatalogLibraries(deps: Deps, withVersions: Boolean) = buildString { + private fun addPlugins(plugins: List): List = + plugins + .distinctBy { d -> "${d.group}:${d.name}" } + .map { d -> + val pluginId = d.name.removeSuffix(".gradle.plugin") + val map = mapOf( + "id" to pluginId, + "version" to (d.version ?: "_") + ) + TomlLine(TomlLine.Section.plugins, pluginId.replace(".", "-"), map) + + }.flatMap { + listOf(TomlLine.newLine, it) + } + + private fun versionsCatalogLibraries(deps: Deps, withVersions: Boolean): List { val versionsMap = RefreshVersionsConfigHolder.readVersionsMap() val versionKeyReader: ArtifactVersionKeyReader = RefreshVersionsConfigHolder.versionKeyReader - append('\n') - deps.libraries.forEach { lib -> + return deps.libraries.flatMap { lib -> val versionKey = getVersionPropertyName(ModuleId.Maven(lib.group, lib.name), versionKeyReader) val version = versionsMap[versionKey] ?: "_" - append(deps.names[lib]) - append(" = \"") - append(lib.groupModule() + ":" + if (withVersions) version else "_") - append('"') - append("\n") - append("\n") + val value = lib.groupModule() + ":" + if (withVersions) version else "_" + listOf( + TomlLine.newLine, + TomlLine(TomlLine.Section.libraries, deps.names[lib]!!, value) + ) } - append("\n") } } diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/UsedPluginsHolder.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/UsedPluginsHolder.kt index 88baae33a..22311e5f6 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/UsedPluginsHolder.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/UsedPluginsHolder.kt @@ -5,7 +5,8 @@ import org.gradle.api.artifacts.Dependency import org.gradle.api.artifacts.ExternalDependency import org.gradle.api.internal.artifacts.dependencies.AbstractDependency -internal object UsedPluginsHolder { +@InternalRefreshVersionsApi +object UsedPluginsHolder { fun noteUsedPluginDependency( dependencyNotation: String, diff --git a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt index 2c5794074..3b23d2acd 100644 --- a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt +++ b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt @@ -10,6 +10,7 @@ import de.fayard.refreshVersions.core.internal.checkModeAndNames import de.fayard.refreshVersions.core.internal.computeAliases import de.fayard.refreshVersions.core.internal.findDependencies import de.fayard.refreshVersions.core.internal.Toml.versionsCatalog +import de.fayard.refreshVersions.core.internal.UsedPluginsHolder import de.fayard.refreshVersions.internal.getArtifactNameToConstantMapping import org.gradle.api.DefaultTask import org.gradle.api.GradleException @@ -50,7 +51,6 @@ open class RefreshVersionsCatalogTask : DefaultTask() { val builtInDependencies = getArtifactNameToConstantMapping() .map { Library(it.group, it.artifact, "_") } - .toSet() val allDependencies: List = project.findDependencies() @@ -60,6 +60,9 @@ open class RefreshVersionsCatalogTask : DefaultTask() { allDependencies.filter { it.copy(version = "_") !in builtInDependencies } } + val plugins = UsedPluginsHolder.usedPluginsWithoutEntryInVersionsFile + + UsedPluginsHolder.read().map { it.first } + val versionCatalogAliases: List = dependenciesToUse.computeAliases( configured = emptyList(), byDefault = MEANING_LESS_NAMES @@ -68,7 +71,7 @@ open class RefreshVersionsCatalogTask : DefaultTask() { val deps: Deps = dependenciesToUse.checkModeAndNames(versionCatalogAliases, Case.`kebab-case`) val currentText = if (catalog.existed) catalog.readText(project) else "" - val newText = versionsCatalog(deps, currentText, withVersions) + val newText = versionsCatalog(deps, currentText, withVersions, plugins) catalog.writeText(newText, project) catalog.logFileWasModified() diff --git a/sample-kotlin/gradle/libs.versions.toml b/sample-kotlin/gradle/libs.versions.toml index 4ce8b906c..209112ea8 100644 --- a/sample-kotlin/gradle/libs.versions.toml +++ b/sample-kotlin/gradle/libs.versions.toml @@ -2,24 +2,44 @@ [libraries] -guava = "com.google.guava:guava:_" +androidx-core-core = "androidx.core:core:1.3.1" -guice = "com.google.inject:guice:_" +guava = "com.google.guava:guava:15.0" -okhttp-urlconnection = "com.squareup.okhttp3:okhttp-urlconnection:_" +guice = "com.google.inject:guice:2.0" -poi = "org.apache.poi:poi:_" +okhttp = "com.squareup.okhttp3:okhttp:3.10.0" -poi-ooxml = "org.apache.poi:poi-ooxml:_" +okhttp-urlconnection = "com.squareup.okhttp3:okhttp-urlconnection:3.10.0" -gradle-hello-world-plugin = "org.gradle:gradle-hello-world-plugin:_" +kotest-runner-junit4 = "io.kotest:kotest-runner-junit4:5.1.0" -org-jetbrains-kotlin-jvm-gradle-plugin = "org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:_" +junit = "junit:junit:4.12" -kotlin-scripting-compiler-embeddable = "org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:_" +poi = "org.apache.poi:poi:4.0.0" -org-jetbrains-kotlinx-benchmark-gradle-plugin = "org.jetbrains.kotlinx.benchmark:org.jetbrains.kotlinx.benchmark.gradle.plugin:_" +poi-ooxml = "org.apache.poi:poi-ooxml:4.0.0" -mongo-java-driver = "org.mongodb:mongo-java-driver:_" +gradle-hello-world-plugin = "org.gradle:gradle-hello-world-plugin:0.1" +org-jetbrains-kotlin-jvm-gradle-plugin = "org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:1.6.10" +kotlin-script-runtime = "org.jetbrains.kotlin:kotlin-script-runtime:1.6.10" + +kotlin-scripting-compiler-embeddable = "org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:1.6.10" + +kotlin-stdlib-jdk8 = "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.10" + +org-jetbrains-kotlinx-benchmark-gradle-plugin = "org.jetbrains.kotlinx.benchmark:org.jetbrains.kotlinx.benchmark.gradle.plugin:0.4.2" + +kotlinx-coroutines-core = "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0" + +kotlinx-coroutines-jdk8 = "org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:1.6.0" + +mongo-java-driver = "org.mongodb:mongo-java-driver:3.11.0" + +[plugins] + +org-jetbrains-kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version = "1.6.10" } + +org-jetbrains-kotlinx-benchmark = { id = "org.jetbrains.kotlinx.benchmark", version = "0.4.2" } diff --git a/sample-kotlin/gradlew.bat b/sample-kotlin/gradlew.bat index ac1b06f93..107acd32c 100644 --- a/sample-kotlin/gradlew.bat +++ b/sample-kotlin/gradlew.bat @@ -1,89 +1,89 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega From 316fed342aaaa96c9e2b5d4e0eb3d87ba7a9812c Mon Sep 17 00:00:00 2001 From: Jean-Michel Fayard Date: Sat, 26 Feb 2022 22:22:06 +0100 Subject: [PATCH 021/103] refactor: Classes VersionCatalogs Toml TomlSection --- .../core/RefreshVersionsTask.kt | 30 ++---- .../core/extensions/gradle/Project.kt | 12 +++ .../core/internal/OutputFile.kt | 3 +- .../refreshVersions/core/internal/Toml.kt | 87 +++++------------ .../refreshVersions/core/internal/TomlLine.kt | 36 +++---- .../core/internal/TomlSection.kt | 22 +++++ .../core/internal/TomlUpdater.kt | 21 ++-- .../core/internal/VersionCatalogs.kt | 97 +++++++++++++++++++ .../refreshVersions/core/TomlLineTest.kt | 20 ++-- .../refreshVersions/core/TomlSectionTest.kt | 6 +- .../RefreshVersionsCatalogTask.kt | 21 ++-- .../RefreshVersionsMigrateTask.kt | 28 ++---- .../refreshVersions/RefreshVersionsPlugin.kt | 3 +- sample-kotlin/gradle/libs.versions.toml | 16 +-- 14 files changed, 231 insertions(+), 171 deletions(-) create mode 100644 plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlSection.kt create mode 100644 plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsTask.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsTask.kt index 9e26903dd..1c7eb642a 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsTask.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsTask.kt @@ -1,13 +1,16 @@ package de.fayard.refreshVersions.core +import de.fayard.refreshVersions.core.extensions.gradle.getVersionsCatalog import de.fayard.refreshVersions.core.internal.* import de.fayard.refreshVersions.core.internal.RefreshVersionsConfigHolder.settings +import de.fayard.refreshVersions.core.internal.VersionCatalogs.LIBS_VERSIONS_TOML import de.fayard.refreshVersions.core.internal.problems.log import de.fayard.refreshVersions.core.internal.versions.VersionsPropertiesModel import de.fayard.refreshVersions.core.internal.versions.writeWithNewVersions import kotlinx.coroutines.async import kotlinx.coroutines.runBlocking import org.gradle.api.DefaultTask +import org.gradle.api.Project import org.gradle.api.UnknownDomainObjectException import org.gradle.api.artifacts.Dependency import org.gradle.api.artifacts.MinimalExternalModuleDependency @@ -58,6 +61,9 @@ open class RefreshVersionsTask : DefaultTask() { //TODO: Filter using known grouping strategies to only use the main artifact to resolve latest version, this // will reduce the number of repositories lookups, improving performance a little more. + val versionsCatalogMapping: Set = + VersionCatalogs.dependencyAliases(project.getVersionsCatalog()).keys + runBlocking { val lintUpdatingProblemsAsync = async { configureLintIfRunningOnAnAndroidProject(settings, RefreshVersionsConfigHolder.readVersionsMap()) @@ -70,7 +76,7 @@ open class RefreshVersionsTask : DefaultTask() { project = project, versionMap = RefreshVersionsConfigHolder.readVersionsMap(), versionKeyReader = RefreshVersionsConfigHolder.versionKeyReader, - versionsCatalogMapping = getVersionsCatalogMapping(), + versionsCatalogMapping = versionsCatalogMapping, ) } VersionsPropertiesModel.writeWithNewVersions(result.dependenciesUpdates) @@ -79,8 +85,8 @@ open class RefreshVersionsTask : DefaultTask() { settingsPluginsUpdates = result.settingsPluginsUpdates, buildSrcSettingsPluginsUpdates = result.buildSrcSettingsPluginsUpdates ) - val libsToml = project.file("gradle/libs.versions.toml") - if (GradleVersion.current() >= GradleVersion.version("7.4")) { + val libsToml = project.file(LIBS_VERSIONS_TOML) + if (VersionCatalogs.isSupported()) { TomlUpdater(libsToml, result.dependenciesUpdates).updateNewVersions(libsToml) } @@ -166,22 +172,4 @@ open class RefreshVersionsTask : DefaultTask() { //TODO: Replace issue link above with stable link to explanation in documentation. } } - - private fun getVersionsCatalogMapping(): Set { - val versionCatalog = try { - project.extensions.getByType().named("libs") - } catch (e: UnknownDomainObjectException) { - // File gradle/libs.versions.toml does not exist - return emptySet() - } - - return versionCatalog.dependencyAliases.mapNotNull { alias -> - versionCatalog.findDependency(alias) - .orElse(null) - ?.orNull - ?.let { dependency: MinimalExternalModuleDependency -> - ModuleId.Maven(dependency.module.group, dependency.module.name) - } - }.toSet() - } } diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/extensions/gradle/Project.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/extensions/gradle/Project.kt index 01a6e0851..32dd65536 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/extensions/gradle/Project.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/extensions/gradle/Project.kt @@ -1,6 +1,18 @@ package de.fayard.refreshVersions.core.extensions.gradle +import de.fayard.refreshVersions.core.internal.InternalRefreshVersionsApi import org.gradle.api.Project +import org.gradle.api.UnknownDomainObjectException +import org.gradle.api.artifacts.VersionCatalogsExtension +import org.gradle.kotlin.dsl.getByType internal val Project.isRootProject: Boolean get() = this == rootProject + internal val Project.isBuildSrc: Boolean get() = isRootProject && name == "buildSrc" + +@InternalRefreshVersionsApi +fun Project.getVersionsCatalog() = try { + project.extensions.getByType().named("libs") +} catch (e: UnknownDomainObjectException) { + null +} \ No newline at end of file diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/OutputFile.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/OutputFile.kt index f41d58f6a..eab81bc71 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/OutputFile.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/OutputFile.kt @@ -1,5 +1,6 @@ package de.fayard.refreshVersions.core.internal +import de.fayard.refreshVersions.core.internal.VersionCatalogs.LIBS_VERSIONS_TOML import org.gradle.api.Project import java.io.File @@ -13,7 +14,7 @@ enum class OutputFile(var path: String, var existed: Boolean = false, val altern VERSIONS_PROPERTIES("versions.properties"), SETTINGS_GRADLE("settings.gradle"), SETTINGS_GRADLE_KTS("settings.gradle.kts"), - GRADLE_VERSIONS_CATALOG("gradle/libs.versions.toml"), + GRADLE_VERSIONS_CATALOG(LIBS_VERSIONS_TOML), ; diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/Toml.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/Toml.kt index ecb781f2c..f59a5be1f 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/Toml.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/Toml.kt @@ -1,77 +1,40 @@ package de.fayard.refreshVersions.core.internal -import de.fayard.refreshVersions.core.ModuleId -import org.gradle.api.artifacts.Dependency +internal data class Toml( + val sections: MutableMap> +) { -@InternalRefreshVersionsApi -object Toml { + override fun toString() = format() - fun parseTomlInSection(toml: String): Map { - val result = mutableMapOf() - result["root"] = StringBuilder() - var current: StringBuilder = result["root"]!! - val lines = toml.lines() - for ((index, line) in lines.withIndex()) { - val trimmed = line.trim() - val isSectionHeader = trimmed.startsWith("[") && trimmed.endsWith("]") - if (isSectionHeader) { - val sectionName = trimmed.removePrefix("[").removeSuffix("]") - result[sectionName] = StringBuilder() - current = result[sectionName]!! - } else { - current.append(line) - if (index != lines.lastIndex) current.append("\n") - } - } - return result.mapValues { it.value.toString() } - } - - fun tomlSectionsToString(sections: Map): String = buildString { - for ((header, content) in sections) { - if (header != "root") append("\n[$header]\n\n") - append(content.trim()) - append("\n") - } + internal operator fun set(section: TomlSection, lines: List) { + sections[section] = lines } - fun versionsCatalog(deps: Deps, currentText: String, withVersions: Boolean, plugins: List): String { - val sections = parseTomlInSection(currentText).toMutableMap() - if (sections["root"].isNullOrBlank()) { - sections["root"] = "## Generated by $ ./gradlew refreshVersionsCatalog\n\n" + internal operator fun get(section: TomlSection): List = + sections.get(section) ?: emptyList() + + private fun format(): String = buildString { + initializeRoot() + for (section in sortedSections()) { + val lines = get(section) + if (lines.isNotEmpty()) { + if (section != TomlSection.Root) append("\n[$section]\n\n") + append(lines.toText().trim()) + append("\n") + } } - sections["plugins"] = addPlugins(plugins).toText() - sections["libraries"] = versionsCatalogLibraries(deps, withVersions).toText() - return tomlSectionsToString(sections) } - private fun addPlugins(plugins: List): List = - plugins - .distinctBy { d -> "${d.group}:${d.name}" } - .map { d -> - val pluginId = d.name.removeSuffix(".gradle.plugin") - val map = mapOf( - "id" to pluginId, - "version" to (d.version ?: "_") - ) - TomlLine(TomlLine.Section.plugins, pluginId.replace(".", "-"), map) + private fun sortedSections() = + (TomlSection.sectionOrder + sections.keys).toSet() - }.flatMap { - listOf(TomlLine.newLine, it) - } - - private fun versionsCatalogLibraries(deps: Deps, withVersions: Boolean): List { - val versionsMap = RefreshVersionsConfigHolder.readVersionsMap() - val versionKeyReader: ArtifactVersionKeyReader = RefreshVersionsConfigHolder.versionKeyReader - - return deps.libraries.flatMap { lib -> - val versionKey = getVersionPropertyName(ModuleId.Maven(lib.group, lib.name), versionKeyReader) - val version = versionsMap[versionKey] ?: "_" - - val value = lib.groupModule() + ":" + if (withVersions) version else "_" - listOf( + private fun initializeRoot() { + if (get(TomlSection.Root).isEmpty()) { + this[TomlSection.Root] = listOf( + TomlLine(TomlSection.Root, "## Generated by \$ ./gradlew refreshVersionsCatalog"), TomlLine.newLine, - TomlLine(TomlLine.Section.libraries, deps.names[lib]!!, value) ) } } } + diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlLine.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlLine.kt index aeb4602f8..622049f09 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlLine.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlLine.kt @@ -1,21 +1,14 @@ package de.fayard.refreshVersions.core.internal import de.fayard.refreshVersions.core.internal.TomlLine.Kind.* -import de.fayard.refreshVersions.core.internal.TomlLine.Section.* +import de.fayard.refreshVersions.core.internal.TomlSection.* import org.gradle.api.artifacts.Dependency internal data class TomlLine( - val section: Section, + val section: TomlSection, val text: String, ) { - @Suppress("EnumEntryName") - internal enum class Section { versions, libraries, bundles, plugins, others ; - companion object { - fun from(name: String): Section = values().firstOrNull { it.name == name } ?: others - } - } - internal enum class Kind { Ignore, Delete, Libs, LibsUnderscore, LibsVersionRef, Version, Plugin, PluginVersionRef } val textWithoutComment = text.substringBefore("#") @@ -39,33 +32,33 @@ internal data class TomlLine( val module get() = "$group:$name" val version: String get() = - if (section == versions) value else map["version"]!! + if (section == Versions) value else map["version"]!! val group: String get() = - if (section == plugins) id else map["group"]!! + if (section == Plugins) id else map["group"]!! val name: String get() = - if (section == plugins) "$id.gradle.plugin" else map["name"]!! + if (section == Plugins) "$id.gradle.plugin" else map["name"]!! val id: String by map override fun toString(): String = "TomlLine(section=$section, kind=$kind, key=$key, value=$value, map=$map)\n$text" internal companion object { - val newLine = TomlLine(TomlLine.Section.others, "") + val newLine = TomlLine(TomlSection.Custom("blank"), "") } } internal fun List.toText(): String = joinToString("\n", postfix = "\n", prefix = "\n") { it.text } -internal fun TomlLine(section: TomlLine.Section, key: String, value: String): TomlLine = +internal fun TomlLine(section: TomlSection, key: String, value: String): TomlLine = TomlLine(section, """$key = "$value"""" ) -internal fun TomlLine(section: TomlLine.Section, key: String, dependency: Dependency): TomlLine = +internal fun TomlLine(section: TomlSection, key: String, dependency: Dependency): TomlLine = TomlLine(section, key, """${dependency.group}:${dependency.name}:${dependency.version}""") -internal fun TomlLine(section: TomlLine.Section, key: String, map: Map): TomlLine { +internal fun TomlLine(section: TomlSection, key: String, map: Map): TomlLine { require((map.keys - validKeys).isEmpty()) { "Map $map has invalid keys. Valid: $validKeys"} val formatMap = map.entries .joinToString(", ") { (key, value) -> """$key = "$value"""" } @@ -133,13 +126,14 @@ private fun TomlLine.guessTomlLineKind(): TomlLine.Kind { val hasVersionRef = textWithoutComment.contains("version.ref") return when (section) { - bundles -> Ignore - others -> Ignore - versions -> when { + is Custom -> Ignore + Root -> Ignore + Bundles -> Ignore + Versions -> when { hasKey -> Version else -> Ignore } - libraries -> { + Libraries -> { when { hasKey.not() -> Ignore textWithoutComment.endsWith(":_\"") -> LibsUnderscore @@ -147,7 +141,7 @@ private fun TomlLine.guessTomlLineKind(): TomlLine.Kind { else -> Libs } } - plugins -> when { + Plugins -> when { hasKey.not() -> Ignore hasVersionRef -> PluginVersionRef else -> Plugin diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlSection.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlSection.kt new file mode 100644 index 000000000..99ae8fdb9 --- /dev/null +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlSection.kt @@ -0,0 +1,22 @@ +package de.fayard.refreshVersions.core.internal + +internal sealed class TomlSection(val name: String) { + + override fun toString() = name + + object Root: TomlSection("root") + object Versions: TomlSection("versions") + object Plugins: TomlSection("plugins") + object Bundles: TomlSection("bundles") + object Libraries: TomlSection("libraries") + class Custom(name: String) : TomlSection(name) + + companion object { + val sectionOrder = listOf(Root, Bundles, Plugins, Versions, Libraries) + + fun from(name: String): TomlSection = + sectionOrder + .firstOrNull { it.name == name } + ?: Custom(name) + } +} \ No newline at end of file diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlUpdater.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlUpdater.kt index 370c5a3b8..dea48408c 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlUpdater.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlUpdater.kt @@ -4,21 +4,16 @@ import de.fayard.refreshVersions.core.internal.TomlLine.Kind.* import java.io.File import de.fayard.refreshVersions.core.Version as MavenVersion -internal class TomlUpdater(val toml: String, val dependenciesUpdates: List) { - private val sectionsMap: Map = Toml.parseTomlInSection(toml) - - private val sections: Map> = sectionsMap.mapValues { (key, text) -> - val section = TomlLine.Section.from(key) - text.lines().map { TomlLine(section, it) } - } +internal class TomlUpdater(val fileContent: String, val dependenciesUpdates: List) { + private val toml = VersionCatalogs.parseToml(fileContent) fun updateNewVersions(actual: File) { - if (toml.isBlank()) return + if (fileContent.isBlank()) return - val newSectionsText = sections.mapValues { (key, lines) -> - updateNewVersions(lines).joinToString(separator = "\n") { it.text } + toml.sections.forEach { (section, lines) -> + toml[section] = updateNewVersions(lines) } - actual.writeText(Toml.tomlSectionsToString(newSectionsText)) + actual.writeText(toml.toString()) } private fun updateNewVersions(lines: List): List { @@ -41,7 +36,7 @@ internal class TomlUpdater(val toml: String, val dependenciesUpdates: List + val libOrPlugin = toml.sections.values.flatten().firstOrNull { line -> line.versionRef == version.key } ?: return null @@ -59,7 +54,7 @@ internal class TomlUpdater(val toml: String, val dependenciesUpdates: List """ = "${v.value}" }""" - line.section == TomlLine.Section.versions -> """ = "${v.value}"""" + line.section == TomlSection.Versions -> """ = "${v.value}"""" else -> """:${v.value}"""" } diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt new file mode 100644 index 000000000..674dbdb56 --- /dev/null +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt @@ -0,0 +1,97 @@ +package de.fayard.refreshVersions.core.internal + +import de.fayard.refreshVersions.core.ModuleId +import org.gradle.api.artifacts.Dependency +import org.gradle.api.artifacts.MinimalExternalModuleDependency +import org.gradle.api.artifacts.VersionCatalog +import org.gradle.util.GradleVersion + +@InternalRefreshVersionsApi +object VersionCatalogs { + + const val LIBS_VERSIONS_TOML = "gradle/libs.versions.toml" + + val NEEDS_GRADLE_VERSION: GradleVersion = GradleVersion.version("7.4") + + fun isSupported(): Boolean = + GradleVersion.current() >= NEEDS_GRADLE_VERSION + + fun dependencyAliases(versionCatalog: VersionCatalog?): Map { + versionCatalog ?: return emptyMap() + return versionCatalog.dependencyAliases.mapNotNull { alias -> + versionCatalog.findDependency(alias) + .orElse(null) + ?.orNull + ?.let { dependency: MinimalExternalModuleDependency -> + ModuleId.Maven(dependency.module.group, dependency.module.name) to "libs.$alias" + } + }.toMap() + } + + internal fun parseToml(toml: String): Toml { + val map = parseTomlInSection(toml) + .map { (sectionName, paragraph) -> + val section = TomlSection.from(sectionName) + section to paragraph.lines().map { TomlLine(section, it) } + }.toMap() + return Toml(map.toMutableMap()) + } + + fun parseTomlInSection(toml: String): Map { + val result = mutableMapOf() + result["root"] = StringBuilder() + var current: StringBuilder = result["root"]!! + val lines = toml.lines() + for ((index, line) in lines.withIndex()) { + val trimmed = line.trim() + val isSectionHeader = trimmed.startsWith("[") && trimmed.endsWith("]") + if (isSectionHeader) { + val sectionName = trimmed.removePrefix("[").removeSuffix("]") + result[sectionName] = StringBuilder() + current = result[sectionName]!! + } else { + current.append(line) + if (index != lines.lastIndex) current.append("\n") + } + } + return result.mapValues { it.value.toString() } + } + + fun versionsCatalog(deps: Deps, currentText: String, withVersions: Boolean, plugins: List): String { + val toml = parseToml(currentText) + toml[TomlSection.Plugins] = addPlugins(plugins) + toml[TomlSection.Libraries] = versionsCatalogLibraries(deps, withVersions) + return toml.toString() + } + + private fun addPlugins(plugins: List): List = + plugins + .distinctBy { d -> "${d.group}:${d.name}" } + .map { d -> + val pluginId = d.name.removeSuffix(".gradle.plugin") + val map = mapOf( + "id" to pluginId, + "version" to (d.version ?: "_") + ) + TomlLine(TomlSection.Plugins, pluginId.replace(".", "-"), map) + + }.flatMap { + listOf(TomlLine.newLine, it) + } + + private fun versionsCatalogLibraries(deps: Deps, withVersions: Boolean): List { + val versionsMap = RefreshVersionsConfigHolder.readVersionsMap() + val versionKeyReader: ArtifactVersionKeyReader = RefreshVersionsConfigHolder.versionKeyReader + + return deps.libraries.flatMap { lib -> + val versionKey = getVersionPropertyName(ModuleId.Maven(lib.group, lib.name), versionKeyReader) + val version = versionsMap[versionKey] ?: "_" + + val value = lib.groupModule() + ":" + if (withVersions) version else "_" + listOf( + TomlLine.newLine, + TomlLine(TomlSection.Libraries, deps.names[lib]!!, value) + ) + } + } +} diff --git a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlLineTest.kt b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlLineTest.kt index 197c5b406..b579acb5a 100644 --- a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlLineTest.kt +++ b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlLineTest.kt @@ -9,7 +9,7 @@ import de.fayard.refreshVersions.core.internal.TomlLine.Kind.LibsVersionRef import de.fayard.refreshVersions.core.internal.TomlLine.Kind.Plugin import de.fayard.refreshVersions.core.internal.TomlLine.Kind.PluginVersionRef import de.fayard.refreshVersions.core.internal.TomlLine.Kind.Version -import de.fayard.refreshVersions.core.internal.UsedPluginsHolder +import de.fayard.refreshVersions.core.internal.TomlSection import de.fayard.refreshVersions.core.internal.UsedPluginsHolder.ConfigurationLessDependency import io.kotest.assertions.assertSoftly import io.kotest.core.spec.style.FunSpec @@ -52,7 +52,7 @@ class TomlLineTest : FunSpec({ val testCases = lines.zip(expectedKinds) testCases.forAll { (line, expectedKind) -> - TomlLine(TomlLine.Section.libraries, line).kind shouldBe expectedKind + TomlLine(TomlSection.Libraries, line).kind shouldBe expectedKind } } @@ -78,7 +78,7 @@ class TomlLineTest : FunSpec({ val testCases = lines.zip(expectedKinds) testCases.forAll { (line, expectedKind) -> - TomlLine(TomlLine.Section.versions, line).kind shouldBe expectedKind + TomlLine(TomlSection.Versions, line).kind shouldBe expectedKind } } @@ -101,7 +101,7 @@ class TomlLineTest : FunSpec({ val testCases = lines.zip(expectedKinds) testCases.forAll { (line, expectedKind) -> - TomlLine(TomlLine.Section.plugins, line).kind shouldBe expectedKind + TomlLine(TomlSection.Plugins, line).kind shouldBe expectedKind } } @@ -135,7 +135,7 @@ class TomlLineTest : FunSpec({ val testCases = lines.zip(expected) testCases.forAll { (line, map) -> - TomlLine(TomlLine.Section.libraries, line).map shouldBe map + TomlLine(TomlSection.Libraries, line).map shouldBe map } } @@ -166,7 +166,7 @@ class TomlLineTest : FunSpec({ val testCases = lines.zip(expected) testCases.forAll { (line, map) -> - TomlLine(TomlLine.Section.plugins, line).map shouldBe map + TomlLine(TomlSection.Plugins, line).map shouldBe map } } @@ -178,20 +178,20 @@ class TomlLineTest : FunSpec({ """.trimIndent().lines() lines.forAny { - TomlLine(TomlLine.Section.libraries, it).kind shouldBe Delete + TomlLine(TomlSection.Libraries, it).kind shouldBe Delete } } test("Constructors for TomlLine") { assertSoftly { - TomlLine(TomlLine.Section.plugins, "org-jetbrains-kotlin-jvm", mapOf("id" to "org.jetbrains.kotlin.jvm", "version" to "1.6.10")) + TomlLine(TomlSection.Plugins, "org-jetbrains-kotlin-jvm", mapOf("id" to "org.jetbrains.kotlin.jvm", "version" to "1.6.10")) .text shouldBe """org-jetbrains-kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version = "1.6.10" }""" - TomlLine(TomlLine.Section.libraries, "my-lib", "com.example:name:1.0") + TomlLine(TomlSection.Libraries, "my-lib", "com.example:name:1.0") .text shouldBe """my-lib = "com.example:name:1.0"""" val d = ConfigurationLessDependency("com.example:name:1.0") - TomlLine(TomlLine.Section.libraries, "my-lib", d) + TomlLine(TomlSection.Libraries, "my-lib", d) .text shouldBe """my-lib = "com.example:name:1.0"""" } } diff --git a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlSectionTest.kt b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlSectionTest.kt index bb77fdd37..c9c00f416 100644 --- a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlSectionTest.kt +++ b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlSectionTest.kt @@ -1,6 +1,6 @@ package de.fayard.refreshVersions.core -import de.fayard.refreshVersions.core.internal.Toml +import de.fayard.refreshVersions.core.internal.VersionCatalogs import io.kotest.core.spec.style.StringSpec import io.kotest.matchers.shouldBe @@ -48,11 +48,11 @@ class TomlSectionTest : StringSpec({ val expected = mapOf("root" to a, "versions" to b, "libraries" to c, "bundles" to d) "Parse Toml in Sections" { - Toml.parseTomlInSection(toml) shouldBe expected + VersionCatalogs.parseTomlInSection(toml) shouldBe expected } "Sections to Toml" { - Toml.tomlSectionsToString(expected) shouldBe toml + VersionCatalogs.tomlSectionsToString(expected) shouldBe toml } }) diff --git a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt index 3b23d2acd..ea6b77d90 100644 --- a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt +++ b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt @@ -9,8 +9,10 @@ import de.fayard.refreshVersions.core.internal.OutputFile import de.fayard.refreshVersions.core.internal.checkModeAndNames import de.fayard.refreshVersions.core.internal.computeAliases import de.fayard.refreshVersions.core.internal.findDependencies -import de.fayard.refreshVersions.core.internal.Toml.versionsCatalog +import de.fayard.refreshVersions.core.internal.VersionCatalogs.versionsCatalog import de.fayard.refreshVersions.core.internal.UsedPluginsHolder +import de.fayard.refreshVersions.core.internal.VersionCatalogs +import de.fayard.refreshVersions.core.internal.VersionCatalogs.LIBS_VERSIONS_TOML import de.fayard.refreshVersions.internal.getArtifactNameToConstantMapping import org.gradle.api.DefaultTask import org.gradle.api.GradleException @@ -23,22 +25,22 @@ import org.gradle.util.GradleVersion open class RefreshVersionsCatalogTask : DefaultTask() { @Input - @Option(option = "versions", description = "Add the versions in gradle/libs.versions.toml") + @Option(option = "versions", description = "Add the versions in $LIBS_VERSIONS_TOML") var withVersions: Boolean = false @Input - @Option(option = "all", description = "Add all libraries in gradle/libs.versions.toml") + @Option(option = "all", description = "Add all libraries in $LIBS_VERSIONS_TOML") var withAllLibraries: Boolean = false @TaskAction fun refreshVersionsCatalogAction() { // Check Gradle version - if (currentGradleVersion < versionWithVersionsCatalog) { + if (VersionCatalogs.isSupported().not()) { throw GradleException( """ - |Gradle versions catalogs are not supported in $currentGradleVersion + |Gradle versions catalogs are not supported in ${GradleVersion.current()} |Upgrade Gradle with this command - | ./gradlew wrapper --gradle-version ${versionWithVersionsCatalog.version} + | ./gradlew wrapper --gradle-version ${VersionCatalogs.NEEDS_GRADLE_VERSION.version} """.trimMargin() ) } @@ -46,7 +48,7 @@ open class RefreshVersionsCatalogTask : DefaultTask() { // Update versions.properties addMissingEntriesInVersionsProperties(project) - // Generate gradle/libs.versions.toml + // Generate LIBS_VERSIONS_TOML val catalog = OutputFile.GRADLE_VERSIONS_CATALOG val builtInDependencies = getArtifactNameToConstantMapping() @@ -81,10 +83,5 @@ open class RefreshVersionsCatalogTask : DefaultTask() { $ANSI_GREEN./gradlew refreshVersionsMigrate$ANSI_RESET """.trimIndent()) } - - companion object { - val currentGradleVersion: GradleVersion = GradleVersion.current() - val versionWithVersionsCatalog: GradleVersion = GradleVersion.version("7.4") - } } diff --git a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsMigrateTask.kt b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsMigrateTask.kt index 39c9707bc..946579c96 100644 --- a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsMigrateTask.kt +++ b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsMigrateTask.kt @@ -2,16 +2,18 @@ package de.fayard.refreshVersions import de.fayard.refreshVersions.core.ModuleId import de.fayard.refreshVersions.core.addMissingEntriesInVersionsProperties +import de.fayard.refreshVersions.core.extensions.gradle.getVersionsCatalog import de.fayard.refreshVersions.core.internal.associateShortestByMavenCoordinate import de.fayard.refreshVersions.internal.getArtifactNameToConstantMapping import org.gradle.api.DefaultTask +import org.gradle.api.Project import org.gradle.api.UnknownDomainObjectException -import org.gradle.api.artifacts.MinimalExternalModuleDependency import org.gradle.api.artifacts.VersionCatalogsExtension import org.gradle.api.tasks.TaskAction import org.gradle.kotlin.dsl.getByType import org.intellij.lang.annotations.Language import java.io.File +import de.fayard.refreshVersions.core.internal.VersionCatalogs open class RefreshVersionsMigrateTask : DefaultTask() { @@ -22,7 +24,8 @@ open class RefreshVersionsMigrateTask : DefaultTask() { @TaskAction fun migrateBuild() { - val versionsCatalogMapping: Map = getVersionsCatalogMapping() + val versionsCatalogMapping: Map = + VersionCatalogs.dependencyAliases(project.getVersionsCatalog()) val dependencyMapping: Map = getArtifactNameToConstantMapping() .associateShortestByMavenCoordinate() @@ -37,26 +40,9 @@ open class RefreshVersionsMigrateTask : DefaultTask() { $ANSI_GREEN./gradlew refreshVersions$ANSI_RESET """.trimIndent()) } - - private fun getVersionsCatalogMapping(): Map { - val versionCatalog = try { - project.extensions.getByType().named("libs") - } catch (e: UnknownDomainObjectException) { - // File gradle/libs.versions.toml does not exist - return emptyMap() - } - - return versionCatalog.dependencyAliases.mapNotNull { alias -> - versionCatalog.findDependency(alias) - .orElse(null) - ?.orNull - ?.let { dependency: MinimalExternalModuleDependency -> - ModuleId.Maven(dependency.module.group, dependency.module.name) to "libs.$alias" - } - }.toMap() - } } + //TODO: Don't replace random versions in build.gradle(.kts) files to avoid breaking plugins. //TODO: Don't rely on a regex to extract the version so we detect absolutely any version string literal. //TODO: Use CharSequence.findSymbolsRanges(…) to find the plugins block. @@ -113,7 +99,7 @@ internal fun withVersionPlaceholder( line: String, isInsidePluginsBlock: Boolean, isBuildFile: Boolean, - dependencyMapping: Map = emptyMap() + dependencyMapping: Map = emptyMap(), ): String? = when { isInsidePluginsBlock -> line.replace(pluginVersionRegex, "") isBuildFile -> when { diff --git a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsPlugin.kt b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsPlugin.kt index 2acd2da7a..5ef5e45b0 100644 --- a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsPlugin.kt +++ b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsPlugin.kt @@ -2,6 +2,7 @@ package de.fayard.refreshVersions import de.fayard.refreshVersions.core.* import de.fayard.refreshVersions.core.extensions.gradle.isBuildSrc +import de.fayard.refreshVersions.core.internal.VersionCatalogs.LIBS_VERSIONS_TOML import de.fayard.refreshVersions.core.internal.removals_replacement.RemovedDependencyNotationsReplacementInfo import de.fayard.refreshVersions.internal.getArtifactNameToConstantMapping import org.gradle.api.DefaultTask @@ -181,7 +182,7 @@ open class RefreshVersionsPlugin : Plugin { name = "refreshVersionsCatalog" ) { group = "refreshVersions" - description = "Update gradle/libs.versions.toml" + description = "Update $LIBS_VERSIONS_TOML" outputs.upToDateWhen { false } } diff --git a/sample-kotlin/gradle/libs.versions.toml b/sample-kotlin/gradle/libs.versions.toml index 209112ea8..921040182 100644 --- a/sample-kotlin/gradle/libs.versions.toml +++ b/sample-kotlin/gradle/libs.versions.toml @@ -1,5 +1,15 @@ ## Generated by $ ./gradlew refreshVersionsCatalog +[plugins] + +org-jetbrains-kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version = "1.6.10" } + +org-jetbrains-kotlinx-benchmark = { id = "org.jetbrains.kotlinx.benchmark", version = "0.4.2" } + +[versions] + +groovy = "3.0.5" + [libraries] androidx-core-core = "androidx.core:core:1.3.1" @@ -37,9 +47,3 @@ kotlinx-coroutines-core = "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0" kotlinx-coroutines-jdk8 = "org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:1.6.0" mongo-java-driver = "org.mongodb:mongo-java-driver:3.11.0" - -[plugins] - -org-jetbrains-kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version = "1.6.10" } - -org-jetbrains-kotlinx-benchmark = { id = "org.jetbrains.kotlinx.benchmark", version = "0.4.2" } From 747fd31ea9237c5654a519786882fe1c7f3873eb Mon Sep 17 00:00:00 2001 From: Jean-Michel Fayard Date: Sat, 26 Feb 2022 22:49:54 +0100 Subject: [PATCH 022/103] feat(VersionsCatalog): generate libs.toml incrementally Do not remove keys that were already present --- .../refreshVersions/core/internal/Toml.kt | 19 ++++++++++++++- .../refreshVersions/core/internal/TomlLine.kt | 7 +----- .../core/internal/VersionCatalogs.kt | 4 ++-- sample-kotlin/gradle/libs.versions.toml | 23 +++++++++++-------- 4 files changed, 34 insertions(+), 19 deletions(-) diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/Toml.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/Toml.kt index f59a5be1f..43150e49e 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/Toml.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/Toml.kt @@ -10,6 +10,12 @@ internal data class Toml( sections[section] = lines } + fun merge(section: TomlSection, newLines: List) { + val existingKeys = get(section).map { it.key }.toSet() + val filteredLines = newLines.filterNot { it.section.name != "blank" && it.key in existingKeys } + sections[section] = get(section) + filteredLines + } + internal operator fun get(section: TomlSection): List = sections.get(section) ?: emptyList() @@ -17,17 +23,28 @@ internal data class Toml( initializeRoot() for (section in sortedSections()) { val lines = get(section) + if (lines.isNotEmpty()) { if (section != TomlSection.Root) append("\n[$section]\n\n") - append(lines.toText().trim()) + append(lines.removeDuplicateBlanks().toText().trim()) append("\n") } } } + private fun List.removeDuplicateBlanks(): List { + return filterIndexed { index, tomlLine -> + if (index == 0) return@filterIndexed true + val previous = this[index - 1] + tomlLine.text.isNotBlank() || previous.text.isNotBlank() + } + } + private fun sortedSections() = (TomlSection.sectionOrder + sections.keys).toSet() + + private fun initializeRoot() { if (get(TomlSection.Root).isEmpty()) { this[TomlSection.Root] = listOf( diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlLine.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlLine.kt index 622049f09..1b1eccb0d 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlLine.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlLine.kt @@ -116,12 +116,7 @@ private fun lineMap(group: String, name: String, version: String?, versionRef: S .toMap() private fun TomlLine.guessTomlLineKind(): TomlLine.Kind { - when { - text.contains("# available") -> return Delete - text.startsWith("## unused") -> return Delete - text.startsWith("## error") -> return Delete - text.startsWith("## warning") -> return Delete - } + if (text.startsWith("##")) return Delete val hasVersionRef = textWithoutComment.contains("version.ref") diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt index 674dbdb56..dd464d85d 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt @@ -59,8 +59,8 @@ object VersionCatalogs { fun versionsCatalog(deps: Deps, currentText: String, withVersions: Boolean, plugins: List): String { val toml = parseToml(currentText) - toml[TomlSection.Plugins] = addPlugins(plugins) - toml[TomlSection.Libraries] = versionsCatalogLibraries(deps, withVersions) + toml.merge(TomlSection.Plugins, addPlugins(plugins)) + toml.merge(TomlSection.Libraries, versionsCatalogLibraries(deps, withVersions)) return toml.toString() } diff --git a/sample-kotlin/gradle/libs.versions.toml b/sample-kotlin/gradle/libs.versions.toml index 921040182..14139cf01 100644 --- a/sample-kotlin/gradle/libs.versions.toml +++ b/sample-kotlin/gradle/libs.versions.toml @@ -6,36 +6,41 @@ org-jetbrains-kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version = "1.6.10" org-jetbrains-kotlinx-benchmark = { id = "org.jetbrains.kotlinx.benchmark", version = "0.4.2" } +patrick = { id = "org.jetbrains.patrick", version = "0.4.2" } + [versions] groovy = "3.0.5" [libraries] +mongo-java-driver = "org.mongodb:mongo-java-driver:3.11.0" + androidx-core-core = "androidx.core:core:1.3.1" guava = "com.google.guava:guava:15.0" -guice = "com.google.inject:guice:2.0" - -okhttp = "com.squareup.okhttp3:okhttp:3.10.0" +patrick = "com.google.guava:guava:15.0" okhttp-urlconnection = "com.squareup.okhttp3:okhttp-urlconnection:3.10.0" kotest-runner-junit4 = "io.kotest:kotest-runner-junit4:5.1.0" junit = "junit:junit:4.12" - -poi = "org.apache.poi:poi:4.0.0" - -poi-ooxml = "org.apache.poi:poi-ooxml:4.0.0" - gradle-hello-world-plugin = "org.gradle:gradle-hello-world-plugin:0.1" org-jetbrains-kotlin-jvm-gradle-plugin = "org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:1.6.10" kotlin-script-runtime = "org.jetbrains.kotlin:kotlin-script-runtime:1.6.10" +guice = "com.google.inject:guice:2.0" + +okhttp = "com.squareup.okhttp3:okhttp:3.10.0" + +poi = "org.apache.poi:poi:4.0.0" + +poi-ooxml = "org.apache.poi:poi-ooxml:4.0.0" + kotlin-scripting-compiler-embeddable = "org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:1.6.10" kotlin-stdlib-jdk8 = "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.10" @@ -45,5 +50,3 @@ org-jetbrains-kotlinx-benchmark-gradle-plugin = "org.jetbrains.kotlinx.benchmark kotlinx-coroutines-core = "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0" kotlinx-coroutines-jdk8 = "org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:1.6.0" - -mongo-java-driver = "org.mongodb:mongo-java-driver:3.11.0" From 3eb128f7d9125fe46ef25caf394a9d54afb800d4 Mon Sep 17 00:00:00 2001 From: Jean-Michel Fayard Date: Sun, 27 Feb 2022 00:04:44 +0100 Subject: [PATCH 023/103] feat(VersionsCatalog): create versions from rules --- .../refreshVersions/core/internal/Toml.kt | 9 ++- .../core/internal/VersionCatalogs.kt | 81 +++++++++++++++---- sample-kotlin/gradle/libs.versions.toml | 41 +++++++--- 3 files changed, 99 insertions(+), 32 deletions(-) diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/Toml.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/Toml.kt index 43150e49e..9045b2d4d 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/Toml.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/Toml.kt @@ -11,9 +11,12 @@ internal data class Toml( } fun merge(section: TomlSection, newLines: List) { - val existingKeys = get(section).map { it.key }.toSet() - val filteredLines = newLines.filterNot { it.section.name != "blank" && it.key in existingKeys } - sections[section] = get(section) + filteredLines + val existingKeys = get(section).map { it.key }.toSet() - "" + val filteredLines = newLines.filterNot { it.key in existingKeys } + val updateExistingLines = get(section).map { line -> + newLines.firstOrNull { it.key == line.key } ?: line + } + sections[section] = updateExistingLines + filteredLines } internal operator fun get(section: TomlSection): List = diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt index dd464d85d..b7939761b 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt @@ -58,40 +58,89 @@ object VersionCatalogs { } fun versionsCatalog(deps: Deps, currentText: String, withVersions: Boolean, plugins: List): String { + val map = dependenciesMap(deps) + val toml = parseToml(currentText) - toml.merge(TomlSection.Plugins, addPlugins(plugins)) - toml.merge(TomlSection.Libraries, versionsCatalogLibraries(deps, withVersions)) + toml.merge(TomlSection.Plugins, addPlugins(plugins, map)) + toml.merge(TomlSection.Libraries, versionsCatalogLibraries(deps, map, withVersions)) + toml.merge(TomlSection.Versions, addVersions(deps, map)) return toml.toString() } - private fun addPlugins(plugins: List): List = - plugins + private fun addPlugins(plugins: List, map: Map>): List { + return plugins .distinctBy { d -> "${d.group}:${d.name}" } .map { d -> - val pluginId = d.name.removeSuffix(".gradle.plugin") - val map = mapOf( - "id" to pluginId, + val lib = Library(d.group!!, d.name, d.version!!) + + val pair = if (lib in map) { + "version.ref" to map[lib]!!.first + } else { "version" to (d.version ?: "_") + } + + val pluginId = d.name.removeSuffix(".gradle.plugin") + TomlLine( + TomlSection.Plugins, + pluginId.replace(".", "-"), + mapOf("id" to pluginId, pair) ) - TomlLine(TomlSection.Plugins, pluginId.replace(".", "-"), map) }.flatMap { listOf(TomlLine.newLine, it) } + } + + private fun addVersions(deps: Deps, map: Map>): List { + return deps.libraries + .distinctBy { lib -> map[lib]?.first } + .flatMap { lib -> + val (versionName, versionValue) = map[lib] ?: return@flatMap emptyList() + + val versionLine = TomlLine(TomlSection.Versions, versionName, versionValue) + listOf(TomlLine.newLine, versionLine) + } + } - private fun versionsCatalogLibraries(deps: Deps, withVersions: Boolean): List { + private fun dependenciesMap(deps: Deps): Map> { val versionsMap = RefreshVersionsConfigHolder.readVersionsMap() val versionKeyReader: ArtifactVersionKeyReader = RefreshVersionsConfigHolder.versionKeyReader - return deps.libraries.flatMap { lib -> - val versionKey = getVersionPropertyName(ModuleId.Maven(lib.group, lib.name), versionKeyReader) - val version = versionsMap[versionKey] ?: "_" + return deps.libraries.mapNotNull { lib -> + val name = getVersionPropertyName(ModuleId.Maven(lib.group, lib.name), versionKeyReader) - val value = lib.groupModule() + ":" + if (withVersions) version else "_" - listOf( - TomlLine.newLine, + if (name.contains("..") || name.startsWith("plugin")) { + return@mapNotNull null + } + val tomlName = name.removePrefix("version.").replace(".", "-") + + lib to Pair(tomlName, versionsMap[name] ?: lib.version) + }.toMap() + } + + private fun versionsCatalogLibraries( + deps: Deps, + map: Map>, + withVersions: Boolean, + ): List { + val versionsMap = RefreshVersionsConfigHolder.readVersionsMap() + val versionKeyReader: ArtifactVersionKeyReader = RefreshVersionsConfigHolder.versionKeyReader + + return deps.libraries + .filterNot { lib -> lib.name.endsWith("gradle.plugin") } + .flatMap { lib -> + val line: TomlLine = if (lib in map) { + val versionName = map[lib]!!.first + val refVersion = mapOf("group" to lib.group, "name" to lib.name, "version.ref" to versionName) + TomlLine(TomlSection.Libraries, deps.names[lib]!!, refVersion) + } else { + val versionKey = getVersionPropertyName(ModuleId.Maven(lib.group, lib.name), versionKeyReader) + val version = versionsMap[versionKey] ?: "_" + val value = lib.groupModule() + ":" + if (withVersions) version else "_" TomlLine(TomlSection.Libraries, deps.names[lib]!!, value) - ) + } + + listOf(TomlLine.newLine, line) } } } diff --git a/sample-kotlin/gradle/libs.versions.toml b/sample-kotlin/gradle/libs.versions.toml index 14139cf01..6d1572433 100644 --- a/sample-kotlin/gradle/libs.versions.toml +++ b/sample-kotlin/gradle/libs.versions.toml @@ -2,7 +2,7 @@ [plugins] -org-jetbrains-kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version = "1.6.10" } +org-jetbrains-kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } org-jetbrains-kotlinx-benchmark = { id = "org.jetbrains.kotlinx.benchmark", version = "0.4.2" } @@ -12,41 +12,56 @@ patrick = { id = "org.jetbrains.patrick", version = "0.4.2" } groovy = "3.0.5" +androidx.core = "1.3.1" + +okhttp3 = "3.10.0" + +kotest = "5.1.0" + +junit.junit = "4.12" + +apache.poi = "4.0.0" + +kotlin = "1.6.10" + +kotlinx.coroutines = "1.6.0" + [libraries] mongo-java-driver = "org.mongodb:mongo-java-driver:3.11.0" -androidx-core-core = "androidx.core:core:1.3.1" +androidx-core-core = { group = "androidx.core", name = "core", version.ref = "androidx.core" } guava = "com.google.guava:guava:15.0" patrick = "com.google.guava:guava:15.0" -okhttp-urlconnection = "com.squareup.okhttp3:okhttp-urlconnection:3.10.0" +okhttp-urlconnection = { group = "com.squareup.okhttp3", name = "okhttp-urlconnection", version.ref = "okhttp3" } + +kotest-runner-junit4 = { group = "io.kotest", name = "kotest-runner-junit4", version.ref = "kotest" } -kotest-runner-junit4 = "io.kotest:kotest-runner-junit4:5.1.0" +junit = { group = "junit", name = "junit", version.ref = "junit.junit" } -junit = "junit:junit:4.12" gradle-hello-world-plugin = "org.gradle:gradle-hello-world-plugin:0.1" org-jetbrains-kotlin-jvm-gradle-plugin = "org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:1.6.10" -kotlin-script-runtime = "org.jetbrains.kotlin:kotlin-script-runtime:1.6.10" +kotlin-script-runtime = { group = "org.jetbrains.kotlin", name = "kotlin-script-runtime", version.ref = "kotlin" } guice = "com.google.inject:guice:2.0" -okhttp = "com.squareup.okhttp3:okhttp:3.10.0" +okhttp = { group = "com.squareup.okhttp3", name = "okhttp", version.ref = "okhttp3" } -poi = "org.apache.poi:poi:4.0.0" +poi = { group = "org.apache.poi", name = "poi", version.ref = "apache.poi" } -poi-ooxml = "org.apache.poi:poi-ooxml:4.0.0" +poi-ooxml = { group = "org.apache.poi", name = "poi-ooxml", version.ref = "apache.poi" } -kotlin-scripting-compiler-embeddable = "org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:1.6.10" +kotlin-scripting-compiler-embeddable = { group = "org.jetbrains.kotlin", name = "kotlin-scripting-compiler-embeddable", version.ref = "kotlin" } -kotlin-stdlib-jdk8 = "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.10" +kotlin-stdlib-jdk8 = { group = "org.jetbrains.kotlin", name = "kotlin-stdlib-jdk8", version.ref = "kotlin" } org-jetbrains-kotlinx-benchmark-gradle-plugin = "org.jetbrains.kotlinx.benchmark:org.jetbrains.kotlinx.benchmark.gradle.plugin:0.4.2" -kotlinx-coroutines-core = "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0" +kotlinx-coroutines-core = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-core", version.ref = "kotlinx.coroutines" } -kotlinx-coroutines-jdk8 = "org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:1.6.0" +kotlinx-coroutines-jdk8 = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-jdk8", version.ref = "kotlinx.coroutines" } From 563ac471dff73d828c528adfd1f6f6b6f80fcdaf Mon Sep 17 00:00:00 2001 From: Jean-Michel Fayard Date: Sun, 27 Feb 2022 00:27:21 +0100 Subject: [PATCH 024/103] ci: fix tests --- .../refreshVersions/core/TomlLineTest.kt | 2 +- .../refreshVersions/core/TomlSectionTest.kt | 4 -- .../toml-happy-path/expected.libs.toml | 43 ++++++++++--------- 3 files changed, 23 insertions(+), 26 deletions(-) diff --git a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlLineTest.kt b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlLineTest.kt index b579acb5a..8043759f7 100644 --- a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlLineTest.kt +++ b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlLineTest.kt @@ -46,7 +46,7 @@ class TomlLineTest : FunSpec({ LibsUnderscore, Ignore, Libs, Delete, Ignore, Libs, Ignore, - Libs, Ignore, + Libs, Delete, ) val testCases = lines.zip(expectedKinds) diff --git a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlSectionTest.kt b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlSectionTest.kt index c9c00f416..ad1746964 100644 --- a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlSectionTest.kt +++ b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlSectionTest.kt @@ -51,10 +51,6 @@ class TomlSectionTest : StringSpec({ VersionCatalogs.parseTomlInSection(toml) shouldBe expected } - "Sections to Toml" { - VersionCatalogs.tomlSectionsToString(expected) shouldBe toml - } - }) diff --git a/plugins/core/src/test/resources/toml-happy-path/expected.libs.toml b/plugins/core/src/test/resources/toml-happy-path/expected.libs.toml index 7179405c4..7f10aa264 100644 --- a/plugins/core/src/test/resources/toml-happy-path/expected.libs.toml +++ b/plugins/core/src/test/resources/toml-happy-path/expected.libs.toml @@ -2,7 +2,28 @@ key = "some key" +[bundles] + +groovy = ["groovy-core", "groovy-json", "groovy-nio"] + +[plugins] + +short-notation = "some.plugin.id:1.4" +## # available:1.5" +## # available:1.6" +## # available:1.7" + +# yet another comment + +long-notation = { id = "some.plugin.id", version = "1.4" } +## # available = "1.5" } +## # available = "1.6" } +## # available = "1.7" } + +reference-notation = { id = "other.plugin.id", version.ref = "common" } + [versions] + # some comment groovy = "3.0.5" @@ -15,6 +36,7 @@ common = "3.4" ### available = "3.6" [libraries] + groovy-core = { module = "org.codehaus.groovy:groovy", version.ref = "groovy" } groovy-json = { module = "org.codehaus.groovy:groovy-json", version.ref = "groovy" } groovy-nio = { module = "org.codehaus.groovy:groovy-nio", version.ref = "groovy" } @@ -31,24 +53,3 @@ my-other-lib = { module = "com.mycompany:other", version = "1.4" } my-other-lib2 = { group = "com.mycompany", name = "alternate", version = "1.4" } ## # available = "1.5" } - -[bundles] - -groovy = ["groovy-core", "groovy-json", "groovy-nio"] - -[plugins] - -short-notation = "some.plugin.id:1.4" -## # available:1.5" -## # available:1.6" -## # available:1.7" - -# yet another comment - -long-notation = { id = "some.plugin.id", version = "1.4" } -## # available = "1.5" } -## # available = "1.6" } -## # available = "1.7" } - -reference-notation = { id = "other.plugin.id", version.ref = "common" } - From ac553bf5f23369c9e45be0555fbe73ad10c354f5 Mon Sep 17 00:00:00 2001 From: Jean-Michel Fayard Date: Sun, 27 Feb 2022 09:12:33 +0100 Subject: [PATCH 025/103] feat(VersionsCatalog): support in refreshVersionsCleanup --- .../core/RefreshVersionsCleanupTask.kt | 32 ++++++--- .../core/internal/OutputFile.kt | 4 ++ .../refreshVersions/core/internal/Toml.kt | 2 +- .../core/internal/TomlUpdater.kt | 9 +++ .../refreshVersions/core/TomlUpdaterTest.kt | 72 ++++++++++++------- .../resources/toml-cleanup/expected.libs.toml | 27 +++++++ .../resources/toml-cleanup/initial.libs.toml | 36 ++++++++++ .../dependencies.txt | 0 .../expected.libs.toml | 0 .../initial.libs.toml | 0 sample-kotlin/gradle/libs.versions.toml | 42 +++++------ sample-kotlin/versions.properties | 15 +--- 12 files changed, 162 insertions(+), 77 deletions(-) create mode 100644 plugins/core/src/test/resources/toml-cleanup/expected.libs.toml create mode 100644 plugins/core/src/test/resources/toml-cleanup/initial.libs.toml rename plugins/core/src/test/resources/{toml-happy-path => toml-refreshversions}/dependencies.txt (100%) rename plugins/core/src/test/resources/{toml-happy-path => toml-refreshversions}/expected.libs.toml (100%) rename plugins/core/src/test/resources/{toml-happy-path => toml-refreshversions}/initial.libs.toml (100%) diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsCleanupTask.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsCleanupTask.kt index b320f9ca7..d2ca3cc42 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsCleanupTask.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsCleanupTask.kt @@ -1,18 +1,24 @@ package de.fayard.refreshVersions.core +import de.fayard.refreshVersions.core.internal.OutputFile import de.fayard.refreshVersions.core.internal.RefreshVersionsConfigHolder import de.fayard.refreshVersions.core.internal.SettingsPluginsUpdater.removeCommentsAddedByUs +import de.fayard.refreshVersions.core.internal.TomlUpdater +import de.fayard.refreshVersions.core.internal.VersionCatalogs +import de.fayard.refreshVersions.core.internal.VersionCatalogs.LIBS_VERSIONS_TOML import de.fayard.refreshVersions.core.internal.versions.VersionsPropertiesModel import de.fayard.refreshVersions.core.internal.versions.VersionsPropertiesModel.Section import de.fayard.refreshVersions.core.internal.versions.readFromFile import de.fayard.refreshVersions.core.internal.versions.writeTo import org.gradle.api.DefaultTask import org.gradle.api.tasks.TaskAction +import java.io.File open class RefreshVersionsCleanupTask : DefaultTask() { @TaskAction fun cleanUpVersionsProperties() { + OutputFile.checkWhichFilesExist(project.rootDir) val model = VersionsPropertiesModel.readFromFile(RefreshVersionsConfigHolder.versionsPropertiesFile) val sectionsWithoutAvailableUpdates = model.sections.map { section -> @@ -23,28 +29,34 @@ open class RefreshVersionsCleanupTask : DefaultTask() { } val newModel = model.copy(sections = sectionsWithoutAvailableUpdates) newModel.writeTo(RefreshVersionsConfigHolder.versionsPropertiesFile) + OutputFile.VERSIONS_PROPERTIES.logFileWasModified() } @TaskAction fun cleanUpSettings() { - val settingsFiles = listOf( - "settings.gradle", - "settings.gradle.kts", - "buildSrc/settings.gradle", - "buildSrc/settings.gradle.kts" - ).mapNotNull { path -> - project.file(path).takeIf { it.exists() } - } + val settingsFiles = OutputFile.settingsFiles + .filter { it.existed } settingsFiles.forEach { settingsFile -> - val initialContent = settingsFile.readText() + val initialContent = settingsFile.readText(project) val newContent = buildString { append(initialContent) removeCommentsAddedByUs() } if (initialContent.length != newContent.length) { - settingsFile.writeText(newContent) + settingsFile.writeText(newContent, project) } } + + settingsFiles.forEach { it.logFileWasModified() } + } + + @TaskAction + fun cleanUpVersionsCatalog() { + if (VersionCatalogs.isSupported()) { + val file = File(LIBS_VERSIONS_TOML) + TomlUpdater(file, emptyList()).cleanupComments(file) + OutputFile.GRADLE_VERSIONS_CATALOG.logFileWasModified() + } } } diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/OutputFile.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/OutputFile.kt index eab81bc71..63580aa75 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/OutputFile.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/OutputFile.kt @@ -14,6 +14,8 @@ enum class OutputFile(var path: String, var existed: Boolean = false, val altern VERSIONS_PROPERTIES("versions.properties"), SETTINGS_GRADLE("settings.gradle"), SETTINGS_GRADLE_KTS("settings.gradle.kts"), + BUILD_SETTINGS_GRADLE("build/settings.gradle"), + BUILD_SETTINGS_GRADLE_KTS("build/settings.gradle.kts"), GRADLE_VERSIONS_CATALOG(LIBS_VERSIONS_TOML), ; @@ -44,6 +46,8 @@ enum class OutputFile(var path: String, var existed: Boolean = false, val altern } companion object { + val settingsFiles = listOf(SETTINGS_GRADLE, SETTINGS_GRADLE_KTS, BUILD_SETTINGS_GRADLE, BUILD_SETTINGS_GRADLE_KTS) + // COLORS private const val ANSI_RESET = "\u001B[0m" private const val ANSI_GREEN = "\u001B[32m" diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/Toml.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/Toml.kt index 9045b2d4d..ef781dc80 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/Toml.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/Toml.kt @@ -49,7 +49,7 @@ internal data class Toml( private fun initializeRoot() { - if (get(TomlSection.Root).isEmpty()) { + if (get(TomlSection.Root).none { it.text.isNotBlank() }) { this[TomlSection.Root] = listOf( TomlLine(TomlSection.Root, "## Generated by \$ ./gradlew refreshVersionsCatalog"), TomlLine.newLine, diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlUpdater.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlUpdater.kt index dea48408c..8b1fd08c5 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlUpdater.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlUpdater.kt @@ -16,6 +16,15 @@ internal class TomlUpdater(val fileContent: String, val dependenciesUpdates: Lis actual.writeText(toml.toString()) } + fun cleanupComments(actual: File) { + if (fileContent.isBlank()) return + + toml.sections.forEach { (section, lines) -> + toml[section] = lines.filter { it.kind != Delete } + } + actual.writeText(toml.toString()) + } + private fun updateNewVersions(lines: List): List { return lines.flatMap { line -> val noop = listOf(line) diff --git a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlUpdaterTest.kt b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlUpdaterTest.kt index 8eae24575..065ea08d1 100644 --- a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlUpdaterTest.kt +++ b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlUpdaterTest.kt @@ -9,23 +9,32 @@ import de.fayard.refreshVersions.core.Version as MavenVersion class TomlUpdaterTest : FunSpec({ - val folders = listOf("toml-happy-path") + test("Folder toml-refreshversions - update new versions") { + val input = FolderInput("toml-refreshversions") - folders.forEach { folder -> - test("Test for folder $folder") { - val input = FolderInput(folder) - val expectedText = input.expected.readText() + TomlUpdater(input.initial, input.dependenciesUpdates).updateNewVersions(input.actual) + input.actual.readText() shouldBe input.expectedText - TomlUpdater(input.initial, input.dependenciesUpdates).updateNewVersions(input.actual) - expectedText shouldBe input.actual.readText() + // check idempotent + TomlUpdater(input.expected, input.dependenciesUpdates).updateNewVersions(input.expected) + input.actual.readText() shouldBe input.expectedText - // check idempotent - TomlUpdater(input.expected, input.dependenciesUpdates).updateNewVersions(input.expected) - expectedText shouldBe input.actual.readText() + // delete actual file if successful + input.actual.delete() + } - // delete actual file if successfull - input.actual.delete() - } + test("Folder toml-cleanup - remove refreshVersions comments") { + val input = FolderInput("toml-cleanup") + + TomlUpdater(input.initial, input.dependenciesUpdates).cleanupComments(input.actual) + input.actual.readText() shouldBe input.expectedText + + // check idempotent + TomlUpdater(input.expected, input.dependenciesUpdates).cleanupComments(input.expected) + input.actual.readText() shouldBe input.expectedText + + // delete actual file if successful + input.actual.delete() } }) @@ -36,13 +45,30 @@ private data class FolderInput( val expected: File, val actual: File, val dependenciesUpdates: List -) +) { + val expectedText = expected.readText() +} -private fun FolderInput(folder: String): FolderInput { - val file = testResources.resolve(folder) - require(file.canRead()) { "Invalid folder ${file.absolutePath}" } - val dependencies = file.resolve("dependencies.txt") - .readText().lines() +private fun FolderInput(folderName: String): FolderInput { + val folder = testResources.resolve(folderName) + require(folder.canRead()) { "Invalid folder ${folder.absolutePath}" } + val dependencies = dependencyWithVersionCandidates(folder) + return FolderInput( + folder = folderName, + initial = folder.resolve("initial.libs.toml"), + actual = folder.resolve("actual.libs.toml"), + expected = folder.resolve("expected.libs.toml"), + dependenciesUpdates = dependencies + ) +} + +private fun dependencyWithVersionCandidates(folder: File): List { + val file = folder.resolve("dependencies.txt") + .takeIf { it.canRead() } + ?: return emptyList() + + val dependencies = file.readText() + .lines() .map { line -> val (group, name, version, available) = line.split(":") DependencyWithVersionCandidates( @@ -52,11 +78,5 @@ private fun FolderInput(folder: String): FolderInput { failures = emptyList() ) } - return FolderInput( - folder = folder, - initial = file.resolve("initial.libs.toml"), - actual = file.resolve("actual.libs.toml"), - expected = file.resolve("expected.libs.toml"), - dependenciesUpdates = dependencies - ) + return dependencies } diff --git a/plugins/core/src/test/resources/toml-cleanup/expected.libs.toml b/plugins/core/src/test/resources/toml-cleanup/expected.libs.toml new file mode 100644 index 000000000..21e0dbe2b --- /dev/null +++ b/plugins/core/src/test/resources/toml-cleanup/expected.libs.toml @@ -0,0 +1,27 @@ +# See https://docs.gradle.org/current/userguide/platforms.html#sub:conventional-dependencies-toml + +key = "some key" + +[bundles] + +groovy = ["groovy-core", "groovy-json", "groovy-nio"] + +[plugins] + +short-notation = "some.plugin.id:1.4" + +# yet another comment + +[versions] + +# some comment + +groovy = "3.0.5" + +[libraries] + +# another comment + +my-lib = "com.mycompany:mylib:1.4" + +my-other-lib2 = { group = "com.mycompany", name = "alternate", version = "1.4" } diff --git a/plugins/core/src/test/resources/toml-cleanup/initial.libs.toml b/plugins/core/src/test/resources/toml-cleanup/initial.libs.toml new file mode 100644 index 000000000..4ab31d61a --- /dev/null +++ b/plugins/core/src/test/resources/toml-cleanup/initial.libs.toml @@ -0,0 +1,36 @@ +# See https://docs.gradle.org/current/userguide/platforms.html#sub:conventional-dependencies-toml + +## strange key +key = "some key" + +[bundles] + +## unused +groovy = ["groovy-core", "groovy-json", "groovy-nio"] + +[plugins] + +short-notation = "some.plugin.id:1.4" +## # available:1.5" +## # available:1.6" + +# yet another comment + +[versions] + +# some comment + +## warning: Kotlin is better than Groovy +groovy = "3.0.5" +### available = "3.1.0" +### available = "3.2.0" + +[libraries] + +# another comment + +## error: could not resolve this dependency on mavenCentral() +my-lib = "com.mycompany:mylib:1.4" + +my-other-lib2 = { group = "com.mycompany", name = "alternate", version = "1.4" } +## # available = "1.5" } diff --git a/plugins/core/src/test/resources/toml-happy-path/dependencies.txt b/plugins/core/src/test/resources/toml-refreshversions/dependencies.txt similarity index 100% rename from plugins/core/src/test/resources/toml-happy-path/dependencies.txt rename to plugins/core/src/test/resources/toml-refreshversions/dependencies.txt diff --git a/plugins/core/src/test/resources/toml-happy-path/expected.libs.toml b/plugins/core/src/test/resources/toml-refreshversions/expected.libs.toml similarity index 100% rename from plugins/core/src/test/resources/toml-happy-path/expected.libs.toml rename to plugins/core/src/test/resources/toml-refreshversions/expected.libs.toml diff --git a/plugins/core/src/test/resources/toml-happy-path/initial.libs.toml b/plugins/core/src/test/resources/toml-refreshversions/initial.libs.toml similarity index 100% rename from plugins/core/src/test/resources/toml-happy-path/initial.libs.toml rename to plugins/core/src/test/resources/toml-refreshversions/initial.libs.toml diff --git a/sample-kotlin/gradle/libs.versions.toml b/sample-kotlin/gradle/libs.versions.toml index 6d1572433..6e3466bff 100644 --- a/sample-kotlin/gradle/libs.versions.toml +++ b/sample-kotlin/gradle/libs.versions.toml @@ -6,62 +6,52 @@ org-jetbrains-kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kot org-jetbrains-kotlinx-benchmark = { id = "org.jetbrains.kotlinx.benchmark", version = "0.4.2" } -patrick = { id = "org.jetbrains.patrick", version = "0.4.2" } - [versions] -groovy = "3.0.5" - -androidx.core = "1.3.1" +androidx-core = "1.3.1" okhttp3 = "3.10.0" kotest = "5.1.0" -junit.junit = "4.12" +junit-junit = "4.12" -apache.poi = "4.0.0" +apache-poi = "4.0.0" kotlin = "1.6.10" -kotlinx.coroutines = "1.6.0" +kotlinx-coroutines = "1.6.0" [libraries] -mongo-java-driver = "org.mongodb:mongo-java-driver:3.11.0" - -androidx-core-core = { group = "androidx.core", name = "core", version.ref = "androidx.core" } +androidx-core-core = { group = "androidx.core", name = "core", version.ref = "androidx-core" } guava = "com.google.guava:guava:15.0" -patrick = "com.google.guava:guava:15.0" +guice = "com.google.inject:guice:2.0" + +okhttp = { group = "com.squareup.okhttp3", name = "okhttp", version.ref = "okhttp3" } okhttp-urlconnection = { group = "com.squareup.okhttp3", name = "okhttp-urlconnection", version.ref = "okhttp3" } kotest-runner-junit4 = { group = "io.kotest", name = "kotest-runner-junit4", version.ref = "kotest" } -junit = { group = "junit", name = "junit", version.ref = "junit.junit" } +junit = { group = "junit", name = "junit", version.ref = "junit-junit" } -gradle-hello-world-plugin = "org.gradle:gradle-hello-world-plugin:0.1" +poi = { group = "org.apache.poi", name = "poi", version.ref = "apache-poi" } -org-jetbrains-kotlin-jvm-gradle-plugin = "org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:1.6.10" +poi-ooxml = { group = "org.apache.poi", name = "poi-ooxml", version.ref = "apache-poi" } -kotlin-script-runtime = { group = "org.jetbrains.kotlin", name = "kotlin-script-runtime", version.ref = "kotlin" } - -guice = "com.google.inject:guice:2.0" - -okhttp = { group = "com.squareup.okhttp3", name = "okhttp", version.ref = "okhttp3" } - -poi = { group = "org.apache.poi", name = "poi", version.ref = "apache.poi" } +gradle-hello-world-plugin = "org.gradle:gradle-hello-world-plugin:0.1" -poi-ooxml = { group = "org.apache.poi", name = "poi-ooxml", version.ref = "apache.poi" } +kotlin-script-runtime = { group = "org.jetbrains.kotlin", name = "kotlin-script-runtime", version.ref = "kotlin" } kotlin-scripting-compiler-embeddable = { group = "org.jetbrains.kotlin", name = "kotlin-scripting-compiler-embeddable", version.ref = "kotlin" } kotlin-stdlib-jdk8 = { group = "org.jetbrains.kotlin", name = "kotlin-stdlib-jdk8", version.ref = "kotlin" } -org-jetbrains-kotlinx-benchmark-gradle-plugin = "org.jetbrains.kotlinx.benchmark:org.jetbrains.kotlinx.benchmark.gradle.plugin:0.4.2" +kotlinx-coroutines-core = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-core", version.ref = "kotlinx-coroutines" } -kotlinx-coroutines-core = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-core", version.ref = "kotlinx.coroutines" } +kotlinx-coroutines-jdk8 = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-jdk8", version.ref = "kotlinx-coroutines" } -kotlinx-coroutines-jdk8 = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-jdk8", version.ref = "kotlinx.coroutines" } +mongo-java-driver = "org.mongodb:mongo-java-driver:3.11.0" diff --git a/sample-kotlin/versions.properties b/sample-kotlin/versions.properties index f478fdb62..c5d8f7e65 100644 --- a/sample-kotlin/versions.properties +++ b/sample-kotlin/versions.properties @@ -15,9 +15,8 @@ plugin.org.jetbrains.kotlinx.benchmark=0.4.2 ## unused plugin.com.example.unused=42 +## unused version.com.example..dummy-library-for-testing=0.1.0-alpha01 -## # available=0.1.0-alpha02 -## # available=0.1.0-alpha03 version.org.mongodb..mongo-java-driver=3.11.0 @@ -39,19 +38,8 @@ version.androidx.browser=1.0.0 version.androidx.cardview=1.0.0 version.androidx.core=1.3.1 -## # available=1.3.2 -## # available=1.5.0 -## # available=1.6.0 -## # available=1.7.0 version.apache.poi=4.0.0 -## # available=4.0.1 -## # available=4.1.0 -## # available=4.1.1 -## # available=4.1.2 -## # available=5.0.0 -## # available=5.1.0 -## # available=5.2.0 version.kotest=5.1.0 @@ -66,4 +54,3 @@ version.org.apache.poi..poi=4.1.2 version.org.apache.poi..poi-ooxml=4.1.2 version.org.gradle..gradle-hello-world-plugin=0.1 -## # available=0.2 From bc08604ac9381843936d4c0e4a9e28c40bc453ca Mon Sep 17 00:00:00 2001 From: Jean-Michel Fayard Date: Sun, 27 Feb 2022 09:28:23 +0100 Subject: [PATCH 026/103] test: incremental merge of properties in libs.versions.toml --- .../refreshVersions/core/TomlUpdaterTest.kt | 29 +++++++++++++++++++ .../toml-merge-properties/expected.libs.toml | 29 +++++++++++++++++++ .../toml-merge-properties/initial.libs.toml | 21 ++++++++++++++ 3 files changed, 79 insertions(+) create mode 100644 plugins/core/src/test/resources/toml-merge-properties/expected.libs.toml create mode 100644 plugins/core/src/test/resources/toml-merge-properties/initial.libs.toml diff --git a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlUpdaterTest.kt b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlUpdaterTest.kt index 065ea08d1..b50df60b2 100644 --- a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlUpdaterTest.kt +++ b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlUpdaterTest.kt @@ -1,7 +1,11 @@ package de.fayard.refreshVersions.core import de.fayard.refreshVersions.core.internal.DependencyWithVersionCandidates +import de.fayard.refreshVersions.core.internal.Toml +import de.fayard.refreshVersions.core.internal.TomlLine +import de.fayard.refreshVersions.core.internal.TomlSection import de.fayard.refreshVersions.core.internal.TomlUpdater +import de.fayard.refreshVersions.core.internal.VersionCatalogs import io.kotest.core.spec.style.FunSpec import io.kotest.matchers.shouldBe import java.io.File @@ -36,6 +40,31 @@ class TomlUpdaterTest : FunSpec({ // delete actual file if successful input.actual.delete() } + + test("Folder toml-merge-properties - modify file incrementally") { + val input = FolderInput("toml-merge-properties") + + val toml = VersionCatalogs.parseToml(input.initial.readText()) + toml.merge(TomlSection.Versions, listOf( + TomlLine(TomlSection.Versions, "groovy", "3.0.6"), + TomlLine(TomlSection.Versions, "ktor", "2.0"), + )) + + toml.merge(TomlSection.Libraries, listOf( + TomlLine(TomlSection.Libraries, "my-lib", "com.mycompany:mylib:1.5"), + TomlLine(TomlSection.Libraries, "other-lib", "com.mycompany:other:1.5"), + )) + + toml.merge(TomlSection.Plugins, listOf( + TomlLine(TomlSection.Plugins, "short-notation", "some.plugin.id:1.6"), + TomlLine(TomlSection.Plugins, "ben-manes", "ben.manes:versions:1.0"), + )) + + input.actual.writeText(toml.toString()) + toml.toString() shouldBe input.expectedText + // delete actual file if successful + input.actual.delete() + } }) diff --git a/plugins/core/src/test/resources/toml-merge-properties/expected.libs.toml b/plugins/core/src/test/resources/toml-merge-properties/expected.libs.toml new file mode 100644 index 000000000..c9105ec5c --- /dev/null +++ b/plugins/core/src/test/resources/toml-merge-properties/expected.libs.toml @@ -0,0 +1,29 @@ +## Generated by $ ./gradlew refreshVersionsCatalog + +[bundles] + +groovy = ["groovy-core", "groovy-json", "groovy-nio"] + +[plugins] + +short-notation = "some.plugin.id:1.6" + +refreshversions = "de.fayard.refreshversions:1.0" + +ben-manes = "ben.manes:versions:1.0" + +[versions] + +groovy = "3.0.6" + +kotlin = "1.6" + +ktor = "2.0" + +[libraries] + +my-lib = "com.mycompany:mylib:1.5" + +my-other-lib2 = { group = "com.mycompany", name = "alternate", version = "1.4" } + +other-lib = "com.mycompany:other:1.5" diff --git a/plugins/core/src/test/resources/toml-merge-properties/initial.libs.toml b/plugins/core/src/test/resources/toml-merge-properties/initial.libs.toml new file mode 100644 index 000000000..cd9a9d4c9 --- /dev/null +++ b/plugins/core/src/test/resources/toml-merge-properties/initial.libs.toml @@ -0,0 +1,21 @@ +[libraries] + +my-lib = "com.mycompany:mylib:1.4" + +my-other-lib2 = { group = "com.mycompany", name = "alternate", version = "1.4" } + +[versions] + +groovy = "3.0.5" + +kotlin = "1.6" + +[plugins] + +short-notation = "some.plugin.id:1.4" + +refreshversions = "de.fayard.refreshversions:1.0" + +[bundles] + +groovy = ["groovy-core", "groovy-json", "groovy-nio"] From ab83f57166f333c94636b79369c65784be508b6a Mon Sep 17 00:00:00 2001 From: Jean-Michel Fayard Date: Mon, 28 Feb 2022 11:16:03 +0100 Subject: [PATCH 027/103] feat(migrate): don't migrate build files inside resources or build folder --- .../de/fayard/refreshVersions/RefreshVersionsMigrateTask.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsMigrateTask.kt b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsMigrateTask.kt index 946579c96..0da3c654e 100644 --- a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsMigrateTask.kt +++ b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsMigrateTask.kt @@ -139,7 +139,9 @@ internal fun findFilesWithDependencyNotations(fromDir: File): List { require(fromDir.isDirectory) { "Expected a directory, got ${fromDir.absolutePath}" } val expectedNames = listOf("build", "build.gradle", "deps", "dependencies", "libs", "libraries", "versions") val expectedExtensions = listOf("gradle", "kts", "groovy", "kt") - return fromDir.walkBottomUp().filter { + return fromDir.walkBottomUp() + .onEnter { dir -> dir.name !in listOf("resources", "build") } + .filter { it.extension in expectedExtensions && it.nameWithoutExtension.toLowerCase() in expectedNames }.toList() } From c1c9a190148a5b88d0e8fb2c96d4312bc8db5274 Mon Sep 17 00:00:00 2001 From: Jean-Michel Fayard Date: Mon, 28 Feb 2022 11:54:38 +0100 Subject: [PATCH 028/103] feat(migrate): option --toml use libraries from libs.versions.toml first --- .../RefreshVersionsMigrateTask.kt | 26 ++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsMigrateTask.kt b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsMigrateTask.kt index 0da3c654e..bb17a05e1 100644 --- a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsMigrateTask.kt +++ b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsMigrateTask.kt @@ -3,20 +3,22 @@ package de.fayard.refreshVersions import de.fayard.refreshVersions.core.ModuleId import de.fayard.refreshVersions.core.addMissingEntriesInVersionsProperties import de.fayard.refreshVersions.core.extensions.gradle.getVersionsCatalog +import de.fayard.refreshVersions.core.internal.VersionCatalogs import de.fayard.refreshVersions.core.internal.associateShortestByMavenCoordinate import de.fayard.refreshVersions.internal.getArtifactNameToConstantMapping import org.gradle.api.DefaultTask -import org.gradle.api.Project -import org.gradle.api.UnknownDomainObjectException -import org.gradle.api.artifacts.VersionCatalogsExtension +import org.gradle.api.tasks.Input import org.gradle.api.tasks.TaskAction -import org.gradle.kotlin.dsl.getByType +import org.gradle.api.tasks.options.Option import org.intellij.lang.annotations.Language import java.io.File -import de.fayard.refreshVersions.core.internal.VersionCatalogs open class RefreshVersionsMigrateTask : DefaultTask() { + @Input + @Option(option = "toml", description = "Use libraries from ${VersionCatalogs.LIBS_VERSIONS_TOML} before built-in dependency notations") + var tomlFirst: Boolean = false + @TaskAction fun refreshVersionsMissingEntries() { addMissingEntriesInVersionsProperties(project) @@ -27,11 +29,17 @@ open class RefreshVersionsMigrateTask : DefaultTask() { val versionsCatalogMapping: Map = VersionCatalogs.dependencyAliases(project.getVersionsCatalog()) - val dependencyMapping: Map = getArtifactNameToConstantMapping() + val builtInDependenciesMapping: Map = getArtifactNameToConstantMapping() .associateShortestByMavenCoordinate() + val dependencyMapping = if (tomlFirst) { + builtInDependenciesMapping + versionsCatalogMapping + } else { + versionsCatalogMapping + builtInDependenciesMapping + } + findFilesWithDependencyNotations(project.rootDir).forEach { buildFile -> - migrateFileIfNeeded(buildFile, versionsCatalogMapping + dependencyMapping) + migrateFileIfNeeded(buildFile, dependencyMapping) } println() println(""" @@ -142,8 +150,8 @@ internal fun findFilesWithDependencyNotations(fromDir: File): List { return fromDir.walkBottomUp() .onEnter { dir -> dir.name !in listOf("resources", "build") } .filter { - it.extension in expectedExtensions && it.nameWithoutExtension.toLowerCase() in expectedNames - }.toList() + it.extension in expectedExtensions && it.nameWithoutExtension.toLowerCase() in expectedNames + }.toList() } /** From 67062e7edea97b18c94a28a1220d977c52eace1a Mon Sep 17 00:00:00 2001 From: Jean-Michel Fayard Date: Wed, 2 Mar 2022 17:20:25 +0100 Subject: [PATCH 029/103] feat(migrate): support custom project.buildFileName --- .../refreshVersions/RefreshVersionsMigrateTask.kt | 14 ++++++++------ sample-android/app/build.gradle.kts | 2 +- sample-android/versions.properties | 8 ++++++-- .../{build.gradle.kts => sample-kotlin.gradle.kts} | 0 sample-kotlin/settings.gradle.kts | 1 + 5 files changed, 16 insertions(+), 9 deletions(-) rename sample-kotlin/{build.gradle.kts => sample-kotlin.gradle.kts} (100%) diff --git a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsMigrateTask.kt b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsMigrateTask.kt index bb17a05e1..874c16f3a 100644 --- a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsMigrateTask.kt +++ b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsMigrateTask.kt @@ -38,9 +38,15 @@ open class RefreshVersionsMigrateTask : DefaultTask() { versionsCatalogMapping + builtInDependenciesMapping } - findFilesWithDependencyNotations(project.rootDir).forEach { buildFile -> + val findFiles = findFilesWithDependencyNotations(project.rootDir).toSet() + findFiles.forEach { buildFile -> migrateFileIfNeeded(buildFile, dependencyMapping) } + project.allprojects { + if (buildFile !in findFiles) { + migrateFileIfNeeded(buildFile, dependencyMapping) + } + } println() println(""" To find available updates, run this: @@ -64,13 +70,9 @@ open class RefreshVersionsMigrateTask : DefaultTask() { // - Interactive task // - separate CLI tool // - FIXME/TODO comments insertion -//TODO: Release BEFORE the 30th of June. -//TODO: Replace versions with underscore in the Gradle Versions Catalog files. - -private val buildFilesNames = setOf("build.gradle", "build.gradle.kts") internal fun migrateFileIfNeeded(file: File, dependencyMapping: Map) { - val isBuildFile = file.name in buildFilesNames + val isBuildFile = file.name.removeSuffix(".kts").endsWith(".gradle") val oldContent = file.readText() val newContent = oldContent.lines() .detectPluginsBlock() diff --git a/sample-android/app/build.gradle.kts b/sample-android/app/build.gradle.kts index fc4d28c7c..4e532c3a4 100755 --- a/sample-android/app/build.gradle.kts +++ b/sample-android/app/build.gradle.kts @@ -21,7 +21,7 @@ dependencies { implementation(Kotlin.stdlib.jdk7) implementation(AndroidX.appCompat) - implementation(AndroidX.activityKtx) + implementation(AndroidX.activity.ktx) implementation(AndroidX.constraintLayout) implementation(Google.android.material) implementation(AndroidX.lifecycle.runtime) diff --git a/sample-android/versions.properties b/sample-android/versions.properties index 764bde0b5..55dd9daf4 100644 --- a/sample-android/versions.properties +++ b/sample-android/versions.properties @@ -1,6 +1,6 @@ #### Dependencies and Plugin versions with their available updates. -#### Generated by `./gradlew refreshVersions` version 0.24.0-SNAPSHOT -#### Revision of dependency notations removals: 1 +#### Generated by `./gradlew refreshVersions` version 0.40.2-SNAPSHOT +#### Revision of dependency notations removals: 9 #### #### Don't manually edit or split the comments that start with four hashtags (####), #### they will be overwritten by refreshVersions. @@ -14,6 +14,10 @@ plugin.gradle.site=0.6 version.androidx.activity=1.2.2 +version.androidx.test.rules=1.3.0 + +version.androidx.test.runner=1.3.0 + version.firebase-bom=27.1.0 version.google.android.material=1.3.0 diff --git a/sample-kotlin/build.gradle.kts b/sample-kotlin/sample-kotlin.gradle.kts similarity index 100% rename from sample-kotlin/build.gradle.kts rename to sample-kotlin/sample-kotlin.gradle.kts diff --git a/sample-kotlin/settings.gradle.kts b/sample-kotlin/settings.gradle.kts index 1effe00d4..99a0726b2 100644 --- a/sample-kotlin/settings.gradle.kts +++ b/sample-kotlin/settings.gradle.kts @@ -60,3 +60,4 @@ gradleEnterprise { } rootProject.name = "sample-kotlin" +rootProject.buildFileName = "${rootProject.name}.gradle.kts" From 224179faf30a7ad792dd39ce9d24ca44d8f28346 Mon Sep 17 00:00:00 2001 From: Jean-Michel Fayard Date: Wed, 2 Mar 2022 21:04:11 +0100 Subject: [PATCH 030/103] refactor: clean-up OutputFile.kt --- .../fayard/buildSrcLibs/BuildSrcLibsTask.kt | 2 +- .../core/MissingVersionEntries.kt | 3 +- .../core/RefreshVersionsCleanupTask.kt | 6 ++-- .../core/RefreshVersionsCorePlugin.kt | 2 ++ .../core/RefreshVersionsTask.kt | 7 +--- .../core/internal/OutputFile.kt | 34 +++++++++++-------- .../RefreshVersionsCatalogTask.kt | 4 +-- 7 files changed, 30 insertions(+), 28 deletions(-) diff --git a/plugins/buildSrcLibs/src/main/kotlin/de/fayard/buildSrcLibs/BuildSrcLibsTask.kt b/plugins/buildSrcLibs/src/main/kotlin/de/fayard/buildSrcLibs/BuildSrcLibsTask.kt index 992883b66..872000e7a 100644 --- a/plugins/buildSrcLibs/src/main/kotlin/de/fayard/buildSrcLibs/BuildSrcLibsTask.kt +++ b/plugins/buildSrcLibs/src/main/kotlin/de/fayard/buildSrcLibs/BuildSrcLibsTask.kt @@ -22,7 +22,7 @@ open class BuildSrcLibsTask : DefaultTask() { @TaskAction fun taskActionInitializeBuildSrc() { - OutputFile.checkWhichFilesExist(project.rootDir) + OutputFile.checkWhichFilesExist() project.file(OutputFile.OUTPUT_DIR.path).also { if (it.isDirectory.not()) it.mkdirs() } diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/MissingVersionEntries.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/MissingVersionEntries.kt index 166ec6d1b..871807aaf 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/MissingVersionEntries.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/MissingVersionEntries.kt @@ -9,8 +9,7 @@ import org.gradle.api.artifacts.ExternalDependency @InternalRefreshVersionsApi fun addMissingEntriesInVersionsProperties(project: Project) { - require(project == project.rootProject) { "Expected a rootProject but got $project" } - OutputFile.checkWhichFilesExist(project.rootDir) + OutputFile.checkWhichFilesExist() val configurationsWithHardcodedDependencies = project.findHardcodedDependencies() val versionsMap = RefreshVersionsConfigHolder.readVersionsMap() diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsCleanupTask.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsCleanupTask.kt index d2ca3cc42..26fad2089 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsCleanupTask.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsCleanupTask.kt @@ -18,7 +18,7 @@ open class RefreshVersionsCleanupTask : DefaultTask() { @TaskAction fun cleanUpVersionsProperties() { - OutputFile.checkWhichFilesExist(project.rootDir) + OutputFile.checkWhichFilesExist() val model = VersionsPropertiesModel.readFromFile(RefreshVersionsConfigHolder.versionsPropertiesFile) val sectionsWithoutAvailableUpdates = model.sections.map { section -> @@ -38,13 +38,13 @@ open class RefreshVersionsCleanupTask : DefaultTask() { .filter { it.existed } settingsFiles.forEach { settingsFile -> - val initialContent = settingsFile.readText(project) + val initialContent = settingsFile.readText() val newContent = buildString { append(initialContent) removeCommentsAddedByUs() } if (initialContent.length != newContent.length) { - settingsFile.writeText(newContent, project) + settingsFile.writeText(newContent) } } diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsCorePlugin.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsCorePlugin.kt index 484c9e4b7..b7586a064 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsCorePlugin.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsCorePlugin.kt @@ -3,6 +3,7 @@ package de.fayard.refreshVersions.core import de.fayard.refreshVersions.core.extensions.gradle.isBuildSrc import de.fayard.refreshVersions.core.extensions.gradle.isRootProject import de.fayard.refreshVersions.core.internal.InternalRefreshVersionsApi +import de.fayard.refreshVersions.core.internal.OutputFile import de.fayard.refreshVersions.core.internal.RefreshVersionsConfigHolder import org.gradle.api.Plugin import org.gradle.api.Project @@ -14,6 +15,7 @@ open class RefreshVersionsCorePlugin : Plugin { override fun apply(project: Project) { check(project.isRootProject) { "ERROR: de.fayard.refreshVersions.core should not be applied manually" } + OutputFile.rootDir = project.rootDir if (project.isBuildSrc.not()) { // In the case where this runs in includedBuilds, the task configuration lambda may (will) run // after RefreshVersionsConfigHolder content is cleared (via its ClearStaticStateBuildService), diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsTask.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsTask.kt index 1c7eb642a..3491bc3d9 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsTask.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsTask.kt @@ -10,16 +10,11 @@ import de.fayard.refreshVersions.core.internal.versions.writeWithNewVersions import kotlinx.coroutines.async import kotlinx.coroutines.runBlocking import org.gradle.api.DefaultTask -import org.gradle.api.Project -import org.gradle.api.UnknownDomainObjectException import org.gradle.api.artifacts.Dependency -import org.gradle.api.artifacts.MinimalExternalModuleDependency -import org.gradle.api.artifacts.VersionCatalogsExtension import org.gradle.api.tasks.Input import org.gradle.api.tasks.Optional import org.gradle.api.tasks.TaskAction import org.gradle.api.tasks.options.Option -import org.gradle.kotlin.dsl.getByType import org.gradle.util.GradleVersion /** @@ -53,7 +48,7 @@ open class RefreshVersionsTask : DefaultTask() { @TaskAction fun taskActionRefreshVersions() { - OutputFile.checkWhichFilesExist(project.rootDir) + OutputFile.checkWhichFilesExist() if (FeatureFlag.userSettings.isNotEmpty()) { logger.lifecycle("Feature flags: " + FeatureFlag.userSettings) diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/OutputFile.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/OutputFile.kt index 63580aa75..8b2eba466 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/OutputFile.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/OutputFile.kt @@ -1,7 +1,6 @@ package de.fayard.refreshVersions.core.internal import de.fayard.refreshVersions.core.internal.VersionCatalogs.LIBS_VERSIONS_TOML -import org.gradle.api.Project import java.io.File @InternalRefreshVersionsApi @@ -19,21 +18,26 @@ enum class OutputFile(var path: String, var existed: Boolean = false, val altern GRADLE_VERSIONS_CATALOG(LIBS_VERSIONS_TOML), ; + val file get() = rootDir.resolve(path) - fun readText(project: Project) = when { - project.file(path).canRead() -> project.file(path).readText() - alternativePath != null && project.file(alternativePath).canRead() -> project.file(alternativePath).readText() - else -> { - println("${ANSI_RED}Cannot read file $path ${alternativePath ?: ""} $ANSI_RESET") - error("File not found $this") + val alternativeFile: File? + get() = alternativePath + ?.let { rootDir.resolve(it) } + ?.takeIf { it.canRead() } + + fun readText() = when { + file.canRead() -> file.readText() + alternativeFile != null -> alternativeFile!!.readText() + else -> { + println("${ANSI_RED}Cannot read file $path ${alternativePath ?: ""} $ANSI_RESET") + error("File not found $this") + } } - } - fun writeText(text: String, project: Project, mustExists: Boolean = false) = when { - !mustExists -> project.file(path).writeText(text) - project.file(path).exists() -> project.file(path).writeText(text) - alternativePath != null && project.file(alternativePath).canRead() -> project.file(alternativePath) - .writeText(text) + fun writeText(text: String, mustExists: Boolean = false) = when { + !mustExists -> file.writeText(text) + file.exists() -> file.writeText(text) + alternativeFile != null -> alternativeFile!!.writeText(text) else -> { println("${ANSI_RED}Cannot write file $path ${alternativePath ?: ""} $ANSI_RESET") error("File not found $this") @@ -46,6 +50,8 @@ enum class OutputFile(var path: String, var existed: Boolean = false, val altern } companion object { + lateinit var rootDir: File + val settingsFiles = listOf(SETTINGS_GRADLE, SETTINGS_GRADLE_KTS, BUILD_SETTINGS_GRADLE, BUILD_SETTINGS_GRADLE_KTS) // COLORS @@ -68,7 +74,7 @@ enum class OutputFile(var path: String, var existed: Boolean = false, val altern println("$color$status$path$ANSI_RESET") } - fun checkWhichFilesExist(rootDir: File) { + fun checkWhichFilesExist() { values().forEach { outputFile -> outputFile.existed = when { rootDir.resolve(outputFile.path).exists() -> true diff --git a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt index ea6b77d90..8704a010c 100644 --- a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt +++ b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt @@ -72,9 +72,9 @@ open class RefreshVersionsCatalogTask : DefaultTask() { val deps: Deps = dependenciesToUse.checkModeAndNames(versionCatalogAliases, Case.`kebab-case`) - val currentText = if (catalog.existed) catalog.readText(project) else "" + val currentText = if (catalog.existed) catalog.readText() else "" val newText = versionsCatalog(deps, currentText, withVersions, plugins) - catalog.writeText(newText, project) + catalog.writeText(newText) catalog.logFileWasModified() println(""" From 0a3c28788079ec2ced0ab0c7e95a3fa1d0ef2aa8 Mon Sep 17 00:00:00 2001 From: Jean-Michel Fayard Date: Wed, 2 Mar 2022 21:23:35 +0100 Subject: [PATCH 031/103] feat: skip Configuration Cache for refreshVersions tasks --- .../de/fayard/buildSrcLibs/BuildSrcLibsPlugin.kt | 2 ++ .../de/fayard/buildSrcLibs/BuildSrcLibsTask.kt | 2 +- .../core/RefreshVersionsCorePlugin.kt | 2 ++ .../fayard/refreshVersions/core/internal/Tasks.kt | 14 ++++++++++++++ .../refreshVersions/RefreshVersionsPlugin.kt | 4 ++++ sample-kotlin/gradle.properties | 5 +++++ sample-kotlin/settings.gradle.kts | 1 + 7 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/Tasks.kt create mode 100644 sample-kotlin/gradle.properties diff --git a/plugins/buildSrcLibs/src/main/kotlin/de/fayard/buildSrcLibs/BuildSrcLibsPlugin.kt b/plugins/buildSrcLibs/src/main/kotlin/de/fayard/buildSrcLibs/BuildSrcLibsPlugin.kt index e52d58656..49f619b3c 100644 --- a/plugins/buildSrcLibs/src/main/kotlin/de/fayard/buildSrcLibs/BuildSrcLibsPlugin.kt +++ b/plugins/buildSrcLibs/src/main/kotlin/de/fayard/buildSrcLibs/BuildSrcLibsPlugin.kt @@ -1,5 +1,6 @@ package de.fayard.buildSrcLibs +import de.fayard.refreshVersions.core.internal.skipConfigurationCache import org.gradle.api.DefaultTask import org.gradle.api.Plugin import org.gradle.api.Project @@ -14,6 +15,7 @@ class BuildSrcLibsPlugin : Plugin { group = "refreshVersions" description = "Update buildSrc/src/main/kotlin/Libs.kt" outputs.upToDateWhen { false } + skipConfigurationCache() } project.tasks.register( name = "buildSrcVersions" diff --git a/plugins/buildSrcLibs/src/main/kotlin/de/fayard/buildSrcLibs/BuildSrcLibsTask.kt b/plugins/buildSrcLibs/src/main/kotlin/de/fayard/buildSrcLibs/BuildSrcLibsTask.kt index 872000e7a..c3a055ea3 100644 --- a/plugins/buildSrcLibs/src/main/kotlin/de/fayard/buildSrcLibs/BuildSrcLibsTask.kt +++ b/plugins/buildSrcLibs/src/main/kotlin/de/fayard/buildSrcLibs/BuildSrcLibsTask.kt @@ -47,7 +47,7 @@ open class BuildSrcLibsTask : DefaultTask() { @TaskAction fun taskUpdateLibsKt() { - val outputDir = project.file(OutputFile.OUTPUT_DIR.path) + val outputDir = OutputFile.OUTPUT_DIR.file val allDependencies = project.findDependencies() val resolvedUseFqdn = allDependencies.computeAliases( diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsCorePlugin.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsCorePlugin.kt index b7586a064..2d0d63a58 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsCorePlugin.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsCorePlugin.kt @@ -5,6 +5,7 @@ import de.fayard.refreshVersions.core.extensions.gradle.isRootProject import de.fayard.refreshVersions.core.internal.InternalRefreshVersionsApi import de.fayard.refreshVersions.core.internal.OutputFile import de.fayard.refreshVersions.core.internal.RefreshVersionsConfigHolder +import de.fayard.refreshVersions.core.internal.skipConfigurationCache import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.kotlin.dsl.register @@ -25,6 +26,7 @@ open class RefreshVersionsCorePlugin : Plugin { project.tasks.register(name = "refreshVersions") { group = "refreshVersions" description = "Search for new dependencies versions and update $versionsFileName" + skipConfigurationCache() } project.tasks.register(name = "refreshVersionsCleanup") { diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/Tasks.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/Tasks.kt new file mode 100644 index 000000000..5ec276ff3 --- /dev/null +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/Tasks.kt @@ -0,0 +1,14 @@ +package de.fayard.refreshVersions.core.internal + +import org.gradle.api.Task +import kotlin.reflect.full.memberFunctions + +@InternalRefreshVersionsApi +fun Task.skipConfigurationCache() { + this::class.memberFunctions + .firstOrNull { it.name == "notCompatibleWithConfigurationCache" } + ?.call(this, "Task $name does not support Configuration Cache") + ?: run { + println("warning: task $name not compatible with the configuration cache.") + } +} \ No newline at end of file diff --git a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsPlugin.kt b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsPlugin.kt index 5ef5e45b0..70eb2cfc1 100644 --- a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsPlugin.kt +++ b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsPlugin.kt @@ -4,6 +4,7 @@ import de.fayard.refreshVersions.core.* import de.fayard.refreshVersions.core.extensions.gradle.isBuildSrc import de.fayard.refreshVersions.core.internal.VersionCatalogs.LIBS_VERSIONS_TOML import de.fayard.refreshVersions.core.internal.removals_replacement.RemovedDependencyNotationsReplacementInfo +import de.fayard.refreshVersions.core.internal.skipConfigurationCache import de.fayard.refreshVersions.internal.getArtifactNameToConstantMapping import org.gradle.api.DefaultTask import org.gradle.api.Plugin @@ -167,6 +168,7 @@ open class RefreshVersionsPlugin : Plugin { description = "Assists migration from hardcoded dependencies to constants of " + "the refreshVersions dependencies plugin" finalizedBy("refreshVersions") + skipConfigurationCache() } project.tasks.register( @@ -184,6 +186,7 @@ open class RefreshVersionsPlugin : Plugin { group = "refreshVersions" description = "Update $LIBS_VERSIONS_TOML" outputs.upToDateWhen { false } + skipConfigurationCache() } project.tasks.register( @@ -191,6 +194,7 @@ open class RefreshVersionsPlugin : Plugin { ) { group = "refreshVersions" description = "Migrate build to refreshVersions" + skipConfigurationCache() } } diff --git a/sample-kotlin/gradle.properties b/sample-kotlin/gradle.properties new file mode 100644 index 000000000..8ac56d9ba --- /dev/null +++ b/sample-kotlin/gradle.properties @@ -0,0 +1,5 @@ + + +org.gradle.unsafe.configuration-cache=true +#org.gradle.unsafe.configuration-cache-problems=warn + diff --git a/sample-kotlin/settings.gradle.kts b/sample-kotlin/settings.gradle.kts index 99a0726b2..bd7c15abf 100644 --- a/sample-kotlin/settings.gradle.kts +++ b/sample-kotlin/settings.gradle.kts @@ -56,6 +56,7 @@ gradleEnterprise { buildScan { termsOfServiceUrl = "https://gradle.com/terms-of-service" termsOfServiceAgree = "yes" + publishOnFailure() } } From 7f49f16544a0c3f4ecfe3f99ee6fdaab178a6b09 Mon Sep 17 00:00:00 2001 From: Jean-Michel Fayard Date: Thu, 3 Mar 2022 11:07:51 +0100 Subject: [PATCH 032/103] pr(migrate): skip build files that can't be read --- .../de/fayard/refreshVersions/RefreshVersionsMigrateTask.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsMigrateTask.kt b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsMigrateTask.kt index 874c16f3a..4bf3a7a52 100644 --- a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsMigrateTask.kt +++ b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsMigrateTask.kt @@ -72,6 +72,8 @@ open class RefreshVersionsMigrateTask : DefaultTask() { // - FIXME/TODO comments insertion internal fun migrateFileIfNeeded(file: File, dependencyMapping: Map) { + if (file.canRead().not()) return + val isBuildFile = file.name.removeSuffix(".kts").endsWith(".gradle") val oldContent = file.readText() val newContent = oldContent.lines() From 5b3bd78d2a3d1e2fd647ecbeca4a48aca193c6f0 Mon Sep 17 00:00:00 2001 From: Jean-Michel Fayard Date: Thu, 28 Apr 2022 16:41:04 +0200 Subject: [PATCH 033/103] fix(versions-catalog): NPE when a BOM was used and no version available --- .../refreshVersions/core/internal/InternalExtensions.kt | 3 ++- .../de/fayard/refreshVersions/core/internal/TomlLine.kt | 2 +- .../de/fayard/refreshVersions/core/TomlUpdaterTest.kt | 1 + .../resources/toml-refreshversions/expected.libs.toml | 2 ++ .../test/resources/toml-refreshversions/initial.libs.toml | 3 ++- .../dependency-groups-alias-rules.txt | 2 +- sample-kotlin/gradle/libs.versions.toml | 6 ++++++ sample-kotlin/sample-kotlin.gradle.kts | 8 ++++++++ 8 files changed, 23 insertions(+), 4 deletions(-) diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/InternalExtensions.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/InternalExtensions.kt index 675ed8bb7..b0c2b12c3 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/InternalExtensions.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/InternalExtensions.kt @@ -31,7 +31,8 @@ fun Dependency.isManageableVersion( else -> false } } - ModuleId.Maven(group ?: "", name) in versionsCatalogMapping -> true + ModuleId.Maven(group ?: "", name) in versionsCatalogMapping && + version.isNullOrBlank().not() -> true else -> false } } diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlLine.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlLine.kt index 1b1eccb0d..bf88c2bc1 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlLine.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlLine.kt @@ -32,7 +32,7 @@ internal data class TomlLine( val module get() = "$group:$name" val version: String get() = - if (section == Versions) value else map["version"]!! + if (section == Versions) value else map["version"] ?: "" val group: String get() = if (section == Plugins) id else map["group"]!! diff --git a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlUpdaterTest.kt b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlUpdaterTest.kt index b50df60b2..bac778a05 100644 --- a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlUpdaterTest.kt +++ b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlUpdaterTest.kt @@ -98,6 +98,7 @@ private fun dependencyWithVersionCandidates(folder: File): List val (group, name, version, available) = line.split(":") DependencyWithVersionCandidates( diff --git a/plugins/core/src/test/resources/toml-refreshversions/expected.libs.toml b/plugins/core/src/test/resources/toml-refreshversions/expected.libs.toml index 7f10aa264..df19d519f 100644 --- a/plugins/core/src/test/resources/toml-refreshversions/expected.libs.toml +++ b/plugins/core/src/test/resources/toml-refreshversions/expected.libs.toml @@ -53,3 +53,5 @@ my-other-lib = { module = "com.mycompany:other", version = "1.4" } my-other-lib2 = { group = "com.mycompany", name = "alternate", version = "1.4" } ## # available = "1.5" } + +log4j-jul = { module = "org.apache.logging.log4j:log4j-jul" } diff --git a/plugins/core/src/test/resources/toml-refreshversions/initial.libs.toml b/plugins/core/src/test/resources/toml-refreshversions/initial.libs.toml index 8a2e89c72..5fd72c4b5 100644 --- a/plugins/core/src/test/resources/toml-refreshversions/initial.libs.toml +++ b/plugins/core/src/test/resources/toml-refreshversions/initial.libs.toml @@ -29,6 +29,8 @@ my-other-lib = { module = "com.mycompany:other", version = "1.4" } my-other-lib2 = { group = "com.mycompany", name = "alternate", version = "1.4" } ## # available="1.5" } +log4j-jul = { module = "org.apache.logging.log4j:log4j-jul" } + [bundles] groovy = ["groovy-core", "groovy-json", "groovy-nio"] @@ -45,4 +47,3 @@ long-notation = { id = "some.plugin.id", version = "1.4" } ## # available="1.6" } reference-notation = { id = "other.plugin.id", version.ref = "common" } - diff --git a/plugins/dependencies/src/main/resources/refreshVersions-rules/dependency-groups-alias-rules.txt b/plugins/dependencies/src/main/resources/refreshVersions-rules/dependency-groups-alias-rules.txt index 80c781116..70ee78fb6 100644 --- a/plugins/dependencies/src/main/resources/refreshVersions-rules/dependency-groups-alias-rules.txt +++ b/plugins/dependencies/src/main/resources/refreshVersions-rules/dependency-groups-alias-rules.txt @@ -41,4 +41,4 @@ com.russhwolf:multiplatform-settings(-*) ^^^^^^^^^^^^^^^^^^^^^^ com.rickclephas.kmp:kmp-nativecoroutines(-*) - ^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^ + ^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^ \ No newline at end of file diff --git a/sample-kotlin/gradle/libs.versions.toml b/sample-kotlin/gradle/libs.versions.toml index 6e3466bff..f46226ff9 100644 --- a/sample-kotlin/gradle/libs.versions.toml +++ b/sample-kotlin/gradle/libs.versions.toml @@ -55,3 +55,9 @@ kotlinx-coroutines-core = { group = "org.jetbrains.kotlinx", name = "kotlinx-cor kotlinx-coroutines-jdk8 = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-jdk8", version.ref = "kotlinx-coroutines" } mongo-java-driver = "org.mongodb:mongo-java-driver:3.11.0" + +log4j-bom = "org.apache.logging.log4j:log4j-bom:2.17.2" + +log4j-slf4jImpl = { module = "org.apache.logging.log4j:log4j-slf4j-impl" } + +log4j-jul = { module = "org.apache.logging.log4j:log4j-jul" } diff --git a/sample-kotlin/sample-kotlin.gradle.kts b/sample-kotlin/sample-kotlin.gradle.kts index fe89c6304..adec4bf5e 100644 --- a/sample-kotlin/sample-kotlin.gradle.kts +++ b/sample-kotlin/sample-kotlin.gradle.kts @@ -46,6 +46,14 @@ dependencies { api("org.apache.poi:poi:_") api("org.apache.poi:poi-ooxml:_") + + // logging + implementation(platform(libs.log4j.bom)) + runtimeOnly(libs.log4j.slf4jImpl) + runtimeOnly(libs.log4j.jul) + // implementation("org.apache.logging.log4j:log4j-bom:2.17.2") + // runtimeOnly("org.apache.logging.log4j:log4j-slf4j-impl") + // runtimeOnly("org.apache.logging.log4j:log4j-jul") } getKotlinPluginVersion().let { From a4f3026a2091ca3dd6f9151b2782268dc0db7756 Mon Sep 17 00:00:00 2001 From: Jean-Michel Fayard Date: Thu, 28 Apr 2022 17:13:14 +0200 Subject: [PATCH 034/103] feat(migration): support dependencies without versions --- .../refreshVersions/RefreshVersionsMigrateTask.kt | 14 +++++++------- .../de/fayard/refreshVersions/MigrationTest.kt | 6 +++++- sample-kotlin/gradle/libs.versions.toml | 4 ++-- sample-kotlin/sample-kotlin.gradle.kts | 7 ++----- sample-kotlin/versions.properties | 2 ++ 5 files changed, 18 insertions(+), 15 deletions(-) diff --git a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsMigrateTask.kt b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsMigrateTask.kt index 4bf3a7a52..0c979b814 100644 --- a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsMigrateTask.kt +++ b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsMigrateTask.kt @@ -132,12 +132,12 @@ internal fun withVersionPlaceholder( private fun extractCoordinate(line: String): ModuleId.Maven { val coordinate = mavenCoordinateRegex.find(line)!!.value - coordinate.replaceAfterLast(':', "").let { - return ModuleId.Maven( - group = it.substringBefore(':').removePrefix("'").removePrefix("\""), - name = it.substringAfter(':').removeSuffix(":") - ) - } + .replace("'", "") + .replace("\"", "") + + val (group, name) = coordinate.split(":") + + return ModuleId.Maven(group = group, name = name) } private const val mavenChars = "[a-zA-Z0-9_.-]" @@ -145,7 +145,7 @@ private const val versionChars = "[a-zA-Z0-9_.{}$-]" @Language("RegExp") private val mavenCoordinateRegex = - "(['\"]$mavenChars{4,}:$mavenChars{2,}:)(?:_|$versionChars{3,})([\"'])".toRegex() + "(['\"]$mavenChars{4,}:$mavenChars{2,})(?:|:_|:$versionChars{3,})([\"'])".toRegex() internal fun findFilesWithDependencyNotations(fromDir: File): List { require(fromDir.isDirectory) { "Expected a directory, got ${fromDir.absolutePath}" } diff --git a/plugins/dependencies/src/test/kotlin/de/fayard/refreshVersions/MigrationTest.kt b/plugins/dependencies/src/test/kotlin/de/fayard/refreshVersions/MigrationTest.kt index 4a071770d..160fed50a 100644 --- a/plugins/dependencies/src/test/kotlin/de/fayard/refreshVersions/MigrationTest.kt +++ b/plugins/dependencies/src/test/kotlin/de/fayard/refreshVersions/MigrationTest.kt @@ -21,6 +21,7 @@ class MigrationTest : StringSpec({ "Replace versions in maven coordinates in build files" { val input = """ + implementation("com.example:name:_") implementation("com.example:name:_") implementation("com.example:name:${'$'}exampleVersion") implementation("com.example:name:${'$'}version") @@ -179,7 +180,8 @@ class MigrationTest : StringSpec({ val dependencyMapping = mapOf( "com.squareup.okio:okio" to "Square.okio", "com.squareup.moshi:moshi" to "Square.moshi", - "com.google.firebase:firebase-analytics" to "Firebase.analytics" + "com.google.firebase:firebase-analytics" to "Firebase.analytics", + "org.apache.logging.log4j:log4j-jul" to "libs.log4j.jul", ).mapKeys { (key, _) -> ModuleId.Maven( group = key.substringBefore(':'), @@ -190,11 +192,13 @@ class MigrationTest : StringSpec({ implementation 'com.squareup.okio:okio:1.2' implementation("com.squareup.moshi:moshi:_") implementation("com.google.firebase:firebase-analytics:3.4") + implementation("org.apache.logging.log4j:log4j-jul") """.trimIndent().lines() val expected = """ implementation Square.okio implementation(Square.moshi) implementation(Firebase.analytics) + implementation(libs.log4j.jul) """.trimIndent().lines() input.size shouldBeExactly expected.size List(input.size) { input[it] to expected[it] } diff --git a/sample-kotlin/gradle/libs.versions.toml b/sample-kotlin/gradle/libs.versions.toml index f46226ff9..40a773f17 100644 --- a/sample-kotlin/gradle/libs.versions.toml +++ b/sample-kotlin/gradle/libs.versions.toml @@ -58,6 +58,6 @@ mongo-java-driver = "org.mongodb:mongo-java-driver:3.11.0" log4j-bom = "org.apache.logging.log4j:log4j-bom:2.17.2" -log4j-slf4jImpl = { module = "org.apache.logging.log4j:log4j-slf4j-impl" } - log4j-jul = { module = "org.apache.logging.log4j:log4j-jul" } + +log4j-slf4j-impl = { module = "org.apache.logging.log4j:log4j-slf4j-impl" } diff --git a/sample-kotlin/sample-kotlin.gradle.kts b/sample-kotlin/sample-kotlin.gradle.kts index adec4bf5e..8285c761f 100644 --- a/sample-kotlin/sample-kotlin.gradle.kts +++ b/sample-kotlin/sample-kotlin.gradle.kts @@ -48,12 +48,9 @@ dependencies { api("org.apache.poi:poi-ooxml:_") // logging - implementation(platform(libs.log4j.bom)) - runtimeOnly(libs.log4j.slf4jImpl) + implementation(libs.log4j.bom) + runtimeOnly(libs.log4j.slf4j.impl) runtimeOnly(libs.log4j.jul) - // implementation("org.apache.logging.log4j:log4j-bom:2.17.2") - // runtimeOnly("org.apache.logging.log4j:log4j-slf4j-impl") - // runtimeOnly("org.apache.logging.log4j:log4j-jul") } getKotlinPluginVersion().let { diff --git a/sample-kotlin/versions.properties b/sample-kotlin/versions.properties index c5d8f7e65..c49603962 100644 --- a/sample-kotlin/versions.properties +++ b/sample-kotlin/versions.properties @@ -18,6 +18,8 @@ plugin.com.example.unused=42 ## unused version.com.example..dummy-library-for-testing=0.1.0-alpha01 +version.org.apache.logging.log4j..log4j-bom=2.17.2 + version.org.mongodb..mongo-java-driver=3.11.0 version.okhttp3=3.10.0 From 68e8af4ed9acce3f310f4fcadb7cc5ff7aba259c Mon Sep 17 00:00:00 2001 From: Jean-Michel Fayard Date: Thu, 28 Apr 2022 17:38:31 +0200 Subject: [PATCH 035/103] feat(versions-catalog): support version="none" when generating libs.versions.toml --- .../core/internal/DependencyNotations.kt | 3 +++ .../refreshVersions/core/internal/TomlLine.kt | 8 ++++++-- .../core/internal/VersionCatalogs.kt | 10 ++++++++-- .../refreshVersions/core/TomlLineTest.kt | 18 +++++++++++------- .../RefreshVersionsCatalogTask.kt | 2 +- sample-kotlin/gradle/libs.versions.toml | 4 ++-- sample-kotlin/sample-kotlin.gradle.kts | 6 +++--- 7 files changed, 34 insertions(+), 17 deletions(-) diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/DependencyNotations.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/DependencyNotations.kt index df088383b..f82df6773 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/DependencyNotations.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/DependencyNotations.kt @@ -1,6 +1,7 @@ package de.fayard.refreshVersions.core.internal import org.gradle.api.Project +import org.gradle.api.artifacts.Dependency import org.gradle.api.artifacts.ExternalDependency @Suppress("EnumEntryName") @@ -80,6 +81,8 @@ data class Library( val module: String = "", val version: String = "" ) { + fun toDependency(): Dependency = UsedPluginsHolder.ConfigurationLessDependency(groupModuleVersion()) + val name: String get() = module fun groupModuleVersion() = "$group:$module:$version" fun groupModuleUnderscore() = "$group:$module:_" diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlLine.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlLine.kt index bf88c2bc1..76038de66 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlLine.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlLine.kt @@ -55,8 +55,12 @@ internal fun List.toText(): String internal fun TomlLine(section: TomlSection, key: String, value: String): TomlLine = TomlLine(section, """$key = "$value"""" ) -internal fun TomlLine(section: TomlSection, key: String, dependency: Dependency): TomlLine = - TomlLine(section, key, """${dependency.group}:${dependency.name}:${dependency.version}""") +internal fun TomlLine(section: TomlSection, key: String, dependency: Dependency): TomlLine = when { + dependency.version == "none" -> + TomlLine(section, key, mapOf("group" to (dependency.group ?: ""), "name" to dependency.name)) + else -> + TomlLine(section, key, """${dependency.group}:${dependency.name}:${dependency.version}""") +} internal fun TomlLine(section: TomlSection, key: String, map: Map): TomlLine { require((map.keys - validKeys).isEmpty()) { "Map $map has invalid keys. Valid: $validKeys"} diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt index b7939761b..92627a076 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt @@ -1,6 +1,7 @@ package de.fayard.refreshVersions.core.internal import de.fayard.refreshVersions.core.ModuleId +import de.fayard.refreshVersions.core.internal.UsedPluginsHolder.ConfigurationLessDependency import org.gradle.api.artifacts.Dependency import org.gradle.api.artifacts.MinimalExternalModuleDependency import org.gradle.api.artifacts.VersionCatalog @@ -135,8 +136,13 @@ object VersionCatalogs { TomlLine(TomlSection.Libraries, deps.names[lib]!!, refVersion) } else { val versionKey = getVersionPropertyName(ModuleId.Maven(lib.group, lib.name), versionKeyReader) - val version = versionsMap[versionKey] ?: "_" - val value = lib.groupModule() + ":" + if (withVersions) version else "_" + val version = when { + lib.version == "none" -> "none" + withVersions.not() -> "_" + versionKey in versionsMap -> versionsMap[versionKey]!! + else -> "_" + } + val value = lib.copy(version = version).toDependency() TomlLine(TomlSection.Libraries, deps.names[lib]!!, value) } diff --git a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlLineTest.kt b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlLineTest.kt index 8043759f7..d0aed41b6 100644 --- a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlLineTest.kt +++ b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlLineTest.kt @@ -37,7 +37,7 @@ class TomlLineTest : FunSpec({ my-other-lib = { module = "com.mycompany:other", version = "1.4" } my-other-lib2 = { group = "com.mycompany", name = "alternate", version = "1.4" } - ## + ## """.trimIndent().lines() val expectedKinds: List = listOf( @@ -60,13 +60,13 @@ class TomlLineTest : FunSpec({ val lines = """ # some comment - + groovy = "3.0.5" ## available: "1.5" ## available: "1.6" - + checkstyle = "8.37" - common = "3.4" + common = "3.4" """.trimIndent().lines() val expectedKinds: List = listOf( @@ -87,10 +87,10 @@ class TomlLineTest : FunSpec({ val lines = """ short-notation = "some.plugin.id:1.4" ## # available:"1.5" - + # yet another comment long-notation = { id = "some.plugin.id", version = "1.4" } - reference-notation = { id = "some.plugin.id", version.ref = "common" } + reference-notation = { id = "some.plugin.id", version.ref = "common" } """.trimIndent().lines() val expectedKinds: List = listOf( @@ -148,7 +148,7 @@ class TomlLineTest : FunSpec({ val lines = """ # yet another comment ## # available:"1.5" - + short-notation = "some.plugin.id:1.4" long-notation = { id = "some.plugin.id", version = "1.4" } reference-notation = { id = "some.plugin.id", version.ref = "common" } @@ -193,6 +193,10 @@ class TomlLineTest : FunSpec({ val d = ConfigurationLessDependency("com.example:name:1.0") TomlLine(TomlSection.Libraries, "my-lib", d) .text shouldBe """my-lib = "com.example:name:1.0"""" + + val noVersion = ConfigurationLessDependency("com.example:name:none") + TomlLine(TomlSection.Libraries, "my-lib", noVersion) + .text shouldBe """my-lib = { group = "com.example", name = "name" }""" } } }) diff --git a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt index 8704a010c..bceac005a 100644 --- a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt +++ b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt @@ -79,7 +79,7 @@ open class RefreshVersionsCatalogTask : DefaultTask() { println(""" You can now automatically migrate your build.gradle/build.gradle.kts file with the command: - + $ANSI_GREEN./gradlew refreshVersionsMigrate$ANSI_RESET """.trimIndent()) } diff --git a/sample-kotlin/gradle/libs.versions.toml b/sample-kotlin/gradle/libs.versions.toml index 40a773f17..646e876db 100644 --- a/sample-kotlin/gradle/libs.versions.toml +++ b/sample-kotlin/gradle/libs.versions.toml @@ -58,6 +58,6 @@ mongo-java-driver = "org.mongodb:mongo-java-driver:3.11.0" log4j-bom = "org.apache.logging.log4j:log4j-bom:2.17.2" -log4j-jul = { module = "org.apache.logging.log4j:log4j-jul" } +log4j-jul = { group = "org.apache.logging.log4j", name = "log4j-jul" } -log4j-slf4j-impl = { module = "org.apache.logging.log4j:log4j-slf4j-impl" } +log4j-slf4j-impl = { group = "org.apache.logging.log4j", name = "log4j-slf4j-impl" } diff --git a/sample-kotlin/sample-kotlin.gradle.kts b/sample-kotlin/sample-kotlin.gradle.kts index 8285c761f..f1dfd0cf3 100644 --- a/sample-kotlin/sample-kotlin.gradle.kts +++ b/sample-kotlin/sample-kotlin.gradle.kts @@ -48,9 +48,9 @@ dependencies { api("org.apache.poi:poi-ooxml:_") // logging - implementation(libs.log4j.bom) - runtimeOnly(libs.log4j.slf4j.impl) - runtimeOnly(libs.log4j.jul) + implementation("org.apache.logging.log4j:log4j-bom:2.17.2") + runtimeOnly("org.apache.logging.log4j:log4j-slf4j-impl") + runtimeOnly("org.apache.logging.log4j:log4j-jul") } getKotlinPluginVersion().let { From 20643fe8c3ccb8e1ac0256e76799e821279fe58b Mon Sep 17 00:00:00 2001 From: Jean-Michel Fayard Date: Thu, 28 Apr 2022 17:42:15 +0200 Subject: [PATCH 036/103] test: fix tests --- .../de/fayard/refreshVersions/RefreshVersionsMigrateTask.kt | 2 +- .../src/test/kotlin/de/fayard/refreshVersions/MigrationTest.kt | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsMigrateTask.kt b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsMigrateTask.kt index 0c979b814..b82eab59e 100644 --- a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsMigrateTask.kt +++ b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsMigrateTask.kt @@ -120,7 +120,7 @@ internal fun withVersionPlaceholder( if (coordinate in dependencyMapping) { line.replace(mavenCoordinateRegex, dependencyMapping[coordinate]!!) } else { - line.replace(mavenCoordinateRegex, "\$1_\$2") + line.replace(mavenCoordinateRegex, "\$1:_\$2") } } else -> null diff --git a/plugins/dependencies/src/test/kotlin/de/fayard/refreshVersions/MigrationTest.kt b/plugins/dependencies/src/test/kotlin/de/fayard/refreshVersions/MigrationTest.kt index 160fed50a..f042e1cef 100644 --- a/plugins/dependencies/src/test/kotlin/de/fayard/refreshVersions/MigrationTest.kt +++ b/plugins/dependencies/src/test/kotlin/de/fayard/refreshVersions/MigrationTest.kt @@ -21,7 +21,6 @@ class MigrationTest : StringSpec({ "Replace versions in maven coordinates in build files" { val input = """ - implementation("com.example:name:_") implementation("com.example:name:_") implementation("com.example:name:${'$'}exampleVersion") implementation("com.example:name:${'$'}version") From 8d8521b04694cbdb060fe24e0ee71440c56c1835 Mon Sep 17 00:00:00 2001 From: Jean-Michel Fayard Date: Thu, 28 Apr 2022 17:48:46 +0200 Subject: [PATCH 037/103] ci: fix bom --- sample-kotlin/sample-kotlin.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sample-kotlin/sample-kotlin.gradle.kts b/sample-kotlin/sample-kotlin.gradle.kts index f1dfd0cf3..2df109e84 100644 --- a/sample-kotlin/sample-kotlin.gradle.kts +++ b/sample-kotlin/sample-kotlin.gradle.kts @@ -48,7 +48,7 @@ dependencies { api("org.apache.poi:poi-ooxml:_") // logging - implementation("org.apache.logging.log4j:log4j-bom:2.17.2") + implementation(platform("org.apache.logging.log4j:log4j-bom:2.17.2")) runtimeOnly("org.apache.logging.log4j:log4j-slf4j-impl") runtimeOnly("org.apache.logging.log4j:log4j-jul") } From da344528507e22eeed76a8964304c46e3401bc2a Mon Sep 17 00:00:00 2001 From: Louis CAD Date: Sat, 25 Jun 2022 01:20:28 +0200 Subject: [PATCH 038/103] Line endings fix? --- plugins/gradlew.bat | 178 +++++++++--------- .../gradle/wrapper/gradle-wrapper.jar | Bin 55616 -> 55615 bytes sample-groovy/gradlew.bat | 178 +++++++++--------- sample-multi-modules/gradlew.bat | 178 +++++++++--------- 4 files changed, 267 insertions(+), 267 deletions(-) diff --git a/plugins/gradlew.bat b/plugins/gradlew.bat index ac1b06f93..107acd32c 100644 --- a/plugins/gradlew.bat +++ b/plugins/gradlew.bat @@ -1,89 +1,89 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/sample-android/gradle/wrapper/gradle-wrapper.jar b/sample-android/gradle/wrapper/gradle-wrapper.jar index 5c2d1cf016b3885f6930543d57b744ea8c220a1a..27325a3bf7c666a651a1497f35739b300f689a25 100644 GIT binary patch delta 14 WcmX@GiFyAf<_&NBHox@??g9Wh6$hUH delta 16 YcmdnLiTS`L<_&NB7NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/sample-multi-modules/gradlew.bat b/sample-multi-modules/gradlew.bat index ac1b06f93..107acd32c 100644 --- a/sample-multi-modules/gradlew.bat +++ b/sample-multi-modules/gradlew.bat @@ -1,89 +1,89 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega From 400f5356e1e090554b824e295d54b2966899dd1d Mon Sep 17 00:00:00 2001 From: Louis CAD Date: Sat, 25 Jun 2022 02:24:34 +0200 Subject: [PATCH 039/103] Replace deprecated usages --- .../fayard/refreshVersions/core/internal/VersionCatalogs.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt index 29d964327..b87d96ee1 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt @@ -18,8 +18,8 @@ object VersionCatalogs { fun dependencyAliases(versionCatalog: VersionCatalog?): Map { versionCatalog ?: return emptyMap() - return versionCatalog.dependencyAliases.mapNotNull { alias -> - versionCatalog.findDependency(alias) + return versionCatalog.libraryAliases.mapNotNull { alias -> + versionCatalog.findLibrary(alias) .orElse(null) ?.orNull ?.let { dependency: MinimalExternalModuleDependency -> From 2f32488847ba959a7854f09e6d6fcd4e3585ade4 Mon Sep 17 00:00:00 2001 From: Louis CAD Date: Sat, 25 Jun 2022 17:09:46 +0200 Subject: [PATCH 040/103] Rename NEEDS_GRADLE_VERSION to minimumGradleVersion --- .../fayard/refreshVersions/core/internal/VersionCatalogs.kt | 5 ++--- .../de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt index b87d96ee1..8c7f82028 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt @@ -11,10 +11,9 @@ object VersionCatalogs { const val LIBS_VERSIONS_TOML = "gradle/libs.versions.toml" - val NEEDS_GRADLE_VERSION: GradleVersion = GradleVersion.version("7.4") + val minimumGradleVersion: GradleVersion = GradleVersion.version("7.4") - fun isSupported(): Boolean = - GradleVersion.current() >= NEEDS_GRADLE_VERSION + fun isSupported(): Boolean = GradleVersion.current() >= minimumGradleVersion fun dependencyAliases(versionCatalog: VersionCatalog?): Map { versionCatalog ?: return emptyMap() diff --git a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt index b0d9a090b..ea9ccfcb0 100644 --- a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt +++ b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt @@ -40,7 +40,7 @@ open class RefreshVersionsCatalogTask : DefaultTask() { """ |Gradle versions catalogs are not supported in ${GradleVersion.current()} |Upgrade Gradle with this command - | ./gradlew wrapper --gradle-version ${VersionCatalogs.NEEDS_GRADLE_VERSION.version} + | ./gradlew wrapper --gradle-version ${VersionCatalogs.minimumGradleVersion.version} """.trimMargin() ) } From 839345ac7855942dd9315a358dec0b286ef316c7 Mon Sep 17 00:00:00 2001 From: Louis CAD Date: Sat, 25 Jun 2022 17:49:56 +0200 Subject: [PATCH 041/103] De-duplicate the ConfigurationLessDependency class --- .../fayard/refreshVersions/core/Versions.kt | 2 +- .../internal/ConfigurationLessDependency.kt | 41 +++++++++++++++++++ .../core/internal/DependencyNotations.kt | 2 +- .../core/internal/NewRefreshVersionsImpl.kt | 3 +- .../core/internal/UsedPluginsTracker.kt | 19 --------- .../core/internal/UsedVersionForTracker.kt | 30 +++----------- .../refreshVersions/core/TomlLineTest.kt | 2 +- 7 files changed, 50 insertions(+), 49 deletions(-) create mode 100644 plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/ConfigurationLessDependency.kt diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/Versions.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/Versions.kt index 588ff5177..78c92668d 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/Versions.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/Versions.kt @@ -46,7 +46,7 @@ private fun retrieveVersionFor( ).also { version -> UsedVersionForTracker.noteUsedDependencyNotation( project = project, - dependencyNotation = it, + moduleId = moduleId, version = version ) } diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/ConfigurationLessDependency.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/ConfigurationLessDependency.kt new file mode 100644 index 000000000..0f7610801 --- /dev/null +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/ConfigurationLessDependency.kt @@ -0,0 +1,41 @@ +package de.fayard.refreshVersions.core.internal + +import de.fayard.refreshVersions.core.ModuleId +import org.gradle.api.artifacts.Dependency +import org.gradle.api.internal.artifacts.dependencies.AbstractDependency + +internal class ConfigurationLessDependency private constructor( + private val group: String, + private val name: String, + private val version: String +) : AbstractDependency() { + + constructor( + moduleId: ModuleId.Maven, + version: String + ) : this( + group = moduleId.group, + name = moduleId.name, + version = version + ) + + constructor(dependencyNotationWithVersion: String) : this( + group = dependencyNotationWithVersion.substringBefore(':'), + name = dependencyNotationWithVersion.substringAfter(':').substringBefore(':'), + version = dependencyNotationWithVersion.substringAfterLast(':') + ) + + override fun getGroup() = group + override fun getName() = name + override fun getVersion(): String = version + + override fun contentEquals(dependency: Dependency): Boolean = throw UnsupportedOperationException() + + override fun copy(): Dependency = ConfigurationLessDependency( + group = group, + name = name, + version = version + ) + + override fun toString() = "$group:$name:$version" +} diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/DependencyNotations.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/DependencyNotations.kt index eefee9cc9..a758a22a9 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/DependencyNotations.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/DependencyNotations.kt @@ -81,7 +81,7 @@ data class Library( val module: String = "", val version: String = "" ) { - fun toDependency(): Dependency = UsedPluginsTracker.ConfigurationLessDependency(groupModuleVersion()) + fun toDependency(): Dependency = ConfigurationLessDependency(groupModuleVersion()) val name: String get() = module fun groupModuleVersion() = "$group:$module:$version" diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/NewRefreshVersionsImpl.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/NewRefreshVersionsImpl.kt index 2ed76f20a..857b239d7 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/NewRefreshVersionsImpl.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/NewRefreshVersionsImpl.kt @@ -114,8 +114,7 @@ internal suspend fun lookupVersionCandidates( } } -private fun ModuleId.toDependency() = - UsedPluginsTracker.ConfigurationLessDependency("$group:$name:_") +private fun ModuleId.Maven.toDependency() = ConfigurationLessDependency(moduleId = this, version = "_") private suspend fun lookupAvailableGradleVersions(httpClient: OkHttpClient): List = coroutineScope { val checker = GradleUpdateChecker(httpClient) diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/UsedPluginsTracker.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/UsedPluginsTracker.kt index 426d97531..f5e63affa 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/UsedPluginsTracker.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/UsedPluginsTracker.kt @@ -5,7 +5,6 @@ import org.gradle.api.artifacts.ArtifactRepositoryContainer import org.gradle.api.artifacts.Dependency import org.gradle.api.artifacts.ExternalDependency import org.gradle.api.initialization.Settings -import org.gradle.api.internal.artifacts.dependencies.AbstractDependency @InternalRefreshVersionsApi object UsedPluginsTracker { @@ -76,22 +75,4 @@ object UsedPluginsTracker { val usedPluginDependencies = mutableListOf() val usedPluginsWithoutEntryInVersionsFile = mutableListOf() } - - internal class ConfigurationLessDependency(val dependencyNotation: String) : AbstractDependency() { - - override fun getGroup() = group - override fun getName() = name - override fun getVersion(): String? = version - - override fun contentEquals(dependency: Dependency): Boolean = throw UnsupportedOperationException() - override fun copy(): Dependency = ConfigurationLessDependency(dependencyNotation) - - private val group = dependencyNotation.substringBefore(':').unwrappedNullableValue() - private val name = dependencyNotation.substringAfter(':').substringBefore(':') - private val version = dependencyNotation.substringAfterLast(':').unwrappedNullableValue() - - private fun String.unwrappedNullableValue(): String? = if (this == "null") null else this - - override fun toString() = "$group:$name:$version" - } } diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/UsedVersionForTracker.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/UsedVersionForTracker.kt index 4246ca4d2..645fc1a46 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/UsedVersionForTracker.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/UsedVersionForTracker.kt @@ -1,11 +1,11 @@ package de.fayard.refreshVersions.core.internal +import de.fayard.refreshVersions.core.ModuleId import de.fayard.refreshVersions.core.extensions.gradle.isBuildSrc import org.gradle.api.Project import org.gradle.api.artifacts.ArtifactRepositoryContainer import org.gradle.api.artifacts.Dependency import org.gradle.api.initialization.Settings -import org.gradle.api.internal.artifacts.dependencies.AbstractDependency internal object UsedVersionForTracker { @@ -15,12 +15,12 @@ internal object UsedVersionForTracker { fun noteUsedDependencyNotation( project: Project, - dependencyNotation: String, + moduleId: ModuleId.Maven, version: String ) { editHolder(project) { holder -> holder.usedInVersionsFor += VersionForUsage( - dependencyNotation = dependencyNotation, + moduleId = moduleId, version = version, repositories = project.repositories ) @@ -36,7 +36,7 @@ internal object UsedVersionForTracker { fun read(): Sequence> { return usedInVersionsFor.asSequence().map { ConfigurationLessDependency( - it.dependencyNotation, + it.moduleId, it.version ) to it.repositories } @@ -72,7 +72,7 @@ internal object UsedVersionForTracker { private var buildSrcHolder: Holder? = null private data class VersionForUsage( - val dependencyNotation: String, + val moduleId: ModuleId.Maven, val version: String, val repositories: ArtifactRepositoryContainer ) @@ -81,24 +81,4 @@ internal object UsedVersionForTracker { val usedInVersionsFor = mutableListOf() val usedVersionKeys = mutableListOf() } - - private class ConfigurationLessDependency( - val dependencyNotation: String, - private val version: String - ) : AbstractDependency() { - - override fun getGroup() = group - override fun getName() = name - override fun getVersion(): String = version - - override fun contentEquals(dependency: Dependency): Boolean = throw UnsupportedOperationException() - override fun copy(): Dependency = ConfigurationLessDependency(dependencyNotation, version) - - private val group = dependencyNotation.substringBefore(':').unwrappedNullableValue() - private val name = dependencyNotation.substringAfter(':').substringBefore(':') - - private fun String.unwrappedNullableValue(): String? = if (this == "null") null else this - - override fun toString() = "$group:$name:$version" - } } diff --git a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlLineTest.kt b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlLineTest.kt index 589c3dfac..9b34f9831 100644 --- a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlLineTest.kt +++ b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlLineTest.kt @@ -1,5 +1,6 @@ package de.fayard.refreshVersions.core +import de.fayard.refreshVersions.core.internal.ConfigurationLessDependency import de.fayard.refreshVersions.core.internal.TomlLine import de.fayard.refreshVersions.core.internal.TomlLine.Kind.Delete import de.fayard.refreshVersions.core.internal.TomlLine.Kind.Ignore @@ -10,7 +11,6 @@ import de.fayard.refreshVersions.core.internal.TomlLine.Kind.Plugin import de.fayard.refreshVersions.core.internal.TomlLine.Kind.PluginVersionRef import de.fayard.refreshVersions.core.internal.TomlLine.Kind.Version import de.fayard.refreshVersions.core.internal.TomlSection -import de.fayard.refreshVersions.core.internal.UsedPluginsTracker.ConfigurationLessDependency import io.kotest.assertions.assertSoftly import io.kotest.core.spec.style.FunSpec import io.kotest.inspectors.forAll From 4c4ac4f7099bcf3719b4a42799eb6485efb7b6ea Mon Sep 17 00:00:00 2001 From: Louis CAD Date: Sat, 25 Jun 2022 17:58:31 +0200 Subject: [PATCH 042/103] Simplify char test and remove warning --- .../refreshVersions/core/internal/DependencyNotations.kt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/DependencyNotations.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/DependencyNotations.kt index a758a22a9..ecc63c316 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/DependencyNotations.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/DependencyNotations.kt @@ -12,13 +12,9 @@ enum class Case( snake_case({ it }), `kebab-case`({ it.map { c-> - if (c in separators) '-' else c + if (c in ".-_") '-' else c }.joinToString(separator = "") }); - - companion object { - val separators = setOf('.', '-', '_') - } } /** From d98ba10ab58ac1da66074188dc885d4887f923dc Mon Sep 17 00:00:00 2001 From: Louis CAD Date: Sun, 26 Jun 2022 02:54:30 +0200 Subject: [PATCH 043/103] Simplify TomlSectionTest --- .../core/internal/VersionCatalogs.kt | 4 +- .../refreshVersions/core/TomlSectionTest.kt | 42 ++++++------------- 2 files changed, 15 insertions(+), 31 deletions(-) diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt index 8c7f82028..7fd92e9d5 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt @@ -28,7 +28,7 @@ object VersionCatalogs { } internal fun parseToml(toml: String): Toml { - val map = parseTomlInSection(toml) + val map = parseTomlInSections(toml) .map { (sectionName, paragraph) -> val section = TomlSection.from(sectionName) section to paragraph.lines().map { TomlLine(section, it) } @@ -36,7 +36,7 @@ object VersionCatalogs { return Toml(map.toMutableMap()) } - fun parseTomlInSection(toml: String): Map { + fun parseTomlInSections(toml: String): Map { val result = mutableMapOf() result["root"] = StringBuilder() var current: StringBuilder = result["root"]!! diff --git a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlSectionTest.kt b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlSectionTest.kt index ad1746964..678e9295a 100644 --- a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlSectionTest.kt +++ b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlSectionTest.kt @@ -1,12 +1,12 @@ package de.fayard.refreshVersions.core import de.fayard.refreshVersions.core.internal.VersionCatalogs -import io.kotest.core.spec.style.StringSpec import io.kotest.matchers.shouldBe +import kotlin.test.Test -class TomlSectionTest : StringSpec({ +class TomlSectionTest { - val toml = """ + private val toml = """ ## This is a great comment [versions] @@ -26,32 +26,16 @@ class TomlSectionTest : StringSpec({ testDependencies = ["junit-jupiter", "junit-engine"] """.trimIndent() - val (a, b, c, d) = """ - ## This is a great comment + @Test + fun `Parse Toml in Sections`() { - --- - groovy = "2.5.14" - guava = "30.0-jre" - jupiter = "5.7.1" + val (a, b, c, d) = toml.split( + "[versions]\n", + "[libraries]\n", + "[bundles]\n" + ) - --- - guava = { module="com.google.guava:guava", version.ref="guava" } - junit-jupiter = { module="org.junit.jupiter:junit-jupiter-api", version.ref="jupiter" } - junit-engine = { module="org.junit.jupiter:junit-jupiter-engine" } - - groovy-core = { module="org.codehaus.groovy:groovy", version.ref="groovy" } - groovy-json = { module="org.codehaus.groovy:groovy-json", version.ref="groovy" } - - --- - testDependencies = ["junit-jupiter", "junit-engine"] - """.trimIndent().split("---\n") - val expected = mapOf("root" to a, "versions" to b, "libraries" to c, "bundles" to d) - - "Parse Toml in Sections" { - VersionCatalogs.parseTomlInSection(toml) shouldBe expected + val expected = mapOf("root" to a, "versions" to b, "libraries" to c, "bundles" to d) + VersionCatalogs.parseTomlInSections(toml) shouldBe expected } - -}) - - - +} From 7eb0e1eb60fcb4509a34af78722f93a0cb64e4db Mon Sep 17 00:00:00 2001 From: Louis CAD Date: Sun, 26 Jun 2022 03:06:50 +0200 Subject: [PATCH 044/103] Reformat TomlLine.kt --- .../refreshVersions/core/internal/TomlLine.kt | 85 ++++++++++++------- 1 file changed, 52 insertions(+), 33 deletions(-) diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlLine.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlLine.kt index 76038de66..3a6891fe9 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlLine.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlLine.kt @@ -27,20 +27,17 @@ internal data class TomlLine( val map: Map = parseTomlMap(kind).withDefault { "" } - val versionRef get() = map["version.ref"] + val versionRef get() = map["version.ref"] val module get() = "$group:$name" - val version: String get() = - if (section == Versions) value else map["version"] ?: "" + val version: String get() = if (section == Versions) value else map["version"] ?: "" - val group: String get() = - if (section == Plugins) id else map["group"]!! + val group: String get() = if (section == Plugins) id else map["group"]!! - val name: String get() = - if (section == Plugins) "$id.gradle.plugin" else map["name"]!! + val name: String get() = if (section == Plugins) "$id.gradle.plugin" else map["name"]!! - val id: String by map + val id: String by map override fun toString(): String = "TomlLine(section=$section, kind=$kind, key=$key, value=$value, map=$map)\n$text" @@ -49,21 +46,37 @@ internal data class TomlLine( } } -internal fun List.toText(): String - = joinToString("\n", postfix = "\n", prefix = "\n") { it.text } - -internal fun TomlLine(section: TomlSection, key: String, value: String): TomlLine = - TomlLine(section, """$key = "$value"""" ) - -internal fun TomlLine(section: TomlSection, key: String, dependency: Dependency): TomlLine = when { - dependency.version == "none" -> - TomlLine(section, key, mapOf("group" to (dependency.group ?: ""), "name" to dependency.name)) - else -> - TomlLine(section, key, """${dependency.group}:${dependency.name}:${dependency.version}""") +internal fun List.toText(): String = joinToString("\n", postfix = "\n", prefix = "\n") { it.text } + +internal fun TomlLine( + section: TomlSection, + key: String, + value: String +): TomlLine = TomlLine(section, """$key = "$value"""") + +internal fun TomlLine( + section: TomlSection, + key: String, + dependency: Dependency +): TomlLine = when (dependency.version) { + "none" -> TomlLine( + section = section, + key = key, + map = mapOf("group" to (dependency.group ?: ""), "name" to dependency.name) + ) + else -> TomlLine( + section = section, + key = key, + value = """${dependency.group}:${dependency.name}:${dependency.version}""" + ) } -internal fun TomlLine(section: TomlSection, key: String, map: Map): TomlLine { - require((map.keys - validKeys).isEmpty()) { "Map $map has invalid keys. Valid: $validKeys"} +internal fun TomlLine( + section: TomlSection, + key: String, + map: Map +): TomlLine { + require((map.keys - validKeys).isEmpty()) { "Map $map has invalid keys. Valid: $validKeys" } val formatMap = map.entries .joinToString(", ") { (key, value) -> """$key = "$value"""" } return TomlLine(section, "$key = { $formatMap }") @@ -75,7 +88,7 @@ private fun TomlLine.parseTomlMap(kind: TomlLine.Kind): Map { val splitSemicolon = value.split(":") val map: MutableMap = when { - unparsedValue.startsWith("{").not() -> mutableMapOf() + unparsedValue.startsWith('{').not() -> mutableMapOf() else -> unparsedValue .removePrefix("{").removeSuffix("}") .split(",") @@ -85,7 +98,7 @@ private fun TomlLine.parseTomlMap(kind: TomlLine.Kind): Map { }.toMutableMap() } - return when(kind) { + return when (kind) { Ignore -> emptyMap() Delete -> emptyMap() LibsUnderscore -> emptyMap() @@ -115,9 +128,17 @@ private fun TomlLine.parseTomlMap(kind: TomlLine.Kind): Map { } } -private fun lineMap(group: String, name: String, version: String?, versionRef: String?) = - listOfNotNull("group" to group, "name" to name, version?.let { "version" to it }, versionRef?.let { "version.ref" to it }) - .toMap() +private fun lineMap( + group: String, + name: String, + version: String?, + versionRef: String? +) = listOfNotNull( + "group" to group, + "name" to name, + version?.let { "version" to it }, + versionRef?.let { "version.ref" to it } +).toMap() private fun TomlLine.guessTomlLineKind(): TomlLine.Kind { if (text.startsWith("##")) return Delete @@ -132,13 +153,11 @@ private fun TomlLine.guessTomlLineKind(): TomlLine.Kind { hasKey -> Version else -> Ignore } - Libraries -> { - when { - hasKey.not() -> Ignore - textWithoutComment.endsWith(":_\"") -> LibsUnderscore - hasVersionRef -> LibsVersionRef - else -> Libs - } + Libraries -> when { + hasKey.not() -> Ignore + textWithoutComment.endsWith(":_\"") -> LibsUnderscore + hasVersionRef -> LibsVersionRef + else -> Libs } Plugins -> when { hasKey.not() -> Ignore From f2710cb1c3151aad925187467b17dfd00ba853b4 Mon Sep 17 00:00:00 2001 From: Louis CAD Date: Wed, 6 Jul 2022 18:38:12 +0200 Subject: [PATCH 045/103] Reformat some code --- .../refreshVersions/core/internal/Toml.kt | 13 +++--- .../refreshVersions/core/internal/TomlLine.kt | 26 ++++++------ .../core/internal/TomlSection.kt | 7 +--- .../core/internal/TomlUpdater.kt | 41 ++++++++++--------- .../RefreshVersionsCatalogTask.kt | 8 ++-- 5 files changed, 45 insertions(+), 50 deletions(-) diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/Toml.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/Toml.kt index ef781dc80..eca2958e7 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/Toml.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/Toml.kt @@ -10,7 +10,10 @@ internal data class Toml( sections[section] = lines } - fun merge(section: TomlSection, newLines: List) { + fun merge( + section: TomlSection, + newLines: List + ) { val existingKeys = get(section).map { it.key }.toSet() - "" val filteredLines = newLines.filterNot { it.key in existingKeys } val updateExistingLines = get(section).map { line -> @@ -19,8 +22,7 @@ internal data class Toml( sections[section] = updateExistingLines + filteredLines } - internal operator fun get(section: TomlSection): List = - sections.get(section) ?: emptyList() + internal operator fun get(section: TomlSection): List = sections[section] ?: emptyList() private fun format(): String = buildString { initializeRoot() @@ -43,10 +45,7 @@ internal data class Toml( } } - private fun sortedSections() = - (TomlSection.sectionOrder + sections.keys).toSet() - - + private fun sortedSections() = (TomlSection.orderedSections + sections.keys).toSet() private fun initializeRoot() { if (get(TomlSection.Root).none { it.text.isNotBlank() }) { diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlLine.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlLine.kt index 3a6891fe9..5f613e2a3 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlLine.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlLine.kt @@ -1,7 +1,6 @@ package de.fayard.refreshVersions.core.internal import de.fayard.refreshVersions.core.internal.TomlLine.Kind.* -import de.fayard.refreshVersions.core.internal.TomlSection.* import org.gradle.api.artifacts.Dependency internal data class TomlLine( @@ -18,10 +17,9 @@ internal data class TomlLine( val unparsedValue: String = if (hasKey.not()) "" else textWithoutComment.substringAfter("=").trim() - private val quote = "\"" - fun String.unquote() = trim().removePrefix(quote).removeSuffix(quote) + fun String.unquote() = trim().removeSurrounding("\"") - val value = if (unparsedValue.startsWith(quote)) unparsedValue.unquote() else "" + val value = if (unparsedValue.startsWith('"')) unparsedValue.unquote() else "" val kind: Kind = this.guessTomlLineKind() @@ -31,11 +29,11 @@ internal data class TomlLine( val module get() = "$group:$name" - val version: String get() = if (section == Versions) value else map["version"] ?: "" + val version: String get() = if (section == TomlSection.Versions) value else map["version"] ?: "" - val group: String get() = if (section == Plugins) id else map["group"]!! + val group: String get() = if (section == TomlSection.Plugins) id else map["group"]!! - val name: String get() = if (section == Plugins) "$id.gradle.plugin" else map["name"]!! + val name: String get() = if (section == TomlSection.Plugins) "$id.gradle.plugin" else map["name"]!! val id: String by map @@ -90,7 +88,7 @@ private fun TomlLine.parseTomlMap(kind: TomlLine.Kind): Map { val map: MutableMap = when { unparsedValue.startsWith('{').not() -> mutableMapOf() else -> unparsedValue - .removePrefix("{").removeSuffix("}") + .removeSurrounding("{", "}") .split(",") .associate { entry -> val (key, value) = entry.split("=") @@ -146,20 +144,20 @@ private fun TomlLine.guessTomlLineKind(): TomlLine.Kind { val hasVersionRef = textWithoutComment.contains("version.ref") return when (section) { - is Custom -> Ignore - Root -> Ignore - Bundles -> Ignore - Versions -> when { + is TomlSection.Custom -> Ignore + TomlSection.Root -> Ignore + TomlSection.Bundles -> Ignore + TomlSection.Versions -> when { hasKey -> Version else -> Ignore } - Libraries -> when { + TomlSection.Libraries -> when { hasKey.not() -> Ignore textWithoutComment.endsWith(":_\"") -> LibsUnderscore hasVersionRef -> LibsVersionRef else -> Libs } - Plugins -> when { + TomlSection.Plugins -> when { hasKey.not() -> Ignore hasVersionRef -> PluginVersionRef else -> Plugin diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlSection.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlSection.kt index 99ae8fdb9..985e12ccc 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlSection.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlSection.kt @@ -14,9 +14,6 @@ internal sealed class TomlSection(val name: String) { companion object { val sectionOrder = listOf(Root, Bundles, Plugins, Versions, Libraries) - fun from(name: String): TomlSection = - sectionOrder - .firstOrNull { it.name == name } - ?: Custom(name) + fun from(name: String): TomlSection = orderedSections.firstOrNull { it.name == name } ?: Custom(name) } -} \ No newline at end of file +} diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlUpdater.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlUpdater.kt index 8b1fd08c5..482845777 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlUpdater.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlUpdater.kt @@ -25,21 +25,19 @@ internal class TomlUpdater(val fileContent: String, val dependenciesUpdates: Lis actual.writeText(toml.toString()) } - private fun updateNewVersions(lines: List): List { - return lines.flatMap { line -> - val noop = listOf(line) - when (line.kind) { - Ignore, LibsUnderscore, LibsVersionRef, PluginVersionRef -> noop - Delete -> emptyList() - Version -> { - linesForUpdate(line, findLineReferencing(line)) - } - Libs, Plugin -> { - val update = dependenciesUpdates.firstOrNull { dc -> - dc.moduleId.name == line.name && dc.moduleId.group == line.group - } - linesForUpdate(line, update) + private fun updateNewVersions(lines: List): List = lines.flatMap { line -> + val noop = listOf(line) + when (line.kind) { + Ignore, LibsUnderscore, LibsVersionRef, PluginVersionRef -> noop + Delete -> emptyList() + Version -> { + linesForUpdate(line, findLineReferencing(line)) + } + Libs, Plugin -> { + val update = dependenciesUpdates.firstOrNull { dc -> + dc.moduleId.name == line.name && dc.moduleId.group == line.group } + linesForUpdate(line, update) } } } @@ -54,7 +52,10 @@ internal class TomlUpdater(val fileContent: String, val dependenciesUpdates: Lis } } - private fun linesForUpdate(line: TomlLine, update: DependencyWithVersionCandidates?): List { + private fun linesForUpdate( + line: TomlLine, + update: DependencyWithVersionCandidates? + ): List { val result = mutableListOf(line) val versions = update?.versionsCandidates ?: return result val version = line.version @@ -67,9 +68,8 @@ internal class TomlUpdater(val fileContent: String, val dependenciesUpdates: Lis else -> """:${v.value}"""" } - val nbSpaces = line.text.indexOf(version ?: "oops") - - if (isObject) 17 else 14 - val space = List(Math.max(0, nbSpaces)) { " " }.joinToString("") + val nbSpaces = line.text.indexOf(version) - if (isObject) 17 else 14 + val space = List(nbSpaces.coerceAtLeast(0)) { " " }.joinToString("") versions.mapTo(result) { v: MavenVersion -> TomlLine(line.section, "##${space}# available${suffix(v)}") @@ -79,7 +79,10 @@ internal class TomlUpdater(val fileContent: String, val dependenciesUpdates: Lis } -internal fun TomlUpdater(file: File, dependenciesUpdates: List): TomlUpdater { +internal fun TomlUpdater( + file: File, + dependenciesUpdates: List +): TomlUpdater { val text: String = if (file.canRead()) file.readText() else "" return TomlUpdater(text, dependenciesUpdates) } diff --git a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt index ea9ccfcb0..11bdbfc21 100644 --- a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt +++ b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt @@ -56,10 +56,9 @@ open class RefreshVersionsCatalogTask : DefaultTask() { val allDependencies: List = project.findDependencies() - val dependenciesToUse = if (withAllLibraries) { - allDependencies - } else { - allDependencies.filter { it.copy(version = "_") !in builtInDependencies } + val dependenciesToUse = when { + withAllLibraries -> allDependencies + else -> allDependencies.filter { it.copy(version = "_") !in builtInDependencies } } val plugins = UsedPluginsTracker.usedPluginsWithoutEntryInVersionsFile + @@ -84,4 +83,3 @@ open class RefreshVersionsCatalogTask : DefaultTask() { """.trimIndent()) } } - From f09ef8b8a15e307f5cefc3150b9bc63d7591825c Mon Sep 17 00:00:00 2001 From: Louis CAD Date: Wed, 6 Jul 2022 18:40:12 +0200 Subject: [PATCH 046/103] Remove useless "this is what it is" comment --- .../de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt index 11bdbfc21..3d886df96 100644 --- a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt +++ b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt @@ -34,7 +34,6 @@ open class RefreshVersionsCatalogTask : DefaultTask() { @TaskAction fun refreshVersionsCatalogAction() { - // Check Gradle version if (VersionCatalogs.isSupported().not()) { throw GradleException( """ From 25298915bfca57b2a68767ebda25e99baa064a5a Mon Sep 17 00:00:00 2001 From: Louis CAD Date: Wed, 6 Jul 2022 18:40:45 +0200 Subject: [PATCH 047/103] Make TomlSection.Custom a data class --- .../de/fayard/refreshVersions/core/internal/TomlSection.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlSection.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlSection.kt index 985e12ccc..3d6e00924 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlSection.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlSection.kt @@ -1,6 +1,6 @@ package de.fayard.refreshVersions.core.internal -internal sealed class TomlSection(val name: String) { +internal sealed class TomlSection(open val name: String) { override fun toString() = name @@ -9,7 +9,7 @@ internal sealed class TomlSection(val name: String) { object Plugins: TomlSection("plugins") object Bundles: TomlSection("bundles") object Libraries: TomlSection("libraries") - class Custom(name: String) : TomlSection(name) + data class Custom(override val name: String) : TomlSection(name) companion object { val sectionOrder = listOf(Root, Bundles, Plugins, Versions, Libraries) From 55c06afaed7583b513e22069bf276f87ac8432e6 Mon Sep 17 00:00:00 2001 From: Louis CAD Date: Wed, 6 Jul 2022 18:41:52 +0200 Subject: [PATCH 048/103] Rename sectionOrder to orderedSections in TomlSection --- .../de/fayard/refreshVersions/core/internal/TomlSection.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlSection.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlSection.kt index 3d6e00924..be2563920 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlSection.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlSection.kt @@ -12,7 +12,7 @@ internal sealed class TomlSection(open val name: String) { data class Custom(override val name: String) : TomlSection(name) companion object { - val sectionOrder = listOf(Root, Bundles, Plugins, Versions, Libraries) + val orderedSections = listOf(Root, Bundles, Plugins, Versions, Libraries) fun from(name: String): TomlSection = orderedSections.firstOrNull { it.name == name } ?: Custom(name) } From 771a812f7b86f9a601ea68f653a0af24210e4563 Mon Sep 17 00:00:00 2001 From: Louis CAD Date: Wed, 6 Jul 2022 18:42:09 +0200 Subject: [PATCH 049/103] Make TomlUpdater properties private --- .../de/fayard/refreshVersions/core/internal/TomlUpdater.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlUpdater.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlUpdater.kt index 482845777..94dc1b94b 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlUpdater.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlUpdater.kt @@ -4,7 +4,11 @@ import de.fayard.refreshVersions.core.internal.TomlLine.Kind.* import java.io.File import de.fayard.refreshVersions.core.Version as MavenVersion -internal class TomlUpdater(val fileContent: String, val dependenciesUpdates: List) { +internal class TomlUpdater( + private val fileContent: String, + private val dependenciesUpdates: List +) { + private val toml = VersionCatalogs.parseToml(fileContent) fun updateNewVersions(actual: File) { From 3006467db55098bfb340c2c6c7eb0285aa497846 Mon Sep 17 00:00:00 2001 From: Louis CAD Date: Wed, 6 Jul 2022 18:54:38 +0200 Subject: [PATCH 050/103] Prepare support for version-less dependencies in versions catalog support --- .../internal/ConfigurationLessDependency.kt | 8 ++-- .../core/internal/DependencyNotations.kt | 38 ++++++++++--------- .../refreshVersions/core/internal/TomlLine.kt | 2 +- .../core/internal/VersionCatalogs.kt | 18 +++++---- 4 files changed, 35 insertions(+), 31 deletions(-) diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/ConfigurationLessDependency.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/ConfigurationLessDependency.kt index 0f7610801..9f98fc87f 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/ConfigurationLessDependency.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/ConfigurationLessDependency.kt @@ -4,10 +4,10 @@ import de.fayard.refreshVersions.core.ModuleId import org.gradle.api.artifacts.Dependency import org.gradle.api.internal.artifacts.dependencies.AbstractDependency -internal class ConfigurationLessDependency private constructor( +internal class ConfigurationLessDependency( private val group: String, private val name: String, - private val version: String + private val version: String? ) : AbstractDependency() { constructor( @@ -27,7 +27,7 @@ internal class ConfigurationLessDependency private constructor( override fun getGroup() = group override fun getName() = name - override fun getVersion(): String = version + override fun getVersion() = version override fun contentEquals(dependency: Dependency): Boolean = throw UnsupportedOperationException() @@ -37,5 +37,5 @@ internal class ConfigurationLessDependency private constructor( version = version ) - override fun toString() = "$group:$name:$version" + override fun toString(): String = if (version == null) "$group:$name" else "$group:$name:$version" } diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/DependencyNotations.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/DependencyNotations.kt index ecc63c316..2fc164bde 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/DependencyNotations.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/DependencyNotations.kt @@ -11,7 +11,7 @@ enum class Case( ) { snake_case({ it }), `kebab-case`({ - it.map { c-> + it.map { c -> if (c in ".-_") '-' else c }.joinToString(separator = "") }); @@ -34,7 +34,7 @@ fun List.computeAliases( configured: List, byDefault: List = MEANING_LESS_NAMES ): List { - val groups = (configured + byDefault).filter { it.contains(".") }.distinct() + val groups = (configured + byDefault).filter { it.contains(".") }.toSet() val depsFromGroups = filter { it.group in groups }.map { it.module } val ambiguities = groupBy { it.module }.filter { it.value.size > 1 }.map { it.key } return (configured + byDefault + ambiguities + depsFromGroups - groups).distinct().sorted() @@ -54,18 +54,17 @@ fun escapeLibsKt(name: String): String { fun Project.findDependencies(): List { val allDependencies = mutableListOf() allprojects { - (configurations + buildscript.configurations) - .flatMapTo(allDependencies) { configuration -> - configuration.allDependencies - .filterIsInstance() - .filter { - @Suppress("SENSELESS_COMPARISON") - it.group != null - } - .map { dependency -> - Library(dependency.group, dependency.name, dependency.version ?: "none") - } - } + (buildscript.configurations + configurations).flatMapTo(allDependencies) { configuration -> + configuration.allDependencies + .filterIsInstance() + .mapNotNull { dependency -> + Library( + group = dependency.group ?: return@mapNotNull null, + module = dependency.name, + version = dependency.version + ) + } + } } return allDependencies.distinctBy { d -> d.groupModule() } } @@ -75,12 +74,15 @@ fun Project.findDependencies(): List { data class Library( val group: String = "", val module: String = "", - val version: String = "" + val version: String? = null ) { - fun toDependency(): Dependency = ConfigurationLessDependency(groupModuleVersion()) + fun toDependency(): Dependency = ConfigurationLessDependency( + group = group, + name = name, + version = version + ) val name: String get() = module - fun groupModuleVersion() = "$group:$module:$version" fun groupModuleUnderscore() = "$group:$module:_" fun groupModule() = "$group:$module" @@ -96,7 +98,7 @@ data class Library( return case.convert(name_with_underscores) } - override fun toString() = groupModuleVersion() + override fun toString(): String = if (version == null) "$group:$name" else "$group:$name:$version" } @InternalRefreshVersionsApi diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlLine.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlLine.kt index 5f613e2a3..1755fc567 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlLine.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlLine.kt @@ -72,7 +72,7 @@ internal fun TomlLine( internal fun TomlLine( section: TomlSection, key: String, - map: Map + map: Map ): TomlLine { require((map.keys - validKeys).isEmpty()) { "Map $map has invalid keys. Valid: $validKeys" } val formatMap = map.entries diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt index 7fd92e9d5..3dc5e8b38 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt @@ -66,16 +66,17 @@ object VersionCatalogs { return toml.toString() } - private fun addPlugins(plugins: List, map: Map>): List { + private fun addPlugins(plugins: List, map: Map>): List { return plugins .distinctBy { d -> "${d.group}:${d.name}" } - .map { d -> - val lib = Library(d.group!!, d.name, d.version!!) + .mapNotNull { d -> + val version = d.version ?: return@mapNotNull null + val lib = Library(d.group!!, d.name, version) val pair = if (lib in map) { "version.ref" to map[lib]!!.first } else { - "version" to (d.version ?: "_") + "version" to (version ?: "_") } val pluginId = d.name.removeSuffix(".gradle.plugin") @@ -90,18 +91,19 @@ object VersionCatalogs { } } - private fun addVersions(deps: Deps, map: Map>): List { + private fun addVersions(deps: Deps, map: Map>): List { return deps.libraries .distinctBy { lib -> map[lib]?.first } .flatMap { lib -> val (versionName, versionValue) = map[lib] ?: return@flatMap emptyList() + versionValue ?: return@flatMap emptyList() val versionLine = TomlLine(TomlSection.Versions, versionName, versionValue) listOf(TomlLine.newLine, versionLine) } } - private fun dependenciesMap(deps: Deps): Map> { + private fun dependenciesMap(deps: Deps): Map> { val versionsMap = RefreshVersionsConfigHolder.readVersionsMap() val versionKeyReader: ArtifactVersionKeyReader = RefreshVersionsConfigHolder.versionKeyReader @@ -119,7 +121,7 @@ object VersionCatalogs { private fun versionsCatalogLibraries( deps: Deps, - map: Map>, + map: Map>, withVersions: Boolean, ): List { val versionsMap = RefreshVersionsConfigHolder.readVersionsMap() @@ -129,7 +131,7 @@ object VersionCatalogs { .filterNot { lib -> lib.name.endsWith("gradle.plugin") } .flatMap { lib -> val line: TomlLine = if (lib in map) { - val versionName = map[lib]!!.first + val versionName: String? = map[lib]?.first val refVersion = mapOf("group" to lib.group, "name" to lib.name, "version.ref" to versionName) TomlLine(TomlSection.Libraries, deps.names[lib]!!, refVersion) } else { From 8e3c81f5ce8dcb46018fa85f5e37dad0a66a0e93 Mon Sep 17 00:00:00 2001 From: Louis CAD Date: Wed, 6 Jul 2022 18:55:06 +0200 Subject: [PATCH 051/103] Remove empty line --- .../main/kotlin/de/fayard/refreshVersions/core/internal/Toml.kt | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/Toml.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/Toml.kt index eca2958e7..75572ee7d 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/Toml.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/Toml.kt @@ -56,4 +56,3 @@ internal data class Toml( } } } - From d46973cf62c42cc7ca27d087a424389a7de75a2c Mon Sep 17 00:00:00 2001 From: Louis CAD Date: Wed, 6 Jul 2022 18:55:41 +0200 Subject: [PATCH 052/103] Use IDE recognizable test functions in TomlLineTest --- .../refreshVersions/core/TomlLineTest.kt | 29 +++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlLineTest.kt b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlLineTest.kt index 9b34f9831..b5386696b 100644 --- a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlLineTest.kt +++ b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlLineTest.kt @@ -12,15 +12,16 @@ import de.fayard.refreshVersions.core.internal.TomlLine.Kind.PluginVersionRef import de.fayard.refreshVersions.core.internal.TomlLine.Kind.Version import de.fayard.refreshVersions.core.internal.TomlSection import io.kotest.assertions.assertSoftly -import io.kotest.core.spec.style.FunSpec import io.kotest.inspectors.forAll import io.kotest.inspectors.forAny import io.kotest.matchers.shouldBe +import kotlin.test.Test -class TomlLineTest : FunSpec({ +class TomlLineTest { - test("Parsing kind for libraries") { + @Test + fun `Parsing kind for libraries`() { val lines = """ groovy-core = { module = "org.codehaus.groovy:groovy", version.ref = "groovy" } @@ -56,7 +57,8 @@ class TomlLineTest : FunSpec({ } } - test("Parsing kind for versions") { + @Test + fun `Parsing kind for versions`() { val lines = """ # some comment @@ -82,7 +84,8 @@ class TomlLineTest : FunSpec({ } } - test("Parsing kind for plugins") { + @Test + fun `Parsing kind for plugins`() { val lines = """ short-notation = "some.plugin.id:1.4" @@ -105,7 +108,8 @@ class TomlLineTest : FunSpec({ } } - test("Parsing libraries values") { + @Test + fun `Parsing libraries values`() { fun map(group: String, name: String, version: String?, versionRef: String?) = listOfNotNull("group" to group, "name" to name, version?.let { "version" to it }, versionRef?.let { "version.ref" to it }) .toMap() @@ -140,7 +144,8 @@ class TomlLineTest : FunSpec({ } - test("Parsing plugins values") { + @Test + fun `Parsing plugins values`() { fun map(id: String, version: String?, versionRef: String?) = listOfNotNull("id" to id, version?.let { "version" to it }, versionRef?.let { "version.ref" to it }) .toMap() @@ -170,7 +175,8 @@ class TomlLineTest : FunSpec({ } } - test("Parsing for warning or error messages") { + @Test + fun `Parsing for warning or error messages`() { val lines = """ ## error: something happened ## warning: just a warning @@ -182,7 +188,8 @@ class TomlLineTest : FunSpec({ } } - test("Constructors for TomlLine") { + @Test + fun `Constructors for TomlLine`() { assertSoftly { TomlLine(TomlSection.Plugins, "org-jetbrains-kotlin-jvm", mapOf("id" to "org.jetbrains.kotlin.jvm", "version" to "1.6.10")) .text shouldBe """org-jetbrains-kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version = "1.6.10" }""" @@ -199,6 +206,4 @@ class TomlLineTest : FunSpec({ .text shouldBe """my-lib = { group = "com.example", name = "name" }""" } } -}) - - +} From 9cc2cdaa47cf574460089dca62dc9eb5f6af08e2 Mon Sep 17 00:00:00 2001 From: Louis CAD Date: Wed, 6 Jul 2022 18:57:20 +0200 Subject: [PATCH 053/103] Rename Delete to Deletable in TomlLine.Kind --- .../de/fayard/refreshVersions/core/internal/TomlLine.kt | 7 ++++--- .../de/fayard/refreshVersions/core/internal/TomlUpdater.kt | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlLine.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlLine.kt index 1755fc567..b550e0190 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlLine.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlLine.kt @@ -8,7 +8,8 @@ internal data class TomlLine( val text: String, ) { - internal enum class Kind { Ignore, Delete, Libs, LibsUnderscore, LibsVersionRef, Version, Plugin, PluginVersionRef } + internal enum class Kind { Ignore, Deletable, Libs, LibsUnderscore, LibsVersionRef, Version, Plugin, PluginVersionRef } + //TODO: Maybe convert to sealed class/interface? val textWithoutComment = text.substringBefore("#") @@ -98,7 +99,7 @@ private fun TomlLine.parseTomlMap(kind: TomlLine.Kind): Map { return when (kind) { Ignore -> emptyMap() - Delete -> emptyMap() + Deletable -> emptyMap() LibsUnderscore -> emptyMap() Version -> emptyMap() Plugin, PluginVersionRef -> when { @@ -139,7 +140,7 @@ private fun lineMap( ).toMap() private fun TomlLine.guessTomlLineKind(): TomlLine.Kind { - if (text.startsWith("##")) return Delete + if (text.startsWith("##")) return Deletable val hasVersionRef = textWithoutComment.contains("version.ref") diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlUpdater.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlUpdater.kt index 94dc1b94b..6cd51b448 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlUpdater.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlUpdater.kt @@ -24,7 +24,7 @@ internal class TomlUpdater( if (fileContent.isBlank()) return toml.sections.forEach { (section, lines) -> - toml[section] = lines.filter { it.kind != Delete } + toml[section] = lines.filter { it.kind != Deletable } } actual.writeText(toml.toString()) } @@ -33,7 +33,7 @@ internal class TomlUpdater( val noop = listOf(line) when (line.kind) { Ignore, LibsUnderscore, LibsVersionRef, PluginVersionRef -> noop - Delete -> emptyList() + Deletable -> emptyList() Version -> { linesForUpdate(line, findLineReferencing(line)) } From f10c8902a023581954cc566ae5c5472380eecd48 Mon Sep 17 00:00:00 2001 From: Louis CAD Date: Wed, 6 Jul 2022 23:52:43 +0200 Subject: [PATCH 054/103] Add missing changes following previous commit --- .../de/fayard/refreshVersions/core/TomlLineTest.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlLineTest.kt b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlLineTest.kt index b5386696b..f072cf7c6 100644 --- a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlLineTest.kt +++ b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlLineTest.kt @@ -2,7 +2,7 @@ package de.fayard.refreshVersions.core import de.fayard.refreshVersions.core.internal.ConfigurationLessDependency import de.fayard.refreshVersions.core.internal.TomlLine -import de.fayard.refreshVersions.core.internal.TomlLine.Kind.Delete +import de.fayard.refreshVersions.core.internal.TomlLine.Kind.Deletable import de.fayard.refreshVersions.core.internal.TomlLine.Kind.Ignore import de.fayard.refreshVersions.core.internal.TomlLine.Kind.Libs import de.fayard.refreshVersions.core.internal.TomlLine.Kind.LibsUnderscore @@ -45,9 +45,9 @@ class TomlLineTest { LibsVersionRef, LibsVersionRef, LibsVersionRef, Ignore, Ignore, Ignore, LibsUnderscore, Ignore, - Libs, Delete, Ignore, + Libs, Deletable, Ignore, Libs, Ignore, - Libs, Delete, + Libs, Deletable, ) val testCases = lines.zip(expectedKinds) @@ -73,7 +73,7 @@ class TomlLineTest { val expectedKinds: List = listOf( Ignore, Ignore, - Version, Delete, Delete, Ignore, + Version, Deletable, Deletable, Ignore, Version, Version, ) @@ -97,7 +97,7 @@ class TomlLineTest { """.trimIndent().lines() val expectedKinds: List = listOf( - Plugin, Delete, Ignore, Ignore, + Plugin, Deletable, Ignore, Ignore, Plugin, PluginVersionRef ) @@ -184,7 +184,7 @@ class TomlLineTest { """.trimIndent().lines() lines.forAny { - TomlLine(TomlSection.Libraries, it).kind shouldBe Delete + TomlLine(TomlSection.Libraries, it).kind shouldBe Deletable } } From 0e15759896c1c7c95497b677f4813d077b0e2a74 Mon Sep 17 00:00:00 2001 From: Louis CAD Date: Wed, 27 Jul 2022 02:47:43 +0200 Subject: [PATCH 055/103] Fix support for version-less dependencies in catalog migration This commit also clarifies some code to make it easier to understand: - The cryptic type `Map` was replaced by `Map`. - Functions were renamed to better communicate what they are actually doing. - Wrongly named `splitSemicolon` local property was renamed to `splitByColon`. - Magic "none" strings were removed. They are unneeded now. No magic now. - KDoc was added where it could clarify what a function can return. - Line breaks were added to improve readability (especially for parameters) --- .../buildSrcLibs/internal/KotlinPoetry.kt | 4 +- .../internal/ConfigurationLessDependency.kt | 18 ++- .../refreshVersions/core/internal/TomlLine.kt | 23 ++-- .../core/internal/VersionCatalogs.kt | 124 +++++++++++------- .../refreshVersions/core/TomlLineTest.kt | 18 ++- .../RefreshVersionsCatalogTask.kt | 4 +- 6 files changed, 118 insertions(+), 73 deletions(-) diff --git a/plugins/buildSrcLibs/src/main/kotlin/de/fayard/buildSrcLibs/internal/KotlinPoetry.kt b/plugins/buildSrcLibs/src/main/kotlin/de/fayard/buildSrcLibs/internal/KotlinPoetry.kt index 4a31ec512..c3cfbc497 100644 --- a/plugins/buildSrcLibs/src/main/kotlin/de/fayard/buildSrcLibs/internal/KotlinPoetry.kt +++ b/plugins/buildSrcLibs/src/main/kotlin/de/fayard/buildSrcLibs/internal/KotlinPoetry.kt @@ -17,8 +17,8 @@ internal fun kotlinpoet( val libsProperties: List = libraries .distinctBy { it.groupModule() } .map { d -> - val libValue = when { - d.version == "none" -> CodeBlock.of("%S", d.groupModule()) + val libValue = when (d.version) { + null -> CodeBlock.of("%S", d.groupModule()) else -> CodeBlock.of("%S", d.groupModuleUnderscore()) } constStringProperty( diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/ConfigurationLessDependency.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/ConfigurationLessDependency.kt index 9f98fc87f..5f77714fc 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/ConfigurationLessDependency.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/ConfigurationLessDependency.kt @@ -19,11 +19,19 @@ internal class ConfigurationLessDependency( version = version ) - constructor(dependencyNotationWithVersion: String) : this( - group = dependencyNotationWithVersion.substringBefore(':'), - name = dependencyNotationWithVersion.substringAfter(':').substringBefore(':'), - version = dependencyNotationWithVersion.substringAfterLast(':') - ) + companion object { + operator fun invoke(dependencyNotation: String): ConfigurationLessDependency { + val beforeFirstColon = dependencyNotation.substringBefore(':') + val afterFirstColon = dependencyNotation.substringAfter(':') + val name = afterFirstColon.substringBefore(':') + val version = if (afterFirstColon == name) null else afterFirstColon.substringAfterLast(':') + return ConfigurationLessDependency( + group = beforeFirstColon, + name = name, + version = version + ) + } + } override fun getGroup() = group override fun getName() = name diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlLine.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlLine.kt index b550e0190..eb905772c 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlLine.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlLine.kt @@ -3,6 +3,10 @@ package de.fayard.refreshVersions.core.internal import de.fayard.refreshVersions.core.internal.TomlLine.Kind.* import org.gradle.api.artifacts.Dependency +/** + * Despite TOML supporting braces in its syntax, they must open and close on + * the same line, so having a per-line model is fine. + */ internal data class TomlLine( val section: TomlSection, val text: String, @@ -58,10 +62,10 @@ internal fun TomlLine( key: String, dependency: Dependency ): TomlLine = when (dependency.version) { - "none" -> TomlLine( + null -> TomlLine( section = section, key = key, - map = mapOf("group" to (dependency.group ?: ""), "name" to dependency.name) + value = """${dependency.group}:${dependency.name}""" ) else -> TomlLine( section = section, @@ -84,7 +88,7 @@ internal fun TomlLine( private val validKeys = listOf("module", "group", "name", "version.ref", "version", "id") private fun TomlLine.parseTomlMap(kind: TomlLine.Kind): Map { - val splitSemicolon = value.split(":") + val splitByColon = value.split(":") val map: MutableMap = when { unparsedValue.startsWith('{').not() -> mutableMapOf() @@ -103,16 +107,19 @@ private fun TomlLine.parseTomlMap(kind: TomlLine.Kind): Map { LibsUnderscore -> emptyMap() Version -> emptyMap() Plugin, PluginVersionRef -> when { - value.isNotBlank() -> { - val (id, version) = splitSemicolon - mapOf("id" to id, "version" to version) + value.isNotBlank() -> mutableMapOf().apply { //TODO: Replace with buildMap later. + this["id"] = splitByColon.first() + splitByColon.getOrNull(1)?.also { version -> + this["version"] = version + } } else -> map } Libs, LibsVersionRef -> when { value.isNotBlank() -> { - val (group, name, version) = splitSemicolon - lineMap(group, name, version, null) + val (group, name) = splitByColon + val version = splitByColon.getOrNull(2) + lineMap(group = group, name = name, version = version, versionRef = null) } else -> { map["module"]?.also { module -> diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt index 3dc5e8b38..eff199146 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt @@ -36,7 +36,10 @@ object VersionCatalogs { return Toml(map.toMutableMap()) } - fun parseTomlInSections(toml: String): Map { + /** + * Returns a map where the key is the section name, and the value, the section content. + */ + internal fun parseTomlInSections(toml: String): Map { val result = mutableMapOf() result["root"] = StringBuilder() var current: StringBuilder = result["root"]!! @@ -56,54 +59,62 @@ object VersionCatalogs { return result.mapValues { it.value.toString() } } - fun versionsCatalog(deps: Deps, currentText: String, withVersions: Boolean, plugins: List): String { - val map = dependenciesMap(deps) + fun generateVersionsCatalogText( + deps: Deps, + currentText: String, + withVersions: Boolean, + plugins: List + ): String { + val versionRefMap = dependenciesWithVersionRefsMapIfAny(deps) val toml = parseToml(currentText) - toml.merge(TomlSection.Plugins, addPlugins(plugins, map)) - toml.merge(TomlSection.Libraries, versionsCatalogLibraries(deps, map, withVersions)) - toml.merge(TomlSection.Versions, addVersions(deps, map)) + toml.merge(TomlSection.Plugins, addPlugins(plugins, versionRefMap)) + toml.merge(TomlSection.Libraries, versionsCatalogLibraries(deps, versionRefMap, withVersions)) + toml.merge(TomlSection.Versions, addVersions(deps, versionRefMap)) return toml.toString() } - private fun addPlugins(plugins: List, map: Map>): List { - return plugins - .distinctBy { d -> "${d.group}:${d.name}" } - .mapNotNull { d -> - val version = d.version ?: return@mapNotNull null - val lib = Library(d.group!!, d.name, version) - - val pair = if (lib in map) { - "version.ref" to map[lib]!!.first - } else { - "version" to (version ?: "_") - } + private fun addPlugins( + plugins: List, + versionRefMap: Map + ): List = plugins.distinctBy { d -> + "${d.group}:${d.name}" + }.mapNotNull { d -> + val version = d.version ?: return@mapNotNull null + val lib = Library(d.group!!, d.name, version) + + val pair = if (lib in versionRefMap) { + "version.ref" to versionRefMap[lib]!!.key + } else { + "version" to version + } - val pluginId = d.name.removeSuffix(".gradle.plugin") - TomlLine( - TomlSection.Plugins, - pluginId.replace(".", "-"), - mapOf("id" to pluginId, pair) - ) + val pluginId = d.name.removeSuffix(".gradle.plugin") + TomlLine( + TomlSection.Plugins, + pluginId.replace(".", "-"), + mapOf("id" to pluginId, pair) + ) - }.flatMap { - listOf(TomlLine.newLine, it) - } + }.flatMap { + listOf(TomlLine.newLine, it) } - private fun addVersions(deps: Deps, map: Map>): List { - return deps.libraries - .distinctBy { lib -> map[lib]?.first } - .flatMap { lib -> - val (versionName, versionValue) = map[lib] ?: return@flatMap emptyList() - versionValue ?: return@flatMap emptyList() - - val versionLine = TomlLine(TomlSection.Versions, versionName, versionValue) - listOf(TomlLine.newLine, versionLine) - } + private fun addVersions( + deps: Deps, + versionRefMap: Map + ): List = deps.libraries.distinctBy { lib -> + versionRefMap[lib]?.key + }.flatMap { lib -> + val (versionName, versionValue) = versionRefMap[lib] ?: return@flatMap emptyList() + + val versionLine = TomlLine(TomlSection.Versions, versionName, versionValue) + listOf(TomlLine.newLine, versionLine) } - private fun dependenciesMap(deps: Deps): Map> { + private data class TomlVersionRef(val key: String, val version: String) + + private fun dependenciesWithVersionRefsMapIfAny(deps: Deps): Map { val versionsMap = RefreshVersionsConfigHolder.readVersionsMap() val versionKeyReader: ArtifactVersionKeyReader = RefreshVersionsConfigHolder.versionKeyReader @@ -111,33 +122,44 @@ object VersionCatalogs { val name = getVersionPropertyName(ModuleId.Maven(lib.group, lib.name), versionKeyReader) if (name.contains("..") || name.startsWith("plugin")) { - return@mapNotNull null + return@mapNotNull null + } + val version = versionsMap[name] ?: lib.version + lib to version?.let { + TomlVersionRef( + key = name.removePrefix("version.").replace(".", "-"), // Better match TOML naming convention. + version = it + ) } - val tomlName = name.removePrefix("version.").replace(".", "-") - - lib to Pair(tomlName, versionsMap[name] ?: lib.version) }.toMap() } private fun versionsCatalogLibraries( deps: Deps, - map: Map>, + versionRefMap: Map, withVersions: Boolean, ): List { val versionsMap = RefreshVersionsConfigHolder.readVersionsMap() val versionKeyReader: ArtifactVersionKeyReader = RefreshVersionsConfigHolder.versionKeyReader - return deps.libraries - .filterNot { lib -> lib.name.endsWith("gradle.plugin") } - .flatMap { lib -> - val line: TomlLine = if (lib in map) { - val versionName: String? = map[lib]?.first - val refVersion = mapOf("group" to lib.group, "name" to lib.name, "version.ref" to versionName) - TomlLine(TomlSection.Libraries, deps.names[lib]!!, refVersion) + return deps.libraries.filterNot { lib -> + lib.name.endsWith("gradle.plugin") + }.flatMap { lib -> + val line: TomlLine = if (lib in versionRefMap) { + val versionRef: TomlVersionRef? = versionRefMap[lib] + TomlLine( + section = TomlSection.Libraries, + key = deps.names[lib]!!, + map = mutableMapOf().apply { //TODO: Replace with buildMap later. + put("group", lib.group) + put("name", lib.name) + put("version.ref", versionRef?.key ?: return@apply) + } + ) } else { val versionKey = getVersionPropertyName(ModuleId.Maven(lib.group, lib.name), versionKeyReader) val version = when { - lib.version == "none" -> "none" + lib.version == null -> null withVersions.not() -> "_" versionKey in versionsMap -> versionsMap[versionKey]!! else -> "_" diff --git a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlLineTest.kt b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlLineTest.kt index f072cf7c6..45cc43e6c 100644 --- a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlLineTest.kt +++ b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlLineTest.kt @@ -110,9 +110,17 @@ class TomlLineTest { @Test fun `Parsing libraries values`() { - fun map(group: String, name: String, version: String?, versionRef: String?) = - listOfNotNull("group" to group, "name" to name, version?.let { "version" to it }, versionRef?.let { "version.ref" to it }) - .toMap() + fun map( + group: String, + name: String, + version: String?, + versionRef: String? + ) = listOfNotNull( + "group" to group, + "name" to name, + version?.let { "version" to it }, + versionRef?.let { "version.ref" to it } + ).toMap() val lines = """ ## # available:1.5" @@ -201,9 +209,9 @@ class TomlLineTest { TomlLine(TomlSection.Libraries, "my-lib", d) .text shouldBe """my-lib = "com.example:name:1.0"""" - val noVersion = ConfigurationLessDependency("com.example:name:none") + val noVersion = ConfigurationLessDependency("com.example:name") TomlLine(TomlSection.Libraries, "my-lib", noVersion) - .text shouldBe """my-lib = { group = "com.example", name = "name" }""" + .text shouldBe """my-lib = "com.example:name"""" } } } diff --git a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt index 3d886df96..9d885eb97 100644 --- a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt +++ b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt @@ -9,7 +9,7 @@ import de.fayard.refreshVersions.core.internal.OutputFile import de.fayard.refreshVersions.core.internal.checkModeAndNames import de.fayard.refreshVersions.core.internal.computeAliases import de.fayard.refreshVersions.core.internal.findDependencies -import de.fayard.refreshVersions.core.internal.VersionCatalogs.versionsCatalog +import de.fayard.refreshVersions.core.internal.VersionCatalogs.generateVersionsCatalogText import de.fayard.refreshVersions.core.internal.UsedPluginsTracker import de.fayard.refreshVersions.core.internal.VersionCatalogs import de.fayard.refreshVersions.core.internal.VersionCatalogs.LIBS_VERSIONS_TOML @@ -71,7 +71,7 @@ open class RefreshVersionsCatalogTask : DefaultTask() { val deps: Deps = dependenciesToUse.checkModeAndNames(versionCatalogAliases, Case.`kebab-case`) val currentText = if (catalog.existed) catalog.readText() else "" - val newText = versionsCatalog(deps, currentText, withVersions, plugins) + val newText = generateVersionsCatalogText(deps, currentText, withVersions, plugins) catalog.writeText(newText) catalog.logFileWasModified() From f37e8f8506efc12e00f0ba6dd0c92ecd65631ce9 Mon Sep 17 00:00:00 2001 From: Jean-Michel Fayard Date: Wed, 27 Jul 2022 12:10:45 +0200 Subject: [PATCH 056/103] test: RefreshVersionsConfigHolder gets in the way of testing We should transform that a pure function but I'm doing the minimum of work that enables testing --- .../refreshVersions/core/internal/VersionCatalogs.kt | 11 ++++------- .../refreshVersions/RefreshVersionsCatalogTask.kt | 4 ++++ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt index eff199146..e028fe6c2 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt @@ -114,11 +114,11 @@ object VersionCatalogs { private data class TomlVersionRef(val key: String, val version: String) - private fun dependenciesWithVersionRefsMapIfAny(deps: Deps): Map { - val versionsMap = RefreshVersionsConfigHolder.readVersionsMap() - val versionKeyReader: ArtifactVersionKeyReader = RefreshVersionsConfigHolder.versionKeyReader + lateinit var versionsMap: Map + lateinit var versionKeyReader: ArtifactVersionKeyReader - return deps.libraries.mapNotNull { lib -> + private fun dependenciesWithVersionRefsMapIfAny(deps: Deps): Map = + deps.libraries.mapNotNull { lib -> val name = getVersionPropertyName(ModuleId.Maven(lib.group, lib.name), versionKeyReader) if (name.contains("..") || name.startsWith("plugin")) { @@ -132,15 +132,12 @@ object VersionCatalogs { ) } }.toMap() - } private fun versionsCatalogLibraries( deps: Deps, versionRefMap: Map, withVersions: Boolean, ): List { - val versionsMap = RefreshVersionsConfigHolder.readVersionsMap() - val versionKeyReader: ArtifactVersionKeyReader = RefreshVersionsConfigHolder.versionKeyReader return deps.libraries.filterNot { lib -> lib.name.endsWith("gradle.plugin") diff --git a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt index 9d885eb97..01832c175 100644 --- a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt +++ b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt @@ -1,11 +1,13 @@ package de.fayard.refreshVersions import de.fayard.refreshVersions.core.addMissingEntriesInVersionsProperties +import de.fayard.refreshVersions.core.internal.ArtifactVersionKeyReader import de.fayard.refreshVersions.core.internal.Case import de.fayard.refreshVersions.core.internal.Deps import de.fayard.refreshVersions.core.internal.Library import de.fayard.refreshVersions.core.internal.MEANING_LESS_NAMES import de.fayard.refreshVersions.core.internal.OutputFile +import de.fayard.refreshVersions.core.internal.RefreshVersionsConfigHolder import de.fayard.refreshVersions.core.internal.checkModeAndNames import de.fayard.refreshVersions.core.internal.computeAliases import de.fayard.refreshVersions.core.internal.findDependencies @@ -71,6 +73,8 @@ open class RefreshVersionsCatalogTask : DefaultTask() { val deps: Deps = dependenciesToUse.checkModeAndNames(versionCatalogAliases, Case.`kebab-case`) val currentText = if (catalog.existed) catalog.readText() else "" + VersionCatalogs.versionsMap = RefreshVersionsConfigHolder.readVersionsMap() + VersionCatalogs.versionKeyReader = RefreshVersionsConfigHolder.versionKeyReader val newText = generateVersionsCatalogText(deps, currentText, withVersions, plugins) catalog.writeText(newText) catalog.logFileWasModified() From 4da8e97b5ca6fe273f55d36f2595c76003e4f3c3 Mon Sep 17 00:00:00 2001 From: Jean-Michel Fayard Date: Wed, 27 Jul 2022 14:20:03 +0200 Subject: [PATCH 057/103] test(FAILING): toml-generate-initial-versions The real versions should be shown, but underscore is used instead --- .../refreshVersions/core/TomlUpdaterTest.kt | 55 +++++++++++++++++-- .../actual.libs.toml | 33 +++++++++++ .../dependencies.txt | 6 ++ .../expected.libs.toml | 33 +++++++++++ .../initial.libs.toml | 21 +++++++ 5 files changed, 142 insertions(+), 6 deletions(-) create mode 100644 plugins/core/src/test/resources/refreshVersionsCatalog-versions-new/actual.libs.toml create mode 100644 plugins/core/src/test/resources/refreshVersionsCatalog-versions-new/dependencies.txt create mode 100644 plugins/core/src/test/resources/refreshVersionsCatalog-versions-new/expected.libs.toml create mode 100644 plugins/core/src/test/resources/refreshVersionsCatalog-versions-new/initial.libs.toml diff --git a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlUpdaterTest.kt b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlUpdaterTest.kt index bac778a05..a1537f9bf 100644 --- a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlUpdaterTest.kt +++ b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlUpdaterTest.kt @@ -1,18 +1,24 @@ package de.fayard.refreshVersions.core +import de.fayard.refreshVersions.core.extensions.gradle.moduleId +import de.fayard.refreshVersions.core.internal.ArtifactVersionKeyReader +import de.fayard.refreshVersions.core.internal.ConfigurationLessDependency import de.fayard.refreshVersions.core.internal.DependencyWithVersionCandidates -import de.fayard.refreshVersions.core.internal.Toml +import de.fayard.refreshVersions.core.internal.Deps +import de.fayard.refreshVersions.core.internal.Library import de.fayard.refreshVersions.core.internal.TomlLine import de.fayard.refreshVersions.core.internal.TomlSection import de.fayard.refreshVersions.core.internal.TomlUpdater import de.fayard.refreshVersions.core.internal.VersionCatalogs +import io.kotest.assertions.asClue +import io.kotest.assertions.withClue import io.kotest.core.spec.style.FunSpec import io.kotest.matchers.shouldBe +import org.gradle.api.artifacts.Dependency import java.io.File import de.fayard.refreshVersions.core.Version as MavenVersion class TomlUpdaterTest : FunSpec({ - test("Folder toml-refreshversions - update new versions") { val input = FolderInput("toml-refreshversions") @@ -21,7 +27,9 @@ class TomlUpdaterTest : FunSpec({ // check idempotent TomlUpdater(input.expected, input.dependenciesUpdates).updateNewVersions(input.expected) - input.actual.readText() shouldBe input.expectedText + input.asClue { + input.actual.readText() shouldBe input.expectedText + } // delete actual file if successful input.actual.delete() @@ -35,7 +43,9 @@ class TomlUpdaterTest : FunSpec({ // check idempotent TomlUpdater(input.expected, input.dependenciesUpdates).cleanupComments(input.expected) - input.actual.readText() shouldBe input.expectedText + input.asClue { + input.actual.readText() shouldBe input.expectedText + } // delete actual file if successful input.actual.delete() @@ -61,13 +71,44 @@ class TomlUpdaterTest : FunSpec({ )) input.actual.writeText(toml.toString()) - toml.toString() shouldBe input.expectedText + input.asClue { + toml.toString() shouldBe input.expectedText + } // delete actual file if successful input.actual.delete() } -}) + val rulesDir = File(".").absoluteFile.parentFile.parentFile + .resolve("dependencies/src/main/resources/refreshVersions-rules") + .also { require(it.canRead()) { "Can't read foler $it"} } + VersionCatalogs.versionsMap = emptyMap() // TODO + VersionCatalogs.versionKeyReader = ArtifactVersionKeyReader.fromRules(rulesDir.listFiles()!!.map { it.readText() }) + + test("Folder toml-generate-initial-versions - generate the initial versions catalog") { + val input = FolderInput("refreshVersionsCatalog-versions-new") + val withVersions = true + + val currentText = input.initial.readText() + val librariesMap = input.dependenciesUpdates + .associate { d -> + val versionName = d.versionsCandidates.first().value + Library(d.moduleId.group!!, d.moduleId.name, d.currentVersion) to versionName + } + val deps = Deps(librariesMap.keys.toList(), librariesMap) + val plugins = input.dependenciesUpdates.mapNotNull { + ConfigurationLessDependency(it.moduleId as ModuleId.Maven, it.currentVersion) + .takeIf { it.name.endsWith(".gradle.plugin") } + } + val newText = VersionCatalogs.generateVersionsCatalogText(deps, currentText, withVersions, plugins) + input.actual.writeText(newText) + input.asClue { + newText shouldBe input.expectedText + } + input.actual.delete() + } +}) + private data class FolderInput( val folder: String, val initial: File, @@ -76,6 +117,8 @@ private data class FolderInput( val dependenciesUpdates: List ) { val expectedText = expected.readText() + + override fun toString() = "Comparing from resources folder=$folder: actual=${actual.name} and expected=${expected.name}" } private fun FolderInput(folderName: String): FolderInput { diff --git a/plugins/core/src/test/resources/refreshVersionsCatalog-versions-new/actual.libs.toml b/plugins/core/src/test/resources/refreshVersionsCatalog-versions-new/actual.libs.toml new file mode 100644 index 000000000..684faa69d --- /dev/null +++ b/plugins/core/src/test/resources/refreshVersionsCatalog-versions-new/actual.libs.toml @@ -0,0 +1,33 @@ +# See https://docs.gradle.org/current/userguide/platforms.html#sub:conventional-dependencies-toml + +key = "some key" + +[bundles] + +groovy = ["groovy-core", "groovy-json", "groovy-nio"] + +[plugins] + +short-notation = "some.plugin.id:1.4" + +long-notation = { id = "some.plugin.id", version = "1.4" } + +some-plugin-id = { id = "some.plugin.id", version = "1.4" } + +other-plugin-id = { id = "other.plugin.id", version = "3.4" } + +[versions] + +groovy = "3.0.5" + +[libraries] + +my-lib-ok = "com.mycompany:mylib-ok:1.0" + +groovy-kotlin = "org.codehaus.groovy:groovy-kotlin:_" + +my-lib = "com.mycompany:mylib:_" + +my-other-lib = "com.mycompany:other:_" + +my-alternate-lib = "com.mycompany:alternate:_" diff --git a/plugins/core/src/test/resources/refreshVersionsCatalog-versions-new/dependencies.txt b/plugins/core/src/test/resources/refreshVersionsCatalog-versions-new/dependencies.txt new file mode 100644 index 000000000..339aedc24 --- /dev/null +++ b/plugins/core/src/test/resources/refreshVersionsCatalog-versions-new/dependencies.txt @@ -0,0 +1,6 @@ +org.codehaus.groovy:groovy-kotlin:3.0.5:groovy-kotlin +com.mycompany:mylib:1.4:my-lib +com.mycompany:other:1.4:my-other-lib +com.mycompany:alternate:1.2:my-alternate-lib +some.plugin.id:some.plugin.id.gradle.plugin:1.4:1.5,1.6,1.7 +other.plugin.id:other.plugin.id.gradle.plugin:3.4:3.5,3.6 diff --git a/plugins/core/src/test/resources/refreshVersionsCatalog-versions-new/expected.libs.toml b/plugins/core/src/test/resources/refreshVersionsCatalog-versions-new/expected.libs.toml new file mode 100644 index 000000000..60b60c012 --- /dev/null +++ b/plugins/core/src/test/resources/refreshVersionsCatalog-versions-new/expected.libs.toml @@ -0,0 +1,33 @@ +# See https://docs.gradle.org/current/userguide/platforms.html#sub:conventional-dependencies-toml + +key = "some key" + +[bundles] + +groovy = ["groovy-core", "groovy-json", "groovy-nio"] + +[plugins] + +short-notation = "some.plugin.id:1.4" + +long-notation = { id = "some.plugin.id", version = "1.4" } + +some-plugin-id = { id = "some.plugin.id", version = "1.4" } + +other-plugin-id = { id = "other.plugin.id", version = "3.4" } + +[versions] + +groovy = "3.0.5" + +[libraries] + +my-lib-ok = "com.mycompany:mylib-ok:1.0" + +groovy-kotlin = "org.codehaus.groovy:groovy-kotlin:3.0.5" + +my-lib = "com.mycompany:mylib:1.4" + +my-other-lib = "com.mycompany:other:1.4" + +my-alternate-lib = "com.mycompany:alternate:1.2" diff --git a/plugins/core/src/test/resources/refreshVersionsCatalog-versions-new/initial.libs.toml b/plugins/core/src/test/resources/refreshVersionsCatalog-versions-new/initial.libs.toml new file mode 100644 index 000000000..1b88e9588 --- /dev/null +++ b/plugins/core/src/test/resources/refreshVersionsCatalog-versions-new/initial.libs.toml @@ -0,0 +1,21 @@ +# See https://docs.gradle.org/current/userguide/platforms.html#sub:conventional-dependencies-toml + +key = "some key" + +[versions] + +groovy = "3.0.5" + +[libraries] + +my-lib-ok = "com.mycompany:mylib-ok:1.0" + +[bundles] + +groovy = ["groovy-core", "groovy-json", "groovy-nio"] + +[plugins] + +short-notation = "some.plugin.id:1.4" + +long-notation = { id = "some.plugin.id", version = "1.4" } From d4c497bafd00cda4a605835497d5e3d6594772d9 Mon Sep 17 00:00:00 2001 From: Jean-Michel Fayard Date: Wed, 27 Jul 2022 14:22:05 +0200 Subject: [PATCH 058/103] FIX(refreshVersionsCatalog): real versions should be used with --versions --- .../core/internal/VersionCatalogs.kt | 2 +- .../actual.libs.toml | 33 ------------------- 2 files changed, 1 insertion(+), 34 deletions(-) delete mode 100644 plugins/core/src/test/resources/refreshVersionsCatalog-versions-new/actual.libs.toml diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt index e028fe6c2..fc17e30b6 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt @@ -159,7 +159,7 @@ object VersionCatalogs { lib.version == null -> null withVersions.not() -> "_" versionKey in versionsMap -> versionsMap[versionKey]!! - else -> "_" + else -> lib.version } val value = lib.copy(version = version).toDependency() TomlLine(TomlSection.Libraries, deps.names[lib]!!, value) diff --git a/plugins/core/src/test/resources/refreshVersionsCatalog-versions-new/actual.libs.toml b/plugins/core/src/test/resources/refreshVersionsCatalog-versions-new/actual.libs.toml deleted file mode 100644 index 684faa69d..000000000 --- a/plugins/core/src/test/resources/refreshVersionsCatalog-versions-new/actual.libs.toml +++ /dev/null @@ -1,33 +0,0 @@ -# See https://docs.gradle.org/current/userguide/platforms.html#sub:conventional-dependencies-toml - -key = "some key" - -[bundles] - -groovy = ["groovy-core", "groovy-json", "groovy-nio"] - -[plugins] - -short-notation = "some.plugin.id:1.4" - -long-notation = { id = "some.plugin.id", version = "1.4" } - -some-plugin-id = { id = "some.plugin.id", version = "1.4" } - -other-plugin-id = { id = "other.plugin.id", version = "3.4" } - -[versions] - -groovy = "3.0.5" - -[libraries] - -my-lib-ok = "com.mycompany:mylib-ok:1.0" - -groovy-kotlin = "org.codehaus.groovy:groovy-kotlin:_" - -my-lib = "com.mycompany:mylib:_" - -my-other-lib = "com.mycompany:other:_" - -my-alternate-lib = "com.mycompany:alternate:_" From 073895ad201e6259cc92569858f2df577cc6e771 Mon Sep 17 00:00:00 2001 From: Jean-Michel Fayard Date: Wed, 27 Jul 2022 14:48:23 +0200 Subject: [PATCH 059/103] test(refreshVersionsCatalog): expand tests we can either generate versions or not we are either coming from a blank file or merging with an existing one --- .../refreshVersions/core/TomlUpdaterTest.kt | 93 +++++++++++-------- .../dependencies.txt | 9 ++ .../expected.libs.toml | 43 +++++++++ .../initial.libs.toml | 21 +++++ .../dependencies.txt | 9 ++ .../expected.libs.toml | 31 +++++++ .../initial.libs.toml | 3 + .../dependencies.txt | 9 ++ .../expected.libs.toml | 43 +++++++++ .../initial.libs.toml | 21 +++++ .../dependencies.txt | 3 + .../expected.libs.toml | 20 ++-- .../initial.libs.toml | 18 ---- 13 files changed, 255 insertions(+), 68 deletions(-) create mode 100644 plugins/core/src/test/resources/refreshVersionsCatalog-underscore-existing/dependencies.txt create mode 100644 plugins/core/src/test/resources/refreshVersionsCatalog-underscore-existing/expected.libs.toml create mode 100644 plugins/core/src/test/resources/refreshVersionsCatalog-underscore-existing/initial.libs.toml create mode 100644 plugins/core/src/test/resources/refreshVersionsCatalog-underscore-new/dependencies.txt create mode 100644 plugins/core/src/test/resources/refreshVersionsCatalog-underscore-new/expected.libs.toml create mode 100644 plugins/core/src/test/resources/refreshVersionsCatalog-underscore-new/initial.libs.toml create mode 100644 plugins/core/src/test/resources/refreshVersionsCatalog-versions-existing/dependencies.txt create mode 100644 plugins/core/src/test/resources/refreshVersionsCatalog-versions-existing/expected.libs.toml create mode 100644 plugins/core/src/test/resources/refreshVersionsCatalog-versions-existing/initial.libs.toml diff --git a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlUpdaterTest.kt b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlUpdaterTest.kt index a1537f9bf..7d202d5f9 100644 --- a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlUpdaterTest.kt +++ b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlUpdaterTest.kt @@ -1,6 +1,5 @@ package de.fayard.refreshVersions.core -import de.fayard.refreshVersions.core.extensions.gradle.moduleId import de.fayard.refreshVersions.core.internal.ArtifactVersionKeyReader import de.fayard.refreshVersions.core.internal.ConfigurationLessDependency import de.fayard.refreshVersions.core.internal.DependencyWithVersionCandidates @@ -11,10 +10,8 @@ import de.fayard.refreshVersions.core.internal.TomlSection import de.fayard.refreshVersions.core.internal.TomlUpdater import de.fayard.refreshVersions.core.internal.VersionCatalogs import io.kotest.assertions.asClue -import io.kotest.assertions.withClue import io.kotest.core.spec.style.FunSpec import io.kotest.matchers.shouldBe -import org.gradle.api.artifacts.Dependency import java.io.File import de.fayard.refreshVersions.core.Version as MavenVersion @@ -28,7 +25,7 @@ class TomlUpdaterTest : FunSpec({ // check idempotent TomlUpdater(input.expected, input.dependenciesUpdates).updateNewVersions(input.expected) input.asClue { - input.actual.readText() shouldBe input.expectedText + input.actual.readText() shouldBe input.expectedText } // delete actual file if successful @@ -44,7 +41,7 @@ class TomlUpdaterTest : FunSpec({ // check idempotent TomlUpdater(input.expected, input.dependenciesUpdates).cleanupComments(input.expected) input.asClue { - input.actual.readText() shouldBe input.expectedText + input.actual.readText() shouldBe input.expectedText } // delete actual file if successful @@ -55,20 +52,26 @@ class TomlUpdaterTest : FunSpec({ val input = FolderInput("toml-merge-properties") val toml = VersionCatalogs.parseToml(input.initial.readText()) - toml.merge(TomlSection.Versions, listOf( - TomlLine(TomlSection.Versions, "groovy", "3.0.6"), - TomlLine(TomlSection.Versions, "ktor", "2.0"), - )) + toml.merge( + TomlSection.Versions, listOf( + TomlLine(TomlSection.Versions, "groovy", "3.0.6"), + TomlLine(TomlSection.Versions, "ktor", "2.0"), + ) + ) - toml.merge(TomlSection.Libraries, listOf( - TomlLine(TomlSection.Libraries, "my-lib", "com.mycompany:mylib:1.5"), - TomlLine(TomlSection.Libraries, "other-lib", "com.mycompany:other:1.5"), - )) + toml.merge( + TomlSection.Libraries, listOf( + TomlLine(TomlSection.Libraries, "my-lib", "com.mycompany:mylib:1.5"), + TomlLine(TomlSection.Libraries, "other-lib", "com.mycompany:other:1.5"), + ) + ) - toml.merge(TomlSection.Plugins, listOf( - TomlLine(TomlSection.Plugins, "short-notation", "some.plugin.id:1.6"), - TomlLine(TomlSection.Plugins, "ben-manes", "ben.manes:versions:1.0"), - )) + toml.merge( + TomlSection.Plugins, listOf( + TomlLine(TomlSection.Plugins, "short-notation", "some.plugin.id:1.6"), + TomlLine(TomlSection.Plugins, "ben-manes", "ben.manes:versions:1.0"), + ) + ) input.actual.writeText(toml.toString()) input.asClue { @@ -81,31 +84,42 @@ class TomlUpdaterTest : FunSpec({ val rulesDir = File(".").absoluteFile.parentFile.parentFile .resolve("dependencies/src/main/resources/refreshVersions-rules") - .also { require(it.canRead()) { "Can't read foler $it"} } - VersionCatalogs.versionsMap = emptyMap() // TODO + .also { require(it.canRead()) { "Can't read foler $it" } } + VersionCatalogs.versionsMap = mapOf( + "version.junit.jupiter" to "42" + ) VersionCatalogs.versionKeyReader = ArtifactVersionKeyReader.fromRules(rulesDir.listFiles()!!.map { it.readText() }) - test("Folder toml-generate-initial-versions - generate the initial versions catalog") { - val input = FolderInput("refreshVersionsCatalog-versions-new") - val withVersions = true - - val currentText = input.initial.readText() - val librariesMap = input.dependenciesUpdates - .associate { d -> - val versionName = d.versionsCandidates.first().value - Library(d.moduleId.group!!, d.moduleId.name, d.currentVersion) to versionName + context("refreshVersionsCatalog") { + val refreshVersionsCatalogInputs = listOf( + FolderInput("refreshVersionsCatalog-versions-new"), + FolderInput("refreshVersionsCatalog-versions-existing"), + FolderInput("refreshVersionsCatalog-underscore-new"), + FolderInput("refreshVersionsCatalog-underscore-existing"), + ) + for (input in refreshVersionsCatalogInputs) { + test("Folder ${input.folder}") { + val withVersions = input.folder.contains("versions") + + val currentText = input.initial.readText() + val librariesMap = input.dependenciesUpdates + .associate { d -> + val versionName = d.versionsCandidates.first().value + Library(d.moduleId.group!!, d.moduleId.name, d.currentVersion) to versionName + } + val deps = Deps(librariesMap.keys.toList(), librariesMap) + val plugins = input.dependenciesUpdates.mapNotNull { + ConfigurationLessDependency(it.moduleId as ModuleId.Maven, it.currentVersion) + .takeIf { it.name.endsWith(".gradle.plugin") } + } + val newText = VersionCatalogs.generateVersionsCatalogText(deps, currentText, withVersions, plugins) + input.actual.writeText(newText) + input.asClue { + newText shouldBe input.expectedText + } + input.actual.delete() } - val deps = Deps(librariesMap.keys.toList(), librariesMap) - val plugins = input.dependenciesUpdates.mapNotNull { - ConfigurationLessDependency(it.moduleId as ModuleId.Maven, it.currentVersion) - .takeIf { it.name.endsWith(".gradle.plugin") } - } - val newText = VersionCatalogs.generateVersionsCatalogText(deps, currentText, withVersions, plugins) - input.actual.writeText(newText) - input.asClue { - newText shouldBe input.expectedText } - input.actual.delete() } }) @@ -118,7 +132,8 @@ private data class FolderInput( ) { val expectedText = expected.readText() - override fun toString() = "Comparing from resources folder=$folder: actual=${actual.name} and expected=${expected.name}" + override fun toString() = + "Comparing from resources folder=$folder: actual=${actual.name} and expected=${expected.name}" } private fun FolderInput(folderName: String): FolderInput { diff --git a/plugins/core/src/test/resources/refreshVersionsCatalog-underscore-existing/dependencies.txt b/plugins/core/src/test/resources/refreshVersionsCatalog-underscore-existing/dependencies.txt new file mode 100644 index 000000000..ca3bc22ef --- /dev/null +++ b/plugins/core/src/test/resources/refreshVersionsCatalog-underscore-existing/dependencies.txt @@ -0,0 +1,9 @@ +org.codehaus.groovy:groovy-kotlin:3.0.5:groovy-kotlin +com.mycompany:mylib:1.4:my-lib +com.mycompany:other:1.4:my-other-lib +com.mycompany:alternate:1.2:my-alternate-lib +some.plugin.id:some.plugin.id.gradle.plugin:1.4:1.5,1.6,1.7 +other.plugin.id:other.plugin.id.gradle.plugin:3.4:3.5,3.6 +io.kotest:kotest:3.0:kotest-core +io.kotest:kotest-property:3.0:kotest-property +org.junit.jupiter:junit-jupiter-engine:1.0:junit-jupiter diff --git a/plugins/core/src/test/resources/refreshVersionsCatalog-underscore-existing/expected.libs.toml b/plugins/core/src/test/resources/refreshVersionsCatalog-underscore-existing/expected.libs.toml new file mode 100644 index 000000000..d54cb05b6 --- /dev/null +++ b/plugins/core/src/test/resources/refreshVersionsCatalog-underscore-existing/expected.libs.toml @@ -0,0 +1,43 @@ +# See https://docs.gradle.org/current/userguide/platforms.html#sub:conventional-dependencies-toml + +key = "some key" + +[bundles] + +groovy = ["groovy-core", "groovy-json", "groovy-nio"] + +[plugins] + +short-notation = "some.plugin.id:1.4" + +long-notation = { id = "some.plugin.id", version = "1.4" } + +some-plugin-id = { id = "some.plugin.id", version = "1.4" } + +other-plugin-id = { id = "other.plugin.id", version = "3.4" } + +[versions] + +groovy = "3.0.5" + +kotest = "3.0" + +junit-jupiter = "42" + +[libraries] + +my-lib-ok = "com.mycompany:mylib-ok:1.0" + +groovy-kotlin = "org.codehaus.groovy:groovy-kotlin:_" + +my-lib = "com.mycompany:mylib:_" + +my-other-lib = "com.mycompany:other:_" + +my-alternate-lib = "com.mycompany:alternate:_" + +kotest-core = { group = "io.kotest", name = "kotest", version.ref = "kotest" } + +kotest-property = { group = "io.kotest", name = "kotest-property", version.ref = "kotest" } + +junit-jupiter = { group = "org.junit.jupiter", name = "junit-jupiter-engine", version.ref = "junit-jupiter" } diff --git a/plugins/core/src/test/resources/refreshVersionsCatalog-underscore-existing/initial.libs.toml b/plugins/core/src/test/resources/refreshVersionsCatalog-underscore-existing/initial.libs.toml new file mode 100644 index 000000000..1b88e9588 --- /dev/null +++ b/plugins/core/src/test/resources/refreshVersionsCatalog-underscore-existing/initial.libs.toml @@ -0,0 +1,21 @@ +# See https://docs.gradle.org/current/userguide/platforms.html#sub:conventional-dependencies-toml + +key = "some key" + +[versions] + +groovy = "3.0.5" + +[libraries] + +my-lib-ok = "com.mycompany:mylib-ok:1.0" + +[bundles] + +groovy = ["groovy-core", "groovy-json", "groovy-nio"] + +[plugins] + +short-notation = "some.plugin.id:1.4" + +long-notation = { id = "some.plugin.id", version = "1.4" } diff --git a/plugins/core/src/test/resources/refreshVersionsCatalog-underscore-new/dependencies.txt b/plugins/core/src/test/resources/refreshVersionsCatalog-underscore-new/dependencies.txt new file mode 100644 index 000000000..ca3bc22ef --- /dev/null +++ b/plugins/core/src/test/resources/refreshVersionsCatalog-underscore-new/dependencies.txt @@ -0,0 +1,9 @@ +org.codehaus.groovy:groovy-kotlin:3.0.5:groovy-kotlin +com.mycompany:mylib:1.4:my-lib +com.mycompany:other:1.4:my-other-lib +com.mycompany:alternate:1.2:my-alternate-lib +some.plugin.id:some.plugin.id.gradle.plugin:1.4:1.5,1.6,1.7 +other.plugin.id:other.plugin.id.gradle.plugin:3.4:3.5,3.6 +io.kotest:kotest:3.0:kotest-core +io.kotest:kotest-property:3.0:kotest-property +org.junit.jupiter:junit-jupiter-engine:1.0:junit-jupiter diff --git a/plugins/core/src/test/resources/refreshVersionsCatalog-underscore-new/expected.libs.toml b/plugins/core/src/test/resources/refreshVersionsCatalog-underscore-new/expected.libs.toml new file mode 100644 index 000000000..cf7a55012 --- /dev/null +++ b/plugins/core/src/test/resources/refreshVersionsCatalog-underscore-new/expected.libs.toml @@ -0,0 +1,31 @@ +# See https://docs.gradle.org/current/userguide/platforms.html#sub:conventional-dependencies-toml + +key = "some key" + +[plugins] + +some-plugin-id = { id = "some.plugin.id", version = "1.4" } + +other-plugin-id = { id = "other.plugin.id", version = "3.4" } + +[versions] + +kotest = "3.0" + +junit-jupiter = "42" + +[libraries] + +groovy-kotlin = "org.codehaus.groovy:groovy-kotlin:_" + +my-lib = "com.mycompany:mylib:_" + +my-other-lib = "com.mycompany:other:_" + +my-alternate-lib = "com.mycompany:alternate:_" + +kotest-core = { group = "io.kotest", name = "kotest", version.ref = "kotest" } + +kotest-property = { group = "io.kotest", name = "kotest-property", version.ref = "kotest" } + +junit-jupiter = { group = "org.junit.jupiter", name = "junit-jupiter-engine", version.ref = "junit-jupiter" } diff --git a/plugins/core/src/test/resources/refreshVersionsCatalog-underscore-new/initial.libs.toml b/plugins/core/src/test/resources/refreshVersionsCatalog-underscore-new/initial.libs.toml new file mode 100644 index 000000000..ca6f603bf --- /dev/null +++ b/plugins/core/src/test/resources/refreshVersionsCatalog-underscore-new/initial.libs.toml @@ -0,0 +1,3 @@ +# See https://docs.gradle.org/current/userguide/platforms.html#sub:conventional-dependencies-toml + +key = "some key" diff --git a/plugins/core/src/test/resources/refreshVersionsCatalog-versions-existing/dependencies.txt b/plugins/core/src/test/resources/refreshVersionsCatalog-versions-existing/dependencies.txt new file mode 100644 index 000000000..ca3bc22ef --- /dev/null +++ b/plugins/core/src/test/resources/refreshVersionsCatalog-versions-existing/dependencies.txt @@ -0,0 +1,9 @@ +org.codehaus.groovy:groovy-kotlin:3.0.5:groovy-kotlin +com.mycompany:mylib:1.4:my-lib +com.mycompany:other:1.4:my-other-lib +com.mycompany:alternate:1.2:my-alternate-lib +some.plugin.id:some.plugin.id.gradle.plugin:1.4:1.5,1.6,1.7 +other.plugin.id:other.plugin.id.gradle.plugin:3.4:3.5,3.6 +io.kotest:kotest:3.0:kotest-core +io.kotest:kotest-property:3.0:kotest-property +org.junit.jupiter:junit-jupiter-engine:1.0:junit-jupiter diff --git a/plugins/core/src/test/resources/refreshVersionsCatalog-versions-existing/expected.libs.toml b/plugins/core/src/test/resources/refreshVersionsCatalog-versions-existing/expected.libs.toml new file mode 100644 index 000000000..19477df05 --- /dev/null +++ b/plugins/core/src/test/resources/refreshVersionsCatalog-versions-existing/expected.libs.toml @@ -0,0 +1,43 @@ +# See https://docs.gradle.org/current/userguide/platforms.html#sub:conventional-dependencies-toml + +key = "some key" + +[bundles] + +groovy = ["groovy-core", "groovy-json", "groovy-nio"] + +[plugins] + +short-notation = "some.plugin.id:1.4" + +long-notation = { id = "some.plugin.id", version = "1.4" } + +some-plugin-id = { id = "some.plugin.id", version = "1.4" } + +other-plugin-id = { id = "other.plugin.id", version = "3.4" } + +[versions] + +groovy = "3.0.5" + +kotest = "3.0" + +junit-jupiter = "42" + +[libraries] + +my-lib-ok = "com.mycompany:mylib-ok:1.0" + +groovy-kotlin = "org.codehaus.groovy:groovy-kotlin:3.0.5" + +my-lib = "com.mycompany:mylib:1.4" + +my-other-lib = "com.mycompany:other:1.4" + +my-alternate-lib = "com.mycompany:alternate:1.2" + +kotest-core = { group = "io.kotest", name = "kotest", version.ref = "kotest" } + +kotest-property = { group = "io.kotest", name = "kotest-property", version.ref = "kotest" } + +junit-jupiter = { group = "org.junit.jupiter", name = "junit-jupiter-engine", version.ref = "junit-jupiter" } diff --git a/plugins/core/src/test/resources/refreshVersionsCatalog-versions-existing/initial.libs.toml b/plugins/core/src/test/resources/refreshVersionsCatalog-versions-existing/initial.libs.toml new file mode 100644 index 000000000..1b88e9588 --- /dev/null +++ b/plugins/core/src/test/resources/refreshVersionsCatalog-versions-existing/initial.libs.toml @@ -0,0 +1,21 @@ +# See https://docs.gradle.org/current/userguide/platforms.html#sub:conventional-dependencies-toml + +key = "some key" + +[versions] + +groovy = "3.0.5" + +[libraries] + +my-lib-ok = "com.mycompany:mylib-ok:1.0" + +[bundles] + +groovy = ["groovy-core", "groovy-json", "groovy-nio"] + +[plugins] + +short-notation = "some.plugin.id:1.4" + +long-notation = { id = "some.plugin.id", version = "1.4" } diff --git a/plugins/core/src/test/resources/refreshVersionsCatalog-versions-new/dependencies.txt b/plugins/core/src/test/resources/refreshVersionsCatalog-versions-new/dependencies.txt index 339aedc24..ca3bc22ef 100644 --- a/plugins/core/src/test/resources/refreshVersionsCatalog-versions-new/dependencies.txt +++ b/plugins/core/src/test/resources/refreshVersionsCatalog-versions-new/dependencies.txt @@ -4,3 +4,6 @@ com.mycompany:other:1.4:my-other-lib com.mycompany:alternate:1.2:my-alternate-lib some.plugin.id:some.plugin.id.gradle.plugin:1.4:1.5,1.6,1.7 other.plugin.id:other.plugin.id.gradle.plugin:3.4:3.5,3.6 +io.kotest:kotest:3.0:kotest-core +io.kotest:kotest-property:3.0:kotest-property +org.junit.jupiter:junit-jupiter-engine:1.0:junit-jupiter diff --git a/plugins/core/src/test/resources/refreshVersionsCatalog-versions-new/expected.libs.toml b/plugins/core/src/test/resources/refreshVersionsCatalog-versions-new/expected.libs.toml index 60b60c012..0538f701c 100644 --- a/plugins/core/src/test/resources/refreshVersionsCatalog-versions-new/expected.libs.toml +++ b/plugins/core/src/test/resources/refreshVersionsCatalog-versions-new/expected.libs.toml @@ -2,27 +2,19 @@ key = "some key" -[bundles] - -groovy = ["groovy-core", "groovy-json", "groovy-nio"] - [plugins] -short-notation = "some.plugin.id:1.4" - -long-notation = { id = "some.plugin.id", version = "1.4" } - some-plugin-id = { id = "some.plugin.id", version = "1.4" } other-plugin-id = { id = "other.plugin.id", version = "3.4" } [versions] -groovy = "3.0.5" +kotest = "3.0" -[libraries] +junit-jupiter = "42" -my-lib-ok = "com.mycompany:mylib-ok:1.0" +[libraries] groovy-kotlin = "org.codehaus.groovy:groovy-kotlin:3.0.5" @@ -31,3 +23,9 @@ my-lib = "com.mycompany:mylib:1.4" my-other-lib = "com.mycompany:other:1.4" my-alternate-lib = "com.mycompany:alternate:1.2" + +kotest-core = { group = "io.kotest", name = "kotest", version.ref = "kotest" } + +kotest-property = { group = "io.kotest", name = "kotest-property", version.ref = "kotest" } + +junit-jupiter = { group = "org.junit.jupiter", name = "junit-jupiter-engine", version.ref = "junit-jupiter" } diff --git a/plugins/core/src/test/resources/refreshVersionsCatalog-versions-new/initial.libs.toml b/plugins/core/src/test/resources/refreshVersionsCatalog-versions-new/initial.libs.toml index 1b88e9588..ca6f603bf 100644 --- a/plugins/core/src/test/resources/refreshVersionsCatalog-versions-new/initial.libs.toml +++ b/plugins/core/src/test/resources/refreshVersionsCatalog-versions-new/initial.libs.toml @@ -1,21 +1,3 @@ # See https://docs.gradle.org/current/userguide/platforms.html#sub:conventional-dependencies-toml key = "some key" - -[versions] - -groovy = "3.0.5" - -[libraries] - -my-lib-ok = "com.mycompany:mylib-ok:1.0" - -[bundles] - -groovy = ["groovy-core", "groovy-json", "groovy-nio"] - -[plugins] - -short-notation = "some.plugin.id:1.4" - -long-notation = { id = "some.plugin.id", version = "1.4" } From cdc0c29940aab123d181ef285b8a4951ab2f6d1f Mon Sep 17 00:00:00 2001 From: Jean-Michel Fayard Date: Wed, 27 Jul 2022 15:09:39 +0200 Subject: [PATCH 060/103] refactor(refreshVersionsCatalog): get rid of Deps/Library Use Gradle's Dependency type instead --- .../core/internal/VersionCatalogs.kt | 65 ++++++++++--------- .../refreshVersions/core/TomlUpdaterTest.kt | 15 ++--- .../RefreshVersionsCatalogTask.kt | 20 +++--- .../dependency-groups-alias-rules.txt | 2 +- 4 files changed, 54 insertions(+), 48 deletions(-) diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt index fc17e30b6..58a71bc05 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt @@ -60,31 +60,31 @@ object VersionCatalogs { } fun generateVersionsCatalogText( - deps: Deps, + dependenciesAndNames: Map, currentText: String, withVersions: Boolean, plugins: List ): String { - val versionRefMap = dependenciesWithVersionRefsMapIfAny(deps) + val dependencies = dependenciesAndNames.keys.toList() + val versionRefMap = dependenciesWithVersionRefsMapIfAny(dependencies) val toml = parseToml(currentText) toml.merge(TomlSection.Plugins, addPlugins(plugins, versionRefMap)) - toml.merge(TomlSection.Libraries, versionsCatalogLibraries(deps, versionRefMap, withVersions)) - toml.merge(TomlSection.Versions, addVersions(deps, versionRefMap)) + toml.merge(TomlSection.Libraries, versionsCatalogLibraries(dependenciesAndNames, versionRefMap, withVersions)) + toml.merge(TomlSection.Versions, addVersions(dependenciesAndNames, versionRefMap)) return toml.toString() } private fun addPlugins( plugins: List, - versionRefMap: Map + versionRefMap: Map ): List = plugins.distinctBy { d -> "${d.group}:${d.name}" }.mapNotNull { d -> val version = d.version ?: return@mapNotNull null - val lib = Library(d.group!!, d.name, version) - val pair = if (lib in versionRefMap) { - "version.ref" to versionRefMap[lib]!!.key + val pair = if (d in versionRefMap) { + "version.ref" to versionRefMap.getValue(d)!!.key } else { "version" to version } @@ -101,9 +101,9 @@ object VersionCatalogs { } private fun addVersions( - deps: Deps, - versionRefMap: Map - ): List = deps.libraries.distinctBy { lib -> + dependenciesAndNames: Map, + versionRefMap: Map + ): List = dependenciesAndNames.keys.distinctBy { lib -> versionRefMap[lib]?.key }.flatMap { lib -> val (versionName, versionValue) = versionRefMap[lib] ?: return@flatMap emptyList() @@ -117,52 +117,57 @@ object VersionCatalogs { lateinit var versionsMap: Map lateinit var versionKeyReader: ArtifactVersionKeyReader - private fun dependenciesWithVersionRefsMapIfAny(deps: Deps): Map = - deps.libraries.mapNotNull { lib -> - val name = getVersionPropertyName(ModuleId.Maven(lib.group, lib.name), versionKeyReader) + private fun dependenciesWithVersionRefsMapIfAny(libraries: List): Map = + libraries + .mapNotNull { lib -> + val group = lib.group ?: return@mapNotNull null + + val name = getVersionPropertyName(ModuleId.Maven(group, lib.name), versionKeyReader) if (name.contains("..") || name.startsWith("plugin")) { return@mapNotNull null } val version = versionsMap[name] ?: lib.version - lib to version?.let { + val versionRef = version?.let { TomlVersionRef( key = name.removePrefix("version.").replace(".", "-"), // Better match TOML naming convention. version = it ) } + lib to versionRef }.toMap() private fun versionsCatalogLibraries( - deps: Deps, - versionRefMap: Map, + dependenciesAndNames: Map, + versionRefMap: Map, withVersions: Boolean, ): List { - return deps.libraries.filterNot { lib -> - lib.name.endsWith("gradle.plugin") - }.flatMap { lib -> - val line: TomlLine = if (lib in versionRefMap) { - val versionRef: TomlVersionRef? = versionRefMap[lib] + return dependenciesAndNames.keys.filterNot { lib -> + lib.name.endsWith("gradle.plugin") && lib.group != null + }.flatMap { dependency: Dependency -> + val group = dependency.group!! + val line: TomlLine = if (dependency in versionRefMap) { + val versionRef: TomlVersionRef? = versionRefMap[dependency] TomlLine( section = TomlSection.Libraries, - key = deps.names[lib]!!, + key = dependenciesAndNames.getValue(dependency), map = mutableMapOf().apply { //TODO: Replace with buildMap later. - put("group", lib.group) - put("name", lib.name) + put("group", dependency.group) + put("name", dependency.name) put("version.ref", versionRef?.key ?: return@apply) } ) } else { - val versionKey = getVersionPropertyName(ModuleId.Maven(lib.group, lib.name), versionKeyReader) + val versionKey = getVersionPropertyName(ModuleId.Maven(group, dependency.name), versionKeyReader) val version = when { - lib.version == null -> null + dependency.version == null -> null withVersions.not() -> "_" versionKey in versionsMap -> versionsMap[versionKey]!! - else -> lib.version + else -> dependency.version } - val value = lib.copy(version = version).toDependency() - TomlLine(TomlSection.Libraries, deps.names[lib]!!, value) + val value = ConfigurationLessDependency(group, dependency.name, version) + TomlLine(TomlSection.Libraries, dependenciesAndNames.get(dependency)!!, value) } listOf(TomlLine.newLine, line) diff --git a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlUpdaterTest.kt b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlUpdaterTest.kt index 7d202d5f9..e8338498b 100644 --- a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlUpdaterTest.kt +++ b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlUpdaterTest.kt @@ -12,6 +12,7 @@ import de.fayard.refreshVersions.core.internal.VersionCatalogs import io.kotest.assertions.asClue import io.kotest.core.spec.style.FunSpec import io.kotest.matchers.shouldBe +import org.gradle.api.artifacts.Dependency import java.io.File import de.fayard.refreshVersions.core.Version as MavenVersion @@ -102,17 +103,15 @@ class TomlUpdaterTest : FunSpec({ val withVersions = input.folder.contains("versions") val currentText = input.initial.readText() - val librariesMap = input.dependenciesUpdates + val dependenciesAndNames = input.dependenciesUpdates .associate { d -> val versionName = d.versionsCandidates.first().value - Library(d.moduleId.group!!, d.moduleId.name, d.currentVersion) to versionName + val dependency: Dependency = ConfigurationLessDependency(d.moduleId.group!!, d.moduleId.name, d.currentVersion) + dependency to versionName } - val deps = Deps(librariesMap.keys.toList(), librariesMap) - val plugins = input.dependenciesUpdates.mapNotNull { - ConfigurationLessDependency(it.moduleId as ModuleId.Maven, it.currentVersion) - .takeIf { it.name.endsWith(".gradle.plugin") } - } - val newText = VersionCatalogs.generateVersionsCatalogText(deps, currentText, withVersions, plugins) + val plugins = dependenciesAndNames.keys + .filter { it.name.endsWith(".gradle.plugin") } + val newText = VersionCatalogs.generateVersionsCatalogText(dependenciesAndNames, currentText, withVersions, plugins) input.actual.writeText(newText) input.asClue { newText shouldBe input.expectedText diff --git a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt index 01832c175..19d136520 100644 --- a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt +++ b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt @@ -1,20 +1,19 @@ package de.fayard.refreshVersions import de.fayard.refreshVersions.core.addMissingEntriesInVersionsProperties -import de.fayard.refreshVersions.core.internal.ArtifactVersionKeyReader import de.fayard.refreshVersions.core.internal.Case import de.fayard.refreshVersions.core.internal.Deps import de.fayard.refreshVersions.core.internal.Library import de.fayard.refreshVersions.core.internal.MEANING_LESS_NAMES import de.fayard.refreshVersions.core.internal.OutputFile import de.fayard.refreshVersions.core.internal.RefreshVersionsConfigHolder -import de.fayard.refreshVersions.core.internal.checkModeAndNames -import de.fayard.refreshVersions.core.internal.computeAliases -import de.fayard.refreshVersions.core.internal.findDependencies -import de.fayard.refreshVersions.core.internal.VersionCatalogs.generateVersionsCatalogText import de.fayard.refreshVersions.core.internal.UsedPluginsTracker import de.fayard.refreshVersions.core.internal.VersionCatalogs import de.fayard.refreshVersions.core.internal.VersionCatalogs.LIBS_VERSIONS_TOML +import de.fayard.refreshVersions.core.internal.VersionCatalogs.generateVersionsCatalogText +import de.fayard.refreshVersions.core.internal.checkModeAndNames +import de.fayard.refreshVersions.core.internal.computeAliases +import de.fayard.refreshVersions.core.internal.findDependencies import de.fayard.refreshVersions.internal.getArtifactNameToConstantMapping import org.gradle.api.DefaultTask import org.gradle.api.GradleException @@ -63,7 +62,7 @@ open class RefreshVersionsCatalogTask : DefaultTask() { } val plugins = UsedPluginsTracker.usedPluginsWithoutEntryInVersionsFile + - UsedPluginsTracker.read().map { it.first } + UsedPluginsTracker.read().map { it.first } val versionCatalogAliases: List = dependenciesToUse.computeAliases( configured = emptyList(), @@ -71,18 +70,21 @@ open class RefreshVersionsCatalogTask : DefaultTask() { ) val deps: Deps = dependenciesToUse.checkModeAndNames(versionCatalogAliases, Case.`kebab-case`) + val dependenciesAndNames = deps.names.mapKeys { it.key.toDependency() } val currentText = if (catalog.existed) catalog.readText() else "" VersionCatalogs.versionsMap = RefreshVersionsConfigHolder.readVersionsMap() VersionCatalogs.versionKeyReader = RefreshVersionsConfigHolder.versionKeyReader - val newText = generateVersionsCatalogText(deps, currentText, withVersions, plugins) + val newText = generateVersionsCatalogText(dependenciesAndNames, currentText, withVersions, plugins) catalog.writeText(newText) catalog.logFileWasModified() - println(""" + println( + """ You can now automatically migrate your build.gradle/build.gradle.kts file with the command: $ANSI_GREEN./gradlew refreshVersionsMigrate$ANSI_RESET - """.trimIndent()) + """.trimIndent() + ) } } diff --git a/plugins/dependencies/src/main/resources/refreshVersions-rules/dependency-groups-alias-rules.txt b/plugins/dependencies/src/main/resources/refreshVersions-rules/dependency-groups-alias-rules.txt index 70ee78fb6..80c781116 100644 --- a/plugins/dependencies/src/main/resources/refreshVersions-rules/dependency-groups-alias-rules.txt +++ b/plugins/dependencies/src/main/resources/refreshVersions-rules/dependency-groups-alias-rules.txt @@ -41,4 +41,4 @@ com.russhwolf:multiplatform-settings(-*) ^^^^^^^^^^^^^^^^^^^^^^ com.rickclephas.kmp:kmp-nativecoroutines(-*) - ^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^ \ No newline at end of file + ^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^ From e8a7ce718add3205e8cf62ec16737e09b55e0b16 Mon Sep 17 00:00:00 2001 From: Jean-Michel Fayard Date: Wed, 27 Jul 2022 15:33:35 +0200 Subject: [PATCH 061/103] feat: improve checkPlugins ./checkPlugins refreshVersions ./checkPlugins refreshVersionsCleanup --- checkPlugins.sh | 51 +++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 43 insertions(+), 8 deletions(-) diff --git a/checkPlugins.sh b/checkPlugins.sh index 32b403f46..991e39238 100755 --- a/checkPlugins.sh +++ b/checkPlugins.sh @@ -1,14 +1,49 @@ #!/usr/bin/env bash +fail() { + echo "$1" + exit 1 +} +checkInstalled() { + which "$1" || fail "ERROR: please install $1" +} -cd plugins -./gradlew test publishToMavenLocal +runGradleTaskInFolder() { + echo + echo "== cd $1 ==" + cd $1 || fail "ERROR: Folder $1 doens't exist" + pwd + + echo '$' "./gradlew $TASK" + ./gradlew task || fail "ERROR for task $TASK" + cd .. +} + +DIR="$(basename $PWD)" +TASK="check refreshVersions" + +test -n "$1" && TASK="$1" -cd ../sample-plugins -./gradlew check refreshVersions +test "$DIR" = "refreshVersions" || fail "ERROR: must be called from the refreshVersions folder" +checkInstalled java +checkInstalled node +checkInstalled yarn + + +cd plugins || fail "can't cd plugins" +./gradlew test publishToMavenLocal +cd .. -cd ../sample-kotlin -./gradlew check refreshVersions +runGradleTaskInFolder sample-kotlin +runGradleTaskInFolder sample-multi-modules +runGradleTaskInFolder sample-groovy +runGradleTaskInFolder sample-kotlin-js -cd ..sample-groovy -./gradlew check refreshVersions +test -n "$ANDROID_SDK_ROOT" && { + runGradleTaskInFolder sample-android +} +echo "SUCCESS" +test "$TASK" = "refreshVersionsCleanup" || { + echo "To clean up your git history, you can run:" + echo " ./checkPlugins.sh refreshVersionsCleanup" +} From 21424b549ceac5df73a465781689003269ad3dff Mon Sep 17 00:00:00 2001 From: Jean-Michel Fayard Date: Wed, 27 Jul 2022 15:50:24 +0200 Subject: [PATCH 062/103] chore: ./checkPlugins.sh refreshVersionsCleanup --- plugins/versions.properties | 41 + sample-android/versions.properties | 4 +- sample-groovy/settings.gradle | 1 + sample-groovy/versions.properties | 96 - sample-kotlin-js/kotlin-js-store/yarn.lock | 2458 ++++++++++++++++++++ sample-kotlin-js/versions.properties | 52 +- sample-kotlin/versions.properties | 4 +- sample-multi-modules/settings.gradle.kts | 6 + sample-multi-modules/versions.properties | 63 +- 9 files changed, 2516 insertions(+), 209 deletions(-) create mode 100644 sample-kotlin-js/kotlin-js-store/yarn.lock diff --git a/plugins/versions.properties b/plugins/versions.properties index d69f7a0d9..a8dd9a837 100644 --- a/plugins/versions.properties +++ b/plugins/versions.properties @@ -8,9 +8,17 @@ #### suppress inspection "UnusedProperty" for whole file plugin.com.gradle.plugin-publish=0.20.0 +## # available=0.21.0 +## # available=1.0.0-rc-1 +## # available=1.0.0-rc-2 +## # available=1.0.0-rc-3 +## # available=1.0.0 version.junit=5.8.1 ### available=5.8.2 +### available=5.9.0-M1 +### available=5.9.0-RC1 +### available=5.9.0 version.kotest=4.6.3 ## # available=4.6.4 @@ -25,6 +33,14 @@ version.kotest=4.6.3 ## # available=5.0.2 ## # available=5.0.3 ## # available=5.1.0 +## # available=5.2.0 +## # available=5.2.1 +## # available=5.2.2 +## # available=5.2.3 +## # available=5.3.0 +## # available=5.3.1 +## # available=5.3.2 +## # available=5.4.0 version.kotlin=1.4.20 ## # available=1.4.21 @@ -54,6 +70,16 @@ version.kotlin=1.4.20 ## # available=1.6.0 ## # available=1.6.10-RC ## # available=1.6.10 +## # available=1.6.20-M1 +## # available=1.6.20-RC +## # available=1.6.20-RC2 +## # available=1.6.20 +## # available=1.6.21 +## # available=1.7.0-Beta +## # available=1.7.0-RC +## # available=1.7.0-RC2 +## # available=1.7.0 +## # available=1.7.10 version.kotlinpoet=1.7.2 ## # available=1.8.0 @@ -61,8 +87,16 @@ version.kotlinpoet=1.7.2 ## # available=1.10.0 ## # available=1.10.1 ## # available=1.10.2 +## # available=1.11.0 +## # available=1.12.0 version.kotlinx.coroutines=1.6.0 +## # available=1.6.1-native-mt +## # available=1.6.1 +## # available=1.6.2 +## # available=1.6.3-native-mt +## # available=1.6.3 +## # available=1.6.4 version.moshi=1.11.0 ### available=1.12.0 @@ -70,9 +104,16 @@ version.moshi=1.11.0 version.okhttp3=4.9.3 ## # available=4.10.0-RC1 +## # available=4.10.0 ## # available=5.0.0-alpha.1 ## # available=5.0.0-alpha.2 ## # available=5.0.0-alpha.3 ## # available=5.0.0-alpha.4 +## # available=5.0.0-alpha.5 +## # available=5.0.0-alpha.6 +## # available=5.0.0-alpha.7 +## # available=5.0.0-alpha.8 +## # available=5.0.0-alpha.9 +## # available=5.0.0-alpha.10 version.retrofit2=2.9.0 diff --git a/sample-android/versions.properties b/sample-android/versions.properties index 55dd9daf4..ed334ca72 100644 --- a/sample-android/versions.properties +++ b/sample-android/versions.properties @@ -1,6 +1,6 @@ #### Dependencies and Plugin versions with their available updates. -#### Generated by `./gradlew refreshVersions` version 0.40.2-SNAPSHOT -#### Revision of dependency notations removals: 9 +#### Generated by `./gradlew refreshVersions` version 0.41.0-SNAPSHOT +#### Revision of dependency notations removals: 11 #### #### Don't manually edit or split the comments that start with four hashtags (####), #### they will be overwritten by refreshVersions. diff --git a/sample-groovy/settings.gradle b/sample-groovy/settings.gradle index d22f96dfe..04bda98de 100644 --- a/sample-groovy/settings.gradle +++ b/sample-groovy/settings.gradle @@ -14,6 +14,7 @@ pluginManagement { plugins { id("com.gradle.enterprise").version("3.10.2") +//// # available:"3.10.3") id 'de.fayard.refreshVersions' } diff --git a/sample-groovy/versions.properties b/sample-groovy/versions.properties index 22308d416..e9e2cd6c9 100644 --- a/sample-groovy/versions.properties +++ b/sample-groovy/versions.properties @@ -13,107 +13,11 @@ plugin.org.gradle.hello-world=0.2 version.androidx.annotation=1.1.0 -## # available=1.2.0 -## # available=1.3.0 -## # available=1.4.0 version.androidx.compose.compiler=1.2.0-alpha01 -## # available=1.2.0-alpha02 -## # available=1.2.0-alpha03 -## # available=1.2.0-alpha04 -## # available=1.2.0-alpha05 -## # available=1.2.0-alpha06 -## # available=1.2.0-alpha07 -## # available=1.2.0-alpha08 -## # available=1.2.0-beta01 -## # available=1.2.0-beta02 -## # available=1.2.0-beta03 -## # available=1.2.0-rc01 -## # available=1.2.0-rc02 version.com.google.guava..guava=15.0 -## # available=16.0 -## # available=16.0.1 -## # available=17.0 -## # available=18.0 -## # available=19.0 -## # available=20.0 -## # available=21.0 -## # available=22.0 -## # available=22.0-android -## # available=23.0 -## # available=23.0-android -## # available=23.1-android -## # available=23.1-jre -## # available=23.2-android -## # available=23.2-jre -## # available=23.3-android -## # available=23.3-jre -## # available=23.4-android -## # available=23.4-jre -## # available=23.5-android -## # available=23.5-jre -## # available=23.6-android -## # available=23.6-jre -## # available=23.6.1-android -## # available=23.6.1-jre -## # available=24.0-android -## # available=24.0-jre -## # available=24.1-android -## # available=24.1-jre -## # available=24.1.1-android -## # available=24.1.1-jre -## # available=25.0-android -## # available=25.0-jre -## # available=25.1-android -## # available=25.1-jre -## # available=26.0-android -## # available=26.0-jre -## # available=27.0-android -## # available=27.0-jre -## # available=27.0.1-android -## # available=27.0.1-jre -## # available=27.1-android -## # available=27.1-jre -## # available=28.0-android -## # available=28.0-jre -## # available=28.1-android -## # available=28.1-jre -## # available=28.2-android -## # available=28.2-jre -## # available=29.0-android -## # available=29.0-jre -## # available=30.0-android -## # available=30.0-jre -## # available=30.1-android -## # available=30.1-jre -## # available=30.1.1-android -## # available=30.1.1-jre -## # available=31.0-android -## # available=31.0-jre -## # available=31.0.1-android -## # available=31.0.1-jre -## # available=31.1-android -## # available=31.1-jre version.com.google.inject..guice=2.0 -## # available=3.0 -## # available=4.0 -## # available=4.1.0 -## # available=4.2.0 -## # available=4.2.1 -## # available=4.2.2 -## # available=4.2.3 -## # available=5.0.0 -## # available=5.0.1 -## # available=5.1.0 version.org.jetbrains..annotations=17.0.0 -## # available=18.0.0 -## # available=19.0.0 -## # available=20.0.0 -## # available=20.1.0 -## # available=21.0.0 -## # available=21.0.1 -## # available=22.0.0 -## # available=23.0.0 diff --git a/sample-kotlin-js/kotlin-js-store/yarn.lock b/sample-kotlin-js/kotlin-js-store/yarn.lock new file mode 100644 index 000000000..b3c9cfe9c --- /dev/null +++ b/sample-kotlin-js/kotlin-js-store/yarn.lock @@ -0,0 +1,2458 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@discoveryjs/json-ext@^0.5.0": + version "0.5.7" + resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz#1d572bfbbe14b7704e0ba0f39b74815b84870d70" + integrity sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw== + +"@googlemaps/js-api-loader@1.10.0 - 1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@googlemaps/js-api-loader/-/js-api-loader-1.11.1.tgz#b7f02c04d8d8602fb4bd873b03685fccefce1c6f" + integrity sha512-2ug4uBu0onRXTAo7Yxkay5N7pdNIz3XpTElMTLdCtEfQDxikbjeR6GS8atVhblX+ubFBNlXvDzz7VtuXv0vMRQ== + dependencies: + fast-deep-equal "^3.1.3" + +"@jridgewell/gen-mapping@^0.3.0": + version "0.3.2" + resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz#c1aedc61e853f2bb9f5dfe6d4442d3b565b253b9" + integrity sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A== + dependencies: + "@jridgewell/set-array" "^1.0.1" + "@jridgewell/sourcemap-codec" "^1.4.10" + "@jridgewell/trace-mapping" "^0.3.9" + +"@jridgewell/resolve-uri@^3.0.3": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz#2203b118c157721addfe69d47b70465463066d78" + integrity sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w== + +"@jridgewell/set-array@^1.0.1": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.2.tgz#7c6cf998d6d20b914c0a55a91ae928ff25965e72" + integrity sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw== + +"@jridgewell/source-map@^0.3.2": + version "0.3.2" + resolved "https://registry.yarnpkg.com/@jridgewell/source-map/-/source-map-0.3.2.tgz#f45351aaed4527a298512ec72f81040c998580fb" + integrity sha512-m7O9o2uR8k2ObDysZYzdfhb08VuEml5oWGiosa1VdaPZ/A6QyPkAJuwN0Q1lhULOf6B7MtQmHENS743hWtCrgw== + dependencies: + "@jridgewell/gen-mapping" "^0.3.0" + "@jridgewell/trace-mapping" "^0.3.9" + +"@jridgewell/sourcemap-codec@^1.4.10": + version "1.4.14" + resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz#add4c98d341472a289190b424efbdb096991bb24" + integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw== + +"@jridgewell/trace-mapping@^0.3.7", "@jridgewell/trace-mapping@^0.3.9": + version "0.3.14" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.14.tgz#b231a081d8f66796e475ad588a1ef473112701ed" + integrity sha512-bJWEfQ9lPTvm3SneWwRFVLzrh6nhjwqw7TUFFBEMzwvg7t7PCDenf2lDwqo4NQXzdpgBXyFgDWnQA+2vkruksQ== + dependencies: + "@jridgewell/resolve-uri" "^3.0.3" + "@jridgewell/sourcemap-codec" "^1.4.10" + +"@leichtgewicht/ip-codec@^2.0.1": + version "2.0.4" + resolved "https://registry.yarnpkg.com/@leichtgewicht/ip-codec/-/ip-codec-2.0.4.tgz#b2ac626d6cb9c8718ab459166d4bb405b8ffa78b" + integrity sha512-Hcv+nVC0kZnQ3tD9GVu5xSMR4VVYOteQIr/hwFPVEvPdlXqgGEuRjiheChHgdM+JyqdgNcmzZOX/tnl0JOiI7A== + +"@types/body-parser@*": + version "1.19.2" + resolved "https://registry.yarnpkg.com/@types/body-parser/-/body-parser-1.19.2.tgz#aea2059e28b7658639081347ac4fab3de166e6f0" + integrity sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g== + dependencies: + "@types/connect" "*" + "@types/node" "*" + +"@types/bonjour@^3.5.9": + version "3.5.10" + resolved "https://registry.yarnpkg.com/@types/bonjour/-/bonjour-3.5.10.tgz#0f6aadfe00ea414edc86f5d106357cda9701e275" + integrity sha512-p7ienRMiS41Nu2/igbJxxLDWrSZ0WxM8UQgCeO9KhoVF7cOVFkrKsiDr1EsJIla8vV3oEEjGcz11jc5yimhzZw== + dependencies: + "@types/node" "*" + +"@types/connect-history-api-fallback@^1.3.5": + version "1.3.5" + resolved "https://registry.yarnpkg.com/@types/connect-history-api-fallback/-/connect-history-api-fallback-1.3.5.tgz#d1f7a8a09d0ed5a57aee5ae9c18ab9b803205dae" + integrity sha512-h8QJa8xSb1WD4fpKBDcATDNGXghFj6/3GRWG6dhmRcu0RX1Ubasur2Uvx5aeEwlf0MwblEC2bMzzMQntxnw/Cw== + dependencies: + "@types/express-serve-static-core" "*" + "@types/node" "*" + +"@types/connect@*": + version "3.4.35" + resolved "https://registry.yarnpkg.com/@types/connect/-/connect-3.4.35.tgz#5fcf6ae445e4021d1fc2219a4873cc73a3bb2ad1" + integrity sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ== + dependencies: + "@types/node" "*" + +"@types/eslint-scope@^3.7.3": + version "3.7.4" + resolved "https://registry.yarnpkg.com/@types/eslint-scope/-/eslint-scope-3.7.4.tgz#37fc1223f0786c39627068a12e94d6e6fc61de16" + integrity sha512-9K4zoImiZc3HlIp6AVUDE4CWYx22a+lhSZMYNpbjW04+YF0KWj4pJXnEMjdnFTiQibFFmElcsasJXDbdI/EPhA== + dependencies: + "@types/eslint" "*" + "@types/estree" "*" + +"@types/eslint@*": + version "8.4.5" + resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-8.4.5.tgz#acdfb7dd36b91cc5d812d7c093811a8f3d9b31e4" + integrity sha512-dhsC09y1gpJWnK+Ff4SGvCuSnk9DaU0BJZSzOwa6GVSg65XtTugLBITDAAzRU5duGBoXBHpdR/9jHGxJjNflJQ== + dependencies: + "@types/estree" "*" + "@types/json-schema" "*" + +"@types/estree@*": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.0.tgz#5fb2e536c1ae9bf35366eed879e827fa59ca41c2" + integrity sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ== + +"@types/estree@^0.0.51": + version "0.0.51" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.51.tgz#cfd70924a25a3fd32b218e5e420e6897e1ac4f40" + integrity sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ== + +"@types/express-serve-static-core@*", "@types/express-serve-static-core@^4.17.18": + version "4.17.30" + resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.17.30.tgz#0f2f99617fa8f9696170c46152ccf7500b34ac04" + integrity sha512-gstzbTWro2/nFed1WXtf+TtrpwxH7Ggs4RLYTLbeVgIkUQOI3WG/JKjgeOU1zXDvezllupjrf8OPIdvTbIaVOQ== + dependencies: + "@types/node" "*" + "@types/qs" "*" + "@types/range-parser" "*" + +"@types/express@*", "@types/express@^4.17.13": + version "4.17.13" + resolved "https://registry.yarnpkg.com/@types/express/-/express-4.17.13.tgz#a76e2995728999bab51a33fabce1d705a3709034" + integrity sha512-6bSZTPaTIACxn48l50SR+axgrqm6qXFIxrdAKaG6PaJk3+zuUr35hBlgT7vOmJcum+OEaIBLtHV/qloEAFITeA== + dependencies: + "@types/body-parser" "*" + "@types/express-serve-static-core" "^4.17.18" + "@types/qs" "*" + "@types/serve-static" "*" + +"@types/http-proxy@^1.17.8": + version "1.17.9" + resolved "https://registry.yarnpkg.com/@types/http-proxy/-/http-proxy-1.17.9.tgz#7f0e7931343761efde1e2bf48c40f02f3f75705a" + integrity sha512-QsbSjA/fSk7xB+UXlCT3wHBy5ai9wOcNDWwZAtud+jXhwOM3l+EYZh8Lng4+/6n8uar0J7xILzqftJdJ/Wdfkw== + dependencies: + "@types/node" "*" + +"@types/json-schema@*", "@types/json-schema@^7.0.8", "@types/json-schema@^7.0.9": + version "7.0.11" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.11.tgz#d421b6c527a3037f7c84433fd2c4229e016863d3" + integrity sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ== + +"@types/mime@^1": + version "1.3.2" + resolved "https://registry.yarnpkg.com/@types/mime/-/mime-1.3.2.tgz#93e25bf9ee75fe0fd80b594bc4feb0e862111b5a" + integrity sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw== + +"@types/node@*": + version "18.6.1" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.6.1.tgz#828e4785ccca13f44e2fb6852ae0ef11e3e20ba5" + integrity sha512-z+2vB6yDt1fNwKOeGbckpmirO+VBDuQqecXkgeIqDlaOtmKn6hPR/viQ8cxCfqLU4fTlvM3+YjM367TukWdxpg== + +"@types/qs@*": + version "6.9.7" + resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.9.7.tgz#63bb7d067db107cc1e457c303bc25d511febf6cb" + integrity sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw== + +"@types/range-parser@*": + version "1.2.4" + resolved "https://registry.yarnpkg.com/@types/range-parser/-/range-parser-1.2.4.tgz#cd667bcfdd025213aafb7ca5915a932590acdcdc" + integrity sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw== + +"@types/retry@0.12.0": + version "0.12.0" + resolved "https://registry.yarnpkg.com/@types/retry/-/retry-0.12.0.tgz#2b35eccfcee7d38cd72ad99232fbd58bffb3c84d" + integrity sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA== + +"@types/serve-index@^1.9.1": + version "1.9.1" + resolved "https://registry.yarnpkg.com/@types/serve-index/-/serve-index-1.9.1.tgz#1b5e85370a192c01ec6cec4735cf2917337a6278" + integrity sha512-d/Hs3nWDxNL2xAczmOVZNj92YZCS6RGxfBPjKzuu/XirCgXdpKEb88dYNbrYGint6IVWLNP+yonwVAuRC0T2Dg== + dependencies: + "@types/express" "*" + +"@types/serve-static@*", "@types/serve-static@^1.13.10": + version "1.13.10" + resolved "https://registry.yarnpkg.com/@types/serve-static/-/serve-static-1.13.10.tgz#f5e0ce8797d2d7cc5ebeda48a52c96c4fa47a8d9" + integrity sha512-nCkHGI4w7ZgAdNkrEu0bv+4xNV/XDqW+DydknebMOQwkpDGx8G+HTlj7R7ABI8i8nKxVw0wtKPi1D+lPOkh4YQ== + dependencies: + "@types/mime" "^1" + "@types/node" "*" + +"@types/sockjs@^0.3.33": + version "0.3.33" + resolved "https://registry.yarnpkg.com/@types/sockjs/-/sockjs-0.3.33.tgz#570d3a0b99ac995360e3136fd6045113b1bd236f" + integrity sha512-f0KEEe05NvUnat+boPTZ0dgaLZ4SfSouXUgv5noUiefG2ajgKjmETo9ZJyuqsl7dfl2aHlLJUiki6B4ZYldiiw== + dependencies: + "@types/node" "*" + +"@types/ws@^8.5.1": + version "8.5.3" + resolved "https://registry.yarnpkg.com/@types/ws/-/ws-8.5.3.tgz#7d25a1ffbecd3c4f2d35068d0b283c037003274d" + integrity sha512-6YOoWjruKj1uLf3INHH7D3qTXwFfEsg1kf3c0uDdSBJwfa/llkwIjrAGV7j7mVgGNbzTQ3HiHKKDXl6bJPD97w== + dependencies: + "@types/node" "*" + +"@ungap/promise-all-settled@1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz#aa58042711d6e3275dd37dc597e5d31e8c290a44" + integrity sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q== + +"@webassemblyjs/ast@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.11.1.tgz#2bfd767eae1a6996f432ff7e8d7fc75679c0b6a7" + integrity sha512-ukBh14qFLjxTQNTXocdyksN5QdM28S1CxHt2rdskFyL+xFV7VremuBLVbmCePj+URalXBENx/9Lm7lnhihtCSw== + dependencies: + "@webassemblyjs/helper-numbers" "1.11.1" + "@webassemblyjs/helper-wasm-bytecode" "1.11.1" + +"@webassemblyjs/floating-point-hex-parser@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.1.tgz#f6c61a705f0fd7a6aecaa4e8198f23d9dc179e4f" + integrity sha512-iGRfyc5Bq+NnNuX8b5hwBrRjzf0ocrJPI6GWFodBFzmFnyvrQ83SHKhmilCU/8Jv67i4GJZBMhEzltxzcNagtQ== + +"@webassemblyjs/helper-api-error@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.1.tgz#1a63192d8788e5c012800ba6a7a46c705288fd16" + integrity sha512-RlhS8CBCXfRUR/cwo2ho9bkheSXG0+NwooXcc3PAILALf2QLdFyj7KGsKRbVc95hZnhnERon4kW/D3SZpp6Tcg== + +"@webassemblyjs/helper-buffer@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.1.tgz#832a900eb444884cde9a7cad467f81500f5e5ab5" + integrity sha512-gwikF65aDNeeXa8JxXa2BAk+REjSyhrNC9ZwdT0f8jc4dQQeDQ7G4m0f2QCLPJiMTTO6wfDmRmj/pW0PsUvIcA== + +"@webassemblyjs/helper-numbers@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.1.tgz#64d81da219fbbba1e3bd1bfc74f6e8c4e10a62ae" + integrity sha512-vDkbxiB8zfnPdNK9Rajcey5C0w+QJugEglN0of+kmO8l7lDb77AnlKYQF7aarZuCrv+l0UvqL+68gSDr3k9LPQ== + dependencies: + "@webassemblyjs/floating-point-hex-parser" "1.11.1" + "@webassemblyjs/helper-api-error" "1.11.1" + "@xtuc/long" "4.2.2" + +"@webassemblyjs/helper-wasm-bytecode@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.1.tgz#f328241e41e7b199d0b20c18e88429c4433295e1" + integrity sha512-PvpoOGiJwXeTrSf/qfudJhwlvDQxFgelbMqtq52WWiXC6Xgg1IREdngmPN3bs4RoO83PnL/nFrxucXj1+BX62Q== + +"@webassemblyjs/helper-wasm-section@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.1.tgz#21ee065a7b635f319e738f0dd73bfbda281c097a" + integrity sha512-10P9No29rYX1j7F3EVPX3JvGPQPae+AomuSTPiF9eBQeChHI6iqjMIwR9JmOJXwpnn/oVGDk7I5IlskuMwU/pg== + dependencies: + "@webassemblyjs/ast" "1.11.1" + "@webassemblyjs/helper-buffer" "1.11.1" + "@webassemblyjs/helper-wasm-bytecode" "1.11.1" + "@webassemblyjs/wasm-gen" "1.11.1" + +"@webassemblyjs/ieee754@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/ieee754/-/ieee754-1.11.1.tgz#963929e9bbd05709e7e12243a099180812992614" + integrity sha512-hJ87QIPtAMKbFq6CGTkZYJivEwZDbQUgYd3qKSadTNOhVY7p+gfP6Sr0lLRVTaG1JjFj+r3YchoqRYxNH3M0GQ== + dependencies: + "@xtuc/ieee754" "^1.2.0" + +"@webassemblyjs/leb128@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/leb128/-/leb128-1.11.1.tgz#ce814b45574e93d76bae1fb2644ab9cdd9527aa5" + integrity sha512-BJ2P0hNZ0u+Th1YZXJpzW6miwqQUGcIHT1G/sf72gLVD9DZ5AdYTqPNbHZh6K1M5VmKvFXwGSWZADz+qBWxeRw== + dependencies: + "@xtuc/long" "4.2.2" + +"@webassemblyjs/utf8@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/utf8/-/utf8-1.11.1.tgz#d1f8b764369e7c6e6bae350e854dec9a59f0a3ff" + integrity sha512-9kqcxAEdMhiwQkHpkNiorZzqpGrodQQ2IGrHHxCy+Ozng0ofyMA0lTqiLkVs1uzTRejX+/O0EOT7KxqVPuXosQ== + +"@webassemblyjs/wasm-edit@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.1.tgz#ad206ebf4bf95a058ce9880a8c092c5dec8193d6" + integrity sha512-g+RsupUC1aTHfR8CDgnsVRVZFJqdkFHpsHMfJuWQzWU3tvnLC07UqHICfP+4XyL2tnr1amvl1Sdp06TnYCmVkA== + dependencies: + "@webassemblyjs/ast" "1.11.1" + "@webassemblyjs/helper-buffer" "1.11.1" + "@webassemblyjs/helper-wasm-bytecode" "1.11.1" + "@webassemblyjs/helper-wasm-section" "1.11.1" + "@webassemblyjs/wasm-gen" "1.11.1" + "@webassemblyjs/wasm-opt" "1.11.1" + "@webassemblyjs/wasm-parser" "1.11.1" + "@webassemblyjs/wast-printer" "1.11.1" + +"@webassemblyjs/wasm-gen@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.1.tgz#86c5ea304849759b7d88c47a32f4f039ae3c8f76" + integrity sha512-F7QqKXwwNlMmsulj6+O7r4mmtAlCWfO/0HdgOxSklZfQcDu0TpLiD1mRt/zF25Bk59FIjEuGAIyn5ei4yMfLhA== + dependencies: + "@webassemblyjs/ast" "1.11.1" + "@webassemblyjs/helper-wasm-bytecode" "1.11.1" + "@webassemblyjs/ieee754" "1.11.1" + "@webassemblyjs/leb128" "1.11.1" + "@webassemblyjs/utf8" "1.11.1" + +"@webassemblyjs/wasm-opt@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.1.tgz#657b4c2202f4cf3b345f8a4c6461c8c2418985f2" + integrity sha512-VqnkNqnZlU5EB64pp1l7hdm3hmQw7Vgqa0KF/KCNO9sIpI6Fk6brDEiX+iCOYrvMuBWDws0NkTOxYEb85XQHHw== + dependencies: + "@webassemblyjs/ast" "1.11.1" + "@webassemblyjs/helper-buffer" "1.11.1" + "@webassemblyjs/wasm-gen" "1.11.1" + "@webassemblyjs/wasm-parser" "1.11.1" + +"@webassemblyjs/wasm-parser@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.1.tgz#86ca734534f417e9bd3c67c7a1c75d8be41fb199" + integrity sha512-rrBujw+dJu32gYB7/Lup6UhdkPx9S9SnobZzRVL7VcBH9Bt9bCBLEuX/YXOOtBsOZ4NQrRykKhffRWHvigQvOA== + dependencies: + "@webassemblyjs/ast" "1.11.1" + "@webassemblyjs/helper-api-error" "1.11.1" + "@webassemblyjs/helper-wasm-bytecode" "1.11.1" + "@webassemblyjs/ieee754" "1.11.1" + "@webassemblyjs/leb128" "1.11.1" + "@webassemblyjs/utf8" "1.11.1" + +"@webassemblyjs/wast-printer@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wast-printer/-/wast-printer-1.11.1.tgz#d0c73beda8eec5426f10ae8ef55cee5e7084c2f0" + integrity sha512-IQboUWM4eKzWW+N/jij2sRatKMh99QEelo3Eb2q0qXkvPRISAj8Qxtmw5itwqK+TTkBuUIE45AxYPToqPtL5gg== + dependencies: + "@webassemblyjs/ast" "1.11.1" + "@xtuc/long" "4.2.2" + +"@webpack-cli/configtest@^1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@webpack-cli/configtest/-/configtest-1.2.0.tgz#7b20ce1c12533912c3b217ea68262365fa29a6f5" + integrity sha512-4FB8Tj6xyVkyqjj1OaTqCjXYULB9FMkqQ8yGrZjRDrYh0nOE+7Lhs45WioWQQMV+ceFlE368Ukhe6xdvJM9Egg== + +"@webpack-cli/info@^1.5.0": + version "1.5.0" + resolved "https://registry.yarnpkg.com/@webpack-cli/info/-/info-1.5.0.tgz#6c78c13c5874852d6e2dd17f08a41f3fe4c261b1" + integrity sha512-e8tSXZpw2hPl2uMJY6fsMswaok5FdlGNRTktvFk2sD8RjH0hE2+XistawJx1vmKteh4NmGmNUrp+Tb2w+udPcQ== + dependencies: + envinfo "^7.7.3" + +"@webpack-cli/serve@^1.7.0": + version "1.7.0" + resolved "https://registry.yarnpkg.com/@webpack-cli/serve/-/serve-1.7.0.tgz#e1993689ac42d2b16e9194376cfb6753f6254db1" + integrity sha512-oxnCNGj88fL+xzV+dacXs44HcDwf1ovs3AuEzvP7mqXw7fQntqIhQ1BRmynh4qEKQSSSRSWVyXRjmTbZIX9V2Q== + +"@xtuc/ieee754@^1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@xtuc/ieee754/-/ieee754-1.2.0.tgz#eef014a3145ae477a1cbc00cd1e552336dceb790" + integrity sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA== + +"@xtuc/long@4.2.2": + version "4.2.2" + resolved "https://registry.yarnpkg.com/@xtuc/long/-/long-4.2.2.tgz#d291c6a4e97989b5c61d9acf396ae4fe133a718d" + integrity sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ== + +abab@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.6.tgz#41b80f2c871d19686216b82309231cfd3cb3d291" + integrity sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA== + +accepts@~1.3.4, accepts@~1.3.5, accepts@~1.3.8: + version "1.3.8" + resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.8.tgz#0bf0be125b67014adcb0b0921e62db7bffe16b2e" + integrity sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw== + dependencies: + mime-types "~2.1.34" + negotiator "0.6.3" + +acorn-import-assertions@^1.7.6: + version "1.8.0" + resolved "https://registry.yarnpkg.com/acorn-import-assertions/-/acorn-import-assertions-1.8.0.tgz#ba2b5939ce62c238db6d93d81c9b111b29b855e9" + integrity sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw== + +acorn@^8.4.1, acorn@^8.5.0: + version "8.8.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.0.tgz#88c0187620435c7f6015803f5539dae05a9dbea8" + integrity sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w== + +ajv-formats@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ajv-formats/-/ajv-formats-2.1.1.tgz#6e669400659eb74973bbf2e33327180a0996b520" + integrity sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA== + dependencies: + ajv "^8.0.0" + +ajv-keywords@^3.5.2: + version "3.5.2" + resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.5.2.tgz#31f29da5ab6e00d1c2d329acf7b5929614d5014d" + integrity sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ== + +ajv-keywords@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-5.1.0.tgz#69d4d385a4733cdbeab44964a1170a88f87f0e16" + integrity sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw== + dependencies: + fast-deep-equal "^3.1.3" + +ajv@^6.12.5: + version "6.12.6" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" + integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== + dependencies: + fast-deep-equal "^3.1.1" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" + +ajv@^8.0.0, ajv@^8.8.0: + version "8.11.0" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.11.0.tgz#977e91dd96ca669f54a11e23e378e33b884a565f" + integrity sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg== + dependencies: + fast-deep-equal "^3.1.1" + json-schema-traverse "^1.0.0" + require-from-string "^2.0.2" + uri-js "^4.2.2" + +ansi-colors@4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" + integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== + +ansi-html-community@^0.0.8: + version "0.0.8" + resolved "https://registry.yarnpkg.com/ansi-html-community/-/ansi-html-community-0.0.8.tgz#69fbc4d6ccbe383f9736934ae34c3f8290f1bf41" + integrity sha512-1APHAyr3+PCamwNw3bXCPp4HFLONZt/yIH0sZp0/469KWNTEy+qN5jQ3GVX6DMZ1UXAi34yVwtTeaG/HpBuuzw== + +ansi-regex@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" + integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== + +ansi-styles@^4.0.0, ansi-styles@^4.1.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== + dependencies: + color-convert "^2.0.1" + +anymatch@~3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716" + integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg== + dependencies: + normalize-path "^3.0.0" + picomatch "^2.0.4" + +argparse@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" + integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== + +array-flatten@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" + integrity sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg== + +array-flatten@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-2.1.2.tgz#24ef80a28c1a893617e2149b0c6d0d788293b099" + integrity sha512-hNfzcOV8W4NdualtqBFPyVO+54DSJuZGY9qT4pRroB6S9e3iiido2ISIC5h9R2sPJ8H3FHCIiEnsv1lPXO3KtQ== + +balanced-match@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" + integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== + +batch@0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/batch/-/batch-0.6.1.tgz#dc34314f4e679318093fc760272525f94bf25c16" + integrity sha512-x+VAiMRL6UPkx+kudNvxTl6hB2XNNCG2r+7wixVfIYwu/2HKRXimwQyaumLjMveWvT2Hkd/cAJw+QBMfJ/EKVw== + +binary-extensions@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" + integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== + +body-parser@1.20.0: + version "1.20.0" + resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.0.tgz#3de69bd89011c11573d7bfee6a64f11b6bd27cc5" + integrity sha512-DfJ+q6EPcGKZD1QWUjSpqp+Q7bDQTsQIF4zfUAtZ6qk+H/3/QRhg9CEp39ss+/T2vw0+HaidC0ecJj/DRLIaKg== + dependencies: + bytes "3.1.2" + content-type "~1.0.4" + debug "2.6.9" + depd "2.0.0" + destroy "1.2.0" + http-errors "2.0.0" + iconv-lite "0.4.24" + on-finished "2.4.1" + qs "6.10.3" + raw-body "2.5.1" + type-is "~1.6.18" + unpipe "1.0.0" + +bonjour-service@^1.0.11: + version "1.0.13" + resolved "https://registry.yarnpkg.com/bonjour-service/-/bonjour-service-1.0.13.tgz#4ac003dc1626023252d58adf2946f57e5da450c1" + integrity sha512-LWKRU/7EqDUC9CTAQtuZl5HzBALoCYwtLhffW3et7vZMwv3bWLpJf8bRYlMD5OCcDpTfnPgNCV4yo9ZIaJGMiA== + dependencies: + array-flatten "^2.1.2" + dns-equal "^1.0.0" + fast-deep-equal "^3.1.3" + multicast-dns "^7.2.5" + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +brace-expansion@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae" + integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA== + dependencies: + balanced-match "^1.0.0" + +braces@^3.0.2, braces@~3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" + integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== + dependencies: + fill-range "^7.0.1" + +browser-stdout@1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" + integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== + +browserslist@^4.14.5: + version "4.21.3" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.21.3.tgz#5df277694eb3c48bc5c4b05af3e8b7e09c5a6d1a" + integrity sha512-898rgRXLAyRkM1GryrrBHGkqA5hlpkV5MhtZwg9QXeiyLUYs2k00Un05aX5l2/yJIOObYKOpS2JNo8nJDE7fWQ== + dependencies: + caniuse-lite "^1.0.30001370" + electron-to-chromium "^1.4.202" + node-releases "^2.0.6" + update-browserslist-db "^1.0.5" + +buffer-from@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" + integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== + +bytes@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048" + integrity sha512-pMhOfFDPiv9t5jjIXkHosWmkSyQbvsgEVNkz0ERHbuLh2T/7j4Mqqpz523Fe8MVY89KC6Sh/QfS2sM+SjgFDcw== + +bytes@3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.2.tgz#8b0beeb98605adf1b128fa4386403c009e0221a5" + integrity sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg== + +call-bind@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" + integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA== + dependencies: + function-bind "^1.1.1" + get-intrinsic "^1.0.2" + +camelcase@^6.0.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" + integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== + +caniuse-lite@^1.0.30001370: + version "1.0.30001370" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001370.tgz#0a30d4f20d38b9e108cc5ae7cc62df9fe66cd5ba" + integrity sha512-3PDmaP56wz/qz7G508xzjx8C+MC2qEm4SYhSEzC9IBROo+dGXFWRuaXkWti0A9tuI00g+toiriVqxtWMgl350g== + +chalk@^4.1.0: + version "4.1.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" + integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + +chokidar@3.5.3, chokidar@^3.5.3: + version "3.5.3" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" + integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== + dependencies: + anymatch "~3.1.2" + braces "~3.0.2" + glob-parent "~5.1.2" + is-binary-path "~2.1.0" + is-glob "~4.0.1" + normalize-path "~3.0.0" + readdirp "~3.6.0" + optionalDependencies: + fsevents "~2.3.2" + +chrome-trace-event@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz#1015eced4741e15d06664a957dbbf50d041e26ac" + integrity sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg== + +cliui@^7.0.2: + version "7.0.4" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" + integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.0" + wrap-ansi "^7.0.0" + +clone-deep@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/clone-deep/-/clone-deep-4.0.1.tgz#c19fd9bdbbf85942b4fd979c84dcf7d5f07c2387" + integrity sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ== + dependencies: + is-plain-object "^2.0.4" + kind-of "^6.0.2" + shallow-clone "^3.0.0" + +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + +color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + +colorette@^2.0.10, colorette@^2.0.14: + version "2.0.19" + resolved "https://registry.yarnpkg.com/colorette/-/colorette-2.0.19.tgz#cdf044f47ad41a0f4b56b3a0d5b4e6e1a2d5a798" + integrity sha512-3tlv/dIP7FWvj3BsbHrGLJ6l/oKh1O3TcgBqMn+yyCagOxc23fyzDS6HypQbgxWbkpDnf52p1LuR4eWDQ/K9WQ== + +commander@^2.20.0: + version "2.20.3" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" + integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== + +commander@^7.0.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-7.2.0.tgz#a36cb57d0b501ce108e4d20559a150a391d97ab7" + integrity sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw== + +compressible@~2.0.16: + version "2.0.18" + resolved "https://registry.yarnpkg.com/compressible/-/compressible-2.0.18.tgz#af53cca6b070d4c3c0750fbd77286a6d7cc46fba" + integrity sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg== + dependencies: + mime-db ">= 1.43.0 < 2" + +compression@^1.7.4: + version "1.7.4" + resolved "https://registry.yarnpkg.com/compression/-/compression-1.7.4.tgz#95523eff170ca57c29a0ca41e6fe131f41e5bb8f" + integrity sha512-jaSIDzP9pZVS4ZfQ+TzvtiWhdpFhE2RDHz8QJkpX9SIpLq88VueF5jJw6t+6CUQcAoA6t+x89MLrWAqpfDE8iQ== + dependencies: + accepts "~1.3.5" + bytes "3.0.0" + compressible "~2.0.16" + debug "2.6.9" + on-headers "~1.0.2" + safe-buffer "5.1.2" + vary "~1.1.2" + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== + +connect-history-api-fallback@^1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/connect-history-api-fallback/-/connect-history-api-fallback-1.6.0.tgz#8b32089359308d111115d81cad3fceab888f97bc" + integrity sha512-e54B99q/OUoH64zYYRf3HBP5z24G38h5D3qXu23JGRoigpX5Ss4r9ZnDk3g0Z8uQC2x2lPaJ+UlWBc1ZWBWdLg== + +content-disposition@0.5.4: + version "0.5.4" + resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.4.tgz#8b82b4efac82512a02bb0b1dcec9d2c5e8eb5bfe" + integrity sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ== + dependencies: + safe-buffer "5.2.1" + +content-type@~1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" + integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== + +cookie-signature@1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" + integrity sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ== + +cookie@0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.5.0.tgz#d1f5d71adec6558c58f389987c366aa47e994f8b" + integrity sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw== + +core-util-is@~1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85" + integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ== + +cross-spawn@^7.0.3: + version "7.0.3" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" + integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== + dependencies: + path-key "^3.1.0" + shebang-command "^2.0.0" + which "^2.0.1" + +debug@2.6.9: + version "2.6.9" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== + dependencies: + ms "2.0.0" + +debug@4.3.4, debug@^4.1.0: + version "4.3.4" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" + integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== + dependencies: + ms "2.1.2" + +"decamelize@>=4.0.0 <5.0.0", decamelize@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-4.0.0.tgz#aa472d7bf660eb15f3494efd531cab7f2a709837" + integrity sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ== + +default-gateway@^6.0.3: + version "6.0.3" + resolved "https://registry.yarnpkg.com/default-gateway/-/default-gateway-6.0.3.tgz#819494c888053bdb743edbf343d6cdf7f2943a71" + integrity sha512-fwSOJsbbNzZ/CUFpqFBqYfYNLj1NbMPm8MMCIzHjC83iSJRBEGmDUxU+WP661BaBQImeC2yHwXtz+P/O9o+XEg== + dependencies: + execa "^5.0.0" + +define-lazy-prop@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz#3f7ae421129bcaaac9bc74905c98a0009ec9ee7f" + integrity sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og== + +depd@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df" + integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw== + +depd@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" + integrity sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ== + +destroy@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.2.0.tgz#4803735509ad8be552934c67df614f94e66fa015" + integrity sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg== + +detect-node@^2.0.4: + version "2.1.0" + resolved "https://registry.yarnpkg.com/detect-node/-/detect-node-2.1.0.tgz#c9c70775a49c3d03bc2c06d9a73be550f978f8b1" + integrity sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g== + +diff@5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-5.0.0.tgz#7ed6ad76d859d030787ec35855f5b1daf31d852b" + integrity sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w== + +dns-equal@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/dns-equal/-/dns-equal-1.0.0.tgz#b39e7f1da6eb0a75ba9c17324b34753c47e0654d" + integrity sha512-z+paD6YUQsk+AbGCEM4PrOXSss5gd66QfcVBFTKR/HpFL9jCqikS94HYwKww6fQyO7IxrIIyUu+g0Ka9tUS2Cg== + +dns-packet@^5.2.2: + version "5.4.0" + resolved "https://registry.yarnpkg.com/dns-packet/-/dns-packet-5.4.0.tgz#1f88477cf9f27e78a213fb6d118ae38e759a879b" + integrity sha512-EgqGeaBB8hLiHLZtp/IbaDQTL8pZ0+IvwzSHA6d7VyMDM+B9hgddEMa9xjK5oYnw0ci0JQ6g2XCD7/f6cafU6g== + dependencies: + "@leichtgewicht/ip-codec" "^2.0.1" + +dukat@0.5.8-rc.4: + version "0.5.8-rc.4" + resolved "https://registry.yarnpkg.com/dukat/-/dukat-0.5.8-rc.4.tgz#90384dcb50b14c26f0e99dae92b2dea44f5fce21" + integrity sha512-ZnMt6DGBjlVgK2uQamXfd7uP/AxH7RqI0BL9GLrrJb2gKdDxvJChWy+M9AQEaL+7/6TmxzJxFOsRiInY9oGWTA== + dependencies: + google-protobuf "3.12.2" + typescript "3.9.5" + +ee-first@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" + integrity sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow== + +electron-to-chromium@^1.4.202: + version "1.4.202" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.202.tgz#0c2ed733f42b02ec49a955c5badfcc65888c390b" + integrity sha512-JYsK2ex9lmQD27kj19fhXYxzFJ/phLAkLKHv49A5UY6kMRV2xED3qMMLg/voW/+0AR6wMiI+VxlmK9NDtdxlPA== + +emoji-regex@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" + integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== + +encodeurl@~1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" + integrity sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w== + +enhanced-resolve@^5.9.3: + version "5.10.0" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.10.0.tgz#0dc579c3bb2a1032e357ac45b8f3a6f3ad4fb1e6" + integrity sha512-T0yTFjdpldGY8PmuXXR0PyQ1ufZpEGiHVrp7zHKB7jdR4qlmZHhONVM5AQOAWXuF/w3dnHbEQVrNptJgt7F+cQ== + dependencies: + graceful-fs "^4.2.4" + tapable "^2.2.0" + +envinfo@^7.7.3: + version "7.8.1" + resolved "https://registry.yarnpkg.com/envinfo/-/envinfo-7.8.1.tgz#06377e3e5f4d379fea7ac592d5ad8927e0c4d475" + integrity sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw== + +es-module-lexer@^0.9.0: + version "0.9.3" + resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-0.9.3.tgz#6f13db00cc38417137daf74366f535c8eb438f19" + integrity sha512-1HQ2M2sPtxwnvOvT1ZClHyQDiggdNjURWpY2we6aMKCQiUVxTmVs2UYPLIrD84sS+kMdUwfBSylbJPwNnBrnHQ== + +escalade@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" + integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== + +escape-html@~1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" + integrity sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow== + +escape-string-regexp@4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" + integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== + +eslint-scope@5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" + integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== + dependencies: + esrecurse "^4.3.0" + estraverse "^4.1.1" + +esrecurse@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921" + integrity sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag== + dependencies: + estraverse "^5.2.0" + +estraverse@^4.1.1: + version "4.3.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" + integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== + +estraverse@^5.2.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" + integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== + +etag@~1.8.1: + version "1.8.1" + resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" + integrity sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg== + +eventemitter3@^4.0.0: + version "4.0.7" + resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f" + integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw== + +events@^3.2.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400" + integrity sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q== + +execa@^5.0.0: + version "5.1.1" + resolved "https://registry.yarnpkg.com/execa/-/execa-5.1.1.tgz#f80ad9cbf4298f7bd1d4c9555c21e93741c411dd" + integrity sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg== + dependencies: + cross-spawn "^7.0.3" + get-stream "^6.0.0" + human-signals "^2.1.0" + is-stream "^2.0.0" + merge-stream "^2.0.0" + npm-run-path "^4.0.1" + onetime "^5.1.2" + signal-exit "^3.0.3" + strip-final-newline "^2.0.0" + +express@^4.17.3: + version "4.18.1" + resolved "https://registry.yarnpkg.com/express/-/express-4.18.1.tgz#7797de8b9c72c857b9cd0e14a5eea80666267caf" + integrity sha512-zZBcOX9TfehHQhtupq57OF8lFZ3UZi08Y97dwFCkD8p9d/d2Y3M+ykKcwaMDEL+4qyUolgBDX6AblpR3fL212Q== + dependencies: + accepts "~1.3.8" + array-flatten "1.1.1" + body-parser "1.20.0" + content-disposition "0.5.4" + content-type "~1.0.4" + cookie "0.5.0" + cookie-signature "1.0.6" + debug "2.6.9" + depd "2.0.0" + encodeurl "~1.0.2" + escape-html "~1.0.3" + etag "~1.8.1" + finalhandler "1.2.0" + fresh "0.5.2" + http-errors "2.0.0" + merge-descriptors "1.0.1" + methods "~1.1.2" + on-finished "2.4.1" + parseurl "~1.3.3" + path-to-regexp "0.1.7" + proxy-addr "~2.0.7" + qs "6.10.3" + range-parser "~1.2.1" + safe-buffer "5.2.1" + send "0.18.0" + serve-static "1.15.0" + setprototypeof "1.2.0" + statuses "2.0.1" + type-is "~1.6.18" + utils-merge "1.0.1" + vary "~1.1.2" + +fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" + integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== + +fast-json-stable-stringify@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" + integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== + +fastest-levenshtein@^1.0.12: + version "1.0.14" + resolved "https://registry.yarnpkg.com/fastest-levenshtein/-/fastest-levenshtein-1.0.14.tgz#9054384e4b7a78c88d01a4432dc18871af0ac859" + integrity sha512-tFfWHjnuUfKE186Tfgr+jtaFc0mZTApEgKDOeyN+FwOqRkO/zK/3h1AiRd8u8CY53owL3CUmGr/oI9p/RdyLTA== + +faye-websocket@^0.11.3: + version "0.11.4" + resolved "https://registry.yarnpkg.com/faye-websocket/-/faye-websocket-0.11.4.tgz#7f0d9275cfdd86a1c963dc8b65fcc451edcbb1da" + integrity sha512-CzbClwlXAuiRQAlUyfqPgvPoNKTckTPGfwZV4ZdAhVcP2lh9KUxJg2b5GkE7XbjKQ3YJnQ9z6D9ntLAlB+tP8g== + dependencies: + websocket-driver ">=0.5.1" + +fill-range@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" + integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== + dependencies: + to-regex-range "^5.0.1" + +finalhandler@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.2.0.tgz#7d23fe5731b207b4640e4fcd00aec1f9207a7b32" + integrity sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg== + dependencies: + debug "2.6.9" + encodeurl "~1.0.2" + escape-html "~1.0.3" + on-finished "2.4.1" + parseurl "~1.3.3" + statuses "2.0.1" + unpipe "~1.0.0" + +find-up@5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" + integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== + dependencies: + locate-path "^6.0.0" + path-exists "^4.0.0" + +find-up@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" + integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== + dependencies: + locate-path "^5.0.0" + path-exists "^4.0.0" + +flat@^5.0.2: + version "5.0.2" + resolved "https://registry.yarnpkg.com/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241" + integrity sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ== + +follow-redirects@^1.0.0: + version "1.15.1" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.1.tgz#0ca6a452306c9b276e4d3127483e29575e207ad5" + integrity sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA== + +format-util@1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/format-util/-/format-util-1.0.5.tgz#1ffb450c8a03e7bccffe40643180918cc297d271" + integrity sha512-varLbTj0e0yVyRpqQhuWV+8hlePAgaoFRhNFj50BNjEIrw1/DphHSObtqwskVCPWNgzwPoQrZAbfa/SBiicNeg== + +forwarded@0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.2.0.tgz#2269936428aad4c15c7ebe9779a84bf0b2a81811" + integrity sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow== + +fresh@0.5.2: + version "0.5.2" + resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" + integrity sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q== + +fs-monkey@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/fs-monkey/-/fs-monkey-1.0.3.tgz#ae3ac92d53bb328efe0e9a1d9541f6ad8d48e2d3" + integrity sha512-cybjIfiiE+pTWicSCLFHSrXZ6EilF30oh91FDP9S2B051prEa7QWfrVTQm10/dDpswBDXZugPa1Ogu8Yh+HV0Q== + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== + +fsevents@~2.3.2: + version "2.3.2" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" + integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== + +function-bind@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" + integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== + +get-caller-file@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" + integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== + +get-intrinsic@^1.0.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.2.tgz#336975123e05ad0b7ba41f152ee4aadbea6cf598" + integrity sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA== + dependencies: + function-bind "^1.1.1" + has "^1.0.3" + has-symbols "^1.0.3" + +get-stream@^6.0.0: + version "6.0.1" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" + integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== + +glob-parent@~5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" + integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== + dependencies: + is-glob "^4.0.1" + +glob-to-regexp@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz#c75297087c851b9a578bd217dd59a92f59fe546e" + integrity sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw== + +glob@7.2.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023" + integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +glob@^7.1.3: + version "7.2.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" + integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.1.1" + once "^1.3.0" + path-is-absolute "^1.0.0" + +google-protobuf@3.12.2: + version "3.12.2" + resolved "https://registry.yarnpkg.com/google-protobuf/-/google-protobuf-3.12.2.tgz#50ce9f9b6281235724eb243d6a83e969a2176e53" + integrity sha512-4CZhpuRr1d6HjlyrxoXoocoGFnRYgKULgMtikMddA9ztRyYR59Aondv2FioyxWVamRo0rF2XpYawkTCBEQOSkA== + +graceful-fs@^4.1.2, graceful-fs@^4.2.4, graceful-fs@^4.2.6, graceful-fs@^4.2.9: + version "4.2.10" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" + integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== + +handle-thing@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/handle-thing/-/handle-thing-2.0.1.tgz#857f79ce359580c340d43081cc648970d0bb234e" + integrity sha512-9Qn4yBxelxoh2Ow62nP+Ka/kMnOXRi8BXnRaUwezLNhqelnN49xKz4F/dPP8OYLxLxq6JDtZb2i9XznUQbNPTg== + +has-flag@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" + integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== + +has-symbols@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8" + integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== + +has@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" + integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== + dependencies: + function-bind "^1.1.1" + +he@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" + integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== + +hpack.js@^2.1.6: + version "2.1.6" + resolved "https://registry.yarnpkg.com/hpack.js/-/hpack.js-2.1.6.tgz#87774c0949e513f42e84575b3c45681fade2a0b2" + integrity sha512-zJxVehUdMGIKsRaNt7apO2Gqp0BdqW5yaiGHXXmbpvxgBYVZnAql+BJb4RO5ad2MgpbZKn5G6nMnegrH1FcNYQ== + dependencies: + inherits "^2.0.1" + obuf "^1.0.0" + readable-stream "^2.0.1" + wbuf "^1.1.0" + +html-entities@^2.3.2: + version "2.3.3" + resolved "https://registry.yarnpkg.com/html-entities/-/html-entities-2.3.3.tgz#117d7626bece327fc8baace8868fa6f5ef856e46" + integrity sha512-DV5Ln36z34NNTDgnz0EWGBLZENelNAtkiFA4kyNOG2tDI6Mz1uSWiq1wAKdyjnJwyDiDO7Fa2SO1CTxPXL8VxA== + +http-deceiver@^1.2.7: + version "1.2.7" + resolved "https://registry.yarnpkg.com/http-deceiver/-/http-deceiver-1.2.7.tgz#fa7168944ab9a519d337cb0bec7284dc3e723d87" + integrity sha512-LmpOGxTfbpgtGVxJrj5k7asXHCgNZp5nLfp+hWc8QQRqtb7fUy6kRY3BO1h9ddF6yIPYUARgxGOwB42DnxIaNw== + +http-errors@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-2.0.0.tgz#b7774a1486ef73cf7667ac9ae0858c012c57b9d3" + integrity sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ== + dependencies: + depd "2.0.0" + inherits "2.0.4" + setprototypeof "1.2.0" + statuses "2.0.1" + toidentifier "1.0.1" + +http-errors@~1.6.2: + version "1.6.3" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.6.3.tgz#8b55680bb4be283a0b5bf4ea2e38580be1d9320d" + integrity sha512-lks+lVC8dgGyh97jxvxeYTWQFvh4uw4yC12gVl63Cg30sjPX4wuGcdkICVXDAESr6OJGjqGA8Iz5mkeN6zlD7A== + dependencies: + depd "~1.1.2" + inherits "2.0.3" + setprototypeof "1.1.0" + statuses ">= 1.4.0 < 2" + +http-parser-js@>=0.5.1: + version "0.5.8" + resolved "https://registry.yarnpkg.com/http-parser-js/-/http-parser-js-0.5.8.tgz#af23090d9ac4e24573de6f6aecc9d84a48bf20e3" + integrity sha512-SGeBX54F94Wgu5RH3X5jsDtf4eHyRogWX1XGT3b4HuW3tQPM4AaBzoUji/4AAJNXCEOWZ5O0DgZmJw1947gD5Q== + +http-proxy-middleware@^2.0.3: + version "2.0.6" + resolved "https://registry.yarnpkg.com/http-proxy-middleware/-/http-proxy-middleware-2.0.6.tgz#e1a4dd6979572c7ab5a4e4b55095d1f32a74963f" + integrity sha512-ya/UeJ6HVBYxrgYotAZo1KvPWlgB48kUJLDePFeneHsVujFaW5WNj2NgWCAE//B1Dl02BIfYlpNgBy8Kf8Rjmw== + dependencies: + "@types/http-proxy" "^1.17.8" + http-proxy "^1.18.1" + is-glob "^4.0.1" + is-plain-obj "^3.0.0" + micromatch "^4.0.2" + +http-proxy@^1.18.1: + version "1.18.1" + resolved "https://registry.yarnpkg.com/http-proxy/-/http-proxy-1.18.1.tgz#401541f0534884bbf95260334e72f88ee3976549" + integrity sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ== + dependencies: + eventemitter3 "^4.0.0" + follow-redirects "^1.0.0" + requires-port "^1.0.0" + +human-signals@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0" + integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== + +iconv-lite@0.4.24: + version "0.4.24" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" + integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== + dependencies: + safer-buffer ">= 2.1.2 < 3" + +iconv-lite@^0.6.3: + version "0.6.3" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.6.3.tgz#a52f80bf38da1952eb5c681790719871a1a72501" + integrity sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw== + dependencies: + safer-buffer ">= 2.1.2 < 3.0.0" + +import-local@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/import-local/-/import-local-3.1.0.tgz#b4479df8a5fd44f6cdce24070675676063c95cb4" + integrity sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg== + dependencies: + pkg-dir "^4.2.0" + resolve-cwd "^3.0.0" + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA== + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.3: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + +inherits@2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + integrity sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw== + +interpret@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/interpret/-/interpret-2.2.0.tgz#1a78a0b5965c40a5416d007ad6f50ad27c417df9" + integrity sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw== + +ipaddr.js@1.9.1: + version "1.9.1" + resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3" + integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g== + +ipaddr.js@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-2.0.1.tgz#eca256a7a877e917aeb368b0a7497ddf42ef81c0" + integrity sha512-1qTgH9NG+IIJ4yfKs2e6Pp1bZg8wbDbKHT21HrLIeYBTRLgMYKnMTPAuI3Lcs61nfx5h1xlXnbJtH1kX5/d/ng== + +is-binary-path@~2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" + integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== + dependencies: + binary-extensions "^2.0.0" + +is-core-module@^2.9.0: + version "2.9.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.9.0.tgz#e1c34429cd51c6dd9e09e0799e396e27b19a9c69" + integrity sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A== + dependencies: + has "^1.0.3" + +is-docker@^2.0.0, is-docker@^2.1.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-2.2.1.tgz#33eeabe23cfe86f14bde4408a02c0cfb853acdaa" + integrity sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ== + +is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== + +is-fullwidth-code-point@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" + integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== + +is-glob@^4.0.1, is-glob@~4.0.1: + version "4.0.3" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" + integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== + dependencies: + is-extglob "^2.1.1" + +is-number@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" + integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== + +is-plain-obj@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287" + integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA== + +is-plain-obj@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-3.0.0.tgz#af6f2ea14ac5a646183a5bbdb5baabbc156ad9d7" + integrity sha512-gwsOE28k+23GP1B6vFl1oVh/WOzmawBrKwo5Ev6wMKzPkaXaCDIQKzLnvsA42DRlbVTWorkgTKIviAKCWkfUwA== + +is-plain-object@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" + integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== + dependencies: + isobject "^3.0.1" + +is-stream@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077" + integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg== + +is-unicode-supported@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7" + integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw== + +is-wsl@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-2.2.0.tgz#74a4c76e77ca9fd3f932f290c17ea326cd157271" + integrity sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww== + dependencies: + is-docker "^2.0.0" + +isarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + integrity sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ== + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== + +isobject@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" + integrity sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg== + +jest-worker@^27.4.5: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.5.1.tgz#8d146f0900e8973b106b6f73cc1e9a8cb86f8db0" + integrity sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg== + dependencies: + "@types/node" "*" + merge-stream "^2.0.0" + supports-color "^8.0.0" + +"js-tokens@^3.0.0 || ^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== + +js-yaml@4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" + integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== + dependencies: + argparse "^2.0.1" + +json-parse-even-better-errors@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" + integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== + +json-schema-traverse@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" + integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== + +json-schema-traverse@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz#ae7bcb3656ab77a73ba5c49bf654f38e6b6860e2" + integrity sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug== + +kind-of@^6.0.2: + version "6.0.3" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" + integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== + +loader-runner@^4.2.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-4.3.0.tgz#c1b4a163b99f614830353b16755e7149ac2314e1" + integrity sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg== + +locate-path@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0" + integrity sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g== + dependencies: + p-locate "^4.1.0" + +locate-path@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" + integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== + dependencies: + p-locate "^5.0.0" + +log-symbols@4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.1.0.tgz#3fbdbb95b4683ac9fc785111e792e558d4abd503" + integrity sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg== + dependencies: + chalk "^4.1.0" + is-unicode-supported "^0.1.0" + +loose-envify@^1.1.0, loose-envify@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" + integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== + dependencies: + js-tokens "^3.0.0 || ^4.0.0" + +media-typer@0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" + integrity sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ== + +memfs@^3.4.3: + version "3.4.7" + resolved "https://registry.yarnpkg.com/memfs/-/memfs-3.4.7.tgz#e5252ad2242a724f938cb937e3c4f7ceb1f70e5a" + integrity sha512-ygaiUSNalBX85388uskeCyhSAoOSgzBbtVCr9jA2RROssFL9Q19/ZXFqS+2Th2sr1ewNIWgFdLzLC3Yl1Zv+lw== + dependencies: + fs-monkey "^1.0.3" + +merge-descriptors@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" + integrity sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w== + +merge-stream@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" + integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== + +methods@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" + integrity sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w== + +micromatch@^4.0.2: + version "4.0.5" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6" + integrity sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA== + dependencies: + braces "^3.0.2" + picomatch "^2.3.1" + +mime-db@1.52.0, "mime-db@>= 1.43.0 < 2": + version "1.52.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" + integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== + +mime-types@^2.1.27, mime-types@^2.1.31, mime-types@~2.1.17, mime-types@~2.1.24, mime-types@~2.1.34: + version "2.1.35" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" + integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== + dependencies: + mime-db "1.52.0" + +mime@1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" + integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== + +mimic-fn@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" + integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== + +minimalistic-assert@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" + integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A== + +minimatch@5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.0.1.tgz#fb9022f7528125187c92bd9e9b6366be1cf3415b" + integrity sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g== + dependencies: + brace-expansion "^2.0.1" + +minimatch@^3.0.4, minimatch@^3.1.1: + version "3.1.2" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" + integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== + dependencies: + brace-expansion "^1.1.7" + +mocha@10.0.0: + version "10.0.0" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-10.0.0.tgz#205447d8993ec755335c4b13deba3d3a13c4def9" + integrity sha512-0Wl+elVUD43Y0BqPZBzZt8Tnkw9CMUdNYnUsTfOM1vuhJVZL+kiesFYsqwBkEEuEixaiPe5ZQdqDgX2jddhmoA== + dependencies: + "@ungap/promise-all-settled" "1.1.2" + ansi-colors "4.1.1" + browser-stdout "1.3.1" + chokidar "3.5.3" + debug "4.3.4" + diff "5.0.0" + escape-string-regexp "4.0.0" + find-up "5.0.0" + glob "7.2.0" + he "1.2.0" + js-yaml "4.1.0" + log-symbols "4.1.0" + minimatch "5.0.1" + ms "2.1.3" + nanoid "3.3.3" + serialize-javascript "6.0.0" + strip-json-comments "3.1.1" + supports-color "8.1.1" + workerpool "6.2.1" + yargs "16.2.0" + yargs-parser "20.2.4" + yargs-unparser "2.0.0" + +moment@2.29.1: + version "2.29.1" + resolved "https://registry.yarnpkg.com/moment/-/moment-2.29.1.tgz#b2be769fa31940be9eeea6469c075e35006fa3d3" + integrity sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ== + +ms@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + integrity sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A== + +ms@2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== + +ms@2.1.3: + version "2.1.3" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" + integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== + +multicast-dns@^7.2.5: + version "7.2.5" + resolved "https://registry.yarnpkg.com/multicast-dns/-/multicast-dns-7.2.5.tgz#77eb46057f4d7adbd16d9290fa7299f6fa64cced" + integrity sha512-2eznPJP8z2BFLX50tf0LuODrpINqP1RVIm/CObbTcBRITQgmC/TjcREF1NeTBzIcR5XO/ukWo+YHOjBbFwIupg== + dependencies: + dns-packet "^5.2.2" + thunky "^1.0.2" + +nanoid@3.3.3: + version "3.3.3" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.3.tgz#fd8e8b7aa761fe807dba2d1b98fb7241bb724a25" + integrity sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w== + +negotiator@0.6.3: + version "0.6.3" + resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.3.tgz#58e323a72fedc0d6f9cd4d31fe49f51479590ccd" + integrity sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg== + +neo-async@^2.6.2: + version "2.6.2" + resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f" + integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== + +node-forge@^1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-1.3.1.tgz#be8da2af243b2417d5f646a770663a92b7e9ded3" + integrity sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA== + +node-releases@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.6.tgz#8a7088c63a55e493845683ebf3c828d8c51c5503" + integrity sha512-PiVXnNuFm5+iYkLBNeq5211hvO38y63T0i2KKh2KnUs3RpzJ+JtODFjkD8yjLwnDkTYF1eKXheUwdssR+NRZdg== + +normalize-path@^3.0.0, normalize-path@~3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" + integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== + +npm-run-path@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea" + integrity sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw== + dependencies: + path-key "^3.0.0" + +object-assign@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + integrity sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg== + +object-inspect@^1.9.0: + version "1.12.2" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.2.tgz#c0641f26394532f28ab8d796ab954e43c009a8ea" + integrity sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ== + +obuf@^1.0.0, obuf@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/obuf/-/obuf-1.1.2.tgz#09bea3343d41859ebd446292d11c9d4db619084e" + integrity sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg== + +on-finished@2.4.1: + version "2.4.1" + resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.4.1.tgz#58c8c44116e54845ad57f14ab10b03533184ac3f" + integrity sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg== + dependencies: + ee-first "1.1.1" + +on-headers@~1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/on-headers/-/on-headers-1.0.2.tgz#772b0ae6aaa525c399e489adfad90c403eb3c28f" + integrity sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA== + +once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== + dependencies: + wrappy "1" + +onetime@^5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" + integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== + dependencies: + mimic-fn "^2.1.0" + +open@^8.0.9: + version "8.4.0" + resolved "https://registry.yarnpkg.com/open/-/open-8.4.0.tgz#345321ae18f8138f82565a910fdc6b39e8c244f8" + integrity sha512-XgFPPM+B28FtCCgSb9I+s9szOC1vZRSwgWsRUA5ylIxRTgKozqjOCrVOqGsYABPYK5qnfqClxZTFBa8PKt2v6Q== + dependencies: + define-lazy-prop "^2.0.0" + is-docker "^2.1.1" + is-wsl "^2.2.0" + +p-limit@^2.2.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" + integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== + dependencies: + p-try "^2.0.0" + +p-limit@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" + integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== + dependencies: + yocto-queue "^0.1.0" + +p-locate@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07" + integrity sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A== + dependencies: + p-limit "^2.2.0" + +p-locate@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" + integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== + dependencies: + p-limit "^3.0.2" + +p-retry@^4.5.0: + version "4.6.2" + resolved "https://registry.yarnpkg.com/p-retry/-/p-retry-4.6.2.tgz#9baae7184057edd4e17231cee04264106e092a16" + integrity sha512-312Id396EbJdvRONlngUx0NydfrIQ5lsYu0znKVUzVvArzEIt08V1qhtyESbGVd1FGX7UKtiFp5uwKZdM8wIuQ== + dependencies: + "@types/retry" "0.12.0" + retry "^0.13.1" + +p-try@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" + integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== + +parseurl@~1.3.2, parseurl@~1.3.3: + version "1.3.3" + resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" + integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== + +path-exists@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" + integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== + +path-key@^3.0.0, path-key@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" + integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== + +path-parse@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" + integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== + +path-to-regexp@0.1.7: + version "0.1.7" + resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" + integrity sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ== + +picocolors@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" + integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== + +picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" + integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== + +pkg-dir@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-4.2.0.tgz#f099133df7ede422e81d1d8448270eeb3e4261f3" + integrity sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ== + dependencies: + find-up "^4.0.0" + +process-nextick-args@~2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" + integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== + +prop-types@^15.6.2: + version "15.8.1" + resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5" + integrity sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg== + dependencies: + loose-envify "^1.4.0" + object-assign "^4.1.1" + react-is "^16.13.1" + +proxy-addr@~2.0.7: + version "2.0.7" + resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.7.tgz#f19fe69ceab311eeb94b42e70e8c2070f9ba1025" + integrity sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg== + dependencies: + forwarded "0.2.0" + ipaddr.js "1.9.1" + +punycode@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" + integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== + +qs@6.10.3: + version "6.10.3" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.10.3.tgz#d6cde1b2ffca87b5aa57889816c5f81535e22e8e" + integrity sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ== + dependencies: + side-channel "^1.0.4" + +randombytes@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" + integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== + dependencies: + safe-buffer "^5.1.0" + +range-parser@^1.2.1, range-parser@~1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" + integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== + +raw-body@2.5.1: + version "2.5.1" + resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.5.1.tgz#fe1b1628b181b700215e5fd42389f98b71392857" + integrity sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig== + dependencies: + bytes "3.1.2" + http-errors "2.0.0" + iconv-lite "0.4.24" + unpipe "1.0.0" + +react-is@^16.13.1: + version "16.13.1" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" + integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== + +react@16.14.0: + version "16.14.0" + resolved "https://registry.yarnpkg.com/react/-/react-16.14.0.tgz#94d776ddd0aaa37da3eda8fc5b6b18a4c9a3114d" + integrity sha512-0X2CImDkJGApiAlcf0ODKIneSwBPhqJawOa5wCtKbu7ZECrmS26NvtSILynQ66cgkT/RJ4LidJOc3bUESwmU8g== + dependencies: + loose-envify "^1.1.0" + object-assign "^4.1.1" + prop-types "^15.6.2" + +readable-stream@^2.0.1: + version "2.3.7" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" + integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.3" + isarray "~1.0.0" + process-nextick-args "~2.0.0" + safe-buffer "~5.1.1" + string_decoder "~1.1.1" + util-deprecate "~1.0.1" + +readable-stream@^3.0.6: + version "3.6.0" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" + integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== + dependencies: + inherits "^2.0.3" + string_decoder "^1.1.1" + util-deprecate "^1.0.1" + +readdirp@~3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" + integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== + dependencies: + picomatch "^2.2.1" + +rechoir@^0.7.0: + version "0.7.1" + resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.7.1.tgz#9478a96a1ca135b5e88fc027f03ee92d6c645686" + integrity sha512-/njmZ8s1wVeR6pjTZ+0nCnv8SpZNRMT2D1RLOJQESlYFDBvwpTA4KWJpZ+sBJ4+vhjILRcK7JIFdGCdxEAAitg== + dependencies: + resolve "^1.9.0" + +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== + +require-from-string@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" + integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== + +requires-port@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" + integrity sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ== + +resolve-cwd@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-3.0.0.tgz#0f0075f1bb2544766cf73ba6a6e2adfebcb13f2d" + integrity sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg== + dependencies: + resolve-from "^5.0.0" + +resolve-from@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" + integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== + +resolve@^1.9.0: + version "1.22.1" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.1.tgz#27cb2ebb53f91abb49470a928bba7558066ac177" + integrity sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw== + dependencies: + is-core-module "^2.9.0" + path-parse "^1.0.7" + supports-preserve-symlinks-flag "^1.0.0" + +retry@^0.13.1: + version "0.13.1" + resolved "https://registry.yarnpkg.com/retry/-/retry-0.13.1.tgz#185b1587acf67919d63b357349e03537b2484658" + integrity sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg== + +rimraf@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" + integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== + dependencies: + glob "^7.1.3" + +safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: + version "5.1.2" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== + +safe-buffer@5.2.1, safe-buffer@>=5.1.0, safe-buffer@^5.1.0, safe-buffer@~5.2.0: + version "5.2.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" + integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== + +"safer-buffer@>= 2.1.2 < 3", "safer-buffer@>= 2.1.2 < 3.0.0": + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== + +schema-utils@^3.1.0, schema-utils@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-3.1.1.tgz#bc74c4b6b6995c1d88f76a8b77bea7219e0c8281" + integrity sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw== + dependencies: + "@types/json-schema" "^7.0.8" + ajv "^6.12.5" + ajv-keywords "^3.5.2" + +schema-utils@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-4.0.0.tgz#60331e9e3ae78ec5d16353c467c34b3a0a1d3df7" + integrity sha512-1edyXKgh6XnJsJSQ8mKWXnN/BVaIbFMLpouRUrXgVq7WYne5kw3MW7UPhO44uRXQSIpTSXoJbmrR2X0w9kUTyg== + dependencies: + "@types/json-schema" "^7.0.9" + ajv "^8.8.0" + ajv-formats "^2.1.1" + ajv-keywords "^5.0.0" + +select-hose@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/select-hose/-/select-hose-2.0.0.tgz#625d8658f865af43ec962bfc376a37359a4994ca" + integrity sha512-mEugaLK+YfkijB4fx0e6kImuJdCIt2LxCRcbEYPqRGCs4F2ogyfZU5IAZRdjCP8JPq2AtdNoC/Dux63d9Kiryg== + +selfsigned@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/selfsigned/-/selfsigned-2.0.1.tgz#8b2df7fa56bf014d19b6007655fff209c0ef0a56" + integrity sha512-LmME957M1zOsUhG+67rAjKfiWFox3SBxE/yymatMZsAx+oMrJ0YQ8AToOnyCm7xbeg2ep37IHLxdu0o2MavQOQ== + dependencies: + node-forge "^1" + +send@0.18.0: + version "0.18.0" + resolved "https://registry.yarnpkg.com/send/-/send-0.18.0.tgz#670167cc654b05f5aa4a767f9113bb371bc706be" + integrity sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg== + dependencies: + debug "2.6.9" + depd "2.0.0" + destroy "1.2.0" + encodeurl "~1.0.2" + escape-html "~1.0.3" + etag "~1.8.1" + fresh "0.5.2" + http-errors "2.0.0" + mime "1.6.0" + ms "2.1.3" + on-finished "2.4.1" + range-parser "~1.2.1" + statuses "2.0.1" + +serialize-javascript@6.0.0, serialize-javascript@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.0.tgz#efae5d88f45d7924141da8b5c3a7a7e663fefeb8" + integrity sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag== + dependencies: + randombytes "^2.1.0" + +serve-index@^1.9.1: + version "1.9.1" + resolved "https://registry.yarnpkg.com/serve-index/-/serve-index-1.9.1.tgz#d3768d69b1e7d82e5ce050fff5b453bea12a9239" + integrity sha512-pXHfKNP4qujrtteMrSBb0rc8HJ9Ms/GrXwcUtUtD5s4ewDJI8bT3Cz2zTVRMKtri49pLx2e0Ya8ziP5Ya2pZZw== + dependencies: + accepts "~1.3.4" + batch "0.6.1" + debug "2.6.9" + escape-html "~1.0.3" + http-errors "~1.6.2" + mime-types "~2.1.17" + parseurl "~1.3.2" + +serve-static@1.15.0: + version "1.15.0" + resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.15.0.tgz#faaef08cffe0a1a62f60cad0c4e513cff0ac9540" + integrity sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g== + dependencies: + encodeurl "~1.0.2" + escape-html "~1.0.3" + parseurl "~1.3.3" + send "0.18.0" + +setprototypeof@1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.0.tgz#d0bd85536887b6fe7c0d818cb962d9d91c54e656" + integrity sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ== + +setprototypeof@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424" + integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw== + +shallow-clone@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/shallow-clone/-/shallow-clone-3.0.1.tgz#8f2981ad92531f55035b01fb230769a40e02efa3" + integrity sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA== + dependencies: + kind-of "^6.0.2" + +shebang-command@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" + integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== + dependencies: + shebang-regex "^3.0.0" + +shebang-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" + integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== + +side-channel@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf" + integrity sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw== + dependencies: + call-bind "^1.0.0" + get-intrinsic "^1.0.2" + object-inspect "^1.9.0" + +signal-exit@^3.0.3: + version "3.0.7" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" + integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== + +sockjs@^0.3.24: + version "0.3.24" + resolved "https://registry.yarnpkg.com/sockjs/-/sockjs-0.3.24.tgz#c9bc8995f33a111bea0395ec30aa3206bdb5ccce" + integrity sha512-GJgLTZ7vYb/JtPSSZ10hsOYIvEYsjbNU+zPdIHcUaWVNUEPivzxku31865sSSud0Da0W4lEeOPlmw93zLQchuQ== + dependencies: + faye-websocket "^0.11.3" + uuid "^8.3.2" + websocket-driver "^0.7.4" + +source-map-js@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c" + integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw== + +source-map-loader@4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/source-map-loader/-/source-map-loader-4.0.0.tgz#bdc6b118bc6c87ee4d8d851f2d4efcc5abdb2ef5" + integrity sha512-i3KVgM3+QPAHNbGavK+VBq03YoJl24m9JWNbLgsjTj8aJzXG9M61bantBTNBt7CNwY2FYf+RJRYJ3pzalKjIrw== + dependencies: + abab "^2.0.6" + iconv-lite "^0.6.3" + source-map-js "^1.0.2" + +source-map-support@0.5.21, source-map-support@~0.5.20: + version "0.5.21" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" + integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + +source-map@^0.6.0: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + +spdy-transport@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/spdy-transport/-/spdy-transport-3.0.0.tgz#00d4863a6400ad75df93361a1608605e5dcdcf31" + integrity sha512-hsLVFE5SjA6TCisWeJXFKniGGOpBgMLmerfO2aCyCU5s7nJ/rpAepqmFifv/GCbSbueEeAJJnmSQ2rKC/g8Fcw== + dependencies: + debug "^4.1.0" + detect-node "^2.0.4" + hpack.js "^2.1.6" + obuf "^1.1.2" + readable-stream "^3.0.6" + wbuf "^1.7.3" + +spdy@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/spdy/-/spdy-4.0.2.tgz#b74f466203a3eda452c02492b91fb9e84a27677b" + integrity sha512-r46gZQZQV+Kl9oItvl1JZZqJKGr+oEkB08A6BzkiR7593/7IbtuncXHd2YoYeTsG4157ZssMu9KYvUHLcjcDoA== + dependencies: + debug "^4.1.0" + handle-thing "^2.0.0" + http-deceiver "^1.2.7" + select-hose "^2.0.0" + spdy-transport "^3.0.0" + +statuses@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/statuses/-/statuses-2.0.1.tgz#55cb000ccf1d48728bd23c685a063998cf1a1b63" + integrity sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ== + +"statuses@>= 1.4.0 < 2": + version "1.5.0" + resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" + integrity sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA== + +string-width@^4.1.0, string-width@^4.2.0: + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + +string_decoder@^1.1.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" + integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== + dependencies: + safe-buffer "~5.2.0" + +string_decoder@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" + integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== + dependencies: + safe-buffer "~5.1.0" + +strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + +strip-final-newline@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad" + integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA== + +strip-json-comments@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" + integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== + +supports-color@8.1.1, supports-color@^8.0.0: + version "8.1.1" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" + integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== + dependencies: + has-flag "^4.0.0" + +supports-color@^7.1.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" + integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== + dependencies: + has-flag "^4.0.0" + +supports-preserve-symlinks-flag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" + integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== + +tapable@^2.1.1, tapable@^2.2.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.2.1.tgz#1967a73ef4060a82f12ab96af86d52fdb76eeca0" + integrity sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ== + +terser-webpack-plugin@^5.1.3: + version "5.3.3" + resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.3.3.tgz#8033db876dd5875487213e87c627bca323e5ed90" + integrity sha512-Fx60G5HNYknNTNQnzQ1VePRuu89ZVYWfjRAeT5rITuCY/1b08s49e5kSQwHDirKZWuoKOBRFS98EUUoZ9kLEwQ== + dependencies: + "@jridgewell/trace-mapping" "^0.3.7" + jest-worker "^27.4.5" + schema-utils "^3.1.1" + serialize-javascript "^6.0.0" + terser "^5.7.2" + +terser@^5.7.2: + version "5.14.2" + resolved "https://registry.yarnpkg.com/terser/-/terser-5.14.2.tgz#9ac9f22b06994d736174f4091aa368db896f1c10" + integrity sha512-oL0rGeM/WFQCUd0y2QrWxYnq7tfSuKBiqTjRPWrRgB46WD/kiwHwF8T23z78H6Q6kGCuuHcPB+KULHRdxvVGQA== + dependencies: + "@jridgewell/source-map" "^0.3.2" + acorn "^8.5.0" + commander "^2.20.0" + source-map-support "~0.5.20" + +thunky@^1.0.2: + version "1.1.0" + resolved "https://registry.yarnpkg.com/thunky/-/thunky-1.1.0.tgz#5abaf714a9405db0504732bbccd2cedd9ef9537d" + integrity sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA== + +to-regex-range@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" + integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== + dependencies: + is-number "^7.0.0" + +toidentifier@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35" + integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA== + +type-is@~1.6.18: + version "1.6.18" + resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" + integrity sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g== + dependencies: + media-typer "0.3.0" + mime-types "~2.1.24" + +typescript@3.9.5: + version "3.9.5" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.5.tgz#586f0dba300cde8be52dd1ac4f7e1009c1b13f36" + integrity sha512-hSAifV3k+i6lEoCJ2k6R2Z/rp/H3+8sdmcn5NrS3/3kE7+RyZXm9aqvxWqjEXHAd8b0pShatpcdMTvEdvAJltQ== + +unpipe@1.0.0, unpipe@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" + integrity sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ== + +update-browserslist-db@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.5.tgz#be06a5eedd62f107b7c19eb5bcefb194411abf38" + integrity sha512-dteFFpCyvuDdr9S/ff1ISkKt/9YZxKjI9WlRR99c180GaztJtRa/fn18FdxGVKVsnPY7/a/FDN68mcvUmP4U7Q== + dependencies: + escalade "^3.1.1" + picocolors "^1.0.0" + +uri-js@^4.2.2: + version "4.4.1" + resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" + integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== + dependencies: + punycode "^2.1.0" + +util-deprecate@^1.0.1, util-deprecate@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== + +utils-merge@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" + integrity sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA== + +uuid@^8.3.2: + version "8.3.2" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" + integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== + +vary@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" + integrity sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg== + +watchpack@^2.3.1: + version "2.4.0" + resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.4.0.tgz#fa33032374962c78113f93c7f2fb4c54c9862a5d" + integrity sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg== + dependencies: + glob-to-regexp "^0.4.1" + graceful-fs "^4.1.2" + +wbuf@^1.1.0, wbuf@^1.7.3: + version "1.7.3" + resolved "https://registry.yarnpkg.com/wbuf/-/wbuf-1.7.3.tgz#c1d8d149316d3ea852848895cb6a0bfe887b87df" + integrity sha512-O84QOnr0icsbFGLS0O3bI5FswxzRr8/gHwWkDlQFskhSPryQXvrTMxjxGP4+iWYoauLoBvfDpkrOauZ+0iZpDA== + dependencies: + minimalistic-assert "^1.0.0" + +webpack-cli@4.10.0: + version "4.10.0" + resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-4.10.0.tgz#37c1d69c8d85214c5a65e589378f53aec64dab31" + integrity sha512-NLhDfH/h4O6UOy+0LSso42xvYypClINuMNBVVzX4vX98TmTaTUxwRbXdhucbFMd2qLaCTcLq/PdYrvi8onw90w== + dependencies: + "@discoveryjs/json-ext" "^0.5.0" + "@webpack-cli/configtest" "^1.2.0" + "@webpack-cli/info" "^1.5.0" + "@webpack-cli/serve" "^1.7.0" + colorette "^2.0.14" + commander "^7.0.0" + cross-spawn "^7.0.3" + fastest-levenshtein "^1.0.12" + import-local "^3.0.2" + interpret "^2.2.0" + rechoir "^0.7.0" + webpack-merge "^5.7.3" + +webpack-dev-middleware@^5.3.1: + version "5.3.3" + resolved "https://registry.yarnpkg.com/webpack-dev-middleware/-/webpack-dev-middleware-5.3.3.tgz#efae67c2793908e7311f1d9b06f2a08dcc97e51f" + integrity sha512-hj5CYrY0bZLB+eTO+x/j67Pkrquiy7kWepMHmUMoPsmcUaeEnQJqFzHJOyxgWlq746/wUuA64p9ta34Kyb01pA== + dependencies: + colorette "^2.0.10" + memfs "^3.4.3" + mime-types "^2.1.31" + range-parser "^1.2.1" + schema-utils "^4.0.0" + +webpack-dev-server@4.9.2: + version "4.9.2" + resolved "https://registry.yarnpkg.com/webpack-dev-server/-/webpack-dev-server-4.9.2.tgz#c188db28c7bff12f87deda2a5595679ebbc3c9bc" + integrity sha512-H95Ns95dP24ZsEzO6G9iT+PNw4Q7ltll1GfJHV4fKphuHWgKFzGHWi4alTlTnpk1SPPk41X+l2RB7rLfIhnB9Q== + dependencies: + "@types/bonjour" "^3.5.9" + "@types/connect-history-api-fallback" "^1.3.5" + "@types/express" "^4.17.13" + "@types/serve-index" "^1.9.1" + "@types/serve-static" "^1.13.10" + "@types/sockjs" "^0.3.33" + "@types/ws" "^8.5.1" + ansi-html-community "^0.0.8" + bonjour-service "^1.0.11" + chokidar "^3.5.3" + colorette "^2.0.10" + compression "^1.7.4" + connect-history-api-fallback "^1.6.0" + default-gateway "^6.0.3" + express "^4.17.3" + graceful-fs "^4.2.6" + html-entities "^2.3.2" + http-proxy-middleware "^2.0.3" + ipaddr.js "^2.0.1" + open "^8.0.9" + p-retry "^4.5.0" + rimraf "^3.0.2" + schema-utils "^4.0.0" + selfsigned "^2.0.1" + serve-index "^1.9.1" + sockjs "^0.3.24" + spdy "^4.0.2" + webpack-dev-middleware "^5.3.1" + ws "^8.4.2" + +webpack-merge@^5.7.3: + version "5.8.0" + resolved "https://registry.yarnpkg.com/webpack-merge/-/webpack-merge-5.8.0.tgz#2b39dbf22af87776ad744c390223731d30a68f61" + integrity sha512-/SaI7xY0831XwP6kzuwhKWVKDP9t1QY1h65lAFLbZqMPIuYcD9QAW4u9STIbU9kaJbPBB/geU/gLr1wDjOhQ+Q== + dependencies: + clone-deep "^4.0.1" + wildcard "^2.0.0" + +webpack-sources@^3.2.3: + version "3.2.3" + resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-3.2.3.tgz#2d4daab8451fd4b240cc27055ff6a0c2ccea0cde" + integrity sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w== + +webpack@5.73.0: + version "5.73.0" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.73.0.tgz#bbd17738f8a53ee5760ea2f59dce7f3431d35d38" + integrity sha512-svjudQRPPa0YiOYa2lM/Gacw0r6PvxptHj4FuEKQ2kX05ZLkjbVc5MnPs6its5j7IZljnIqSVo/OsY2X0IpHGA== + dependencies: + "@types/eslint-scope" "^3.7.3" + "@types/estree" "^0.0.51" + "@webassemblyjs/ast" "1.11.1" + "@webassemblyjs/wasm-edit" "1.11.1" + "@webassemblyjs/wasm-parser" "1.11.1" + acorn "^8.4.1" + acorn-import-assertions "^1.7.6" + browserslist "^4.14.5" + chrome-trace-event "^1.0.2" + enhanced-resolve "^5.9.3" + es-module-lexer "^0.9.0" + eslint-scope "5.1.1" + events "^3.2.0" + glob-to-regexp "^0.4.1" + graceful-fs "^4.2.9" + json-parse-even-better-errors "^2.3.1" + loader-runner "^4.2.0" + mime-types "^2.1.27" + neo-async "^2.6.2" + schema-utils "^3.1.0" + tapable "^2.1.1" + terser-webpack-plugin "^5.1.3" + watchpack "^2.3.1" + webpack-sources "^3.2.3" + +websocket-driver@>=0.5.1, websocket-driver@^0.7.4: + version "0.7.4" + resolved "https://registry.yarnpkg.com/websocket-driver/-/websocket-driver-0.7.4.tgz#89ad5295bbf64b480abcba31e4953aca706f5760" + integrity sha512-b17KeDIQVjvb0ssuSDF2cYXSg2iztliJ4B9WdsuB6J952qCPKmnVq4DyW5motImXHDC1cBT/1UezrJVsKw5zjg== + dependencies: + http-parser-js ">=0.5.1" + safe-buffer ">=5.1.0" + websocket-extensions ">=0.1.1" + +websocket-extensions@>=0.1.1: + version "0.1.4" + resolved "https://registry.yarnpkg.com/websocket-extensions/-/websocket-extensions-0.1.4.tgz#7f8473bc839dfd87608adb95d7eb075211578a42" + integrity sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg== + +which@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" + integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== + dependencies: + isexe "^2.0.0" + +wildcard@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/wildcard/-/wildcard-2.0.0.tgz#a77d20e5200c6faaac979e4b3aadc7b3dd7f8fec" + integrity sha512-JcKqAHLPxcdb9KM49dufGXn2x3ssnfjbcaQdLlfZsL9rH9wgDQjUtDxbo8NE0F6SFvydeu1VhZe7hZuHsB2/pw== + +workerpool@6.2.1: + version "6.2.1" + resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.1.tgz#46fc150c17d826b86a008e5a4508656777e9c343" + integrity sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw== + +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== + +ws@^8.4.2: + version "8.8.1" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.8.1.tgz#5dbad0feb7ade8ecc99b830c1d77c913d4955ff0" + integrity sha512-bGy2JzvzkPowEJV++hF07hAD6niYSr0JzBNo/J29WsB57A2r7Wlc1UFcTR9IzrPvuNVO4B8LGqF8qcpsVOhJCA== + +y18n@^5.0.5: + version "5.0.8" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" + integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== + +yargs-parser@20.2.4: + version "20.2.4" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.4.tgz#b42890f14566796f85ae8e3a25290d205f154a54" + integrity sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA== + +yargs-parser@^20.2.2: + version "20.2.9" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" + integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== + +yargs-unparser@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/yargs-unparser/-/yargs-unparser-2.0.0.tgz#f131f9226911ae5d9ad38c432fe809366c2325eb" + integrity sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA== + dependencies: + camelcase "^6.0.0" + decamelize "^4.0.0" + flat "^5.0.2" + is-plain-obj "^2.1.0" + +yargs@16.2.0: + version "16.2.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" + integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== + dependencies: + cliui "^7.0.2" + escalade "^3.1.1" + get-caller-file "^2.0.5" + require-directory "^2.1.1" + string-width "^4.2.0" + y18n "^5.0.5" + yargs-parser "^20.2.2" + +yocto-queue@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" + integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== diff --git a/sample-kotlin-js/versions.properties b/sample-kotlin-js/versions.properties index cbb1f9fa3..63cefdf4a 100644 --- a/sample-kotlin-js/versions.properties +++ b/sample-kotlin-js/versions.properties @@ -1,6 +1,6 @@ #### Dependencies and Plugin versions with their available updates. -#### Generated by `./gradlew refreshVersions` version 0.24.0-SNAPSHOT -#### Revision of dependency notations removals: 1 +#### Generated by `./gradlew refreshVersions` version 0.41.0-SNAPSHOT +#### Revision of dependency notations removals: 11 #### #### Don't manually edit or split the comments that start with four hashtags (####), #### they will be overwritten by refreshVersions. @@ -10,58 +10,21 @@ #### #### NOTE: Some versions are filtered by the rejectVersionsIf predicate. See the settings.gradle.kts file. -version.kotest=4.6.0 -## # available=4.6.1 -## # available=4.6.2 +version.kotest=5.4.0 -version.kotlin=1.4.32 -## # available=1.5.0-M1 -## # available=1.5.0-M2 -## # available=1.5.0-RC -## # available=1.5.0 -## # available=1.5.10 -## # available=1.5.20-M1 -## # available=1.5.20-RC -## # available=1.5.20 -## # available=1.5.21 -## # available=1.5.30-M1 -## # available=1.5.30-RC -## # available=1.5.30 +version.kotlin=1.7.10 version.npm.@googlemaps/js-api-loader=1.10.0 - 1.11.1 -## # available=1.11.0 -## # available=1.11.1 -## # available=1.11.2 -## # available=1.11.3 -## # available=1.11.4 -## # available=1.12.0 -## # available=1.12.1 -## # available=1.12.2 ## unused version.npm.bootstrap-icons=1.4.x -## # available=1.4.0 -## # available=1.4.1 -## # available=1.5.0 # equivalent to ~5.1.0 ## unused version.npm.css-loader=>=5.1.0 <5.2.0 -## # available=5.1.1 -## # available=5.1.2 -## # available=5.1.3 -## # available=5.1.4 -## # available=5.2.0 -## # available=5.2.1 -## # available=5.2.2 -## # available=5.2.3 -## # available=5.2.4 -## # available=5.2.5 -## # available=5.2.6 # equivalent to ^4.0.0 version.npm.decamelize=>=4.0.0 <5.0.0 -## # available=5.0.0 ## unused version.npm.file-loader=^6.2.0 @@ -71,10 +34,6 @@ version.npm.leaflet=^1.7.1 ## unused version.npm.debug=4.3.x -## # available=4.2.0 -## # available=4.3.0 -## # available=4.3.1 -## # available=4.3.2 ## unused version.npm.leaflet-imageoverlay-rotated=^0.2.1 @@ -82,9 +41,6 @@ version.npm.leaflet-imageoverlay-rotated=^0.2.1 version.npm.moment=2.29.1 version.npm.react=16.14.0 -## # available=17.0.0 -## # available=17.0.1 -## # available=17.0.2 ## unused version.npm.style-loader=^2.0.0 diff --git a/sample-kotlin/versions.properties b/sample-kotlin/versions.properties index c49603962..bb4b18e92 100644 --- a/sample-kotlin/versions.properties +++ b/sample-kotlin/versions.properties @@ -1,6 +1,6 @@ #### Dependencies and Plugin versions with their available updates. -#### Generated by `./gradlew refreshVersions` version 0.40.2-SNAPSHOT -#### Revision of dependency notations removals: 9 +#### Generated by `./gradlew refreshVersions` version 0.41.0-SNAPSHOT +#### Revision of dependency notations removals: 11 #### #### Don't manually edit or split the comments that start with four hashtags (####), #### they will be overwritten by refreshVersions. diff --git a/sample-multi-modules/settings.gradle.kts b/sample-multi-modules/settings.gradle.kts index 8ed92ae7e..3f1fa7086 100644 --- a/sample-multi-modules/settings.gradle.kts +++ b/sample-multi-modules/settings.gradle.kts @@ -16,6 +16,12 @@ pluginManagement { plugins { id("com.gradle.enterprise").version("3.8") +//// # available:"3.8.1") +//// # available:"3.9") +//// # available:"3.10") +//// # available:"3.10.1") +//// # available:"3.10.2") +//// # available:"3.10.3") id("de.fayard.refreshVersions") } diff --git a/sample-multi-modules/versions.properties b/sample-multi-modules/versions.properties index d2da39b57..f3a637480 100644 --- a/sample-multi-modules/versions.properties +++ b/sample-multi-modules/versions.properties @@ -1,6 +1,6 @@ #### Dependencies and Plugin versions with their available updates. -#### Generated by `./gradlew refreshVersions` version 0.40.2-SNAPSHOT -#### Revision of dependency notations removals: 9 +#### Generated by `./gradlew refreshVersions` version 0.41.0-SNAPSHOT +#### Revision of dependency notations removals: 11 #### #### Don't manually edit or split the comments that start with four hashtags (####), #### they will be overwritten by refreshVersions. @@ -9,7 +9,6 @@ #### suppress inspection "UnusedProperty" for whole file plugin.org.gradle.hello-world=0.1 -## # available=0.2 version.com.nhaarman.mockitokotlin2..mockito-kotlin=2.2.0 @@ -23,11 +22,6 @@ version.io.mockk..mockk-common=1.10.0 version.junit=5.7.1 version.junit.jupiter=5.7.1 -## # available=5.7.2 -## # available=5.8.0-M1 -## # available=5.8.0-RC1 -## # available=5.8.0 -## # available=5.8.1 version.kotest=5.1.0 @@ -35,57 +29,16 @@ version.kotlin=1.6.10 version.kotlinx.collections.immutable=0.3.2 -## # available=0.3.3 -## # available=0.3.4 version.kotlinx.coroutines=1.6.0 version.ktor=1.3.2-1.4-M1 -### available=1.3.2-1.4.0-rc -### available=1.4.0 -### available=1.4.1 -### available=1.4.2 -### available=1.4.3 -### available=1.5.0 -### available=1.5.1 -### available=1.5.2 -### available=1.5.3 -### available=1.5.4 -### available=1.6.0 -### available=1.6.1 -### available=1.6.2 -### available=1.6.3 -### available=1.6.4 -### available=1.6.5 version.mockito=3.9.0 -## # available=3.10.0 -## # available=3.11.0 -## # available=3.11.1 -## # available=3.11.2 -## # available=3.12.0 -## # available=3.12.1 -## # available=3.12.2 -## # available=3.12.3 -## # available=3.12.4 -## # available=4.0.0 -## # available=4.1.0 version.mockk=1.11.0 -### available=1.12.0 -### available=1.12.1 version.okhttp3=4.7.2 -## # available=4.8.0 -## # available=4.8.1 -## # available=4.9.0 -## # available=4.9.1 -## # available=4.9.2 -## # available=4.9.3 -## # available=4.10.0-RC1 -## # available=5.0.0-alpha.1 -## # available=5.0.0-alpha.2 -## # available=5.0.0-alpha.3 ## unused version.org.junit.jupiter..junit-jupiter=5.6.2 @@ -114,17 +67,5 @@ version.org.mockito..mockito-junit-jupiter=3.3.3 version.retrofit2=2.9.0 version.com.github.ajalt.clikt..clikt=3.0.0 -## # available=3.0.1 -## # available=3.1.0 -## # available=3.2.0 -## # available=3.3.0 version.junit.junit=4.12 -## # available=4.13-beta-1 -## # available=4.13-beta-2 -## # available=4.13-beta-3 -## # available=4.13-rc-1 -## # available=4.13-rc-2 -## # available=4.13 -## # available=4.13.1 -## # available=4.13.2 From 7ebf046db1dfff642900911953b83588b6efc377 Mon Sep 17 00:00:00 2001 From: Jean-Michel Fayard Date: Wed, 27 Jul 2022 17:34:15 +0200 Subject: [PATCH 063/103] feature flag: refreshVersions --disable VERSIONS_CATALOG --- checkPlugins.sh | 5 +++-- .../de/fayard/refreshVersions/core/FeatureFlag.kt | 6 +++++- .../core/RefreshVersionsCleanupTask.kt | 2 +- .../refreshVersions/core/RefreshVersionsTask.kt | 14 ++++++++------ .../core/internal/VersionCatalogs.kt | 8 +++++--- sample-kotlin/gradle/libs.versions.toml | 3 +++ sample-kotlin/settings.gradle.kts | 1 + 7 files changed, 26 insertions(+), 13 deletions(-) diff --git a/checkPlugins.sh b/checkPlugins.sh index 991e39238..5206dba53 100755 --- a/checkPlugins.sh +++ b/checkPlugins.sh @@ -14,14 +14,15 @@ runGradleTaskInFolder() { pwd echo '$' "./gradlew $TASK" - ./gradlew task || fail "ERROR for task $TASK" + ./gradlew $TASK || fail "ERROR for task $TASK" cd .. } DIR="$(basename $PWD)" TASK="check refreshVersions" -test -n "$1" && TASK="$1" +test -n "$1" && TASK="$*" +echo "TASK=$TASK" test "$DIR" = "refreshVersions" || fail "ERROR: must be called from the refreshVersions folder" checkInstalled java diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/FeatureFlag.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/FeatureFlag.kt index 4f759dfdd..f20a45aa8 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/FeatureFlag.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/FeatureFlag.kt @@ -37,7 +37,8 @@ enum class FeatureFlag(private val enabledByDefault: Boolean?) { GRADLE_UPDATES(enabledByDefault = true), LIBS(enabledByDefault = false), - NPM_IMPLICIT_RANGE(enabledByDefault = false) + NPM_IMPLICIT_RANGE(enabledByDefault = false), + VERSIONS_CATALOG(enabledByDefault = true), ; companion object { @@ -59,4 +60,7 @@ enum class FeatureFlag(private val enabledByDefault: Boolean?) { true -> userSettings[this] != false null -> false } + + internal val isNotEnabled + get() = isEnabled.not() } diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsCleanupTask.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsCleanupTask.kt index 26fad2089..6a6bf169a 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsCleanupTask.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsCleanupTask.kt @@ -53,7 +53,7 @@ open class RefreshVersionsCleanupTask : DefaultTask() { @TaskAction fun cleanUpVersionsCatalog() { - if (VersionCatalogs.isSupported()) { + if (VersionCatalogs.isSupported() && FeatureFlag.VERSIONS_CATALOG.isEnabled) { val file = File(LIBS_VERSIONS_TOML) TomlUpdater(file, emptyList()).cleanupComments(file) OutputFile.GRADLE_VERSIONS_CATALOG.logFileWasModified() diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsTask.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsTask.kt index 3491bc3d9..17d351387 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsTask.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsTask.kt @@ -80,10 +80,6 @@ open class RefreshVersionsTask : DefaultTask() { settingsPluginsUpdates = result.settingsPluginsUpdates, buildSrcSettingsPluginsUpdates = result.buildSrcSettingsPluginsUpdates ) - val libsToml = project.file(LIBS_VERSIONS_TOML) - if (VersionCatalogs.isSupported()) { - TomlUpdater(libsToml, result.dependenciesUpdates).updateNewVersions(libsToml) - } warnAboutRefreshVersionsIfSettingIfAny() warnAboutHardcodedVersionsIfAny(result.dependenciesWithHardcodedVersions) @@ -93,8 +89,14 @@ open class RefreshVersionsTask : DefaultTask() { logger.log(problem) } OutputFile.VERSIONS_PROPERTIES.logFileWasModified() - if (libsToml.canRead()) { - OutputFile.GRADLE_VERSIONS_CATALOG.logFileWasModified() + + val libsToml = project.file(LIBS_VERSIONS_TOML) + val shouldUpdateVersionCatalogs = VersionCatalogs.isSupported() && FeatureFlag.VERSIONS_CATALOG.isEnabled + if (shouldUpdateVersionCatalogs) { + TomlUpdater(libsToml, result.dependenciesUpdates).updateNewVersions(libsToml) + if (libsToml.canRead()) { + OutputFile.GRADLE_VERSIONS_CATALOG.logFileWasModified() + } } } } diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt index 58a71bc05..11f8afb00 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt @@ -1,5 +1,6 @@ package de.fayard.refreshVersions.core.internal +import de.fayard.refreshVersions.core.FeatureFlag import de.fayard.refreshVersions.core.ModuleId import org.gradle.api.artifacts.Dependency import org.gradle.api.artifacts.MinimalExternalModuleDependency @@ -15,9 +16,10 @@ object VersionCatalogs { fun isSupported(): Boolean = GradleVersion.current() >= minimumGradleVersion - fun dependencyAliases(versionCatalog: VersionCatalog?): Map { - versionCatalog ?: return emptyMap() - return versionCatalog.libraryAliases.mapNotNull { alias -> + fun dependencyAliases(versionCatalog: VersionCatalog?): Map = when { + FeatureFlag.VERSIONS_CATALOG.isNotEnabled -> emptyMap() + versionCatalog == null -> emptyMap() + else -> versionCatalog.libraryAliases.mapNotNull { alias -> versionCatalog.findLibrary(alias) .orElse(null) ?.orNull diff --git a/sample-kotlin/gradle/libs.versions.toml b/sample-kotlin/gradle/libs.versions.toml index 646e876db..da5c13de7 100644 --- a/sample-kotlin/gradle/libs.versions.toml +++ b/sample-kotlin/gradle/libs.versions.toml @@ -1,5 +1,8 @@ ## Generated by $ ./gradlew refreshVersionsCatalog +## This comment should be removed by ` ./gradlew refreshVersionsCleanup` +## unless feature flag VERSIONS_CATALOG is disabled + [plugins] org-jetbrains-kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } diff --git a/sample-kotlin/settings.gradle.kts b/sample-kotlin/settings.gradle.kts index bd7c15abf..d35d6dbc9 100644 --- a/sample-kotlin/settings.gradle.kts +++ b/sample-kotlin/settings.gradle.kts @@ -25,6 +25,7 @@ refreshVersions { featureFlags { enable(LIBS) disable(GRADLE_UPDATES) + disable(VERSIONS_CATALOG) } extraArtifactVersionKeyRules(file("refreshVersions-extra-rules.txt")) From 00965d39b602b42b98d7d04f7870a1bba692690b Mon Sep 17 00:00:00 2001 From: Louis CAD Date: Thu, 28 Jul 2022 15:50:12 +0200 Subject: [PATCH 064/103] Minor reformat --- .../core/internal/VersionCatalogs.kt | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt index 11f8afb00..beec30d9e 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt @@ -119,25 +119,25 @@ object VersionCatalogs { lateinit var versionsMap: Map lateinit var versionKeyReader: ArtifactVersionKeyReader - private fun dependenciesWithVersionRefsMapIfAny(libraries: List): Map = - libraries - .mapNotNull { lib -> - val group = lib.group ?: return@mapNotNull null + private fun dependenciesWithVersionRefsMapIfAny( + libraries: List + ): Map = libraries.mapNotNull { lib -> + val group = lib.group ?: return@mapNotNull null - val name = getVersionPropertyName(ModuleId.Maven(group, lib.name), versionKeyReader) + val name = getVersionPropertyName(ModuleId.Maven(group, lib.name), versionKeyReader) - if (name.contains("..") || name.startsWith("plugin")) { - return@mapNotNull null - } - val version = versionsMap[name] ?: lib.version - val versionRef = version?.let { - TomlVersionRef( - key = name.removePrefix("version.").replace(".", "-"), // Better match TOML naming convention. - version = it - ) - } - lib to versionRef - }.toMap() + if (name.contains("..") || name.startsWith("plugin")) { + return@mapNotNull null + } + val version = versionsMap[name] ?: lib.version + val versionRef = version?.let { + TomlVersionRef( + key = name.removePrefix("version.").replace(".", "-"), // Better match TOML naming convention. + version = it + ) + } + lib to versionRef + }.toMap() private fun versionsCatalogLibraries( dependenciesAndNames: Map, From a9934eefcbf698264790288ab3966eb00d84d557 Mon Sep 17 00:00:00 2001 From: Louis CAD Date: Thu, 28 Jul 2022 15:50:56 +0200 Subject: [PATCH 065/103] Rename parameter to be more accurate --- .../fayard/refreshVersions/core/internal/VersionCatalogs.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt index beec30d9e..7cab0faeb 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt @@ -120,8 +120,8 @@ object VersionCatalogs { lateinit var versionKeyReader: ArtifactVersionKeyReader private fun dependenciesWithVersionRefsMapIfAny( - libraries: List - ): Map = libraries.mapNotNull { lib -> + dependencies: List + ): Map = dependencies.mapNotNull { lib -> val group = lib.group ?: return@mapNotNull null val name = getVersionPropertyName(ModuleId.Maven(group, lib.name), versionKeyReader) From c27990bdccc8ec2d5ea669fd650b3d6bc758f01c Mon Sep 17 00:00:00 2001 From: Louis CAD Date: Thu, 28 Jul 2022 19:25:38 +0200 Subject: [PATCH 066/103] Rename lambda parameters to be more accurate --- .../core/internal/VersionCatalogs.kt | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt index 7cab0faeb..c1dae0f79 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt @@ -105,10 +105,10 @@ object VersionCatalogs { private fun addVersions( dependenciesAndNames: Map, versionRefMap: Map - ): List = dependenciesAndNames.keys.distinctBy { lib -> - versionRefMap[lib]?.key - }.flatMap { lib -> - val (versionName, versionValue) = versionRefMap[lib] ?: return@flatMap emptyList() + ): List = dependenciesAndNames.keys.distinctBy { dependency -> + versionRefMap[dependency]?.key + }.flatMap { dependency -> + val (versionName, versionValue) = versionRefMap[dependency] ?: return@flatMap emptyList() val versionLine = TomlLine(TomlSection.Versions, versionName, versionValue) listOf(TomlLine.newLine, versionLine) @@ -121,22 +121,22 @@ object VersionCatalogs { private fun dependenciesWithVersionRefsMapIfAny( dependencies: List - ): Map = dependencies.mapNotNull { lib -> - val group = lib.group ?: return@mapNotNull null + ): Map = dependencies.mapNotNull { dependency -> + val group = dependency.group ?: return@mapNotNull null - val name = getVersionPropertyName(ModuleId.Maven(group, lib.name), versionKeyReader) + val name = getVersionPropertyName(ModuleId.Maven(group, dependency.name), versionKeyReader) if (name.contains("..") || name.startsWith("plugin")) { return@mapNotNull null } - val version = versionsMap[name] ?: lib.version + val version = versionsMap[name] ?: dependency.version val versionRef = version?.let { TomlVersionRef( key = name.removePrefix("version.").replace(".", "-"), // Better match TOML naming convention. version = it ) } - lib to versionRef + dependency to versionRef }.toMap() private fun versionsCatalogLibraries( @@ -145,8 +145,8 @@ object VersionCatalogs { withVersions: Boolean, ): List { - return dependenciesAndNames.keys.filterNot { lib -> - lib.name.endsWith("gradle.plugin") && lib.group != null + return dependenciesAndNames.keys.filterNot { dependency -> + dependency.name.endsWith("gradle.plugin") && dependency.group != null }.flatMap { dependency: Dependency -> val group = dependency.group!! val line: TomlLine = if (dependency in versionRefMap) { From b22013ca9886dd792580ccb2ae6273123f6c1fb9 Mon Sep 17 00:00:00 2001 From: Louis CAD Date: Thu, 28 Jul 2022 19:26:21 +0200 Subject: [PATCH 067/103] Use getValue instead and add argument names --- .../refreshVersions/core/internal/VersionCatalogs.kt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt index c1dae0f79..ea97746e7 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt @@ -168,8 +168,15 @@ object VersionCatalogs { versionKey in versionsMap -> versionsMap[versionKey]!! else -> dependency.version } - val value = ConfigurationLessDependency(group, dependency.name, version) - TomlLine(TomlSection.Libraries, dependenciesAndNames.get(dependency)!!, value) + TomlLine( + section = TomlSection.Libraries, + key = dependenciesAndNames.getValue(dependency), + dependency = ConfigurationLessDependency( + group = group, + name = dependency.name, + version = version + ) + ) } listOf(TomlLine.newLine, line) From f8a78451210db3335bb53b5e353491cf32085bbc Mon Sep 17 00:00:00 2001 From: Louis CAD Date: Thu, 28 Jul 2022 19:35:37 +0200 Subject: [PATCH 068/103] Remove unneeded warning suppress --- .../de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt index 19d136520..6c8b1db1d 100644 --- a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt +++ b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt @@ -22,7 +22,6 @@ import org.gradle.api.tasks.TaskAction import org.gradle.api.tasks.options.Option import org.gradle.util.GradleVersion -@Suppress("UnstableApiUsage") open class RefreshVersionsCatalogTask : DefaultTask() { @Input From 905ce35492e8c3bda005bd24cf8d05606a17e61b Mon Sep 17 00:00:00 2001 From: Louis CAD Date: Thu, 28 Jul 2022 19:35:59 +0200 Subject: [PATCH 069/103] Specify type explicitly --- .../de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt index 6c8b1db1d..9c9598a6e 100644 --- a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt +++ b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt @@ -17,6 +17,7 @@ import de.fayard.refreshVersions.core.internal.findDependencies import de.fayard.refreshVersions.internal.getArtifactNameToConstantMapping import org.gradle.api.DefaultTask import org.gradle.api.GradleException +import org.gradle.api.artifacts.Dependency import org.gradle.api.tasks.Input import org.gradle.api.tasks.TaskAction import org.gradle.api.tasks.options.Option @@ -69,7 +70,7 @@ open class RefreshVersionsCatalogTask : DefaultTask() { ) val deps: Deps = dependenciesToUse.checkModeAndNames(versionCatalogAliases, Case.`kebab-case`) - val dependenciesAndNames = deps.names.mapKeys { it.key.toDependency() } + val dependenciesAndNames: Map = deps.names.mapKeys { it.key.toDependency() } val currentText = if (catalog.existed) catalog.readText() else "" VersionCatalogs.versionsMap = RefreshVersionsConfigHolder.readVersionsMap() From 255782d43b247bc53080b559fd36b68042cb9d60 Mon Sep 17 00:00:00 2001 From: Louis CAD Date: Thu, 28 Jul 2022 20:06:15 +0200 Subject: [PATCH 070/103] Get rid of lateinit var in favor of proper parameter --- .../core/internal/VersionCatalogs.kt | 10 +++++++++- .../fayard/refreshVersions/core/TomlUpdaterTest.kt | 13 ++++++++++--- .../refreshVersions/RefreshVersionsCatalogTask.kt | 11 ++++++----- 3 files changed, 25 insertions(+), 9 deletions(-) diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt index ea97746e7..4ae74d72c 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt @@ -62,13 +62,19 @@ object VersionCatalogs { } fun generateVersionsCatalogText( + versionsMap: Map = RefreshVersionsConfigHolder.readVersionsMap(), + versionKeyReader: ArtifactVersionKeyReader = RefreshVersionsConfigHolder.versionKeyReader, dependenciesAndNames: Map, currentText: String, withVersions: Boolean, plugins: List ): String { val dependencies = dependenciesAndNames.keys.toList() - val versionRefMap = dependenciesWithVersionRefsMapIfAny(dependencies) + val versionRefMap = dependenciesWithVersionRefsMapIfAny( + versionsMap = versionsMap, + versionKeyReader = versionKeyReader, + dependencies = dependencies + ) val toml = parseToml(currentText) toml.merge(TomlSection.Plugins, addPlugins(plugins, versionRefMap)) @@ -120,6 +126,8 @@ object VersionCatalogs { lateinit var versionKeyReader: ArtifactVersionKeyReader private fun dependenciesWithVersionRefsMapIfAny( + versionsMap: Map, + versionKeyReader: ArtifactVersionKeyReader, dependencies: List ): Map = dependencies.mapNotNull { dependency -> val group = dependency.group ?: return@mapNotNull null diff --git a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlUpdaterTest.kt b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlUpdaterTest.kt index e8338498b..14551c27b 100644 --- a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlUpdaterTest.kt +++ b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlUpdaterTest.kt @@ -86,10 +86,10 @@ class TomlUpdaterTest : FunSpec({ val rulesDir = File(".").absoluteFile.parentFile.parentFile .resolve("dependencies/src/main/resources/refreshVersions-rules") .also { require(it.canRead()) { "Can't read foler $it" } } - VersionCatalogs.versionsMap = mapOf( + val versionsMap = mapOf( "version.junit.jupiter" to "42" ) - VersionCatalogs.versionKeyReader = ArtifactVersionKeyReader.fromRules(rulesDir.listFiles()!!.map { it.readText() }) + val versionKeyReader = ArtifactVersionKeyReader.fromRules(rulesDir.listFiles()!!.map { it.readText() }) context("refreshVersionsCatalog") { val refreshVersionsCatalogInputs = listOf( @@ -111,7 +111,14 @@ class TomlUpdaterTest : FunSpec({ } val plugins = dependenciesAndNames.keys .filter { it.name.endsWith(".gradle.plugin") } - val newText = VersionCatalogs.generateVersionsCatalogText(dependenciesAndNames, currentText, withVersions, plugins) + val newText = VersionCatalogs.generateVersionsCatalogText( + versionsMap = versionsMap, + versionKeyReader = versionKeyReader, + dependenciesAndNames = dependenciesAndNames, + currentText = currentText, + withVersions = withVersions, + plugins = plugins + ) input.actual.writeText(newText) input.asClue { newText shouldBe input.expectedText diff --git a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt index 9c9598a6e..6bfc14808 100644 --- a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt +++ b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt @@ -6,11 +6,9 @@ import de.fayard.refreshVersions.core.internal.Deps import de.fayard.refreshVersions.core.internal.Library import de.fayard.refreshVersions.core.internal.MEANING_LESS_NAMES import de.fayard.refreshVersions.core.internal.OutputFile -import de.fayard.refreshVersions.core.internal.RefreshVersionsConfigHolder import de.fayard.refreshVersions.core.internal.UsedPluginsTracker import de.fayard.refreshVersions.core.internal.VersionCatalogs import de.fayard.refreshVersions.core.internal.VersionCatalogs.LIBS_VERSIONS_TOML -import de.fayard.refreshVersions.core.internal.VersionCatalogs.generateVersionsCatalogText import de.fayard.refreshVersions.core.internal.checkModeAndNames import de.fayard.refreshVersions.core.internal.computeAliases import de.fayard.refreshVersions.core.internal.findDependencies @@ -73,9 +71,12 @@ open class RefreshVersionsCatalogTask : DefaultTask() { val dependenciesAndNames: Map = deps.names.mapKeys { it.key.toDependency() } val currentText = if (catalog.existed) catalog.readText() else "" - VersionCatalogs.versionsMap = RefreshVersionsConfigHolder.readVersionsMap() - VersionCatalogs.versionKeyReader = RefreshVersionsConfigHolder.versionKeyReader - val newText = generateVersionsCatalogText(dependenciesAndNames, currentText, withVersions, plugins) + val newText = VersionCatalogs.generateVersionsCatalogText( + dependenciesAndNames = dependenciesAndNames, + currentText = currentText, + withVersions = withVersions, + plugins = plugins + ) catalog.writeText(newText) catalog.logFileWasModified() From 177fcb7b6d491660015256b5e2fb04fd383da080 Mon Sep 17 00:00:00 2001 From: Louis CAD Date: Thu, 28 Jul 2022 20:06:23 +0200 Subject: [PATCH 071/103] Remove unused imports --- .../kotlin/de/fayard/refreshVersions/core/TomlUpdaterTest.kt | 2 -- 1 file changed, 2 deletions(-) diff --git a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlUpdaterTest.kt b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlUpdaterTest.kt index 14551c27b..aea3d87ce 100644 --- a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlUpdaterTest.kt +++ b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlUpdaterTest.kt @@ -3,8 +3,6 @@ package de.fayard.refreshVersions.core import de.fayard.refreshVersions.core.internal.ArtifactVersionKeyReader import de.fayard.refreshVersions.core.internal.ConfigurationLessDependency import de.fayard.refreshVersions.core.internal.DependencyWithVersionCandidates -import de.fayard.refreshVersions.core.internal.Deps -import de.fayard.refreshVersions.core.internal.Library import de.fayard.refreshVersions.core.internal.TomlLine import de.fayard.refreshVersions.core.internal.TomlSection import de.fayard.refreshVersions.core.internal.TomlUpdater From f84bba36e2c9730be610cfcb60a6f3ea7e5b99e3 Mon Sep 17 00:00:00 2001 From: Louis CAD Date: Thu, 28 Jul 2022 20:21:08 +0200 Subject: [PATCH 072/103] Standardize and simplify TomlUpdaterTest - Use classic test annotated functions to allow running tests separately by default - Reuse some code - Decrease indent --- .../refreshVersions/core/TomlUpdaterTest.kt | 118 ++++++++---------- 1 file changed, 55 insertions(+), 63 deletions(-) diff --git a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlUpdaterTest.kt b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlUpdaterTest.kt index aea3d87ce..4d137d5ed 100644 --- a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlUpdaterTest.kt +++ b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlUpdaterTest.kt @@ -8,46 +8,41 @@ import de.fayard.refreshVersions.core.internal.TomlSection import de.fayard.refreshVersions.core.internal.TomlUpdater import de.fayard.refreshVersions.core.internal.VersionCatalogs import io.kotest.assertions.asClue -import io.kotest.core.spec.style.FunSpec import io.kotest.matchers.shouldBe import org.gradle.api.artifacts.Dependency +import org.junit.jupiter.api.TestFactory +import testutils.junit.dynamicTest import java.io.File +import kotlin.test.Test import de.fayard.refreshVersions.core.Version as MavenVersion -class TomlUpdaterTest : FunSpec({ - test("Folder toml-refreshversions - update new versions") { - val input = FolderInput("toml-refreshversions") +class TomlUpdaterTest { - TomlUpdater(input.initial, input.dependenciesUpdates).updateNewVersions(input.actual) - input.actual.readText() shouldBe input.expectedText - - // check idempotent - TomlUpdater(input.expected, input.dependenciesUpdates).updateNewVersions(input.expected) - input.asClue { - input.actual.readText() shouldBe input.expectedText - } - - // delete actual file if successful - input.actual.delete() - } + @Test + fun `Folder toml-refreshversions - update new versions`() = testTomlUpdater( + inputFolderName = "toml-refreshversions" + ) { actual: File -> updateNewVersions(actual) } - test("Folder toml-cleanup - remove refreshVersions comments") { - val input = FolderInput("toml-cleanup") + @Test + fun `Folder toml-cleanup - remove refreshVersions comments`() = testTomlUpdater( + inputFolderName = "toml-cleanup" + ) { actual: File -> cleanupComments(actual) } - TomlUpdater(input.initial, input.dependenciesUpdates).cleanupComments(input.actual) + private fun testTomlUpdater(inputFolderName: String, action: TomlUpdater.(actual: File) -> Unit) { + val input = FolderInput(inputFolderName) + TomlUpdater(input.initial, input.dependenciesUpdates).action(input.actual) input.actual.readText() shouldBe input.expectedText - // check idempotent - TomlUpdater(input.expected, input.dependenciesUpdates).cleanupComments(input.expected) - input.asClue { - input.actual.readText() shouldBe input.expectedText - } + // check idempotence + TomlUpdater(input.expected, input.dependenciesUpdates).action(input.expected) + input.actual.readText() shouldBe input.expectedText // delete actual file if successful input.actual.delete() } - test("Folder toml-merge-properties - modify file incrementally") { + @Test + fun `Folder toml-merge-properties - modify file incrementally`() { val input = FolderInput("toml-merge-properties") val toml = VersionCatalogs.parseToml(input.initial.readText()) @@ -81,51 +76,48 @@ class TomlUpdaterTest : FunSpec({ } - val rulesDir = File(".").absoluteFile.parentFile.parentFile + private val rulesDir = File(".").absoluteFile.parentFile.parentFile .resolve("dependencies/src/main/resources/refreshVersions-rules") .also { require(it.canRead()) { "Can't read foler $it" } } - val versionsMap = mapOf( + private val versionsMap = mapOf( "version.junit.jupiter" to "42" ) - val versionKeyReader = ArtifactVersionKeyReader.fromRules(rulesDir.listFiles()!!.map { it.readText() }) - - context("refreshVersionsCatalog") { - val refreshVersionsCatalogInputs = listOf( - FolderInput("refreshVersionsCatalog-versions-new"), - FolderInput("refreshVersionsCatalog-versions-existing"), - FolderInput("refreshVersionsCatalog-underscore-new"), - FolderInput("refreshVersionsCatalog-underscore-existing"), - ) - for (input in refreshVersionsCatalogInputs) { - test("Folder ${input.folder}") { - val withVersions = input.folder.contains("versions") - - val currentText = input.initial.readText() - val dependenciesAndNames = input.dependenciesUpdates - .associate { d -> - val versionName = d.versionsCandidates.first().value - val dependency: Dependency = ConfigurationLessDependency(d.moduleId.group!!, d.moduleId.name, d.currentVersion) - dependency to versionName - } - val plugins = dependenciesAndNames.keys - .filter { it.name.endsWith(".gradle.plugin") } - val newText = VersionCatalogs.generateVersionsCatalogText( - versionsMap = versionsMap, - versionKeyReader = versionKeyReader, - dependenciesAndNames = dependenciesAndNames, - currentText = currentText, - withVersions = withVersions, - plugins = plugins - ) - input.actual.writeText(newText) - input.asClue { - newText shouldBe input.expectedText - } - input.actual.delete() + private val versionKeyReader = ArtifactVersionKeyReader.fromRules(rulesDir.listFiles()!!.map { it.readText() }) + + @TestFactory + fun refreshVersionsCatalog() = listOf( + "refreshVersionsCatalog-versions-new", + "refreshVersionsCatalog-versions-existing", + "refreshVersionsCatalog-underscore-new", + "refreshVersionsCatalog-underscore-existing" + ).map { folderName: String -> + dynamicTest("Folder $folderName") { + val input = FolderInput(folderName) + val withVersions = input.folder.contains("versions") + + val currentText = input.initial.readText() + val dependenciesAndNames = input.dependenciesUpdates.associate { d -> + val versionName = d.versionsCandidates.first().value + val dependency: Dependency = ConfigurationLessDependency(d.moduleId.group!!, d.moduleId.name, d.currentVersion) + dependency to versionName } + val plugins = dependenciesAndNames.keys.filter { it.name.endsWith(".gradle.plugin") } + val newText = VersionCatalogs.generateVersionsCatalogText( + versionsMap = versionsMap, + versionKeyReader = versionKeyReader, + dependenciesAndNames = dependenciesAndNames, + currentText = currentText, + withVersions = withVersions, + plugins = plugins + ) + input.actual.writeText(newText) + input.asClue { + newText shouldBe input.expectedText + } + input.actual.delete() } } -}) +} private data class FolderInput( val folder: String, From d0d702c7b9cf43d51b46d76da0080a3f64535d42 Mon Sep 17 00:00:00 2001 From: Louis CAD Date: Thu, 28 Jul 2022 20:22:31 +0200 Subject: [PATCH 073/103] Create the list only when needed --- .../de/fayard/refreshVersions/core/internal/TomlUpdater.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlUpdater.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlUpdater.kt index 6cd51b448..4fdc54212 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlUpdater.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlUpdater.kt @@ -30,9 +30,8 @@ internal class TomlUpdater( } private fun updateNewVersions(lines: List): List = lines.flatMap { line -> - val noop = listOf(line) when (line.kind) { - Ignore, LibsUnderscore, LibsVersionRef, PluginVersionRef -> noop + Ignore, LibsUnderscore, LibsVersionRef, PluginVersionRef -> listOf(line) Deletable -> emptyList() Version -> { linesForUpdate(line, findLineReferencing(line)) From 966509db675d48d0c71e0c4b7a3accf27e4dfdea Mon Sep 17 00:00:00 2001 From: Louis CAD Date: Thu, 28 Jul 2022 20:31:39 +0200 Subject: [PATCH 074/103] Narrow the scope of a local property --- .../de/fayard/refreshVersions/core/RefreshVersionsTask.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsTask.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsTask.kt index 17d351387..7abe4d376 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsTask.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsTask.kt @@ -90,9 +90,9 @@ open class RefreshVersionsTask : DefaultTask() { } OutputFile.VERSIONS_PROPERTIES.logFileWasModified() - val libsToml = project.file(LIBS_VERSIONS_TOML) val shouldUpdateVersionCatalogs = VersionCatalogs.isSupported() && FeatureFlag.VERSIONS_CATALOG.isEnabled if (shouldUpdateVersionCatalogs) { + val libsToml = project.file(LIBS_VERSIONS_TOML) TomlUpdater(libsToml, result.dependenciesUpdates).updateNewVersions(libsToml) if (libsToml.canRead()) { OutputFile.GRADLE_VERSIONS_CATALOG.logFileWasModified() From 60a6f6bb9ddb500d435abb7bb75e73bfec2b1a1f Mon Sep 17 00:00:00 2001 From: Louis CAD Date: Thu, 28 Jul 2022 21:01:43 +0200 Subject: [PATCH 075/103] Skip TomlUpdater call in the refreshVersions task if no libs.toml file --- .../de/fayard/refreshVersions/core/RefreshVersionsTask.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsTask.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsTask.kt index 7abe4d376..9c77eeaf9 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsTask.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsTask.kt @@ -93,8 +93,8 @@ open class RefreshVersionsTask : DefaultTask() { val shouldUpdateVersionCatalogs = VersionCatalogs.isSupported() && FeatureFlag.VERSIONS_CATALOG.isEnabled if (shouldUpdateVersionCatalogs) { val libsToml = project.file(LIBS_VERSIONS_TOML) - TomlUpdater(libsToml, result.dependenciesUpdates).updateNewVersions(libsToml) if (libsToml.canRead()) { + TomlUpdater(libsToml, result.dependenciesUpdates).updateNewVersions(libsToml) OutputFile.GRADLE_VERSIONS_CATALOG.logFileWasModified() } } From 197decaefc68b538931cf9a738a675f6c3bda7c3 Mon Sep 17 00:00:00 2001 From: Louis CAD Date: Thu, 28 Jul 2022 21:01:55 +0200 Subject: [PATCH 076/103] Fix typo in error message in checkPlugins.sh --- checkPlugins.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/checkPlugins.sh b/checkPlugins.sh index 5206dba53..acd425932 100755 --- a/checkPlugins.sh +++ b/checkPlugins.sh @@ -10,7 +10,7 @@ checkInstalled() { runGradleTaskInFolder() { echo echo "== cd $1 ==" - cd $1 || fail "ERROR: Folder $1 doens't exist" + cd $1 || fail "ERROR: Folder $1 doesn't exist" pwd echo '$' "./gradlew $TASK" From 7bd1e4620eb7931558c16d05a04cf8d6f76a0b09 Mon Sep 17 00:00:00 2001 From: Louis CAD Date: Fri, 29 Jul 2022 00:44:39 +0200 Subject: [PATCH 077/103] Fix the versionsCatalogLibraries function A part of the refactoring from commit 255782d4 had been forgotten, this commit fixes it. --- .../core/internal/VersionCatalogs.kt | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt index 4ae74d72c..709aa88af 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt @@ -78,7 +78,16 @@ object VersionCatalogs { val toml = parseToml(currentText) toml.merge(TomlSection.Plugins, addPlugins(plugins, versionRefMap)) - toml.merge(TomlSection.Libraries, versionsCatalogLibraries(dependenciesAndNames, versionRefMap, withVersions)) + toml.merge( + section = TomlSection.Libraries, + newLines = versionsCatalogLibraries( + versionsMap = versionsMap, + versionKeyReader = versionKeyReader, + dependenciesAndNames = dependenciesAndNames, + versionRefMap = versionRefMap, + withVersions = withVersions + ) + ) toml.merge(TomlSection.Versions, addVersions(dependenciesAndNames, versionRefMap)) return toml.toString() } @@ -122,9 +131,6 @@ object VersionCatalogs { private data class TomlVersionRef(val key: String, val version: String) - lateinit var versionsMap: Map - lateinit var versionKeyReader: ArtifactVersionKeyReader - private fun dependenciesWithVersionRefsMapIfAny( versionsMap: Map, versionKeyReader: ArtifactVersionKeyReader, @@ -148,6 +154,8 @@ object VersionCatalogs { }.toMap() private fun versionsCatalogLibraries( + versionsMap: Map, + versionKeyReader: ArtifactVersionKeyReader, dependenciesAndNames: Map, versionRefMap: Map, withVersions: Boolean, From 8cf12620afd41e5529bafef32f5421be76201390 Mon Sep 17 00:00:00 2001 From: Louis CAD Date: Fri, 29 Jul 2022 00:59:01 +0200 Subject: [PATCH 078/103] Decrease indent in the versionsCatalogLibraries function --- .../core/internal/VersionCatalogs.kt | 67 +++++++++---------- 1 file changed, 32 insertions(+), 35 deletions(-) diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt index 709aa88af..f7a981bc5 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt @@ -159,43 +159,40 @@ object VersionCatalogs { dependenciesAndNames: Map, versionRefMap: Map, withVersions: Boolean, - ): List { - - return dependenciesAndNames.keys.filterNot { dependency -> - dependency.name.endsWith("gradle.plugin") && dependency.group != null - }.flatMap { dependency: Dependency -> - val group = dependency.group!! - val line: TomlLine = if (dependency in versionRefMap) { - val versionRef: TomlVersionRef? = versionRefMap[dependency] - TomlLine( - section = TomlSection.Libraries, - key = dependenciesAndNames.getValue(dependency), - map = mutableMapOf().apply { //TODO: Replace with buildMap later. - put("group", dependency.group) - put("name", dependency.name) - put("version.ref", versionRef?.key ?: return@apply) - } - ) - } else { - val versionKey = getVersionPropertyName(ModuleId.Maven(group, dependency.name), versionKeyReader) - val version = when { - dependency.version == null -> null - withVersions.not() -> "_" - versionKey in versionsMap -> versionsMap[versionKey]!! - else -> dependency.version + ): List = dependenciesAndNames.keys.filterNot { dependency -> + dependency.name.endsWith("gradle.plugin") && dependency.group != null + }.flatMap { dependency: Dependency -> + val group = dependency.group!! + val line: TomlLine = if (dependency in versionRefMap) { + val versionRef: TomlVersionRef? = versionRefMap[dependency] + TomlLine( + section = TomlSection.Libraries, + key = dependenciesAndNames.getValue(dependency), + map = mutableMapOf().apply { //TODO: Replace with buildMap later. + put("group", dependency.group) + put("name", dependency.name) + put("version.ref", versionRef?.key ?: return@apply) } - TomlLine( - section = TomlSection.Libraries, - key = dependenciesAndNames.getValue(dependency), - dependency = ConfigurationLessDependency( - group = group, - name = dependency.name, - version = version - ) - ) + ) + } else { + val versionKey = getVersionPropertyName(ModuleId.Maven(group, dependency.name), versionKeyReader) + val version = when { + dependency.version == null -> null + withVersions.not() -> "_" + versionKey in versionsMap -> versionsMap[versionKey]!! + else -> dependency.version } - - listOf(TomlLine.newLine, line) + TomlLine( + section = TomlSection.Libraries, + key = dependenciesAndNames.getValue(dependency), + dependency = ConfigurationLessDependency( + group = group, + name = dependency.name, + version = version + ) + ) } + + listOf(TomlLine.newLine, line) } } From 42310cc37b0a25cb84ff18c90831669775d0257a Mon Sep 17 00:00:00 2001 From: Louis CAD Date: Fri, 29 Jul 2022 01:06:07 +0200 Subject: [PATCH 079/103] =?UTF-8?q?Replace=20List=20+=20joinToString=20wit?= =?UTF-8?q?h=20String.repeat(=E2=80=A6)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This will make the string building more efficient. --- .../de/fayard/refreshVersions/core/internal/TomlUpdater.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlUpdater.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlUpdater.kt index 4fdc54212..003c5d7e1 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlUpdater.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlUpdater.kt @@ -72,7 +72,7 @@ internal class TomlUpdater( } val nbSpaces = line.text.indexOf(version) - if (isObject) 17 else 14 - val space = List(nbSpaces.coerceAtLeast(0)) { " " }.joinToString("") + val space = " ".repeat(nbSpaces.coerceAtLeast(0)) versions.mapTo(result) { v: MavenVersion -> TomlLine(line.section, "##${space}# available${suffix(v)}") From fb16d9b51e7b923ddb665425baa49d779987fbcf Mon Sep 17 00:00:00 2001 From: Louis CAD Date: Fri, 29 Jul 2022 01:06:24 +0200 Subject: [PATCH 080/103] Add names to call arguments --- .../de/fayard/refreshVersions/core/internal/TomlUpdater.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlUpdater.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlUpdater.kt index 003c5d7e1..eed81a5f4 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlUpdater.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlUpdater.kt @@ -75,7 +75,10 @@ internal class TomlUpdater( val space = " ".repeat(nbSpaces.coerceAtLeast(0)) versions.mapTo(result) { v: MavenVersion -> - TomlLine(line.section, "##${space}# available${suffix(v)}") + TomlLine( + section = line.section, + text = "##${space}# available${suffix(v)}" + ) } return result } From 4fa8e4225b7b2a6a510d6e20251dae2bb40bb3d9 Mon Sep 17 00:00:00 2001 From: Louis CAD Date: Fri, 29 Jul 2022 18:37:07 +0200 Subject: [PATCH 081/103] Group refreshVersionsCatalog test dirs This will make it easier to add further test data. --- .../refreshVersions/core/TomlUpdaterTest.kt | 24 ++++++++----------- .../underscore-existing}/dependencies.txt | 0 .../underscore-existing}/expected.libs.toml | 0 .../underscore-existing}/initial.libs.toml | 0 .../underscore-new}/dependencies.txt | 0 .../underscore-new}/expected.libs.toml | 0 .../underscore-new}/initial.libs.toml | 0 .../versions-existing}/dependencies.txt | 0 .../versions-existing}/expected.libs.toml | 0 .../versions-existing}/initial.libs.toml | 0 .../versions-new}/dependencies.txt | 0 .../versions-new}/expected.libs.toml | 0 .../versions-new}/initial.libs.toml | 0 13 files changed, 10 insertions(+), 14 deletions(-) rename plugins/core/src/test/resources/{refreshVersionsCatalog-underscore-existing => refreshVersionsCatalog/underscore-existing}/dependencies.txt (100%) rename plugins/core/src/test/resources/{refreshVersionsCatalog-underscore-existing => refreshVersionsCatalog/underscore-existing}/expected.libs.toml (100%) rename plugins/core/src/test/resources/{refreshVersionsCatalog-underscore-existing => refreshVersionsCatalog/underscore-existing}/initial.libs.toml (100%) rename plugins/core/src/test/resources/{refreshVersionsCatalog-underscore-new => refreshVersionsCatalog/underscore-new}/dependencies.txt (100%) rename plugins/core/src/test/resources/{refreshVersionsCatalog-underscore-new => refreshVersionsCatalog/underscore-new}/expected.libs.toml (100%) rename plugins/core/src/test/resources/{refreshVersionsCatalog-underscore-new => refreshVersionsCatalog/underscore-new}/initial.libs.toml (100%) rename plugins/core/src/test/resources/{refreshVersionsCatalog-versions-existing => refreshVersionsCatalog/versions-existing}/dependencies.txt (100%) rename plugins/core/src/test/resources/{refreshVersionsCatalog-versions-existing => refreshVersionsCatalog/versions-existing}/expected.libs.toml (100%) rename plugins/core/src/test/resources/{refreshVersionsCatalog-versions-existing => refreshVersionsCatalog/versions-existing}/initial.libs.toml (100%) rename plugins/core/src/test/resources/{refreshVersionsCatalog-versions-new => refreshVersionsCatalog/versions-new}/dependencies.txt (100%) rename plugins/core/src/test/resources/{refreshVersionsCatalog-versions-new => refreshVersionsCatalog/versions-new}/expected.libs.toml (100%) rename plugins/core/src/test/resources/{refreshVersionsCatalog-versions-new => refreshVersionsCatalog/versions-new}/initial.libs.toml (100%) diff --git a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlUpdaterTest.kt b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlUpdaterTest.kt index 4d137d5ed..d9fd24690 100644 --- a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlUpdaterTest.kt +++ b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlUpdaterTest.kt @@ -85,15 +85,10 @@ class TomlUpdaterTest { private val versionKeyReader = ArtifactVersionKeyReader.fromRules(rulesDir.listFiles()!!.map { it.readText() }) @TestFactory - fun refreshVersionsCatalog() = listOf( - "refreshVersionsCatalog-versions-new", - "refreshVersionsCatalog-versions-existing", - "refreshVersionsCatalog-underscore-new", - "refreshVersionsCatalog-underscore-existing" - ).map { folderName: String -> - dynamicTest("Folder $folderName") { - val input = FolderInput(folderName) - val withVersions = input.folder.contains("versions") + fun refreshVersionsCatalog() = testResources.resolve("refreshVersionsCatalog").listFiles()!!.map { folder -> + dynamicTest(folder.name) { + val input = FolderInput(folder) + val withVersions = input.folder.name.contains("versions") val currentText = input.initial.readText() val dependenciesAndNames = input.dependenciesUpdates.associate { d -> @@ -120,7 +115,7 @@ class TomlUpdaterTest { } private data class FolderInput( - val folder: String, + val folder: File, val initial: File, val expected: File, val actual: File, @@ -129,15 +124,16 @@ private data class FolderInput( val expectedText = expected.readText() override fun toString() = - "Comparing from resources folder=$folder: actual=${actual.name} and expected=${expected.name}" + "Comparing from resources folder=${folder.name}: actual=${actual.name} and expected=${expected.name}" } -private fun FolderInput(folderName: String): FolderInput { - val folder = testResources.resolve(folderName) +private fun FolderInput(folderName: String): FolderInput = FolderInput(testResources.resolve(folderName)) + +private fun FolderInput(folder: File): FolderInput { require(folder.canRead()) { "Invalid folder ${folder.absolutePath}" } val dependencies = dependencyWithVersionCandidates(folder) return FolderInput( - folder = folderName, + folder = folder, initial = folder.resolve("initial.libs.toml"), actual = folder.resolve("actual.libs.toml"), expected = folder.resolve("expected.libs.toml"), diff --git a/plugins/core/src/test/resources/refreshVersionsCatalog-underscore-existing/dependencies.txt b/plugins/core/src/test/resources/refreshVersionsCatalog/underscore-existing/dependencies.txt similarity index 100% rename from plugins/core/src/test/resources/refreshVersionsCatalog-underscore-existing/dependencies.txt rename to plugins/core/src/test/resources/refreshVersionsCatalog/underscore-existing/dependencies.txt diff --git a/plugins/core/src/test/resources/refreshVersionsCatalog-underscore-existing/expected.libs.toml b/plugins/core/src/test/resources/refreshVersionsCatalog/underscore-existing/expected.libs.toml similarity index 100% rename from plugins/core/src/test/resources/refreshVersionsCatalog-underscore-existing/expected.libs.toml rename to plugins/core/src/test/resources/refreshVersionsCatalog/underscore-existing/expected.libs.toml diff --git a/plugins/core/src/test/resources/refreshVersionsCatalog-underscore-existing/initial.libs.toml b/plugins/core/src/test/resources/refreshVersionsCatalog/underscore-existing/initial.libs.toml similarity index 100% rename from plugins/core/src/test/resources/refreshVersionsCatalog-underscore-existing/initial.libs.toml rename to plugins/core/src/test/resources/refreshVersionsCatalog/underscore-existing/initial.libs.toml diff --git a/plugins/core/src/test/resources/refreshVersionsCatalog-underscore-new/dependencies.txt b/plugins/core/src/test/resources/refreshVersionsCatalog/underscore-new/dependencies.txt similarity index 100% rename from plugins/core/src/test/resources/refreshVersionsCatalog-underscore-new/dependencies.txt rename to plugins/core/src/test/resources/refreshVersionsCatalog/underscore-new/dependencies.txt diff --git a/plugins/core/src/test/resources/refreshVersionsCatalog-underscore-new/expected.libs.toml b/plugins/core/src/test/resources/refreshVersionsCatalog/underscore-new/expected.libs.toml similarity index 100% rename from plugins/core/src/test/resources/refreshVersionsCatalog-underscore-new/expected.libs.toml rename to plugins/core/src/test/resources/refreshVersionsCatalog/underscore-new/expected.libs.toml diff --git a/plugins/core/src/test/resources/refreshVersionsCatalog-underscore-new/initial.libs.toml b/plugins/core/src/test/resources/refreshVersionsCatalog/underscore-new/initial.libs.toml similarity index 100% rename from plugins/core/src/test/resources/refreshVersionsCatalog-underscore-new/initial.libs.toml rename to plugins/core/src/test/resources/refreshVersionsCatalog/underscore-new/initial.libs.toml diff --git a/plugins/core/src/test/resources/refreshVersionsCatalog-versions-existing/dependencies.txt b/plugins/core/src/test/resources/refreshVersionsCatalog/versions-existing/dependencies.txt similarity index 100% rename from plugins/core/src/test/resources/refreshVersionsCatalog-versions-existing/dependencies.txt rename to plugins/core/src/test/resources/refreshVersionsCatalog/versions-existing/dependencies.txt diff --git a/plugins/core/src/test/resources/refreshVersionsCatalog-versions-existing/expected.libs.toml b/plugins/core/src/test/resources/refreshVersionsCatalog/versions-existing/expected.libs.toml similarity index 100% rename from plugins/core/src/test/resources/refreshVersionsCatalog-versions-existing/expected.libs.toml rename to plugins/core/src/test/resources/refreshVersionsCatalog/versions-existing/expected.libs.toml diff --git a/plugins/core/src/test/resources/refreshVersionsCatalog-versions-existing/initial.libs.toml b/plugins/core/src/test/resources/refreshVersionsCatalog/versions-existing/initial.libs.toml similarity index 100% rename from plugins/core/src/test/resources/refreshVersionsCatalog-versions-existing/initial.libs.toml rename to plugins/core/src/test/resources/refreshVersionsCatalog/versions-existing/initial.libs.toml diff --git a/plugins/core/src/test/resources/refreshVersionsCatalog-versions-new/dependencies.txt b/plugins/core/src/test/resources/refreshVersionsCatalog/versions-new/dependencies.txt similarity index 100% rename from plugins/core/src/test/resources/refreshVersionsCatalog-versions-new/dependencies.txt rename to plugins/core/src/test/resources/refreshVersionsCatalog/versions-new/dependencies.txt diff --git a/plugins/core/src/test/resources/refreshVersionsCatalog-versions-new/expected.libs.toml b/plugins/core/src/test/resources/refreshVersionsCatalog/versions-new/expected.libs.toml similarity index 100% rename from plugins/core/src/test/resources/refreshVersionsCatalog-versions-new/expected.libs.toml rename to plugins/core/src/test/resources/refreshVersionsCatalog/versions-new/expected.libs.toml diff --git a/plugins/core/src/test/resources/refreshVersionsCatalog-versions-new/initial.libs.toml b/plugins/core/src/test/resources/refreshVersionsCatalog/versions-new/initial.libs.toml similarity index 100% rename from plugins/core/src/test/resources/refreshVersionsCatalog-versions-new/initial.libs.toml rename to plugins/core/src/test/resources/refreshVersionsCatalog/versions-new/initial.libs.toml From bc7f6777a029c3c2a3e9a4e2cc950955d7e9995e Mon Sep 17 00:00:00 2001 From: Louis CAD Date: Sat, 30 Jul 2022 06:11:39 +0200 Subject: [PATCH 082/103] Make test data for TomlUpdaterTest easier to read --- .../refreshVersions/core/TomlUpdaterTest.kt | 32 +++++++++++-------- .../default-dependencies.txt | 9 ++++++ .../underscore-existing/dependencies.txt | 9 ------ .../underscore-new/dependencies.txt | 9 ------ .../versions-existing/dependencies.txt | 9 ------ .../versions-new/dependencies.txt | 9 ------ .../toml-refreshversions/dependencies.txt | 14 ++++---- 7 files changed, 35 insertions(+), 56 deletions(-) create mode 100644 plugins/core/src/test/resources/refreshVersionsCatalog/default-dependencies.txt delete mode 100644 plugins/core/src/test/resources/refreshVersionsCatalog/underscore-existing/dependencies.txt delete mode 100644 plugins/core/src/test/resources/refreshVersionsCatalog/underscore-new/dependencies.txt delete mode 100644 plugins/core/src/test/resources/refreshVersionsCatalog/versions-existing/dependencies.txt delete mode 100644 plugins/core/src/test/resources/refreshVersionsCatalog/versions-new/dependencies.txt diff --git a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlUpdaterTest.kt b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlUpdaterTest.kt index d9fd24690..8102982c5 100644 --- a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlUpdaterTest.kt +++ b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlUpdaterTest.kt @@ -85,7 +85,8 @@ class TomlUpdaterTest { private val versionKeyReader = ArtifactVersionKeyReader.fromRules(rulesDir.listFiles()!!.map { it.readText() }) @TestFactory - fun refreshVersionsCatalog() = testResources.resolve("refreshVersionsCatalog").listFiles()!!.map { folder -> + fun refreshVersionsCatalog() = testResources.resolve("refreshVersionsCatalog").listFiles()!!.mapNotNull { folder -> + if (folder.isDirectory.not()) return@mapNotNull null dynamicTest(folder.name) { val input = FolderInput(folder) val withVersions = input.folder.name.contains("versions") @@ -144,19 +145,24 @@ private fun FolderInput(folder: File): FolderInput { private fun dependencyWithVersionCandidates(folder: File): List { val file = folder.resolve("dependencies.txt") .takeIf { it.canRead() } - ?: return emptyList() - - val dependencies = file.readText() - .lines() - .filter { it.isNotBlank() } - .map { line -> - val (group, name, version, available) = line.split(":") + ?: folder.parentFile.resolve("default-dependencies.txt") + .takeIf { it.canRead() } ?: return emptyList() + + return file.useLines { lines -> + lines.filter { + it.isNotBlank() + }.map { line -> + val dependencyNotation = line.substringBefore('|').trimEnd() + val versions = line.substringAfter('|', missingDelimiterValue = "").trim().split(',') DependencyWithVersionCandidates( - moduleId = ModuleId.Maven(group, name), - currentVersion = version, - versionsCandidates = available.split(",").map { MavenVersion(it) }, + moduleId = ModuleId.Maven( + group = dependencyNotation.substringBefore(':'), + name = dependencyNotation.substringAfter(':').substringBefore(':') + ), + currentVersion = dependencyNotation.substringAfterLast(':'), //TODO: Support and test version-less + versionsCandidates = versions.map { MavenVersion(it.trim()) }, failures = emptyList() ) - } - return dependencies + }.toList() + } } diff --git a/plugins/core/src/test/resources/refreshVersionsCatalog/default-dependencies.txt b/plugins/core/src/test/resources/refreshVersionsCatalog/default-dependencies.txt new file mode 100644 index 000000000..52ecafc76 --- /dev/null +++ b/plugins/core/src/test/resources/refreshVersionsCatalog/default-dependencies.txt @@ -0,0 +1,9 @@ +org.codehaus.groovy:groovy-kotlin:3.0.5 | groovy-kotlin +com.mycompany:mylib:1.4 | my-lib +com.mycompany:other:1.4 | my-other-lib +com.mycompany:alternate:1.2 | my-alternate-lib +some.plugin.id:some.plugin.id.gradle.plugin:1.4 | 1.5, 1.6, 1.7 +other.plugin.id:other.plugin.id.gradle.plugin:3.4 | 3.5, 3.6 +io.kotest:kotest:3.0 | kotest-core +io.kotest:kotest-property:3.0 | kotest-property +org.junit.jupiter:junit-jupiter-engine:1.0 | junit-jupiter diff --git a/plugins/core/src/test/resources/refreshVersionsCatalog/underscore-existing/dependencies.txt b/plugins/core/src/test/resources/refreshVersionsCatalog/underscore-existing/dependencies.txt deleted file mode 100644 index ca3bc22ef..000000000 --- a/plugins/core/src/test/resources/refreshVersionsCatalog/underscore-existing/dependencies.txt +++ /dev/null @@ -1,9 +0,0 @@ -org.codehaus.groovy:groovy-kotlin:3.0.5:groovy-kotlin -com.mycompany:mylib:1.4:my-lib -com.mycompany:other:1.4:my-other-lib -com.mycompany:alternate:1.2:my-alternate-lib -some.plugin.id:some.plugin.id.gradle.plugin:1.4:1.5,1.6,1.7 -other.plugin.id:other.plugin.id.gradle.plugin:3.4:3.5,3.6 -io.kotest:kotest:3.0:kotest-core -io.kotest:kotest-property:3.0:kotest-property -org.junit.jupiter:junit-jupiter-engine:1.0:junit-jupiter diff --git a/plugins/core/src/test/resources/refreshVersionsCatalog/underscore-new/dependencies.txt b/plugins/core/src/test/resources/refreshVersionsCatalog/underscore-new/dependencies.txt deleted file mode 100644 index ca3bc22ef..000000000 --- a/plugins/core/src/test/resources/refreshVersionsCatalog/underscore-new/dependencies.txt +++ /dev/null @@ -1,9 +0,0 @@ -org.codehaus.groovy:groovy-kotlin:3.0.5:groovy-kotlin -com.mycompany:mylib:1.4:my-lib -com.mycompany:other:1.4:my-other-lib -com.mycompany:alternate:1.2:my-alternate-lib -some.plugin.id:some.plugin.id.gradle.plugin:1.4:1.5,1.6,1.7 -other.plugin.id:other.plugin.id.gradle.plugin:3.4:3.5,3.6 -io.kotest:kotest:3.0:kotest-core -io.kotest:kotest-property:3.0:kotest-property -org.junit.jupiter:junit-jupiter-engine:1.0:junit-jupiter diff --git a/plugins/core/src/test/resources/refreshVersionsCatalog/versions-existing/dependencies.txt b/plugins/core/src/test/resources/refreshVersionsCatalog/versions-existing/dependencies.txt deleted file mode 100644 index ca3bc22ef..000000000 --- a/plugins/core/src/test/resources/refreshVersionsCatalog/versions-existing/dependencies.txt +++ /dev/null @@ -1,9 +0,0 @@ -org.codehaus.groovy:groovy-kotlin:3.0.5:groovy-kotlin -com.mycompany:mylib:1.4:my-lib -com.mycompany:other:1.4:my-other-lib -com.mycompany:alternate:1.2:my-alternate-lib -some.plugin.id:some.plugin.id.gradle.plugin:1.4:1.5,1.6,1.7 -other.plugin.id:other.plugin.id.gradle.plugin:3.4:3.5,3.6 -io.kotest:kotest:3.0:kotest-core -io.kotest:kotest-property:3.0:kotest-property -org.junit.jupiter:junit-jupiter-engine:1.0:junit-jupiter diff --git a/plugins/core/src/test/resources/refreshVersionsCatalog/versions-new/dependencies.txt b/plugins/core/src/test/resources/refreshVersionsCatalog/versions-new/dependencies.txt deleted file mode 100644 index ca3bc22ef..000000000 --- a/plugins/core/src/test/resources/refreshVersionsCatalog/versions-new/dependencies.txt +++ /dev/null @@ -1,9 +0,0 @@ -org.codehaus.groovy:groovy-kotlin:3.0.5:groovy-kotlin -com.mycompany:mylib:1.4:my-lib -com.mycompany:other:1.4:my-other-lib -com.mycompany:alternate:1.2:my-alternate-lib -some.plugin.id:some.plugin.id.gradle.plugin:1.4:1.5,1.6,1.7 -other.plugin.id:other.plugin.id.gradle.plugin:3.4:3.5,3.6 -io.kotest:kotest:3.0:kotest-core -io.kotest:kotest-property:3.0:kotest-property -org.junit.jupiter:junit-jupiter-engine:1.0:junit-jupiter diff --git a/plugins/core/src/test/resources/toml-refreshversions/dependencies.txt b/plugins/core/src/test/resources/toml-refreshversions/dependencies.txt index 835555ca2..baf3257e2 100644 --- a/plugins/core/src/test/resources/toml-refreshversions/dependencies.txt +++ b/plugins/core/src/test/resources/toml-refreshversions/dependencies.txt @@ -1,7 +1,7 @@ -org.codehaus.groovy:groovy:3.0.5:3.1.0,3.2.0 -com.mycompany:mylib-ok:1.4:2.0 -com.mycompany:mylib-ko:1.4: -com.mycompany:other:1.4:1.5,1.6 -com.mycompany:alternate:1.4:1.5 -some.plugin.id:some.plugin.id.gradle.plugin:1.4:1.5,1.6,1.7 -other.plugin.id:other.plugin.id.gradle.plugin:3.4:3.5,3.6 \ No newline at end of file +org.codehaus.groovy:groovy:3.0.5 | 3.1.0, 3.2.0 +com.mycompany:mylib-ok:1.4 | 2.0 +com.mycompany:mylib-ko:1.4 | +com.mycompany:other:1.4 | 1.5, 1.6 +com.mycompany:alternate:1.4 | 1.5 +some.plugin.id:some.plugin.id.gradle.plugin:1.4 | 1.5, 1.6, 1.7 +other.plugin.id:other.plugin.id.gradle.plugin:3.4 | 3.5, 3.6 From 8df03b550918ebf0ae626ef291edc7158fddc5c3 Mon Sep 17 00:00:00 2001 From: Louis CAD Date: Wed, 3 Aug 2022 16:49:37 +0200 Subject: [PATCH 083/103] Fix typo (add missing d) --- .../kotlin/de/fayard/refreshVersions/core/TomlUpdaterTest.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlUpdaterTest.kt b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlUpdaterTest.kt index 8102982c5..623895197 100644 --- a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlUpdaterTest.kt +++ b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlUpdaterTest.kt @@ -78,7 +78,7 @@ class TomlUpdaterTest { private val rulesDir = File(".").absoluteFile.parentFile.parentFile .resolve("dependencies/src/main/resources/refreshVersions-rules") - .also { require(it.canRead()) { "Can't read foler $it" } } + .also { require(it.canRead()) { "Can't read folder $it" } } private val versionsMap = mapOf( "version.junit.jupiter" to "42" ) From 250e81ccfd973bbff832607e9840cf6f844df3ed Mon Sep 17 00:00:00 2001 From: Louis CAD Date: Sun, 7 Aug 2022 00:52:24 +0200 Subject: [PATCH 084/103] Fix plural of local property --- .../de/fayard/refreshVersions/core/internal/TomlUpdater.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlUpdater.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlUpdater.kt index eed81a5f4..43bdcc1b0 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlUpdater.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlUpdater.kt @@ -37,10 +37,10 @@ internal class TomlUpdater( linesForUpdate(line, findLineReferencing(line)) } Libs, Plugin -> { - val update = dependenciesUpdates.firstOrNull { dc -> + val updates = dependenciesUpdates.firstOrNull { dc -> dc.moduleId.name == line.name && dc.moduleId.group == line.group } - linesForUpdate(line, update) + linesForUpdate(line, updates) } } } From b34b6177af5fd8a3a04843995d8f089b83ba1c97 Mon Sep 17 00:00:00 2001 From: Louis CAD Date: Sun, 7 Aug 2022 00:55:26 +0200 Subject: [PATCH 085/103] Update TomlUpdaterTest and its data Now, we are testing with realistic data when it comes to the versions retrieved from the repos, and this will help ensure we are going in a code path that does the proper filtering. Also, we are now testing for the migration into the version catalog of dependencies that don't have a version specified (e.g. because specified by a BoM). Yes, the tests are currently failing. --- .../refreshVersions/core/TomlUpdaterTest.kt | 54 +++++++++++-------- .../default-dependencies.txt | 14 +++-- .../underscore-existing/expected.libs.toml | 4 +- .../underscore-new/expected.libs.toml | 4 +- .../versions-existing/expected.libs.toml | 4 +- .../versions-new/expected.libs.toml | 4 +- .../toml-refreshversions/dependencies.txt | 17 +++--- 7 files changed, 66 insertions(+), 35 deletions(-) diff --git a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlUpdaterTest.kt b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlUpdaterTest.kt index 623895197..17ad87d56 100644 --- a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlUpdaterTest.kt +++ b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlUpdaterTest.kt @@ -28,14 +28,21 @@ class TomlUpdaterTest { inputFolderName = "toml-cleanup" ) { actual: File -> cleanupComments(actual) } - private fun testTomlUpdater(inputFolderName: String, action: TomlUpdater.(actual: File) -> Unit) { + private fun testTomlUpdater( + inputFolderName: String, + action: TomlUpdater.(actual: File) -> Unit + ) { val input = FolderInput(inputFolderName) - TomlUpdater(input.initial, input.dependenciesUpdates).action(input.actual) - input.actual.readText() shouldBe input.expectedText - - // check idempotence - TomlUpdater(input.expected, input.dependenciesUpdates).action(input.expected) - input.actual.readText() shouldBe input.expectedText + sequence { + yield(input.initial to input.actual) + yield(input.expected to input.expected) // check idempotence + }.forEach { (initial, actual) -> + TomlUpdater( + file = initial, + dependenciesUpdates = dependencyWithVersionCandidates(input.folder) + ).action(actual) + input.actual.readText() shouldBe input.expectedText + } // delete actual file if successful input.actual.delete() @@ -92,10 +99,17 @@ class TomlUpdaterTest { val withVersions = input.folder.name.contains("versions") val currentText = input.initial.readText() - val dependenciesAndNames = input.dependenciesUpdates.associate { d -> - val versionName = d.versionsCandidates.first().value - val dependency: Dependency = ConfigurationLessDependency(d.moduleId.group!!, d.moduleId.name, d.currentVersion) - dependency to versionName + val dependenciesDataFile = folder.resolve("dependencies.txt").takeIf { it.exists() } + ?: folder.parentFile.resolve("default-dependencies.txt") + val dependenciesAndNames = dependenciesDataFile.useLines { lines -> + lines.filter { + it.isNotBlank() && it.startsWith("//").not() + }.toList() + }.associate { + val dependencyNotation = it.substringBefore('|').trimEnd() + val tomlPropertyName = it.substringAfter('|').trim() + val dependency: Dependency = ConfigurationLessDependency(dependencyNotation) + dependency to tomlPropertyName } val plugins = dependenciesAndNames.keys.filter { it.name.endsWith(".gradle.plugin") } val newText = VersionCatalogs.generateVersionsCatalogText( @@ -120,7 +134,6 @@ private data class FolderInput( val initial: File, val expected: File, val actual: File, - val dependenciesUpdates: List ) { val expectedText = expected.readText() @@ -132,13 +145,11 @@ private fun FolderInput(folderName: String): FolderInput = FolderInput(testResou private fun FolderInput(folder: File): FolderInput { require(folder.canRead()) { "Invalid folder ${folder.absolutePath}" } - val dependencies = dependencyWithVersionCandidates(folder) return FolderInput( folder = folder, initial = folder.resolve("initial.libs.toml"), actual = folder.resolve("actual.libs.toml"), expected = folder.resolve("expected.libs.toml"), - dependenciesUpdates = dependencies ) } @@ -153,15 +164,16 @@ private fun dependencyWithVersionCandidates(folder: File): List val dependencyNotation = line.substringBefore('|').trimEnd() - val versions = line.substringAfter('|', missingDelimiterValue = "").trim().split(',') + val moduleId = ModuleId.Maven( + group = dependencyNotation.substringBefore(':'), + name = dependencyNotation.substringAfter(':').substringBefore(':') + ) + val versions = line.substringAfter('|').trim().split(',') DependencyWithVersionCandidates( - moduleId = ModuleId.Maven( - group = dependencyNotation.substringBefore(':'), - name = dependencyNotation.substringAfter(':').substringBefore(':') - ), - currentVersion = dependencyNotation.substringAfterLast(':'), //TODO: Support and test version-less + moduleId = moduleId, + currentVersion = dependencyNotation.substringAfterLast(':'), versionsCandidates = versions.map { MavenVersion(it.trim()) }, - failures = emptyList() + failures = emptyList() //TODO: Test failures ) }.toList() } diff --git a/plugins/core/src/test/resources/refreshVersionsCatalog/default-dependencies.txt b/plugins/core/src/test/resources/refreshVersionsCatalog/default-dependencies.txt index 52ecafc76..cf6eaccea 100644 --- a/plugins/core/src/test/resources/refreshVersionsCatalog/default-dependencies.txt +++ b/plugins/core/src/test/resources/refreshVersionsCatalog/default-dependencies.txt @@ -1,9 +1,17 @@ +// Represents dependencies that we would get in a Gradle build, +// and the key assigned by refreshVersions for +// the version catalog at migration time. +// +// Note: Gradle plugin dependencies should be filtered out by the code, +// and should not appear as libraries in the toml file. + org.codehaus.groovy:groovy-kotlin:3.0.5 | groovy-kotlin com.mycompany:mylib:1.4 | my-lib com.mycompany:other:1.4 | my-other-lib com.mycompany:alternate:1.2 | my-alternate-lib -some.plugin.id:some.plugin.id.gradle.plugin:1.4 | 1.5, 1.6, 1.7 -other.plugin.id:other.plugin.id.gradle.plugin:3.4 | 3.5, 3.6 +some.plugin.id:some.plugin.id.gradle.plugin:1.4 | some-plugin-id +other.plugin.id:other.plugin.id.gradle.plugin:3.4 | other-plugin-id io.kotest:kotest:3.0 | kotest-core io.kotest:kotest-property:3.0 | kotest-property -org.junit.jupiter:junit-jupiter-engine:1.0 | junit-jupiter +org.junit.jupiter:junit-jupiter-bom:1.0 | junit-jupiter-bom +org.junit.jupiter:junit-jupiter | junit-jupiter diff --git a/plugins/core/src/test/resources/refreshVersionsCatalog/underscore-existing/expected.libs.toml b/plugins/core/src/test/resources/refreshVersionsCatalog/underscore-existing/expected.libs.toml index d54cb05b6..bd812c70a 100644 --- a/plugins/core/src/test/resources/refreshVersionsCatalog/underscore-existing/expected.libs.toml +++ b/plugins/core/src/test/resources/refreshVersionsCatalog/underscore-existing/expected.libs.toml @@ -40,4 +40,6 @@ kotest-core = { group = "io.kotest", name = "kotest", version.ref = "kotest" } kotest-property = { group = "io.kotest", name = "kotest-property", version.ref = "kotest" } -junit-jupiter = { group = "org.junit.jupiter", name = "junit-jupiter-engine", version.ref = "junit-jupiter" } +junit-jupiter-bom = { group = "org.junit.jupiter", name = "junit-jupiter-bom", version.ref = "junit-jupiter" } + +junit-jupiter = "org.junit.jupiter:junit-jupiter" diff --git a/plugins/core/src/test/resources/refreshVersionsCatalog/underscore-new/expected.libs.toml b/plugins/core/src/test/resources/refreshVersionsCatalog/underscore-new/expected.libs.toml index cf7a55012..f5ff53dc6 100644 --- a/plugins/core/src/test/resources/refreshVersionsCatalog/underscore-new/expected.libs.toml +++ b/plugins/core/src/test/resources/refreshVersionsCatalog/underscore-new/expected.libs.toml @@ -28,4 +28,6 @@ kotest-core = { group = "io.kotest", name = "kotest", version.ref = "kotest" } kotest-property = { group = "io.kotest", name = "kotest-property", version.ref = "kotest" } -junit-jupiter = { group = "org.junit.jupiter", name = "junit-jupiter-engine", version.ref = "junit-jupiter" } +junit-jupiter-bom = { group = "org.junit.jupiter", name = "junit-jupiter-bom", version.ref = "junit-jupiter" } + +junit-jupiter = "org.junit.jupiter:junit-jupiter" diff --git a/plugins/core/src/test/resources/refreshVersionsCatalog/versions-existing/expected.libs.toml b/plugins/core/src/test/resources/refreshVersionsCatalog/versions-existing/expected.libs.toml index 19477df05..804aa5112 100644 --- a/plugins/core/src/test/resources/refreshVersionsCatalog/versions-existing/expected.libs.toml +++ b/plugins/core/src/test/resources/refreshVersionsCatalog/versions-existing/expected.libs.toml @@ -40,4 +40,6 @@ kotest-core = { group = "io.kotest", name = "kotest", version.ref = "kotest" } kotest-property = { group = "io.kotest", name = "kotest-property", version.ref = "kotest" } -junit-jupiter = { group = "org.junit.jupiter", name = "junit-jupiter-engine", version.ref = "junit-jupiter" } +junit-jupiter-bom = { group = "org.junit.jupiter", name = "junit-jupiter-bom", version.ref = "junit-jupiter" } + +junit-jupiter = "org.junit.jupiter:junit-jupiter" diff --git a/plugins/core/src/test/resources/refreshVersionsCatalog/versions-new/expected.libs.toml b/plugins/core/src/test/resources/refreshVersionsCatalog/versions-new/expected.libs.toml index 0538f701c..e413b7e1c 100644 --- a/plugins/core/src/test/resources/refreshVersionsCatalog/versions-new/expected.libs.toml +++ b/plugins/core/src/test/resources/refreshVersionsCatalog/versions-new/expected.libs.toml @@ -28,4 +28,6 @@ kotest-core = { group = "io.kotest", name = "kotest", version.ref = "kotest" } kotest-property = { group = "io.kotest", name = "kotest-property", version.ref = "kotest" } -junit-jupiter = { group = "org.junit.jupiter", name = "junit-jupiter-engine", version.ref = "junit-jupiter" } +junit-jupiter-bom = { group = "org.junit.jupiter", name = "junit-jupiter-bom", version.ref = "junit-jupiter" } + +junit-jupiter = "org.junit.jupiter:junit-jupiter" diff --git a/plugins/core/src/test/resources/toml-refreshversions/dependencies.txt b/plugins/core/src/test/resources/toml-refreshversions/dependencies.txt index baf3257e2..408957ae6 100644 --- a/plugins/core/src/test/resources/toml-refreshversions/dependencies.txt +++ b/plugins/core/src/test/resources/toml-refreshversions/dependencies.txt @@ -1,7 +1,10 @@ -org.codehaus.groovy:groovy:3.0.5 | 3.1.0, 3.2.0 -com.mycompany:mylib-ok:1.4 | 2.0 -com.mycompany:mylib-ko:1.4 | -com.mycompany:other:1.4 | 1.5, 1.6 -com.mycompany:alternate:1.4 | 1.5 -some.plugin.id:some.plugin.id.gradle.plugin:1.4 | 1.5, 1.6, 1.7 -other.plugin.id:other.plugin.id.gradle.plugin:3.4 | 3.5, 3.6 +// Represents dependencies that we would get in a Gradle build, +// and the versions that we would get by reaching the repositories. + +org.codehaus.groovy:groovy:3.0.5 | 1.0, 2.0, 3.0.0, 3.0.1, 3.0.2, 3.0.3, 3.0.4, 3.0.5, 3.1.0, 3.2.0 +com.mycompany:mylib-ok:1.4 | 1.0, 1.4, 1.4.1, 2.0 +com.mycompany:mylib-ko:1.4 | 1.0, 1.1, 1.2, 1.3, 1.4 +com.mycompany:other:1.4 | 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6 +com.mycompany:alternate:1.4 | 1.0, 1.1, 1.2, 1.3, 1.4, 1.5 +some.plugin.id:some.plugin.id.gradle.plugin:1.4 | 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7 +other.plugin.id:other.plugin.id.gradle.plugin:3.4 | 1.0, 2.0, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 From 076df12fac05327248da4ac0ec081655094f862d Mon Sep 17 00:00:00 2001 From: Louis CAD Date: Sun, 7 Aug 2022 01:05:01 +0200 Subject: [PATCH 086/103] Replace unclear acronym lambda param name with default --- .../de/fayard/refreshVersions/core/internal/TomlUpdater.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlUpdater.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlUpdater.kt index 43bdcc1b0..d44fd4bda 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlUpdater.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlUpdater.kt @@ -37,8 +37,8 @@ internal class TomlUpdater( linesForUpdate(line, findLineReferencing(line)) } Libs, Plugin -> { - val updates = dependenciesUpdates.firstOrNull { dc -> - dc.moduleId.name == line.name && dc.moduleId.group == line.group + val updates = dependenciesUpdates.firstOrNull { + it.moduleId.name == line.name && it.moduleId.group == line.group } linesForUpdate(line, updates) } From 679ce91093e448cf7dcf4cd8459f788c0458def0 Mon Sep 17 00:00:00 2001 From: Louis CAD Date: Mon, 8 Aug 2022 03:31:43 +0200 Subject: [PATCH 087/103] Split the lookupVersionCandidates for testing The freshly introduced overload will be testable without having to perform network calls, which means we will be able to use static, and fake data. Most importantly, the new overload doesn't depend on global mutable state, but only from the arguments it has been passed. --- .../core/internal/NewRefreshVersionsImpl.kt | 57 +++++++++++++------ 1 file changed, 39 insertions(+), 18 deletions(-) diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/NewRefreshVersionsImpl.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/NewRefreshVersionsImpl.kt index 857b239d7..b747d7449 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/NewRefreshVersionsImpl.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/NewRefreshVersionsImpl.kt @@ -35,6 +35,37 @@ internal suspend fun lookupVersionCandidates( val projects = RefreshVersionsConfigHolder.allProjects(project) + return lookupVersionCandidates( + dependencyVersionsFetchers = { dependencyFilter -> + projects.flatMap { + it.getDependencyVersionFetchers(httpClient = httpClient, dependencyFilter = dependencyFilter) + }.plus( + UsedPluginsTracker.read().getDependencyVersionsFetchers(httpClient) + ).plus( + UsedVersionForTracker.read().getDependencyVersionsFetchers(httpClient) + ).toSet() + }, + lookupAvailableGradleVersions = { + if (GRADLE_UPDATES.isEnabled) lookupAvailableGradleVersions(httpClient) else emptyList() + }, + lookupSettingsPluginUpdates = { resultMode -> + SettingsPluginsUpdatesFinder.getSettingsPluginUpdates(httpClient, resultMode) + }, + versionMap = versionMap, + versionKeyReader = versionKeyReader, + versionsCatalogMapping = versionsCatalogMapping + ) +} + +internal suspend fun lookupVersionCandidates( + dependencyVersionsFetchers: (dependencyFilter: (Dependency) -> Boolean) -> Set, + lookupAvailableGradleVersions: suspend () -> List, + lookupSettingsPluginUpdates: suspend (VersionCandidatesResultMode) -> SettingsPluginsUpdatesFinder.UpdatesLookupResult, + versionMap: Map, + versionKeyReader: ArtifactVersionKeyReader, + versionsCatalogMapping: Set +): VersionCandidatesLookupResult { + val dependenciesWithHardcodedVersions = mutableListOf() val dependenciesWithDynamicVersions = mutableListOf() val dependencyFilter: (Dependency) -> Boolean = { dependency -> @@ -51,19 +82,12 @@ internal suspend fun lookupVersionCandidates( } } } - val dependencyVersionsFetchers: Set = projects.flatMap { - it.getDependencyVersionFetchers(httpClient = httpClient, dependencyFilter = dependencyFilter) - }.plus( - UsedPluginsTracker.read().getDependencyVersionsFetchers(httpClient) - ).plus( - UsedVersionForTracker.read().getDependencyVersionsFetchers(httpClient) - ).toSet() return coroutineScope { val resultMode = RefreshVersionsConfigHolder.resultMode val versionRejectionFilter = RefreshVersionsConfigHolder.versionRejectionFilter ?: { false } - val dependenciesWithVersionCandidatesAsync = dependencyVersionsFetchers.groupBy { + val dependenciesWithVersionCandidatesAsync = dependencyVersionsFetchers(dependencyFilter).groupBy { it.moduleId }.map { (moduleId: ModuleId, versionFetchers: List) -> val propertyName = getVersionPropertyName(moduleId, versionKeyReader) @@ -90,17 +114,16 @@ internal suspend fun lookupVersionCandidates( } } - val settingsPluginsUpdatesAsync = async { - SettingsPluginsUpdatesFinder.getSettingsPluginUpdates(httpClient, resultMode) - } - - val gradleUpdatesAsync = async { - if (GRADLE_UPDATES.isEnabled) lookupAvailableGradleVersions(httpClient) else emptyList() - } + val settingsPluginsUpdatesAsync = async { lookupSettingsPluginUpdates(resultMode) } + val gradleUpdatesAsync = async { lookupAvailableGradleVersions() } val dependenciesWithVersionCandidates = dependenciesWithVersionCandidatesAsync.awaitAll() - val dependenciesFromVersionsCatalog = versionsCatalogMapping.map(ModuleId.Maven::toDependency) + val dependenciesFromVersionsCatalog: Set = versionsCatalogMapping.mapTo( + destination = mutableSetOf() + ) { + ConfigurationLessDependency(moduleId = it, version = "_") + } return@coroutineScope VersionCandidatesLookupResult( dependenciesUpdates = dependenciesWithVersionCandidates, @@ -114,8 +137,6 @@ internal suspend fun lookupVersionCandidates( } } -private fun ModuleId.Maven.toDependency() = ConfigurationLessDependency(moduleId = this, version = "_") - private suspend fun lookupAvailableGradleVersions(httpClient: OkHttpClient): List = coroutineScope { val checker = GradleUpdateChecker(httpClient) val currentGradleVersion = GradleVersion.current() From aa1f4d5be35b39af81b095e4f2a1e83bcb87ef50 Mon Sep 17 00:00:00 2001 From: Louis CAD Date: Mon, 8 Aug 2022 03:32:25 +0200 Subject: [PATCH 088/103] Skip getting the version catalog when unsupported --- .../de/fayard/refreshVersions/core/RefreshVersionsTask.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsTask.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsTask.kt index 9c77eeaf9..2c9b0864a 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsTask.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsTask.kt @@ -56,8 +56,12 @@ open class RefreshVersionsTask : DefaultTask() { //TODO: Filter using known grouping strategies to only use the main artifact to resolve latest version, this // will reduce the number of repositories lookups, improving performance a little more. - val versionsCatalogMapping: Set = + val shouldUpdateVersionCatalogs = VersionCatalogs.isSupported() && FeatureFlag.VERSIONS_CATALOG.isEnabled + + + val versionsCatalogMapping: Set = if (shouldUpdateVersionCatalogs) { VersionCatalogs.dependencyAliases(project.getVersionsCatalog()).keys + } else emptySet() runBlocking { val lintUpdatingProblemsAsync = async { @@ -90,7 +94,6 @@ open class RefreshVersionsTask : DefaultTask() { } OutputFile.VERSIONS_PROPERTIES.logFileWasModified() - val shouldUpdateVersionCatalogs = VersionCatalogs.isSupported() && FeatureFlag.VERSIONS_CATALOG.isEnabled if (shouldUpdateVersionCatalogs) { val libsToml = project.file(LIBS_VERSIONS_TOML) if (libsToml.canRead()) { From dc87d7b5eb02223bac550da862ed4362c0a0df95 Mon Sep 17 00:00:00 2001 From: Louis CAD Date: Mon, 8 Aug 2022 03:34:27 +0200 Subject: [PATCH 089/103] Optimize the fun Dependency.isManageableVersion function We no longer allocate on each call. This commit also removes the unused parameter of the hasHardcodedVersion function which always had the default value of emptySet(). --- .../core/internal/InternalExtensions.kt | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/InternalExtensions.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/InternalExtensions.kt index b0c2b12c3..ad1ecd4bd 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/InternalExtensions.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/InternalExtensions.kt @@ -8,9 +8,8 @@ import org.gradle.api.artifacts.ExternalDependency @InternalRefreshVersionsApi fun Dependency.hasHardcodedVersion( versionMap: Map, - versionKeyReader: ArtifactVersionKeyReader, - versionsCatalogMapping: Set = emptySet(), -): Boolean = isManageableVersion(versionMap, versionKeyReader, versionsCatalogMapping).not() + versionKeyReader: ArtifactVersionKeyReader +): Boolean = isManageableVersion(versionMap, versionKeyReader, emptySet()).not() @InternalRefreshVersionsApi fun Dependency.isManageableVersion( @@ -31,8 +30,13 @@ fun Dependency.isManageableVersion( else -> false } } - ModuleId.Maven(group ?: "", name) in versionsCatalogMapping && - version.isNullOrBlank().not() -> true + hasVersionInVersionCatalog(versionsCatalogMapping) -> true else -> false } } + +private fun Dependency.hasVersionInVersionCatalog( + versionsCatalogMapping: Set +): Boolean = versionsCatalogMapping.any { + it.group == group && it.name == name && version != null +} From cb2e9248bd8bdecb9a78919fe395050bd822a289 Mon Sep 17 00:00:00 2001 From: Louis CAD Date: Mon, 8 Aug 2022 15:54:13 +0200 Subject: [PATCH 090/103] Fix version filtering and unused version entries flagging --- .../core/RefreshVersionsTask.kt | 25 +++- .../core/extensions/gradle/Dependency.kt | 4 + .../extensions/gradle/VersionConstraint.kt | 10 ++ .../DependencyWithVersionCandidates.kt | 6 +- .../core/internal/GettingVersionCandidates.kt | 8 +- .../core/internal/InternalExtensions.kt | 42 ------ .../core/internal/NewRefreshVersionsImpl.kt | 124 +++++++++++++----- .../core/internal/PluginDependencyCompat.kt | 18 +++ .../core/internal/TomlUpdater.kt | 6 +- .../internal/VersionCandidatesLookupResult.kt | 3 +- .../core/internal/VersionCatalogs.kt | 16 +++ .../core/internal/VersionManagementKind.kt | 86 ++++++++++++ .../versions/VersionsPropertiesWriting.kt | 2 +- .../refreshVersions/core/TomlUpdaterTest.kt | 6 +- 14 files changed, 266 insertions(+), 90 deletions(-) delete mode 100644 plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/InternalExtensions.kt create mode 100644 plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/PluginDependencyCompat.kt create mode 100644 plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionManagementKind.kt diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsTask.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsTask.kt index 2c9b0864a..a9d8a4257 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsTask.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsTask.kt @@ -11,6 +11,7 @@ import kotlinx.coroutines.async import kotlinx.coroutines.runBlocking import org.gradle.api.DefaultTask import org.gradle.api.artifacts.Dependency +import org.gradle.api.artifacts.MinimalExternalModuleDependency import org.gradle.api.tasks.Input import org.gradle.api.tasks.Optional import org.gradle.api.tasks.TaskAction @@ -59,9 +60,17 @@ open class RefreshVersionsTask : DefaultTask() { val shouldUpdateVersionCatalogs = VersionCatalogs.isSupported() && FeatureFlag.VERSIONS_CATALOG.isEnabled - val versionsCatalogMapping: Set = if (shouldUpdateVersionCatalogs) { - VersionCatalogs.dependencyAliases(project.getVersionsCatalog()).keys - } else emptySet() + val versionsCatalogLibraries: Set + val versionsCatalogPlugins: Set + if (shouldUpdateVersionCatalogs) { + val versionCatalog = project.getVersionsCatalog() + versionsCatalogLibraries = VersionCatalogs.libraries(versionCatalog) + versionsCatalogPlugins = VersionCatalogs.plugins(versionCatalog) + } else { + versionsCatalogLibraries = emptySet() + versionsCatalogPlugins = emptySet() + } + runBlocking { val lintUpdatingProblemsAsync = async { @@ -75,10 +84,11 @@ open class RefreshVersionsTask : DefaultTask() { project = project, versionMap = RefreshVersionsConfigHolder.readVersionsMap(), versionKeyReader = RefreshVersionsConfigHolder.versionKeyReader, - versionsCatalogMapping = versionsCatalogMapping, + versionsCatalogLibraries = versionsCatalogLibraries, + versionsCatalogPlugins = versionsCatalogPlugins ) } - VersionsPropertiesModel.writeWithNewVersions(result.dependenciesUpdates) + VersionsPropertiesModel.writeWithNewVersions(result.dependenciesUpdatesForVersionsProperties) SettingsPluginsUpdater.updateGradleSettingsWithAvailablePluginsUpdates( rootProject = project, settingsPluginsUpdates = result.settingsPluginsUpdates, @@ -97,7 +107,10 @@ open class RefreshVersionsTask : DefaultTask() { if (shouldUpdateVersionCatalogs) { val libsToml = project.file(LIBS_VERSIONS_TOML) if (libsToml.canRead()) { - TomlUpdater(libsToml, result.dependenciesUpdates).updateNewVersions(libsToml) + TomlUpdater( + file = libsToml, + dependenciesUpdates = result.dependenciesUpdatesForVersionCatalog + ).updateNewVersions(libsToml) OutputFile.GRADLE_VERSIONS_CATALOG.logFileWasModified() } } diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/extensions/gradle/Dependency.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/extensions/gradle/Dependency.kt index c0f98a098..8103c604e 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/extensions/gradle/Dependency.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/extensions/gradle/Dependency.kt @@ -21,3 +21,7 @@ internal fun Dependency.npmModuleId(): ModuleId.Npm { val nameWithoutScope = name.substringAfter('/') return ModuleId.Npm(scope, nameWithoutScope) } + +internal fun Dependency.matches(moduleId: ModuleId): Boolean { + return moduleId.group == group && moduleId.name == name +} diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/extensions/gradle/VersionConstraint.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/extensions/gradle/VersionConstraint.kt index c31f49d9c..c5c07cf5d 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/extensions/gradle/VersionConstraint.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/extensions/gradle/VersionConstraint.kt @@ -18,3 +18,13 @@ internal fun VersionConstraint.hasDynamicVersion(): Boolean { if (requiredVersion.isVersionDynamic().not()) return false return true } + +internal fun VersionConstraint.tryExtractingSimpleVersion(): String? { + fun String.isVersionRange(): Boolean = first() in "[]()" && ',' in this || '+' in this + + return sequence { + yield(strictVersion) + yield(requiredVersion) + yield(preferredVersion) + }.firstOrNull { it.isNotEmpty() && it.isVersionRange().not() } +} diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/DependencyWithVersionCandidates.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/DependencyWithVersionCandidates.kt index db386fd26..bbe711981 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/DependencyWithVersionCandidates.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/DependencyWithVersionCandidates.kt @@ -4,9 +4,9 @@ import de.fayard.refreshVersions.core.DependencyVersionsFetcher import de.fayard.refreshVersions.core.ModuleId import de.fayard.refreshVersions.core.Version -internal data class DependencyWithVersionCandidates( +internal class DependencyWithVersionCandidates( val moduleId: ModuleId, - val currentVersion: String, - val versionsCandidates: List, + val currentVersion: String, // TODO: Ensure TomlUpdaterTest can have the data it needs, and remove this. + val versionsCandidates: (currentVersion: Version) -> List, val failures: List ) diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/GettingVersionCandidates.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/GettingVersionCandidates.kt index fbbc29699..1c9e347c7 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/GettingVersionCandidates.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/GettingVersionCandidates.kt @@ -12,8 +12,14 @@ internal suspend fun List.getVersionCandidates( currentVersion: Version, resultMode: VersionCandidatesResultMode ): Pair, List> { - val results = getVersionCandidates(versionFilter = { it > currentVersion }) + return results.sortWith(resultMode) +} + +internal fun List.sortWith( + resultMode: VersionCandidatesResultMode +): Pair, List> { + val results = this val versionsList = results.filterIsInstance() val failures = results.filterIsInstance() return when (resultMode.filterMode) { diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/InternalExtensions.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/InternalExtensions.kt deleted file mode 100644 index ad1ecd4bd..000000000 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/InternalExtensions.kt +++ /dev/null @@ -1,42 +0,0 @@ -package de.fayard.refreshVersions.core.internal - -import de.fayard.refreshVersions.core.ModuleId -import de.fayard.refreshVersions.core.extensions.gradle.moduleId -import org.gradle.api.artifacts.Dependency -import org.gradle.api.artifacts.ExternalDependency - -@InternalRefreshVersionsApi -fun Dependency.hasHardcodedVersion( - versionMap: Map, - versionKeyReader: ArtifactVersionKeyReader -): Boolean = isManageableVersion(versionMap, versionKeyReader, emptySet()).not() - -@InternalRefreshVersionsApi -fun Dependency.isManageableVersion( - versionMap: Map, - versionKeyReader: ArtifactVersionKeyReader, - versionsCatalogMapping: Set, -): Boolean { - return when { - version == versionPlaceholder -> true - this is ExternalDependency && versionPlaceholder in this.versionConstraint.rejectedVersions -> true - name.endsWith(".gradle.plugin") -> { - when (val moduleId = moduleId()) { - is ModuleId.Maven -> { - val versionFromProperty = versionMap[getVersionPropertyName(moduleId, versionKeyReader)] - ?: return false - versionFromProperty.isAVersionAlias().not() - } - else -> false - } - } - hasVersionInVersionCatalog(versionsCatalogMapping) -> true - else -> false - } -} - -private fun Dependency.hasVersionInVersionCatalog( - versionsCatalogMapping: Set -): Boolean = versionsCatalogMapping.any { - it.group == group && it.name == name && version != null -} diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/NewRefreshVersionsImpl.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/NewRefreshVersionsImpl.kt index b747d7449..97c27bfdd 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/NewRefreshVersionsImpl.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/NewRefreshVersionsImpl.kt @@ -18,6 +18,7 @@ import org.gradle.api.artifacts.ArtifactRepositoryContainer import org.gradle.api.artifacts.ConfigurationContainer import org.gradle.api.artifacts.Dependency import org.gradle.api.artifacts.ExternalDependency +import org.gradle.api.artifacts.MinimalExternalModuleDependency import org.gradle.api.artifacts.dsl.RepositoryHandler import org.gradle.api.artifacts.repositories.MavenArtifactRepository import org.gradle.api.initialization.Settings @@ -28,7 +29,8 @@ internal suspend fun lookupVersionCandidates( project: Project, versionMap: Map, versionKeyReader: ArtifactVersionKeyReader, - versionsCatalogMapping: Set + versionsCatalogLibraries: Set, + versionsCatalogPlugins: Set ): VersionCandidatesLookupResult { require(project.isRootProject) @@ -53,7 +55,8 @@ internal suspend fun lookupVersionCandidates( }, versionMap = versionMap, versionKeyReader = versionKeyReader, - versionsCatalogMapping = versionsCatalogMapping + versionsCatalogLibraries = versionsCatalogLibraries, + versionsCatalogPlugins = versionsCatalogPlugins ) } @@ -63,22 +66,37 @@ internal suspend fun lookupVersionCandidates( lookupSettingsPluginUpdates: suspend (VersionCandidatesResultMode) -> SettingsPluginsUpdatesFinder.UpdatesLookupResult, versionMap: Map, versionKeyReader: ArtifactVersionKeyReader, - versionsCatalogMapping: Set + versionsCatalogLibraries: Set, + versionsCatalogPlugins: Set ): VersionCandidatesLookupResult { val dependenciesWithHardcodedVersions = mutableListOf() val dependenciesWithDynamicVersions = mutableListOf() + val managedDependencies = mutableListOf>() + val dependencyFilter: (Dependency) -> Boolean = { dependency -> - dependency.isManageableVersion(versionMap, versionKeyReader, versionsCatalogMapping).also { manageable -> - if (manageable) return@also - if (dependency.version != null) { - // null version means it's expected to be added by a BoM or a plugin, so we ignore them. - dependenciesWithHardcodedVersions.add(dependency) + val versionManagementKind = dependency.versionManagementKind( + versionMap = versionMap, + versionKeyReader = versionKeyReader, + versionsCatalogLibraries = versionsCatalogLibraries, + versionsCatalogPlugins = versionsCatalogPlugins + ) + when (versionManagementKind) { + is VersionManagementKind.Match -> { + managedDependencies.add(dependency to versionManagementKind) + true } - if (dependency is ExternalDependency && - dependency.versionConstraint.hasDynamicVersion() - ) { - dependenciesWithDynamicVersions.add(dependency) + VersionManagementKind.NoMatch -> { + if (dependency.version != null) { + // null version means it's expected to be added by a BoM or a plugin, so we ignore them. + dependenciesWithHardcodedVersions.add(dependency) + } + if (dependency is ExternalDependency && + dependency.versionConstraint.hasDynamicVersion() + ) { + dependenciesWithDynamicVersions.add(dependency) + } + false } } } @@ -90,24 +108,36 @@ internal suspend fun lookupVersionCandidates( val dependenciesWithVersionCandidatesAsync = dependencyVersionsFetchers(dependencyFilter).groupBy { it.moduleId }.map { (moduleId: ModuleId, versionFetchers: List) -> - val propertyName = getVersionPropertyName(moduleId, versionKeyReader) - val resolvedVersion = resolveVersion( - properties = versionMap, - key = propertyName - )?.let { Version(it) } async { + val propertyName = getVersionPropertyName(moduleId, versionKeyReader) + val emptyVersion = Version("") + val resolvedVersion = resolveVersion( + properties = versionMap, + key = propertyName + )?.let { Version(it) } ?: emptyVersion + val lowestVersionInCatalog = versionsCatalogLibraries.mapNotNull { + val matches = it.module.group == moduleId.group && it.module.name == it.module.name + when { + matches -> it.versionConstraint.tryExtractingSimpleVersion()?.let { rawVersion -> + Version(rawVersion) + } + else -> null + } + }.minOrNull() + val lowestUsedVersion = minOf(resolvedVersion, lowestVersionInCatalog ?: resolvedVersion) val (versions, failures) = versionFetchers.getVersionCandidates( - currentVersion = resolvedVersion ?: Version(""), + currentVersion = lowestUsedVersion, resultMode = resultMode ) - val currentVersion = resolvedVersion ?: versions.latestMostStable() - val selection = DependencySelection(moduleId, currentVersion, propertyName) DependencyWithVersionCandidates( moduleId = moduleId, - currentVersion = currentVersion.value, - versionsCandidates = versions.filterNot { version -> - selection.candidate = version - versionRejectionFilter(selection) + currentVersion = lowestUsedVersion.value, + versionsCandidates = { currentVersion -> + val selection = DependencySelection(moduleId, currentVersion, propertyName) + versions.filter { version -> + selection.candidate = version + version > currentVersion && versionRejectionFilter(selection).not() + } }, failures = failures ) @@ -117,17 +147,14 @@ internal suspend fun lookupVersionCandidates( val settingsPluginsUpdatesAsync = async { lookupSettingsPluginUpdates(resultMode) } val gradleUpdatesAsync = async { lookupAvailableGradleVersions() } - val dependenciesWithVersionCandidates = dependenciesWithVersionCandidatesAsync.awaitAll() - - val dependenciesFromVersionsCatalog: Set = versionsCatalogMapping.mapTo( - destination = mutableSetOf() - ) { - ConfigurationLessDependency(moduleId = it, version = "_") - } + val versionsCandidatesResult = dependenciesWithVersionCandidatesAsync.awaitAll().splitForTargets( + managedDependencies = managedDependencies + ) return@coroutineScope VersionCandidatesLookupResult( - dependenciesUpdates = dependenciesWithVersionCandidates, - dependenciesWithHardcodedVersions = dependenciesWithHardcodedVersions - dependenciesFromVersionsCatalog, + dependenciesUpdatesForVersionsProperties = versionsCandidatesResult.forVersionsProperties, + dependenciesUpdatesForVersionCatalog = versionsCandidatesResult.forVersionsCatalog, + dependenciesWithHardcodedVersions = dependenciesWithHardcodedVersions, dependenciesWithDynamicVersions = dependenciesWithDynamicVersions, gradleUpdates = gradleUpdatesAsync.await(), settingsPluginsUpdates = settingsPluginsUpdatesAsync.await().settings, @@ -137,6 +164,37 @@ internal suspend fun lookupVersionCandidates( } } +private class VersionCandidatesResult( + val forVersionsProperties: List, + val forVersionsCatalog: List, +) + +private fun List.splitForTargets( + managedDependencies: MutableList> +): VersionCandidatesResult { + val forVersionsProperties = mutableListOf() + val forVersionCatalog = mutableListOf() + + forEach { dependencyWithVersionCandidates -> + managedDependencies.forEach { (dependency, versionManagementKind) -> + if (dependency.matches(dependencyWithVersionCandidates.moduleId)) { + val targetList = when (versionManagementKind) { + VersionManagementKind.Match.MatchingVersionConstraintInVersionCatalog -> { + forVersionCatalog + } + VersionManagementKind.Match.MatchingPluginVersion -> forVersionsProperties + VersionManagementKind.Match.VersionPlaceholder -> forVersionsProperties + } + targetList.add(dependencyWithVersionCandidates) + } + } + } + return VersionCandidatesResult( + forVersionsProperties = forVersionsProperties, + forVersionsCatalog = forVersionCatalog + ) +} + private suspend fun lookupAvailableGradleVersions(httpClient: OkHttpClient): List = coroutineScope { val checker = GradleUpdateChecker(httpClient) val currentGradleVersion = GradleVersion.current() diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/PluginDependencyCompat.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/PluginDependencyCompat.kt new file mode 100644 index 000000000..311758c1e --- /dev/null +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/PluginDependencyCompat.kt @@ -0,0 +1,18 @@ +package de.fayard.refreshVersions.core.internal + +import org.gradle.api.artifacts.VersionConstraint +import org.gradle.plugin.use.PluginDependency + +/** + * The [PluginDependency] class has been introduced in Gradle 7.2, but we support Gradle 6.8, + * so we have this compatibility class, so that we can reference its type safely even on older Gradle versions. + */ +internal data class PluginDependencyCompat( + val pluginId: String, + val version: VersionConstraint +) { + constructor(pluginDependency: PluginDependency) : this( + pluginId = pluginDependency.pluginId, + version = pluginDependency.version + ) +} diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlUpdater.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlUpdater.kt index d44fd4bda..510fc51d7 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlUpdater.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlUpdater.kt @@ -50,7 +50,8 @@ internal class TomlUpdater( line.versionRef == version.key } ?: return null - return dependenciesUpdates.firstOrNull { (moduleId) -> + return dependenciesUpdates.firstOrNull { + val moduleId = it.moduleId (moduleId.name == libOrPlugin.name) && (moduleId.group == libOrPlugin.group) } } @@ -60,8 +61,9 @@ internal class TomlUpdater( update: DependencyWithVersionCandidates? ): List { val result = mutableListOf(line) - val versions = update?.versionsCandidates ?: return result val version = line.version + if (update == null) return result + val versions = update.versionsCandidates(MavenVersion(version)) val isObject = line.unparsedValue.endsWith("}") diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCandidatesLookupResult.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCandidatesLookupResult.kt index bf3ad7690..56ec884cd 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCandidatesLookupResult.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCandidatesLookupResult.kt @@ -4,7 +4,8 @@ import de.fayard.refreshVersions.core.Version import org.gradle.api.artifacts.Dependency internal class VersionCandidatesLookupResult( - val dependenciesUpdates: List, + val dependenciesUpdatesForVersionsProperties: List, + val dependenciesUpdatesForVersionCatalog: List, val dependenciesWithHardcodedVersions: List, val dependenciesWithDynamicVersions: List, val gradleUpdates: List, diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt index f7a981bc5..4faa32d3b 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt @@ -16,6 +16,22 @@ object VersionCatalogs { fun isSupported(): Boolean = GradleVersion.current() >= minimumGradleVersion + internal fun libraries(versionCatalog: VersionCatalog?): Set { + if (versionCatalog == null) return emptySet() + val aliases = versionCatalog.libraryAliases + return aliases.mapTo(LinkedHashSet(aliases.size)) { alias -> + versionCatalog.findLibrary(alias).get().get() + } + } + + internal fun plugins(versionCatalog: VersionCatalog?): Set { + if (versionCatalog == null) return emptySet() + val aliases = versionCatalog.pluginAliases + return aliases.mapTo(LinkedHashSet(aliases.size)) { alias -> + PluginDependencyCompat(versionCatalog.findPlugin(alias).get().get()) + } + } + fun dependencyAliases(versionCatalog: VersionCatalog?): Map = when { FeatureFlag.VERSIONS_CATALOG.isNotEnabled -> emptyMap() versionCatalog == null -> emptyMap() diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionManagementKind.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionManagementKind.kt new file mode 100644 index 000000000..deff14afc --- /dev/null +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionManagementKind.kt @@ -0,0 +1,86 @@ +package de.fayard.refreshVersions.core.internal + +import de.fayard.refreshVersions.core.ModuleId +import de.fayard.refreshVersions.core.extensions.gradle.moduleId +import de.fayard.refreshVersions.core.internal.VersionManagementKind.* +import de.fayard.refreshVersions.core.internal.VersionManagementKind.Match.* +import org.gradle.api.artifacts.Dependency +import org.gradle.api.artifacts.ExternalDependency +import org.gradle.api.artifacts.MinimalExternalModuleDependency + +@InternalRefreshVersionsApi +fun Dependency.hasHardcodedVersion( + versionMap: Map, + versionKeyReader: ArtifactVersionKeyReader +): Boolean = versionManagementKind(versionMap, versionKeyReader, emptySet(), emptySet()) == NoMatch + +internal sealed class VersionManagementKind { + sealed class Match : VersionManagementKind() { + + /** Matching version constraint doesn't guarantee the version catalog entry is actually used. */ + object MatchingVersionConstraintInVersionCatalog : Match() + + /** Matching version constraint doesn't guarantee the version catalog entry is actually used. */ + object MatchingPluginVersion : Match() + + object VersionPlaceholder : Match() + } + object NoMatch : VersionManagementKind() +} + +internal fun Dependency.versionManagementKind( + versionMap: Map, + versionKeyReader: ArtifactVersionKeyReader, + versionsCatalogLibraries: Collection, + versionsCatalogPlugins: Set, +): VersionManagementKind = when { + version == versionPlaceholder -> VersionPlaceholder + this is ExternalDependency && versionPlaceholder in this.versionConstraint.rejectedVersions -> { + VersionPlaceholder + } + name.endsWith(".gradle.plugin") -> { + when (val moduleId = moduleId()) { + is ModuleId.Maven -> { + val versionFromProperty = resolveVersion( + properties = versionMap, + key = getVersionPropertyName(moduleId, versionKeyReader) + ) + when (versionFromProperty) { + null -> when { + hasVersionInVersionCatalog( + versionsCatalogMapping = versionsCatalogLibraries, + versionsCatalogLibraries = versionsCatalogPlugins + ) -> MatchingVersionConstraintInVersionCatalog + else -> NoMatch + } + version -> MatchingPluginVersion + else -> NoMatch + } + } + else -> NoMatch + } + } + else -> when { + hasVersionInVersionCatalog( + versionsCatalogMapping = versionsCatalogLibraries + ) -> MatchingVersionConstraintInVersionCatalog + else -> NoMatch + } +} + +private fun Dependency.hasVersionInVersionCatalog( + versionsCatalogMapping: Collection, + versionsCatalogLibraries: Set = emptySet() +): Boolean { + if (this !is ExternalDependency) return false + + val matchingLib = versionsCatalogMapping.any { + it.module.group == group && it.module.name == name && it.versionConstraint == versionConstraint + } + if (matchingLib) return true + + if (name.endsWith(".gradle.plugin").not()) return false + + val pluginId = name.substringBeforeLast(".gradle.plugin") + return versionsCatalogLibraries.any { it.pluginId == pluginId && it.version == versionConstraint } +} diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/versions/VersionsPropertiesWriting.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/versions/VersionsPropertiesWriting.kt index bd2376795..eb0de9945 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/versions/VersionsPropertiesWriting.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/versions/VersionsPropertiesWriting.kt @@ -45,7 +45,7 @@ internal fun VersionsPropertiesModel.Companion.writeWithNewVersions( when (val data = candidatesMap[section.key]) { null -> section.asUnused(isUnused = true) else -> section.copy( - availableUpdates = data.versionsCandidates.map { it.value }, + availableUpdates = data.versionsCandidates(Version(section.currentVersion)).map { it.value }, ).asUnused(isUnused = false).withFailures(data.failures) } } diff --git a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlUpdaterTest.kt b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlUpdaterTest.kt index 17ad87d56..18b0aa435 100644 --- a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlUpdaterTest.kt +++ b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlUpdaterTest.kt @@ -172,7 +172,11 @@ private fun dependencyWithVersionCandidates(folder: File): List + versions.mapNotNull { rawVersion -> + MavenVersion(rawVersion.trim()).takeIf { it > currentVersion } + } + }, failures = emptyList() //TODO: Test failures ) }.toList() From c85d1dd3c0d24bcbc8f95e404c051ae8761cfe69 Mon Sep 17 00:00:00 2001 From: Louis CAD Date: Mon, 8 Aug 2022 15:54:36 +0200 Subject: [PATCH 091/103] Add missing dash in KDoc --- .../refreshVersions/core/internal/ArtifactVersionKeyRule.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/ArtifactVersionKeyRule.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/ArtifactVersionKeyRule.kt index f5e822ce2..b0ec39941 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/ArtifactVersionKeyRule.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/ArtifactVersionKeyRule.kt @@ -1,7 +1,7 @@ package de.fayard.refreshVersions.core.internal /** - * The rules are case sensitive. + * The rules are case-sensitive. */ @InternalRefreshVersionsApi abstract class ArtifactVersionKeyRule protected constructor( From cbbc2c84c82ab0cef8623e98b99ca8e7157661f6 Mon Sep 17 00:00:00 2001 From: Louis CAD Date: Mon, 8 Aug 2022 15:57:32 +0200 Subject: [PATCH 092/103] Rename TomlUpdater to VersionsCatalogUpdater (and its test file) --- .../core/RefreshVersionsCleanupTask.kt | 10 +++++----- .../core/RefreshVersionsTask.kt | 10 +++++----- .../DependencyWithVersionCandidates.kt | 2 +- .../core/internal/OutputFile.kt | 2 +- ...mlUpdater.kt => VersionsCatalogUpdater.kt} | 10 +++++----- ...VersionCatalogs.kt => VersionsCatalogs.kt} | 2 +- .../refreshVersions/core/TomlSectionTest.kt | 4 ++-- ...rTest.kt => VersionsCatalogUpdaterTest.kt} | 20 +++++++++---------- .../RefreshVersionsCatalogTask.kt | 10 +++++----- .../RefreshVersionsMigrateTask.kt | 6 +++--- .../refreshVersions/RefreshVersionsPlugin.kt | 2 +- 11 files changed, 39 insertions(+), 39 deletions(-) rename plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/{TomlUpdater.kt => VersionsCatalogUpdater.kt} (92%) rename plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/{VersionCatalogs.kt => VersionsCatalogs.kt} (99%) rename plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/{TomlUpdaterTest.kt => VersionsCatalogUpdaterTest.kt} (92%) diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsCleanupTask.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsCleanupTask.kt index 6a6bf169a..e2f6e4a5f 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsCleanupTask.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsCleanupTask.kt @@ -3,9 +3,9 @@ package de.fayard.refreshVersions.core import de.fayard.refreshVersions.core.internal.OutputFile import de.fayard.refreshVersions.core.internal.RefreshVersionsConfigHolder import de.fayard.refreshVersions.core.internal.SettingsPluginsUpdater.removeCommentsAddedByUs -import de.fayard.refreshVersions.core.internal.TomlUpdater -import de.fayard.refreshVersions.core.internal.VersionCatalogs -import de.fayard.refreshVersions.core.internal.VersionCatalogs.LIBS_VERSIONS_TOML +import de.fayard.refreshVersions.core.internal.VersionsCatalogUpdater +import de.fayard.refreshVersions.core.internal.VersionsCatalogs +import de.fayard.refreshVersions.core.internal.VersionsCatalogs.LIBS_VERSIONS_TOML import de.fayard.refreshVersions.core.internal.versions.VersionsPropertiesModel import de.fayard.refreshVersions.core.internal.versions.VersionsPropertiesModel.Section import de.fayard.refreshVersions.core.internal.versions.readFromFile @@ -53,9 +53,9 @@ open class RefreshVersionsCleanupTask : DefaultTask() { @TaskAction fun cleanUpVersionsCatalog() { - if (VersionCatalogs.isSupported() && FeatureFlag.VERSIONS_CATALOG.isEnabled) { + if (VersionsCatalogs.isSupported() && FeatureFlag.VERSIONS_CATALOG.isEnabled) { val file = File(LIBS_VERSIONS_TOML) - TomlUpdater(file, emptyList()).cleanupComments(file) + VersionsCatalogUpdater(file, emptyList()).cleanupComments(file) OutputFile.GRADLE_VERSIONS_CATALOG.logFileWasModified() } } diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsTask.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsTask.kt index a9d8a4257..85e90c211 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsTask.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsTask.kt @@ -3,7 +3,7 @@ package de.fayard.refreshVersions.core import de.fayard.refreshVersions.core.extensions.gradle.getVersionsCatalog import de.fayard.refreshVersions.core.internal.* import de.fayard.refreshVersions.core.internal.RefreshVersionsConfigHolder.settings -import de.fayard.refreshVersions.core.internal.VersionCatalogs.LIBS_VERSIONS_TOML +import de.fayard.refreshVersions.core.internal.VersionsCatalogs.LIBS_VERSIONS_TOML import de.fayard.refreshVersions.core.internal.problems.log import de.fayard.refreshVersions.core.internal.versions.VersionsPropertiesModel import de.fayard.refreshVersions.core.internal.versions.writeWithNewVersions @@ -57,15 +57,15 @@ open class RefreshVersionsTask : DefaultTask() { //TODO: Filter using known grouping strategies to only use the main artifact to resolve latest version, this // will reduce the number of repositories lookups, improving performance a little more. - val shouldUpdateVersionCatalogs = VersionCatalogs.isSupported() && FeatureFlag.VERSIONS_CATALOG.isEnabled + val shouldUpdateVersionCatalogs = VersionsCatalogs.isSupported() && FeatureFlag.VERSIONS_CATALOG.isEnabled val versionsCatalogLibraries: Set val versionsCatalogPlugins: Set if (shouldUpdateVersionCatalogs) { val versionCatalog = project.getVersionsCatalog() - versionsCatalogLibraries = VersionCatalogs.libraries(versionCatalog) - versionsCatalogPlugins = VersionCatalogs.plugins(versionCatalog) + versionsCatalogLibraries = VersionsCatalogs.libraries(versionCatalog) + versionsCatalogPlugins = VersionsCatalogs.plugins(versionCatalog) } else { versionsCatalogLibraries = emptySet() versionsCatalogPlugins = emptySet() @@ -107,7 +107,7 @@ open class RefreshVersionsTask : DefaultTask() { if (shouldUpdateVersionCatalogs) { val libsToml = project.file(LIBS_VERSIONS_TOML) if (libsToml.canRead()) { - TomlUpdater( + VersionsCatalogUpdater( file = libsToml, dependenciesUpdates = result.dependenciesUpdatesForVersionCatalog ).updateNewVersions(libsToml) diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/DependencyWithVersionCandidates.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/DependencyWithVersionCandidates.kt index bbe711981..9f8c0843f 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/DependencyWithVersionCandidates.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/DependencyWithVersionCandidates.kt @@ -6,7 +6,7 @@ import de.fayard.refreshVersions.core.Version internal class DependencyWithVersionCandidates( val moduleId: ModuleId, - val currentVersion: String, // TODO: Ensure TomlUpdaterTest can have the data it needs, and remove this. + val currentVersion: String, // TODO: Ensure VersionsCatalogUpdater can have the data it needs, and remove this. val versionsCandidates: (currentVersion: Version) -> List, val failures: List ) diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/OutputFile.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/OutputFile.kt index 8b2eba466..5867a8da1 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/OutputFile.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/OutputFile.kt @@ -1,6 +1,6 @@ package de.fayard.refreshVersions.core.internal -import de.fayard.refreshVersions.core.internal.VersionCatalogs.LIBS_VERSIONS_TOML +import de.fayard.refreshVersions.core.internal.VersionsCatalogs.LIBS_VERSIONS_TOML import java.io.File @InternalRefreshVersionsApi diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlUpdater.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionsCatalogUpdater.kt similarity index 92% rename from plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlUpdater.kt rename to plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionsCatalogUpdater.kt index 510fc51d7..79efb2cb4 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/TomlUpdater.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionsCatalogUpdater.kt @@ -4,12 +4,12 @@ import de.fayard.refreshVersions.core.internal.TomlLine.Kind.* import java.io.File import de.fayard.refreshVersions.core.Version as MavenVersion -internal class TomlUpdater( +internal class VersionsCatalogUpdater( private val fileContent: String, private val dependenciesUpdates: List ) { - private val toml = VersionCatalogs.parseToml(fileContent) + private val toml = VersionsCatalogs.parseToml(fileContent) fun updateNewVersions(actual: File) { if (fileContent.isBlank()) return @@ -87,10 +87,10 @@ internal class TomlUpdater( } -internal fun TomlUpdater( +internal fun VersionsCatalogUpdater( file: File, dependenciesUpdates: List -): TomlUpdater { +): VersionsCatalogUpdater { val text: String = if (file.canRead()) file.readText() else "" - return TomlUpdater(text, dependenciesUpdates) + return VersionsCatalogUpdater(text, dependenciesUpdates) } diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionsCatalogs.kt similarity index 99% rename from plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt rename to plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionsCatalogs.kt index 4faa32d3b..ce5a30dd8 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionCatalogs.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionsCatalogs.kt @@ -8,7 +8,7 @@ import org.gradle.api.artifacts.VersionCatalog import org.gradle.util.GradleVersion @InternalRefreshVersionsApi -object VersionCatalogs { +object VersionsCatalogs { const val LIBS_VERSIONS_TOML = "gradle/libs.versions.toml" diff --git a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlSectionTest.kt b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlSectionTest.kt index 678e9295a..13556ac87 100644 --- a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlSectionTest.kt +++ b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlSectionTest.kt @@ -1,6 +1,6 @@ package de.fayard.refreshVersions.core -import de.fayard.refreshVersions.core.internal.VersionCatalogs +import de.fayard.refreshVersions.core.internal.VersionsCatalogs import io.kotest.matchers.shouldBe import kotlin.test.Test @@ -36,6 +36,6 @@ class TomlSectionTest { ) val expected = mapOf("root" to a, "versions" to b, "libraries" to c, "bundles" to d) - VersionCatalogs.parseTomlInSections(toml) shouldBe expected + VersionsCatalogs.parseTomlInSections(toml) shouldBe expected } } diff --git a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlUpdaterTest.kt b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/VersionsCatalogUpdaterTest.kt similarity index 92% rename from plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlUpdaterTest.kt rename to plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/VersionsCatalogUpdaterTest.kt index 18b0aa435..04ae0e1c0 100644 --- a/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/TomlUpdaterTest.kt +++ b/plugins/core/src/test/kotlin/de/fayard/refreshVersions/core/VersionsCatalogUpdaterTest.kt @@ -5,8 +5,8 @@ import de.fayard.refreshVersions.core.internal.ConfigurationLessDependency import de.fayard.refreshVersions.core.internal.DependencyWithVersionCandidates import de.fayard.refreshVersions.core.internal.TomlLine import de.fayard.refreshVersions.core.internal.TomlSection -import de.fayard.refreshVersions.core.internal.TomlUpdater -import de.fayard.refreshVersions.core.internal.VersionCatalogs +import de.fayard.refreshVersions.core.internal.VersionsCatalogUpdater +import de.fayard.refreshVersions.core.internal.VersionsCatalogs import io.kotest.assertions.asClue import io.kotest.matchers.shouldBe import org.gradle.api.artifacts.Dependency @@ -16,28 +16,28 @@ import java.io.File import kotlin.test.Test import de.fayard.refreshVersions.core.Version as MavenVersion -class TomlUpdaterTest { +class VersionsCatalogUpdaterTest { @Test - fun `Folder toml-refreshversions - update new versions`() = testTomlUpdater( + fun `Folder toml-refreshversions - update new versions`() = testVersionsCatalogUpdater( inputFolderName = "toml-refreshversions" ) { actual: File -> updateNewVersions(actual) } @Test - fun `Folder toml-cleanup - remove refreshVersions comments`() = testTomlUpdater( + fun `Folder toml-cleanup - remove refreshVersions comments`() = testVersionsCatalogUpdater( inputFolderName = "toml-cleanup" ) { actual: File -> cleanupComments(actual) } - private fun testTomlUpdater( + private fun testVersionsCatalogUpdater( inputFolderName: String, - action: TomlUpdater.(actual: File) -> Unit + action: VersionsCatalogUpdater.(actual: File) -> Unit ) { val input = FolderInput(inputFolderName) sequence { yield(input.initial to input.actual) yield(input.expected to input.expected) // check idempotence }.forEach { (initial, actual) -> - TomlUpdater( + VersionsCatalogUpdater( file = initial, dependenciesUpdates = dependencyWithVersionCandidates(input.folder) ).action(actual) @@ -52,7 +52,7 @@ class TomlUpdaterTest { fun `Folder toml-merge-properties - modify file incrementally`() { val input = FolderInput("toml-merge-properties") - val toml = VersionCatalogs.parseToml(input.initial.readText()) + val toml = VersionsCatalogs.parseToml(input.initial.readText()) toml.merge( TomlSection.Versions, listOf( TomlLine(TomlSection.Versions, "groovy", "3.0.6"), @@ -112,7 +112,7 @@ class TomlUpdaterTest { dependency to tomlPropertyName } val plugins = dependenciesAndNames.keys.filter { it.name.endsWith(".gradle.plugin") } - val newText = VersionCatalogs.generateVersionsCatalogText( + val newText = VersionsCatalogs.generateVersionsCatalogText( versionsMap = versionsMap, versionKeyReader = versionKeyReader, dependenciesAndNames = dependenciesAndNames, diff --git a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt index 6bfc14808..44cba0f58 100644 --- a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt +++ b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsCatalogTask.kt @@ -7,8 +7,8 @@ import de.fayard.refreshVersions.core.internal.Library import de.fayard.refreshVersions.core.internal.MEANING_LESS_NAMES import de.fayard.refreshVersions.core.internal.OutputFile import de.fayard.refreshVersions.core.internal.UsedPluginsTracker -import de.fayard.refreshVersions.core.internal.VersionCatalogs -import de.fayard.refreshVersions.core.internal.VersionCatalogs.LIBS_VERSIONS_TOML +import de.fayard.refreshVersions.core.internal.VersionsCatalogs +import de.fayard.refreshVersions.core.internal.VersionsCatalogs.LIBS_VERSIONS_TOML import de.fayard.refreshVersions.core.internal.checkModeAndNames import de.fayard.refreshVersions.core.internal.computeAliases import de.fayard.refreshVersions.core.internal.findDependencies @@ -33,12 +33,12 @@ open class RefreshVersionsCatalogTask : DefaultTask() { @TaskAction fun refreshVersionsCatalogAction() { - if (VersionCatalogs.isSupported().not()) { + if (VersionsCatalogs.isSupported().not()) { throw GradleException( """ |Gradle versions catalogs are not supported in ${GradleVersion.current()} |Upgrade Gradle with this command - | ./gradlew wrapper --gradle-version ${VersionCatalogs.minimumGradleVersion.version} + | ./gradlew wrapper --gradle-version ${VersionsCatalogs.minimumGradleVersion.version} """.trimMargin() ) } @@ -71,7 +71,7 @@ open class RefreshVersionsCatalogTask : DefaultTask() { val dependenciesAndNames: Map = deps.names.mapKeys { it.key.toDependency() } val currentText = if (catalog.existed) catalog.readText() else "" - val newText = VersionCatalogs.generateVersionsCatalogText( + val newText = VersionsCatalogs.generateVersionsCatalogText( dependenciesAndNames = dependenciesAndNames, currentText = currentText, withVersions = withVersions, diff --git a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsMigrateTask.kt b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsMigrateTask.kt index b82eab59e..4bba83e7f 100644 --- a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsMigrateTask.kt +++ b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsMigrateTask.kt @@ -3,7 +3,7 @@ package de.fayard.refreshVersions import de.fayard.refreshVersions.core.ModuleId import de.fayard.refreshVersions.core.addMissingEntriesInVersionsProperties import de.fayard.refreshVersions.core.extensions.gradle.getVersionsCatalog -import de.fayard.refreshVersions.core.internal.VersionCatalogs +import de.fayard.refreshVersions.core.internal.VersionsCatalogs import de.fayard.refreshVersions.core.internal.associateShortestByMavenCoordinate import de.fayard.refreshVersions.internal.getArtifactNameToConstantMapping import org.gradle.api.DefaultTask @@ -16,7 +16,7 @@ import java.io.File open class RefreshVersionsMigrateTask : DefaultTask() { @Input - @Option(option = "toml", description = "Use libraries from ${VersionCatalogs.LIBS_VERSIONS_TOML} before built-in dependency notations") + @Option(option = "toml", description = "Use libraries from ${VersionsCatalogs.LIBS_VERSIONS_TOML} before built-in dependency notations") var tomlFirst: Boolean = false @TaskAction @@ -27,7 +27,7 @@ open class RefreshVersionsMigrateTask : DefaultTask() { @TaskAction fun migrateBuild() { val versionsCatalogMapping: Map = - VersionCatalogs.dependencyAliases(project.getVersionsCatalog()) + VersionsCatalogs.dependencyAliases(project.getVersionsCatalog()) val builtInDependenciesMapping: Map = getArtifactNameToConstantMapping() .associateShortestByMavenCoordinate() diff --git a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsPlugin.kt b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsPlugin.kt index 70eb2cfc1..c2b2d9504 100644 --- a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsPlugin.kt +++ b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsPlugin.kt @@ -2,7 +2,7 @@ package de.fayard.refreshVersions import de.fayard.refreshVersions.core.* import de.fayard.refreshVersions.core.extensions.gradle.isBuildSrc -import de.fayard.refreshVersions.core.internal.VersionCatalogs.LIBS_VERSIONS_TOML +import de.fayard.refreshVersions.core.internal.VersionsCatalogs.LIBS_VERSIONS_TOML import de.fayard.refreshVersions.core.internal.removals_replacement.RemovedDependencyNotationsReplacementInfo import de.fayard.refreshVersions.core.internal.skipConfigurationCache import de.fayard.refreshVersions.internal.getArtifactNameToConstantMapping From a3ccc1ace0a1f44e09731fb775f0f4c98cba7cc5 Mon Sep 17 00:00:00 2001 From: Louis CAD Date: Tue, 9 Aug 2022 16:46:15 +0200 Subject: [PATCH 093/103] Fix catalog migration for version-less dependencies Just one line to fix it, unbelievable! --- .../de/fayard/refreshVersions/core/internal/VersionsCatalogs.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionsCatalogs.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionsCatalogs.kt index ce5a30dd8..834cc71e5 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionsCatalogs.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionsCatalogs.kt @@ -153,6 +153,7 @@ object VersionsCatalogs { dependencies: List ): Map = dependencies.mapNotNull { dependency -> val group = dependency.group ?: return@mapNotNull null + if (dependency.version == null) return@mapNotNull null val name = getVersionPropertyName(ModuleId.Maven(group, dependency.name), versionKeyReader) From 7a1ef79194e726a3e7669256bf012ea9c84e2a21 Mon Sep 17 00:00:00 2001 From: Louis CAD Date: Tue, 9 Aug 2022 16:53:26 +0200 Subject: [PATCH 094/103] Don't compute versionKey for version-less dependencies This avoids unnecessary calculations --- .../core/internal/VersionsCatalogs.kt | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionsCatalogs.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionsCatalogs.kt index 834cc71e5..038a272be 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionsCatalogs.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionsCatalogs.kt @@ -192,12 +192,18 @@ object VersionsCatalogs { } ) } else { - val versionKey = getVersionPropertyName(ModuleId.Maven(group, dependency.name), versionKeyReader) val version = when { dependency.version == null -> null withVersions.not() -> "_" - versionKey in versionsMap -> versionsMap[versionKey]!! - else -> dependency.version + else -> when ( + val versionKey = getVersionPropertyName( + moduleId = ModuleId.Maven(group, dependency.name), + versionKeyReader = versionKeyReader + ) + ) { + in versionsMap -> versionsMap[versionKey]!! + else -> dependency.version + } } TomlLine( section = TomlSection.Libraries, From a5365ad3d33d3ebc28ddb14d16783c867f2596e3 Mon Sep 17 00:00:00 2001 From: Louis CAD Date: Tue, 9 Aug 2022 17:32:21 +0200 Subject: [PATCH 095/103] Fix removal of rejectVersionIf not taken into account The problem was that the RefreshVersionsExtension was directly touching RefreshVersionsConfigHolder, whose instance is reused by Gradle across runs. Now, the rejectVersionIf predicate defaults to null, is taken each time the plugin is applied to be set on the RefreshVersionsConfigHolder, so if it's been removed, it's set back to null as it should. --- .../fayard/refreshVersions/core/RefreshVersionsCoreSetup.kt | 6 ++++-- .../core/internal/RefreshVersionsConfigHolder.kt | 4 +++- .../de/fayard/refreshVersions/RefreshVersionsExtension.kt | 6 +++--- .../de/fayard/refreshVersions/RefreshVersionsPlugin.kt | 3 ++- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsCoreSetup.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsCoreSetup.kt index b0ecd9173..00654298b 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsCoreSetup.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/RefreshVersionsCoreSetup.kt @@ -48,7 +48,8 @@ fun Settings.bootstrapRefreshVersionsCore( versionsPropertiesFile: File = rootDir.resolve("versions.properties"), getDependenciesMapping: () -> List = { emptyList() }, getRemovedDependenciesVersionsKeys: () -> Map = { emptyMap() }, - getRemovedDependencyNotationsReplacementInfo: (() -> RemovedDependencyNotationsReplacementInfo)? = null + getRemovedDependencyNotationsReplacementInfo: (() -> RemovedDependencyNotationsReplacementInfo)? = null, + versionRejectionFilter: (DependencySelection.() -> Boolean)? = null ) { null.checkGradleVersionIsSupported() require(settings.isBuildSrc.not()) { @@ -70,7 +71,8 @@ fun Settings.bootstrapRefreshVersionsCore( settings = settings, artifactVersionKeyRules = artifactVersionKeyRules, getRemovedDependenciesVersionsKeys = getRemovedDependenciesVersionsKeys, - versionsPropertiesFile = versionsPropertiesFile + versionsPropertiesFile = versionsPropertiesFile, + versionRejectionFilter = versionRejectionFilter ) val versionsPropertiesModel = RefreshVersionsConfigHolder.readVersionsPropertiesModel() getRemovedDependencyNotationsReplacementInfo?.let { diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/RefreshVersionsConfigHolder.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/RefreshVersionsConfigHolder.kt index abc8db105..71b2360e4 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/RefreshVersionsConfigHolder.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/RefreshVersionsConfigHolder.kt @@ -88,7 +88,8 @@ object RefreshVersionsConfigHolder { settings: Settings, artifactVersionKeyRules: List, getRemovedDependenciesVersionsKeys: () -> Map, - versionsPropertiesFile: File + versionsPropertiesFile: File, + versionRejectionFilter: (DependencySelection.() -> Boolean)? ) { require(settings.isBuildSrc.not()) this.settings = settings @@ -96,6 +97,7 @@ object RefreshVersionsConfigHolder { this.versionsPropertiesFile = versionsPropertiesFile.also { it.createNewFile() // Creates the file if it doesn't exist yet } + this.versionRejectionFilter = versionRejectionFilter this.artifactVersionKeyRules = artifactVersionKeyRules versionKeyReader = ArtifactVersionKeyReader.fromRules( filesContent = artifactVersionKeyRules, diff --git a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsExtension.kt b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsExtension.kt index c16549cb1..b6d3e884a 100644 --- a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsExtension.kt +++ b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsExtension.kt @@ -2,7 +2,6 @@ package de.fayard.refreshVersions import de.fayard.refreshVersions.core.DependencySelection import de.fayard.refreshVersions.core.FeatureFlag -import de.fayard.refreshVersions.core.internal.RefreshVersionsConfigHolder import groovy.lang.Closure import org.gradle.api.Action import org.gradle.api.Incubating @@ -13,6 +12,7 @@ open class RefreshVersionsExtension { var versionsPropertiesFile: File? = null var extraArtifactVersionKeyRules: List = emptyList() internal var isBuildSrcLibsEnabled = false + internal var versionRejectionFilter: (DependencySelection.() -> Boolean)? = null @Incubating fun enableBuildSrcLibs() { @@ -32,14 +32,14 @@ open class RefreshVersionsExtension { } fun rejectVersionIf(filter: Closure) { - RefreshVersionsConfigHolder.versionRejectionFilter = { + versionRejectionFilter = { filter.delegate = this filter.call() } } fun rejectVersionIf(filter: DependencySelection.() -> Boolean) { - RefreshVersionsConfigHolder.versionRejectionFilter = filter + versionRejectionFilter = filter } } diff --git a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsPlugin.kt b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsPlugin.kt index c2b2d9504..00d032982 100644 --- a/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsPlugin.kt +++ b/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsPlugin.kt @@ -134,7 +134,8 @@ open class RefreshVersionsPlugin : Plugin { ?: settings.rootDir.resolve("versions.properties"), getDependenciesMapping = ::getArtifactNameToConstantMapping, getRemovedDependenciesVersionsKeys = ::getRemovedDependenciesVersionsKeys, - getRemovedDependencyNotationsReplacementInfo = ::getRemovedDependencyNotationsReplacementInfo + getRemovedDependencyNotationsReplacementInfo = ::getRemovedDependencyNotationsReplacementInfo, + versionRejectionFilter = extension.versionRejectionFilter ) if (extension.isBuildSrcLibsEnabled) gradle.beforeProject { if (project != project.rootProject) return@beforeProject From daa2b2d9f5a5f5c90c2ac5a43fbd4d7606435a21 Mon Sep 17 00:00:00 2001 From: Louis CAD Date: Tue, 9 Aug 2022 17:33:53 +0200 Subject: [PATCH 096/103] Reset RefreshVersionsConfigHolder prior to its initialization In case someone relies on the reset behavior later (though current code doesn't), the behavior will be correct and will avoid potential memory leaks. --- .../refreshVersions/core/internal/RefreshVersionsConfigHolder.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/RefreshVersionsConfigHolder.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/RefreshVersionsConfigHolder.kt index 71b2360e4..a3d918195 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/RefreshVersionsConfigHolder.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/RefreshVersionsConfigHolder.kt @@ -92,6 +92,7 @@ object RefreshVersionsConfigHolder { versionRejectionFilter: (DependencySelection.() -> Boolean)? ) { require(settings.isBuildSrc.not()) + resettableDelegates.reset() this.settings = settings this.versionsPropertiesFile = versionsPropertiesFile.also { From f5d02d484a5f3e8d9cee659e8bda542b446cdf7f Mon Sep 17 00:00:00 2001 From: Louis CAD Date: Tue, 9 Aug 2022 19:37:22 +0200 Subject: [PATCH 097/103] Don't ignore dependencies used just in versionFor --- .../core/internal/NewRefreshVersionsImpl.kt | 22 +++++---- .../core/internal/UsedVersionForTracker.kt | 8 ++-- .../core/internal/VersionManagementKind.kt | 45 +++++++++++++------ 3 files changed, 48 insertions(+), 27 deletions(-) diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/NewRefreshVersionsImpl.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/NewRefreshVersionsImpl.kt index 97c27bfdd..b6f1e4649 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/NewRefreshVersionsImpl.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/NewRefreshVersionsImpl.kt @@ -37,6 +37,8 @@ internal suspend fun lookupVersionCandidates( val projects = RefreshVersionsConfigHolder.allProjects(project) + val dependenciesFromVersionFor = UsedVersionForTracker.read() + return lookupVersionCandidates( dependencyVersionsFetchers = { dependencyFilter -> projects.flatMap { @@ -44,7 +46,9 @@ internal suspend fun lookupVersionCandidates( }.plus( UsedPluginsTracker.read().getDependencyVersionsFetchers(httpClient) ).plus( - UsedVersionForTracker.read().getDependencyVersionsFetchers(httpClient) + dependenciesFromVersionFor.asSequence().onEach { (dependency, _) -> + check(dependencyFilter(dependency)) // Needed because dependencyFilter also tracks dependencies usage. + }.getDependencyVersionsFetchers(httpClient) ).toSet() }, lookupAvailableGradleVersions = { @@ -56,7 +60,8 @@ internal suspend fun lookupVersionCandidates( versionMap = versionMap, versionKeyReader = versionKeyReader, versionsCatalogLibraries = versionsCatalogLibraries, - versionsCatalogPlugins = versionsCatalogPlugins + versionsCatalogPlugins = versionsCatalogPlugins, + dependenciesFromVersionFor = dependenciesFromVersionFor.map { (dependency, _) -> dependency } ) } @@ -67,7 +72,8 @@ internal suspend fun lookupVersionCandidates( versionMap: Map, versionKeyReader: ArtifactVersionKeyReader, versionsCatalogLibraries: Set, - versionsCatalogPlugins: Set + versionsCatalogPlugins: Set, + dependenciesFromVersionFor: List ): VersionCandidatesLookupResult { val dependenciesWithHardcodedVersions = mutableListOf() @@ -79,7 +85,8 @@ internal suspend fun lookupVersionCandidates( versionMap = versionMap, versionKeyReader = versionKeyReader, versionsCatalogLibraries = versionsCatalogLibraries, - versionsCatalogPlugins = versionsCatalogPlugins + versionsCatalogPlugins = versionsCatalogPlugins, + dependenciesFromVersionFor = dependenciesFromVersionFor ) when (versionManagementKind) { is VersionManagementKind.Match -> { @@ -179,11 +186,8 @@ private fun List.splitForTargets( managedDependencies.forEach { (dependency, versionManagementKind) -> if (dependency.matches(dependencyWithVersionCandidates.moduleId)) { val targetList = when (versionManagementKind) { - VersionManagementKind.Match.MatchingVersionConstraintInVersionCatalog -> { - forVersionCatalog - } - VersionManagementKind.Match.MatchingPluginVersion -> forVersionsProperties - VersionManagementKind.Match.VersionPlaceholder -> forVersionsProperties + is VersionManagementKind.Match.VersionsCatalog -> forVersionCatalog + is VersionManagementKind.Match.VersionsFile -> forVersionsProperties } targetList.add(dependencyWithVersionCandidates) } diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/UsedVersionForTracker.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/UsedVersionForTracker.kt index 645fc1a46..367473eaa 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/UsedVersionForTracker.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/UsedVersionForTracker.kt @@ -33,11 +33,11 @@ internal object UsedVersionForTracker { } } - fun read(): Sequence> { - return usedInVersionsFor.asSequence().map { + fun read(): List> { + return usedInVersionsFor.map { ConfigurationLessDependency( - it.moduleId, - it.version + moduleId = it.moduleId, + version = it.version ) to it.repositories } } diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionManagementKind.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionManagementKind.kt index deff14afc..22ca962e0 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionManagementKind.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/VersionManagementKind.kt @@ -2,28 +2,43 @@ package de.fayard.refreshVersions.core.internal import de.fayard.refreshVersions.core.ModuleId import de.fayard.refreshVersions.core.extensions.gradle.moduleId -import de.fayard.refreshVersions.core.internal.VersionManagementKind.* -import de.fayard.refreshVersions.core.internal.VersionManagementKind.Match.* +import de.fayard.refreshVersions.core.internal.VersionManagementKind.Match +import de.fayard.refreshVersions.core.internal.VersionManagementKind.NoMatch import org.gradle.api.artifacts.Dependency import org.gradle.api.artifacts.ExternalDependency import org.gradle.api.artifacts.MinimalExternalModuleDependency @InternalRefreshVersionsApi -fun Dependency.hasHardcodedVersion( +fun Dependency.hasHardcodedVersion( //TODO: Remove code calling this and remove this. versionMap: Map, versionKeyReader: ArtifactVersionKeyReader -): Boolean = versionManagementKind(versionMap, versionKeyReader, emptySet(), emptySet()) == NoMatch +): Boolean = versionManagementKind( + versionMap = versionMap, + versionKeyReader = versionKeyReader, + versionsCatalogLibraries = emptySet(), + versionsCatalogPlugins = emptySet(), + dependenciesFromVersionFor = emptyList() +) == NoMatch internal sealed class VersionManagementKind { sealed class Match : VersionManagementKind() { - /** Matching version constraint doesn't guarantee the version catalog entry is actually used. */ - object MatchingVersionConstraintInVersionCatalog : Match() + sealed class VersionsCatalog : Match() { + /** Matching version constraint doesn't guarantee the version catalog entry is actually used. */ + object MatchingVersionConstraint : VersionsCatalog() + } + + /** The versions.properties file for now, possibly versions catalogs in the future. */ + sealed class VersionsFile : Match() { + + /** Matching version constraint doesn't guarantee the version catalog entry is actually used. */ + object MatchingPluginVersion : VersionsFile() - /** Matching version constraint doesn't guarantee the version catalog entry is actually used. */ - object MatchingPluginVersion : Match() + object VersionPlaceholder : VersionsFile() + + object UsedInVersionFor : VersionsFile() + } - object VersionPlaceholder : Match() } object NoMatch : VersionManagementKind() } @@ -33,10 +48,12 @@ internal fun Dependency.versionManagementKind( versionKeyReader: ArtifactVersionKeyReader, versionsCatalogLibraries: Collection, versionsCatalogPlugins: Set, + dependenciesFromVersionFor: List, ): VersionManagementKind = when { - version == versionPlaceholder -> VersionPlaceholder + this in dependenciesFromVersionFor -> Match.VersionsFile.UsedInVersionFor + version == versionPlaceholder -> Match.VersionsFile.VersionPlaceholder this is ExternalDependency && versionPlaceholder in this.versionConstraint.rejectedVersions -> { - VersionPlaceholder + Match.VersionsFile.VersionPlaceholder } name.endsWith(".gradle.plugin") -> { when (val moduleId = moduleId()) { @@ -50,10 +67,10 @@ internal fun Dependency.versionManagementKind( hasVersionInVersionCatalog( versionsCatalogMapping = versionsCatalogLibraries, versionsCatalogLibraries = versionsCatalogPlugins - ) -> MatchingVersionConstraintInVersionCatalog + ) -> Match.VersionsCatalog.MatchingVersionConstraint else -> NoMatch } - version -> MatchingPluginVersion + version -> Match.VersionsFile.MatchingPluginVersion else -> NoMatch } } @@ -63,7 +80,7 @@ internal fun Dependency.versionManagementKind( else -> when { hasVersionInVersionCatalog( versionsCatalogMapping = versionsCatalogLibraries - ) -> MatchingVersionConstraintInVersionCatalog + ) -> Match.VersionsCatalog.MatchingVersionConstraint else -> NoMatch } } From 1d518e841b6c5955720b14f7cd20140139af770a Mon Sep 17 00:00:00 2001 From: Louis CAD Date: Tue, 9 Aug 2022 19:38:26 +0200 Subject: [PATCH 098/103] Transform TODO call into TODO comment --- .../refreshVersions/core/internal/NewRefreshVersionsImpl.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/NewRefreshVersionsImpl.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/NewRefreshVersionsImpl.kt index b6f1e4649..fdde0af95 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/NewRefreshVersionsImpl.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/NewRefreshVersionsImpl.kt @@ -167,7 +167,7 @@ internal suspend fun lookupVersionCandidates( settingsPluginsUpdates = settingsPluginsUpdatesAsync.await().settings, buildSrcSettingsPluginsUpdates = settingsPluginsUpdatesAsync.await().buildSrcSettings ) - TODO("Check version candidates for the same key are the same, or warn the user with actionable details") + //TODO: Check version candidates for the same key are the same, or warn the user with actionable details. } } From 451772976d73ff9430a59f828ba5e7bba5a2a1b6 Mon Sep 17 00:00:00 2001 From: Louis CAD Date: Wed, 10 Aug 2022 01:23:35 +0200 Subject: [PATCH 099/103] =?UTF-8?q?Fill=20back=20version-to-removals-revis?= =?UTF-8?q?ion-mapping.txt=20and=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …introduce test to ensure it's never empty, and properly formatted. --- .../version-to-removals-revision-mapping.txt | 7 ++++ ...pendencyNotationsHistoryCorrectnessTest.kt | 37 +++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 plugins/dependencies/src/test/kotlin/de/fayard/refreshVersions/RemovedDependencyNotationsHistoryCorrectnessTest.kt diff --git a/plugins/dependencies/src/main/resources/version-to-removals-revision-mapping.txt b/plugins/dependencies/src/main/resources/version-to-removals-revision-mapping.txt index e69de29bb..2c059d3d0 100644 --- a/plugins/dependencies/src/main/resources/version-to-removals-revision-mapping.txt +++ b/plugins/dependencies/src/main/resources/version-to-removals-revision-mapping.txt @@ -0,0 +1,7 @@ +0.30.0->3 +0.30.1->3 +0.30.2->8 +0.30.2->8 +0.40.0->9 +0.40.1->9 +0.40.2->10 diff --git a/plugins/dependencies/src/test/kotlin/de/fayard/refreshVersions/RemovedDependencyNotationsHistoryCorrectnessTest.kt b/plugins/dependencies/src/test/kotlin/de/fayard/refreshVersions/RemovedDependencyNotationsHistoryCorrectnessTest.kt new file mode 100644 index 000000000..8a740f2ae --- /dev/null +++ b/plugins/dependencies/src/test/kotlin/de/fayard/refreshVersions/RemovedDependencyNotationsHistoryCorrectnessTest.kt @@ -0,0 +1,37 @@ +package de.fayard.refreshVersions + +import io.kotest.assertions.withClue +import io.kotest.matchers.ints.shouldBeGreaterThan +import io.kotest.matchers.shouldBe +import io.kotest.matchers.string.shouldContainOnlyOnce +import io.kotest.matchers.string.shouldHaveMinLength +import org.junit.jupiter.api.Test + +class RemovedDependencyNotationsHistoryCorrectnessTest { + + @Test + fun `Mapping of version to removals revision should have correct format`() { + val separator = "->" + val fileName = "version-to-removals-revision-mapping.txt" + val file = mainResources.resolve(fileName) + file.useLines { lines -> + val nonEmptyLines = lines.withIndex().sumBy { (index, line) -> + if (line.isEmpty()) return@sumBy 0 + withClue("Line $index of $file") { + line shouldContainOnlyOnce separator + val version = line.substringBefore(separator) + val revision = line.substringAfter(separator).toInt() + revision shouldBeGreaterThan 0 + version shouldHaveMinLength 1 + withClue("Unexpected character in the version") { + version.all { it.isLetterOrDigit() || it in ".-" } shouldBe true + } + } + 1 + } + withClue("File must not be empty $file") { + nonEmptyLines shouldBeGreaterThan 0 + } + } + } +} From cb1988bab23a1aca2b01dfb1a1b2ddcce2d0615d Mon Sep 17 00:00:00 2001 From: Louis CAD Date: Wed, 10 Aug 2022 01:24:12 +0200 Subject: [PATCH 100/103] Gradle 7.5.1 --- .../gradle/wrapper/gradle-wrapper.jar | Bin 59536 -> 60756 bytes .../gradle/wrapper/gradle-wrapper.properties | 2 +- dummy-library-for-testing/gradlew | 6 + dummy-library-for-testing/gradlew.bat | 14 +- plugins/gradle/wrapper/gradle-wrapper.jar | Bin 59821 -> 60756 bytes .../gradle/wrapper/gradle-wrapper.properties | 2 +- plugins/gradlew | 6 + plugins/gradlew.bat | 14 +- .../gradle/wrapper/gradle-wrapper.jar | Bin 59821 -> 60756 bytes .../gradle/wrapper/gradle-wrapper.properties | 2 +- sample-android/gradlew | 6 + sample-android/gradlew.bat | 14 +- .../gradle/wrapper/gradle-wrapper.jar | Bin 59821 -> 60756 bytes .../gradle/wrapper/gradle-wrapper.properties | 2 +- sample-groovy/gradlew | 6 + sample-groovy/gradlew.bat | 14 +- .../gradle/wrapper/gradle-wrapper.jar | Bin 59203 -> 60756 bytes .../gradle/wrapper/gradle-wrapper.properties | 2 +- sample-kotlin/gradlew | 263 +++++++++++------- sample-kotlin/gradlew.bat | 14 +- 20 files changed, 228 insertions(+), 139 deletions(-) diff --git a/dummy-library-for-testing/gradle/wrapper/gradle-wrapper.jar b/dummy-library-for-testing/gradle/wrapper/gradle-wrapper.jar index 7454180f2ae8848c63b8b4dea2cb829da983f2fa..249e5832f090a2944b7473328c07c9755baa3196 100644 GIT binary patch delta 10158 zcmaKSbyOWsmn~e}-QC?axCPf>!2<-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kTHb3y@e@%{WrvE&Jp#Lw^ zcj13CbsW+V>i@rj@SEfFf0@yjS@nbPB0)6D`lA;e%61nh`-qhydO!uS7jXGQd%i7opEnOL;| zDn!3EUm(V796;f?fA+RDF<@%qKlo)`0VtL74`!~516_aogYP%QfG#<2kQ!pijthz2 zpaFX3|D$%C7!bL242U?-e@2QZ`q$~lgZbvgfLLyVfT1OC5<8@6lLi=A{stK#zJmWd zlx+(HbgX)l$RGwH|2rV@P3o@xCrxch0$*z1ASpy(n+d4d2XWd~2AYjQm`xZU3af8F p+x$Nxf1895@0bJirXkdpJh+N7@Nb7x007(DEB&^Lm}dWn{T~m64-^0Z diff --git a/dummy-library-for-testing/gradle/wrapper/gradle-wrapper.properties b/dummy-library-for-testing/gradle/wrapper/gradle-wrapper.properties index 2e6e5897b..ae04661ee 100644 --- a/dummy-library-for-testing/gradle/wrapper/gradle-wrapper.properties +++ b/dummy-library-for-testing/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/dummy-library-for-testing/gradlew b/dummy-library-for-testing/gradlew index 1b6c78733..a69d9cb6c 100755 --- a/dummy-library-for-testing/gradlew +++ b/dummy-library-for-testing/gradlew @@ -205,6 +205,12 @@ set -- \ org.gradle.wrapper.GradleWrapperMain \ "$@" +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + # Use "xargs" to parse quoted args. # # With -n1 it outputs one arg per line, with the quotes and backslashes removed. diff --git a/dummy-library-for-testing/gradlew.bat b/dummy-library-for-testing/gradlew.bat index 107acd32c..f127cfd49 100644 --- a/dummy-library-for-testing/gradlew.bat +++ b/dummy-library-for-testing/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,7 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -75,13 +75,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/plugins/gradle/wrapper/gradle-wrapper.jar b/plugins/gradle/wrapper/gradle-wrapper.jar index 41d9927a4d4fb3f96a785543079b8df6723c946b..249e5832f090a2944b7473328c07c9755baa3196 100644 GIT binary patch delta 10197 zcmaKS1ymhDwk=#NxVyW%y9U<)A-Dv)xI0|j{UX8L-JRg>5ZnnKAh;%chM6~S-g^K4 z>eZ{yK4;gd>gwvXs=Id8Jk-J}R4pT911;+{Jp9@aiz6!p1Oz9z&_kGLA%J5%3Ih@0 zQ|U}%$)3u|G`jIfPzMVfcWs?jV2BO^*3+q2><~>3j+Z`^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.properties b/plugins/gradle/wrapper/gradle-wrapper.properties index aa991fcea..ae04661ee 100644 --- a/plugins/gradle/wrapper/gradle-wrapper.properties +++ b/plugins/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/plugins/gradlew b/plugins/gradlew index 1b6c78733..a69d9cb6c 100755 --- a/plugins/gradlew +++ b/plugins/gradlew @@ -205,6 +205,12 @@ set -- \ org.gradle.wrapper.GradleWrapperMain \ "$@" +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + # Use "xargs" to parse quoted args. # # With -n1 it outputs one arg per line, with the quotes and backslashes removed. diff --git a/plugins/gradlew.bat b/plugins/gradlew.bat index 107acd32c..f127cfd49 100644 --- a/plugins/gradlew.bat +++ b/plugins/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,7 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -75,13 +75,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/sample-android/gradle/wrapper/gradle-wrapper.jar b/sample-android/gradle/wrapper/gradle-wrapper.jar index 41d9927a4d4fb3f96a785543079b8df6723c946b..249e5832f090a2944b7473328c07c9755baa3196 100644 GIT binary patch delta 10197 zcmaKS1ymhDwk=#NxVyW%y9U<)A-Dv)xI0|j{UX8L-JRg>5ZnnKAh;%chM6~S-g^K4 z>eZ{yK4;gd>gwvXs=Id8Jk-J}R4pT911;+{Jp9@aiz6!p1Oz9z&_kGLA%J5%3Ih@0 zQ|U}%$)3u|G`jIfPzMVfcWs?jV2BO^*3+q2><~>3j+Z`^Z%=;19VWg0XndJ zwJ~;f4$;t6pBKaWn}UNO-wLCFHBd^1)^v%$P)fJk1PbK5<;Z1K&>k~MUod6d%@Bq9 z>(44uiaK&sdhwTTxFJvC$JDnl;f}*Q-^01T508(8{+!WyquuyB7R!d!J)8Ni0p!cV6$CHsLLy6}7C zYv_$eD;)@L)tLj0GkGpBoa727hs%wH$>EhfuFy{_8Q8@1HI%ZAjlpX$ob{=%g6`Ox zLzM!d^zy`VV1dT9U9(^}YvlTO9Bf8v^wMK37`4wFNFzW?HWDY(U(k6@tp(crHD)X5>8S-# zW1qgdaZa*Sh6i%60e1+hty}34dD%vKgb?QmQiZ=-j+isA4={V_*R$oGN#j|#ia@n6 zuZx4e2Xx?^lUwYFn2&Tmbx0qA3Z8;y+zKoeQu;~k~FZGy!FU_TFxYd!Ck;5QvMx9gj5fI2@BLNp~Ps@ zf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(r`7vU&@93=G~A?b(^pvC-8x=bSk zZ60BQR96WB1Z@9Df(M1IQh+YrU8sEjB=Tc2;(zBn-pete*icZE|M&Uc+oHg`|1o`g zH~m+k=D$o);{Rs)b<9Zo|9_Z6L6QHLNki(N>Dw^^i1LITprZeeqIaT#+)fw)PlllU zldphHC)t!0Gf(i9zgVm>`*TbmITF zH1FZ4{wrjRCx{t^26VK_2srZuWuY*EMAsMrJYFFCH35Ky7bq8<0K|ey2wHnrFMZyr z&^yEgX{{3i@&iE5>xKZ{Ads36G3a!i50D!C4?^~cLB<<|fc1!XN(HJRM)H^21sEs%vv+Mu0h*HkLHaEffMwc0n6)JhNXY#M5w@iO@dfXY z0c6dM2a4Hd1SA*#qYj@jK}uVgAZdaBj8t6uuhUNe>)ne9vfd#C6qLV9+@Q7{MnF#0 zJ7fd-ivG_~u3bVvOzpcw1u~ZSp8-kl(sunnX>L~*K-ByWDM2E8>;Si6kn^58AZQxI xVa^It*?521mj4+UJO?7%w*+`EfEcU=@KhDx-s^WzP+ae~{CgHDE&XryzW}Nww%-5% diff --git a/sample-android/gradle/wrapper/gradle-wrapper.properties b/sample-android/gradle/wrapper/gradle-wrapper.properties index aa991fcea..ae04661ee 100644 --- a/sample-android/gradle/wrapper/gradle-wrapper.properties +++ b/sample-android/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/sample-android/gradlew b/sample-android/gradlew index 1b6c78733..a69d9cb6c 100755 --- a/sample-android/gradlew +++ b/sample-android/gradlew @@ -205,6 +205,12 @@ set -- \ org.gradle.wrapper.GradleWrapperMain \ "$@" +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + # Use "xargs" to parse quoted args. # # With -n1 it outputs one arg per line, with the quotes and backslashes removed. diff --git a/sample-android/gradlew.bat b/sample-android/gradlew.bat index 107acd32c..f127cfd49 100644 --- a/sample-android/gradlew.bat +++ b/sample-android/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,7 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -75,13 +75,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/sample-groovy/gradle/wrapper/gradle-wrapper.jar b/sample-groovy/gradle/wrapper/gradle-wrapper.jar index 41d9927a4d4fb3f96a785543079b8df6723c946b..249e5832f090a2944b7473328c07c9755baa3196 100644 GIT binary patch delta 10197 zcmaKS1ymhDwk=#NxVyW%y9U<)A-Dv)xI0|j{U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G_~u3bVvOzpcw1u~ZSp8-kl(sunnX>L~*K-ByWDM2E8>;Si6kn^58AZQxI xVa^It*?521mj4+UJO?7%w*+`EfEcU=@KhDx-s^WzP+ae~{CgHDE&XryzW}Nww%-5% diff --git a/sample-groovy/gradle/wrapper/gradle-wrapper.properties b/sample-groovy/gradle/wrapper/gradle-wrapper.properties index aa991fcea..ae04661ee 100644 --- a/sample-groovy/gradle/wrapper/gradle-wrapper.properties +++ b/sample-groovy/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/sample-groovy/gradlew b/sample-groovy/gradlew index 1b6c78733..a69d9cb6c 100755 --- a/sample-groovy/gradlew +++ b/sample-groovy/gradlew @@ -205,6 +205,12 @@ set -- \ org.gradle.wrapper.GradleWrapperMain \ "$@" +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + # Use "xargs" to parse quoted args. # # With -n1 it outputs one arg per line, with the quotes and backslashes removed. diff --git a/sample-groovy/gradlew.bat b/sample-groovy/gradlew.bat index 107acd32c..f127cfd49 100644 --- a/sample-groovy/gradlew.bat +++ b/sample-groovy/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,7 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -75,13 +75,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/sample-kotlin/gradle/wrapper/gradle-wrapper.jar b/sample-kotlin/gradle/wrapper/gradle-wrapper.jar index e708b1c023ec8b20f512888fe07c5bd3ff77bb8f..249e5832f090a2944b7473328c07c9755baa3196 100644 GIT binary patch delta 21931 zcmaI6V~n8R6E)b==Cp0wc2C>3ZQD=Vwry+L)3)8ywrx-EZ{KV-`6rwGaFa@IRdPR6 z)u~hG4$gort%Eht{y(MI%kt z0Y0nYm>z`rdM7Lh=##-Ps^6h>FU7m~cgyxqs;Nqi&~ytk^e7KkJL>mWt4%qL*DKv= zcgsip(fRo@w)aGHJ&cRiJs;2cc4v+b>Y#M1j_&4}9i`o^*Uzg;mkN44%!|HxGTNmY za%+!%)BkmU@yFRSA8-3+6za3Rpa>0d>aP z|6x$gEo6tjC%O4IHwK@zhTuzcDM38z%iFcrUhI%h?s07}F{H1l!3u%>r`EgBk|m$r z87XPla{FK=fulv&qhyZ!oAD=l1}cy0X;ZOYTNqV6ux_FyBqy_7sRMe%ATeaSNf3#n zOHbG+%dn12N=ywJWtQcx6Vgpi+L_Aqs+4YL0kAFnwH`6{_7&pk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j0jALg{bye9M-dL*Fkww%5BRMLNfw1XqvS*nvQa@~kIGYPdWuH! zKL`r)AjOw|3fyoioKcN#aqr`OUSJxQ*u1=~fH^o3FdHtFIS;hMi!V`^7_2;4C5siKj4rKx+(MrSy?^zaADG@E+v>8vVHd z%Dg;Oh!!AraDyrw_%Y4~(1oxuf!@>uADzTNEoUPe!T@Z~vmvM@v<^Wa!(cR^`7Z^Y z@zDW{RB&}c5pl2_&MyideT3zo;y4nBgT+05hvL{l$QW8GNM)IqG@v<1Y7duE1pr;J zhv`djXrTnvM9G2!lS^!f1KWXqH3s&}UFsije|L}|unzi~D^g7Y%lwG_Y*S0Hh)*mB z1cE%^cUFlC1%S}+X(7@Fpni2K^kx}_`0w>RNC+H&a<%?xi5@_bWuZ}4RF$QHY5&I{ zsBte11hNk1ohTph6SoB;Ed#{C;OiHGkA~S(LotaJS!k>)*r+^^w1R?WdIHn$Wq?sK z8?e0sho<^~DguyQWdqKQvmpMPWne=>zZwGvY9$zuf{6f2qbR6R2#^Pp1T@A_(2Nkk zcT5%98UoyB;RU3b;J_GYH3q6HHKv4qlR5%JGO{1Wjg;do~nGG}N0Q_?v&=Dda;i \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` +APP_BASE_NAME=${0##*/} # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" +MAX_FD=maximum warn () { echo "$*" -} +} >&2 die () { echo echo "$*" echo exit 1 -} +} >&2 # OS specific support (must be 'true' or 'false'). cygwin=false msys=false darwin=false nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -87,9 +121,9 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" + JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD="$JAVA_HOME/bin/java" + JAVACMD=$JAVA_HOME/bin/java fi if [ ! -x "$JAVACMD" ] ; then die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME @@ -98,7 +132,7 @@ Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi else - JAVACMD="java" + JAVACMD=java which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the @@ -106,80 +140,101 @@ location of your Java installation." fi # Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac fi -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. # For Cygwin or MSYS, switch paths to Windows format before running java -if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) fi - i=`expr $i + 1` + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg done - case $i in - 0) set -- ;; - 1) set -- "$args0" ;; - 2) set -- "$args0" "$args1" ;; - 3) set -- "$args0" "$args1" "$args2" ;; - 4) set -- "$args0" "$args1" "$args2" "$args3" ;; - 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac fi -# Escape application args -save () { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -APP_ARGS=`save "$@"` +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' exec "$JAVACMD" "$@" diff --git a/sample-kotlin/gradlew.bat b/sample-kotlin/gradlew.bat index 107acd32c..f127cfd49 100644 --- a/sample-kotlin/gradlew.bat +++ b/sample-kotlin/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,7 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -75,13 +75,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal From be49222c4b8c7e7c8e6d2394b9a15aab033bcd0f Mon Sep 17 00:00:00 2001 From: Louis CAD Date: Wed, 10 Aug 2022 01:30:23 +0200 Subject: [PATCH 101/103] Don't walk the Gradle files if removals history is empty This optimization will make upgrading refreshVersions slightly faster when there's no potential dependency notations that have been removed since last run. --- .../ReplacementOfRemovedDependencyNotations.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/removals_replacement/ReplacementOfRemovedDependencyNotations.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/removals_replacement/ReplacementOfRemovedDependencyNotations.kt index fcd53e4c7..7f870b9e5 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/removals_replacement/ReplacementOfRemovedDependencyNotations.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/removals_replacement/ReplacementOfRemovedDependencyNotations.kt @@ -28,6 +28,8 @@ internal fun replaceRemovedDependencyNotationReferencesIfNeeded( currentRevision = revisionOfLastRefreshVersionsRun ) + if (history.isEmpty()) return + val shortestDependencyMapping: Map by lazy { dependencyMapping.associateShortestByMavenCoordinate() } From 1d67eb7b13dac2ebe14dc93f3cfd57b954444944 Mon Sep 17 00:00:00 2001 From: Louis CAD Date: Wed, 10 Aug 2022 01:34:39 +0200 Subject: [PATCH 102/103] Use built-in dependency notations for JUnit --- plugins/buildSrcLibs/build.gradle.kts | 4 ++-- plugins/core/build.gradle.kts | 4 ++-- plugins/dependencies/build.gradle.kts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/buildSrcLibs/build.gradle.kts b/plugins/buildSrcLibs/build.gradle.kts index 7ebe2c8af..85cb2cde1 100644 --- a/plugins/buildSrcLibs/build.gradle.kts +++ b/plugins/buildSrcLibs/build.gradle.kts @@ -50,8 +50,8 @@ dependencies { testImplementation(Testing.kotest.runner.junit5) - testImplementation(platform(notation = "org.junit:junit-bom:_")) - testImplementation("org.junit.jupiter:junit-jupiter") + testImplementation(platform(notation = Testing.junit.bom)) + testImplementation(Testing.junit.jupiter) testRuntimeOnly("org.junit.platform:junit-platform-launcher") { because("allows tests to run from IDEs that bundle older version of launcher") } diff --git a/plugins/core/build.gradle.kts b/plugins/core/build.gradle.kts index f6ac3f68a..04ed134ce 100644 --- a/plugins/core/build.gradle.kts +++ b/plugins/core/build.gradle.kts @@ -51,8 +51,8 @@ dependencies { implementation(Square.moshi.kotlinReflect) testImplementation(Square.okHttp3.loggingInterceptor) - testImplementation(platform(notation = "org.junit:junit-bom:_")) - testImplementation("org.junit.jupiter:junit-jupiter") + testImplementation(platform(notation = Testing.junit.bom)) + testImplementation(Testing.junit.jupiter) testImplementation(Testing.kotest.runner.junit5) testImplementation(Kotlin.test.annotationsCommon) testImplementation(Kotlin.test.junit5) diff --git a/plugins/dependencies/build.gradle.kts b/plugins/dependencies/build.gradle.kts index 0a8c03365..1d558376e 100644 --- a/plugins/dependencies/build.gradle.kts +++ b/plugins/dependencies/build.gradle.kts @@ -43,8 +43,8 @@ publishing { dependencies { testImplementation(Testing.kotest.runner.junit5) - testImplementation(platform(notation = "org.junit:junit-bom:_")) - testImplementation("org.junit.jupiter:junit-jupiter") + testImplementation(platform(notation = Testing.junit.bom)) + testImplementation(Testing.junit.jupiter) testRuntimeOnly("org.junit.platform:junit-platform-launcher") { because("allows tests to run from IDEs that bundle older version of launcher") } From 2e31ae9ab47ef5786f03758dee5da89c74602d48 Mon Sep 17 00:00:00 2001 From: Louis CAD Date: Wed, 10 Aug 2022 04:58:17 +0200 Subject: [PATCH 103/103] Add required opt-in for ExperimentalTime in tests --- .../src/test/kotlin/de/fayard/refreshVersions/MigrationTest.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/dependencies/src/test/kotlin/de/fayard/refreshVersions/MigrationTest.kt b/plugins/dependencies/src/test/kotlin/de/fayard/refreshVersions/MigrationTest.kt index f042e1cef..a6cb3d79a 100644 --- a/plugins/dependencies/src/test/kotlin/de/fayard/refreshVersions/MigrationTest.kt +++ b/plugins/dependencies/src/test/kotlin/de/fayard/refreshVersions/MigrationTest.kt @@ -8,7 +8,9 @@ import io.kotest.inspectors.forAll import io.kotest.matchers.ints.shouldBeExactly import io.kotest.matchers.shouldBe import java.io.File +import kotlin.time.ExperimentalTime +@OptIn(ExperimentalTime::class) class MigrationTest : StringSpec({ val testResources: File = File(".").absoluteFile.resolve("src/test/resources")