diff --git a/CHANGELOG.md b/CHANGELOG.md index 39d3a5925..7ff08dac8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,31 @@ # Unreleased +# 0.7.0 + +The plugin will in the future focus on `:refreshVersions`. + +For now it is published under two names, with an identical content: + +``` +plugins { + id("de.fayard.refreshVersions").version("0.7.0") + // or + id("de.fayard.buildSrcVersions).version("0.7.0") +} +``` + +Next step: integration with https://github.com/LouisCAD/Splitties + +See https://github.com/jmfayard/buildSrcVersions/issues/104 + +Changes: + +- New configuration: orderBy = GROUP_AND_LENGTH or GROUP_AND_ALPHABETICAL #65 +- PluginConfig.virtualGroups for kotlinx-coroutines #102 + + + + # 0.6.5 - useFqdnFor() should also work for groups #99 diff --git a/README.adoc b/README.adoc index 28f2bf4e0..03582b2e6 100644 --- a/README.adoc +++ b/README.adoc @@ -1,11 +1,12 @@ -// plugin.de.fayard.buildSrcVersions -:plugin_version: 0.6.5 +// plugin.de.fayard.buildSrcVersions (aka buildSrcVersions) +:plugin_version: 0.7.0 :gradle_version: 5.6.2 +:imagesdir: doc :repo: jmfayard/buildSrcVersions :branch: 26-buildSrcVersions :github: https://github.com/{repo} :plugin_issues: https://github.com/gradle/kotlin-dsl/issues?utf8=%E2%9C%93&q=author%3Ajmfayard+ -:plugin_gradle_portal: https://plugins.gradle.org/plugin/de.fayard.buildSrcVersions +:plugin_gradle_portal: https://plugins.gradle.org/plugin/de.fayard.refreshVersions :contributors_badge: image:https://www.codetriage.com/jmfayard/buildsrcversions/badges/users.svg["Code Triage",link="https://www.codetriage.com/jmfayard/buildsrcversions"] :gradle_kotlin_dsl: https://github.com/gradle/kotlin-dsl :slack_url: https://app.slack.com/client/T09229ZC6/CP5659EL9 @@ -17,12 +18,11 @@ :medium_protips: https://proandroiddev.com/android-studio-pro-tips-for-working-with-gradle-8a7aa61a8cc4 :medium_mvp: https://dev.to/jmfayard/the-minimum-viable-pull-request-5e7p :devto_readme: https://dev.to/jmfayard/how-to-write-a-good-readme-discuss-4hkl -:root: file:///Users/jmfayard/Dev/mautinoa/buildSrcVersions :issues: https://github.com/jmfayard/buildSrcVersions/issues :master: https://github.com/jmfayard/buildSrcVersions/blob/master :badge_mit: image:https://img.shields.io/github/license/mashape/apistatus.svg["GitHub",link="{github}/blob/master/LICENSE.txt"] -:image_version: https://img.shields.io/maven-metadata/v/https/plugins.gradle.org/m2/de.fayard/buildSrcVersions/de.fayard.buildSrcVersions.gradle.plugin/maven-metadata.xml.svg -:badge_version: image:{image_version}?label=gradlePluginPortal["Maven Central",link="https://plugins.gradle.org/plugin/de.fayard.buildSrcVersions"] +:image_version: https://img.shields.io/maven-metadata/v/https/plugins.gradle.org/m2/de.fayard/refreshVersions/de.fayard.refreshVersions.gradle.plugin/maven-metadata.xml.svg +:badge_version: image:{image_version}?label=gradlePluginPortal["Maven Central",link="https://plugins.gradle.org/plugin/de.fayard.refreshVersions"] :badge_issues: image:https://img.shields.io/github/issues/{repo}.svg["GitHub issues",link="{github}/issues"] :badge_pr: image:https://img.shields.io/github/issues-pr/{repo}.svg["GitHub pull requests",link="{github}/pulls?utf8=%E2%9C%93&q=is%3Apr+"] :badge_build: image:https://img.shields.io/travis/com/{repo}/{branch}.svg["Travis (.org)",link="https://travis-ci.com/{repo}"] @@ -31,19 +31,20 @@ :benmanes: https://github.com/ben-manes/gradle-versions-plugin :image_faq: https://user-images.githubusercontent.com/459464/64926128-1a076980-d7fa-11e9-8a69-eb354d211f51.png -//:imagesdir: /Users/jmfayard/Dev/mautinoa/buildSrcVersions/doc -:imagesdir: doc - -= de.fayard.buildSrcVersions += de.fayard.refreshVersions {badge_version} {slack_badge} {contributors_badge} {badge_build} {badge_mit} {badge_issues} {badge_pr} -The Gradle plugin `de.fayard.buildSrcVersions` goal is to make it as painless as possible to upgrade your project to the latest and greatest version of everything. +The Gradle plugin `de.fayard.refreshVersions` goal is to make it as painless as possible to upgrade your project to the latest and greatest version of everything. It does that by extracting all your dependencies, searching for available dependencies updates and generating Kotlin code, Groovy code or Gradle properties. +The plugin was called before `de.fayard.buildSrcVersions`, which still exists and is currently identical. + +[The goal in the future is to focus on :refreshVersions](https://github.com/jmfayard/buildSrcVersions/issues/104) + == Installation Edit your root `build.gradle(.kts)` file @@ -56,7 +57,7 @@ buildscript { //... } plugins { - id("de.fayard.buildSrcVersions") version "{plugin_version}" + id("de.fayard.refreshVersions") version "{plugin_version}" } // Don't put any code before the buildscripts {} and plugins {} block ---- @@ -82,11 +83,11 @@ buildscript { } } dependencies { - classpath "de.fayard.buildSrcVersions:de.fayard.buildSrcVersions.gradle.plugin:{plugin_version}" + classpath "de.fayard.refrshVersions:de.fayard.refrshVersions.gradle.plugin:{plugin_version}" } } -apply plugin: "de.fayard.buildSrcVersions" +apply plugin: "de.fayard.refrshVersions" ---- ++++ @@ -146,6 +147,7 @@ buildSrcVersions { rejectVersionIf { isNonStable(candidate.version) } + orderBy = OrderBy.GROUP_AND_LENGTH indent = "from-editorconfig-file" renameLibs = "Libs" renameVersions = "Versions" diff --git a/RELEASE.md b/RELEASE.md index 9207ed3ed..1d1192621 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -7,7 +7,7 @@ - Create a GitHub release https://github.com/jmfayard/buildSrcVersions/releases/new - Try the plugin in sample projects - Update `:plugin_version:` in `README.adoc` -- Search for `plugin.de.fayard.buildSrcVersions` everywhere to update the version +- Search for `plugin.de.fayard.refreshVersions` everywhere to update the version - Otherwise update the README - Update Plugin Configuration https://github.com/jmfayard/buildSrcVersions/issues/53 diff --git a/plugin/build.gradle.kts b/plugin/build.gradle.kts index 024b40aa6..6cab9647a 100644 --- a/plugin/build.gradle.kts +++ b/plugin/build.gradle.kts @@ -11,7 +11,7 @@ plugins { } -version = "0.7.0" // plugin.de.fayard.buildSrcVersions +version = "0.7.1" // plugin.de.fayard.refreshversions group = "de.fayard" @@ -19,7 +19,13 @@ gradlePlugin { plugins { create("buildSrcVersions") { id = "de.fayard.buildSrcVersions" - displayName = "buildSrcVersions" + displayName = "./gradlew buildSrcVersions" + description = "Painless dependencies management" + implementationClass = "de.fayard.BuildSrcVersionsPlugin" + } + create("refreshVersions") { + id = "de.fayard.refreshVersions" + displayName = "./gradlew refreshVersions" description = "Painless dependencies management" implementationClass = "de.fayard.BuildSrcVersionsPlugin" } diff --git a/plugin/gradle.properties b/plugin/gradle.properties index 23bda43e9..79136c599 100644 --- a/plugin/gradle.properties +++ b/plugin/gradle.properties @@ -3,7 +3,7 @@ # See https://github.com/jmfayard/buildSrcVersions/issues/77 plugin.org.gradle.kotlin.kotlin.dsl=1.2.9 # available=1.3.1 -plugin.de.fayard.buildsrcversions=0.6.4 +plugin.de.fayard.refreshVersions=0.7.0 plugin.com.gradle.plugin-publish=0.10.0 # available=0.10.1 plugin.com.gradle.build-scan=2.4.1 diff --git a/plugin/src/main/kotlin/de/fayard/BuildSrcVersionsExtension.kt b/plugin/src/main/kotlin/de/fayard/BuildSrcVersionsExtension.kt index 9a56b134f..e5a597c0f 100644 --- a/plugin/src/main/kotlin/de/fayard/BuildSrcVersionsExtension.kt +++ b/plugin/src/main/kotlin/de/fayard/BuildSrcVersionsExtension.kt @@ -76,5 +76,13 @@ interface BuildSrcVersionsExtension { */ var versionsOnlyFile: String? + /** + * orderBy = OrderBy.GROUP_AND_ALPHABETICAL to override the default behavior + * https://github.com/jmfayard/buildSrcVersions/issues/65 **/ + var orderBy: OrderBy + +} +enum class OrderBy { + GROUP_AND_LENGTH, GROUP_AND_ALPHABETICAL } diff --git a/plugin/src/main/kotlin/de/fayard/BuildSrcVersionsPlugin.kt b/plugin/src/main/kotlin/de/fayard/BuildSrcVersionsPlugin.kt index 15077c03c..97ca6d062 100644 --- a/plugin/src/main/kotlin/de/fayard/BuildSrcVersionsPlugin.kt +++ b/plugin/src/main/kotlin/de/fayard/BuildSrcVersionsPlugin.kt @@ -16,7 +16,7 @@ import org.gradle.kotlin.dsl.extra open class BuildSrcVersionsPlugin : Plugin { override fun apply(project: Project) { - check(project == project.rootProject) { "ERROR: plugins de.fayard.buildSrcVersions must be applied to the root build.gradle(.kts)" } + check(project == project.rootProject) { "ERROR: plugins de.fayard.refreshVersions must be applied to the root build.gradle(.kts)" } project.apply(plugin = PluginConfig.GRADLE_VERSIONS_PLUGIN_ID) project.configure() project.useVersionsFromGradleProperties() diff --git a/plugin/src/main/kotlin/de/fayard/BuildSrcVersionsTask.kt b/plugin/src/main/kotlin/de/fayard/BuildSrcVersionsTask.kt index 6430bbf75..9007ee587 100644 --- a/plugin/src/main/kotlin/de/fayard/BuildSrcVersionsTask.kt +++ b/plugin/src/main/kotlin/de/fayard/BuildSrcVersionsTask.kt @@ -68,7 +68,7 @@ open class BuildSrcVersionsTask : DefaultTask() { KOTLIN_OBJECT -> false else -> return } - val versions = unsortedParsedDependencies.sortedBeautifullyBy { it.versionName } + val versions = unsortedParsedDependencies.sortedBeautifullyBy(extension.orderBy) { it.versionName } val kotlinPoetry: KotlinPoetry = kotlinpoet(versions, dependencyGraph.gradle, extension, computeIndent()) @@ -109,7 +109,7 @@ open class BuildSrcVersionsTask : DefaultTask() { } val dependencies = (unsortedParsedDependencies + specialDependencies) - .sortedBeautifullyBy { it.versionProperty } + .sortedBeautifullyBy(extension.orderBy) { it.versionProperty } .distinctBy { it.versionProperty } if (versionsOnlyMode == GRADLE_PROPERTIES) { @@ -155,7 +155,7 @@ open class BuildSrcVersionsTask : DefaultTask() { val projectExtension = project.extensions.getByType() as BuildSrcVersionsExtensionImpl this._extension = projectExtension.defensiveCopy() action.execute(this._extension) - PluginConfig.useRefreshVersions = project.hasProperty("plugin.de.fayard.buildSrcVersions") + PluginConfig.useRefreshVersions = project.hasProperty("plugin.de.fayard.buildSrcVersions") || project.hasProperty("plugin.de.refreshVersions") } private fun computeIndent(): String { diff --git a/plugin/src/main/kotlin/de/fayard/internal/BuildSrcVersionsExtensionImpl.kt b/plugin/src/main/kotlin/de/fayard/internal/BuildSrcVersionsExtensionImpl.kt index cb692cc75..1cda448c5 100644 --- a/plugin/src/main/kotlin/de/fayard/internal/BuildSrcVersionsExtensionImpl.kt +++ b/plugin/src/main/kotlin/de/fayard/internal/BuildSrcVersionsExtensionImpl.kt @@ -2,6 +2,7 @@ package de.fayard.internal import com.github.benmanes.gradle.versions.updates.resolutionstrategy.ComponentFilter import de.fayard.BuildSrcVersionsExtension +import de.fayard.OrderBy import de.fayard.VersionsOnlyMode internal open class BuildSrcVersionsExtensionImpl( @@ -11,12 +12,13 @@ internal open class BuildSrcVersionsExtensionImpl( override var versionsOnlyMode: VersionsOnlyMode? = null, override var versionsOnlyFile: String? = null, var useFqqnFor: List = emptyList(), - var alwaysUpdateVersions: Boolean = false + var alwaysUpdateVersions: Boolean = false, + override var orderBy: OrderBy = OrderBy.GROUP_AND_LENGTH ) : BuildSrcVersionsExtension, java.io.Serializable { // Necessary because of https://github.com/jmfayard/buildSrcVersions/issues/92 fun defensiveCopy(): BuildSrcVersionsExtensionImpl = BuildSrcVersionsExtensionImpl( - renameLibs, renameVersions, indent, versionsOnlyMode, versionsOnlyFile, useFqqnFor, alwaysUpdateVersions + renameLibs, renameVersions, indent, versionsOnlyMode, versionsOnlyFile, useFqqnFor, alwaysUpdateVersions, orderBy ) override fun alwaysUpdateVersions() { diff --git a/plugin/src/main/kotlin/de/fayard/internal/DependencyGraph.kt b/plugin/src/main/kotlin/de/fayard/internal/DependencyGraph.kt index f7b9f3c0d..d6615005a 100644 --- a/plugin/src/main/kotlin/de/fayard/internal/DependencyGraph.kt +++ b/plugin/src/main/kotlin/de/fayard/internal/DependencyGraph.kt @@ -37,6 +37,8 @@ data class Dependency( var mode: VersionMode = VersionMode.MODULE, val available: AvailableDependency? = null ) { + fun groupOrVirtualGroup() : String = virtualGroup(this) ?: group + val module: String get() = name val versionName: String get() = PluginConfig.versionKtFor(this) @@ -52,10 +54,21 @@ data class Dependency( else -> this.copy(available = null, version = newerVersion) } } + + companion object { + fun virtualGroup(dependency: Dependency, withVersion: Boolean = false): String? { + val virtualGroup = PluginConfig.virtualGroups.firstOrNull { "${dependency.group}.${dependency.module}".startsWith(it) } + return when { + virtualGroup == null -> null + withVersion -> "version.$virtualGroup" + else -> virtualGroup + } + } + } } enum class VersionMode { - MODULE, GROUP, GROUP_MODULE + GROUP, GROUP_MODULE, MODULE } data class GradleConfig( diff --git a/plugin/src/main/kotlin/de/fayard/internal/KotlinPoetry.kt b/plugin/src/main/kotlin/de/fayard/internal/KotlinPoetry.kt index 87a60b65a..81bb550b2 100644 --- a/plugin/src/main/kotlin/de/fayard/internal/KotlinPoetry.kt +++ b/plugin/src/main/kotlin/de/fayard/internal/KotlinPoetry.kt @@ -8,6 +8,8 @@ import com.squareup.kotlinpoet.PropertySpec import com.squareup.kotlinpoet.TypeSpec import com.squareup.kotlinpoet.asClassName import de.fayard.BuildSrcVersionsExtension +import de.fayard.OrderBy +import de.fayard.OrderBy.* import org.gradle.plugin.use.PluginDependenciesSpec import org.gradle.plugin.use.PluginDependencySpec @@ -62,10 +64,14 @@ fun kotlinpoet( } // https://github.com/jmfayard/buildSrcVersions/issues/65 -fun List.sortedBeautifullyBy(exceptIf: Boolean = false, selection: (T) -> String?) : List = - this.filterNot { selection(it) == null } +fun List.sortedBeautifullyBy(orderBy: OrderBy, selection: (Dependency) -> String?) : List { + val unsorted = this.filterNot { selection(it) == null } .sortedBy { selection(it)!! } - .sortedByDescending { selection(it)!!.length } + return when(orderBy) { + GROUP_AND_LENGTH -> unsorted.sortedByDescending { selection(it)!!.length }.sortedBy { it.mode } + GROUP_AND_ALPHABETICAL -> unsorted.sortedBy { it.mode } + } +} fun FileSpec.Builder.addMaybeBuildSrcVersions(versions: List, extension: BuildSrcVersionsExtension) { versions.firstOrNull { @@ -151,7 +157,7 @@ fun List.checkModeAndNames(useFdqnByDefault: List): List d.name - VersionMode.GROUP -> d.group + VersionMode.GROUP -> d.groupOrVirtualGroup() VersionMode.GROUP_MODULE -> "${d.group}_${d.name}" } ) @@ -166,10 +172,11 @@ fun List.orderDependencies(): List { fun List.findCommonVersions(): List { - val map = groupBy { d -> d.group } + val map = groupBy { d: Dependency -> d.groupOrVirtualGroup() } for (deps in map.values) { - val groupTogether = deps.size > 1 && deps.map { it.version }.distinct().size == 1 - if (groupTogether) { + val sameVersions = deps.map { it.version }.distinct().size == 1 + val hasVirtualGroup = deps.any { it.groupOrVirtualGroup() != it.group } + if (sameVersions && (hasVirtualGroup || deps.size > 1)) { deps.forEach { d -> d.mode = VersionMode.GROUP } } } diff --git a/plugin/src/main/kotlin/de/fayard/internal/PluginConfig.kt b/plugin/src/main/kotlin/de/fayard/internal/PluginConfig.kt index 633ffa042..534e36501 100644 --- a/plugin/src/main/kotlin/de/fayard/internal/PluginConfig.kt +++ b/plugin/src/main/kotlin/de/fayard/internal/PluginConfig.kt @@ -15,9 +15,8 @@ import java.io.File object PluginConfig { - - const val PLUGIN_ID = "de.fayard.buildSrcVersions" - const val PLUGIN_VERSION = "0.7.0" // plugin.de.fayard.buildSrcVersions + const val PLUGIN_ID = "de.fayard.refreshVersions" + const val PLUGIN_VERSION = "0.7.0" // plugin.de.fayard.refreshVersions const val GRADLE_VERSIONS_PLUGIN_ID = "com.github.ben-manes.versions" const val GRADLE_VERSIONS_PLUGIN_VERSION = "0.25.0" // Sync with plugin/build.gradle.kts const val EXTENSION_NAME = "buildSrcVersions" @@ -48,23 +47,36 @@ object PluginConfig { * Gradle properties can be set either in "gradle.properties" or from the command-line with * $ ./gradlew -Pversion.kotlin.stdlib=1.3.50 * **/ - fun considerGradleProperties(group: String, module: String): List = listOf( + fun considerGradleProperties(group: String, module: String): List = listOfNotNull( "version.$group..$module", + Dependency.virtualGroup(Dependency(group = group, name = module)), "version.$group", "version.$module" ) + /** + * We want to treat all "org.getbrains.kotlinx:kotlinx-coroutines-*" as if they were a maven group + * with one common version, but different from org.jetbrains.kotlinx:kotlinx-serialization* + * For now this list is not part of the public API but feel free to add feedback that you need it. + * Add your use case here https://github.com/jmfayard/buildSrcVersions/issues/102 + ***/ + val virtualGroups : MutableList = mutableListOf( + "org.jetbrains.kotlinx.kotlinx-coroutines", + "org.jetbrains.kotlinx.kotlinx-serialization" + ) + + @JvmStatic fun versionPropertyFor(d: Dependency): String = when (d.mode) { MODULE -> d.name - GROUP -> d.group + GROUP -> d.groupOrVirtualGroup() GROUP_MODULE -> "${d.group}..${d.name}" } fun versionKtFor(d: Dependency): String = escapeVersionsKt( when (d.mode) { MODULE -> d.name - GROUP -> d.group + GROUP -> d.groupOrVirtualGroup() GROUP_MODULE -> "${d.group}:${d.name}" } ) diff --git a/plugin/src/test/kotlin/de/fayard/DependenciesTest.kt b/plugin/src/test/kotlin/de/fayard/DependenciesTest.kt new file mode 100644 index 000000000..07e76039b --- /dev/null +++ b/plugin/src/test/kotlin/de/fayard/DependenciesTest.kt @@ -0,0 +1,101 @@ +package de.fayard + +import de.fayard.internal.Dependency +import de.fayard.internal.PluginConfig +import de.fayard.internal.VersionMode +import de.fayard.internal.findCommonVersions +import de.fayard.internal.sortedBeautifullyBy +import io.kotlintest.matchers.collections.containExactlyInAnyOrder +import io.kotlintest.should +import io.kotlintest.shouldBe +import io.kotlintest.specs.FreeSpec + +class DependenciesTest: FreeSpec({ + val appCompat = "androidx.appcompat:appcompat:_".asDependency() + val asyncLayoutInflater = "androidx.asynclayoutinflater:asynclayoutinflater:_".asDependency() + val browser = "androidx.browser:browser:_".asDependency() + val car = "androidx.car:car:1.0.1".asDependency() + val carCluster = "androidx.car:car:1.1.0".asDependency() + val sliceCore = "androidx.slice:slice-core:1.0.0".asDependency() + val sliceView = "androidx.slice:slice-view:1.0.0".asDependency() + val coroutinesCore = "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.0.0".asDependency() + val coroutinesCommon = "org.jetbrains.kotlinx:kotlinx-coroutines-core-common:1.0.0".asDependency() + val kotlinxSerialization = "org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.13.0".asDependency() + val guava = "com.google.guava:guava:15.0".asDependency(fqdn = true) + + val ALL = listOf(appCompat, asyncLayoutInflater, browser, car, sliceCore, sliceView) + val NO_DEFAULT = emptyList() + + "order by" - { + fun orderDependencies(orderBy: OrderBy, vararg dependency: Dependency): List = dependency.toList() + .findCommonVersions() + .sortedBeautifullyBy(orderBy) { PluginConfig.versionPropertyFor(it) } + .map { PluginConfig.versionPropertyFor(it) } + + "group and length" { + orderDependencies(OrderBy.GROUP_AND_LENGTH, guava, coroutinesCommon, car, sliceCore, kotlinxSerialization) shouldBe listOf( + "org.jetbrains.kotlinx.kotlinx-serialization", "org.jetbrains.kotlinx.kotlinx-coroutines", "com.google.guava..guava", "slice-core", "car" + ) + } + + "group and alhpabetical" { + orderDependencies(OrderBy.GROUP_AND_ALPHABETICAL, guava, coroutinesCommon, car, sliceCore, kotlinxSerialization) shouldBe listOf( + "org.jetbrains.kotlinx.kotlinx-coroutines", "org.jetbrains.kotlinx.kotlinx-serialization", "com.google.guava..guava", "car", "slice-core" + ) + } + } + + "findCommonVersions" - { + + fun commonGroups(vararg dependency: Dependency): Map = + dependency.map { it.copy() } + .findCommonVersions() + .filter { it.mode == VersionMode.GROUP } + .associate { Pair(it.module, it.groupOrVirtualGroup()) } + + "no common group" { + commonGroups(appCompat, browser, car, sliceCore) shouldBe emptyMap() + } + + "same group, same version" { + commonGroups(sliceCore, sliceView, browser) shouldBe mapOf("slice-core" to "androidx.slice", "slice-view" to "androidx.slice") + } + + "same group but versions do not match" { + commonGroups(car, carCluster) shouldBe emptyMap() + } + + "virtual groups" { + val kotlinX = "org.jetbrains.kotlinx" + commonGroups(coroutinesCore, coroutinesCommon, kotlinxSerialization) shouldBe mapOf( + coroutinesCore.module to "$kotlinX.kotlinx-coroutines", + coroutinesCommon.module to "$kotlinX.kotlinx-coroutines", + kotlinxSerialization.module to "$kotlinX.kotlinx-serialization" + ) + } + } + + with(PluginConfig) { + + "Nothing configured -> MEANINGLESS NAMES" { + computeUseFqdnFor(emptyList(), emptyList()) shouldBe MEANING_LESS_NAMES.sorted() + } + + "Using a dependency module" { + val result = computeUseFqdnFor(ALL, listOf("car", "car", "browser", "slice-car"), listOf("browser", "gradle")) + result shouldBe listOf("browser", "car", "gradle", "slice-car") + } + + "Using a group" { + computeUseFqdnFor(ALL, listOf("androidx.slice", "androidx.browser", "com.example"), NO_DEFAULT) shouldBe listOf("browser", "slice-core", "slice-view") + } + + "Ambiguity in module names" { + val annotations = listOf( + "androidx.annotation:annotation:1.0.0".asDependency(), + "com.example:annotation:1.0.0".asDependency() + ) + computeUseFqdnFor(annotations, emptyList(), emptyList()) shouldBe listOf("annotation") + } + } +}) diff --git a/plugin/src/test/kotlin/de/fayard/FqdnTest.kt b/plugin/src/test/kotlin/de/fayard/FqdnTest.kt deleted file mode 100644 index a27b83754..000000000 --- a/plugin/src/test/kotlin/de/fayard/FqdnTest.kt +++ /dev/null @@ -1,43 +0,0 @@ -package de.fayard - -import de.fayard.internal.PluginConfig -import io.kotlintest.matchers.collections.containExactlyInAnyOrder -import io.kotlintest.should -import io.kotlintest.shouldBe -import io.kotlintest.specs.FreeSpec - -class FqdnTest: FreeSpec({ - val appCompat = "androidx.appcompat:appcompat:_".asDependency() - val asyncLayoutInflater = "androidx.asynclayoutinflater:asynclayoutinflater:_".asDependency() - val browser = "androidx.browser:browser:_".asDependency() - val car = "androidx.car:car:_".asDependency() - val sliceCore = "androidx.slice:slice-core:_".asDependency() - val sliceView = "androidx.slice:slice-view:_".asDependency() - - val ALL = listOf(appCompat, asyncLayoutInflater, browser, car, sliceCore, sliceView) - val NO_DEFAULT = emptyList() - - with(PluginConfig) { - - "Nothing configured -> MEANINGLESS NAMES" { - computeUseFqdnFor(emptyList(), emptyList()) shouldBe MEANING_LESS_NAMES.sorted() - } - - "Using a dependency module" { - val result = computeUseFqdnFor(ALL, listOf("car", "car", "browser", "slice-car"), listOf("browser", "gradle")) - result shouldBe listOf("browser", "car", "gradle", "slice-car") - } - - "Using a group" { - computeUseFqdnFor(ALL, listOf("androidx.slice", "androidx.browser", "com.example"), NO_DEFAULT) shouldBe listOf("browser", "slice-core", "slice-view") - } - - "Ambiguity in module names" { - val annotations = listOf( - "androidx.annotation:annotation:_".asDependency(), - "com.example:annotation:_".asDependency() - ) - computeUseFqdnFor(annotations, emptyList(), emptyList()) shouldBe listOf("annotation") - } - } -}) diff --git a/plugin/src/test/kotlin/de/fayard/NonRegression.kt b/plugin/src/test/kotlin/de/fayard/NonRegression.kt index cea6c3dda..2be7eb7e0 100644 --- a/plugin/src/test/kotlin/de/fayard/NonRegression.kt +++ b/plugin/src/test/kotlin/de/fayard/NonRegression.kt @@ -21,7 +21,7 @@ class NonRegression : FreeSpec({ val jsonReports = reportsFolder.walk().filter { it.extension == "json" }.toList() fun receivedMessage(approved: File): Pair { - val received = approved.resolveSibling(approved.nameWithoutExtension + "-received" + approved.extension) + val received = approved.resolveSibling(approved.nameWithoutExtension + "-received." + approved.extension) val message = """ |Files differ. Run: | diff -u ${approved.relativeTo(buildSrcVersionsDir)} ${received.relativeTo(buildSrcVersionsDir)} @@ -81,7 +81,7 @@ class NonRegression : FreeSpec({ versionsOnlyFile = propertiesFile.relativeTo(buildSrcVersionsDir).path ) val dependencies = (dependencyGraph.map { it.copy(available = null) }) - .sortedBeautifullyBy { it.versionProperty } + .sortedBeautifullyBy(OrderBy.GROUP_AND_LENGTH) { it.versionProperty } .distinctBy { it.versionProperty } UpdateGradleProperties(extension).generateVersionProperties(received, dependencies) diff --git a/plugin/src/test/resources/properties/Catchup-receivedtxt b/plugin/src/test/resources/properties/Catchup.txt similarity index 100% rename from plugin/src/test/resources/properties/Catchup-receivedtxt rename to plugin/src/test/resources/properties/Catchup.txt diff --git a/plugin/src/test/resources/properties/FastHub-receivedtxt b/plugin/src/test/resources/properties/FastHub.txt similarity index 100% rename from plugin/src/test/resources/properties/FastHub-receivedtxt rename to plugin/src/test/resources/properties/FastHub.txt diff --git a/plugin/src/test/resources/properties/Kodein-DI-receivedtxt b/plugin/src/test/resources/properties/Kodein-DI.txt similarity index 100% rename from plugin/src/test/resources/properties/Kodein-DI-receivedtxt rename to plugin/src/test/resources/properties/Kodein-DI.txt diff --git a/plugin/src/test/resources/properties/KotlinAcademyApp-receivedtxt b/plugin/src/test/resources/properties/KotlinAcademyApp.txt similarity index 96% rename from plugin/src/test/resources/properties/KotlinAcademyApp-receivedtxt rename to plugin/src/test/resources/properties/KotlinAcademyApp.txt index 7e21f7130..303e3961a 100644 --- a/plugin/src/test/resources/properties/KotlinAcademyApp-receivedtxt +++ b/plugin/src/test/resources/properties/KotlinAcademyApp.txt @@ -15,11 +15,9 @@ version.kotlinx-gradle-serialization-plugin=0.6.1 version.com.marcinmoskala.PreferenceHolder=1.51 version.com.android.support.test.espresso=3.0.1 version.kotlin-android-extensions-runtime=1.2.60 -version.kotlinx-serialization-runtime-js=0.6.1 version.com.android.tools.build..gradle=3.1.4 version.kotlin-test-annotations-common=1.2.60 version.kotlinx-coroutines-core-native=0.24.0 -version.kotlinx-serialization-runtime=0.6.1 version.kotlinx-coroutines-core-js=0.24.0 version.KotlinAndroidViewBindings=0.10 version.kotlin-android-extensions=1.2.60 @@ -30,6 +28,7 @@ version.kotlin-react-router-dom=4.3.1-pre.38-kotlin-1.2.60 version.kotlinx-coroutines-core=0.24.0 version.com.squareup.retrofit2=2.3.0 version.kotlin-frontend-plugin=0.0.32 +version.org.jetbrains.kotlinx=0.6.1 version.com.squareup.okhttp3=3.6.0 version.kotlin-stdlib-common=1.2.60 version.org.jetbrains.squash=0.2.3 diff --git a/plugin/src/test/resources/properties/KotlinUnitTesting-receivedtxt b/plugin/src/test/resources/properties/KotlinUnitTesting.txt similarity index 100% rename from plugin/src/test/resources/properties/KotlinUnitTesting-receivedtxt rename to plugin/src/test/resources/properties/KotlinUnitTesting.txt diff --git a/plugin/src/test/resources/properties/SdkSearch-receivedtxt b/plugin/src/test/resources/properties/SdkSearch.txt similarity index 83% rename from plugin/src/test/resources/properties/SdkSearch-receivedtxt rename to plugin/src/test/resources/properties/SdkSearch.txt index b96da8f35..58188791d 100644 --- a/plugin/src/test/resources/properties/SdkSearch-receivedtxt +++ b/plugin/src/test/resources/properties/SdkSearch.txt @@ -6,25 +6,19 @@ plugin.jmfayard.github.io.gradle-kotlin-dsl-libs=0.2.4 version.kotlin-gradle-plugin=1.3.0-rc-146 version.retrofit2-kotlinx-serialization-converter=0.1.0 version.kotlin-scripting-compiler-embeddable=1.3.0-rc-146 -version.kotlinx-serialization-runtime-common=0.8.0-rc13 version.kotlin-annotation-processing-gradle=1.3.0-rc-146 version.retrofit2-kotlin-coroutines-adapter=0.9.2 version.kotlin-android-extensions-runtime=1.3.0-rc-146 -version.kotlinx-serialization-runtime-js=0.8.0-rc13 version.com.android.tools.build..gradle=3.3.0-alpha13 version.kotlin-test-annotations-common=1.3.0-rc-146 -version.kotlinx-coroutines-core-common=0.30.2-eap13 version.kotlin-serialization-unshaded=1.3.0-rc-146 -version.kotlinx-serialization-runtime=0.8.0-rc13 -version.kotlinx-coroutines-android=0.30.2-eap13 -version.kotlinx-coroutines-core-js=0.30.2-eap13 version.kotlin-android-extensions=1.3.0-rc-146 version.com.squareup.sqldelight=1.0.0-rc2 -version.kotlinx-coroutines-core=0.30.2-eap13 version.com.jakewharton.timber=5.0.0-SNAPSHOT version.com.squareup.retrofit2=2.4.0 version.kotlin-frontend-plugin=0.0.37 version.androidx.test..runner=1.1.0-alpha4 +version.org.jetbrains.kotlinx=0.30.2-eap13 version.com.squareup.okhttp3=3.11.0 version.kotlin-serialization=1.3.0-rc-146 version.kotlin-stdlib-common=1.3.0-rc-146 diff --git a/plugin/src/test/resources/properties/android-sunflower-receivedtxt b/plugin/src/test/resources/properties/android-sunflower.txt similarity index 100% rename from plugin/src/test/resources/properties/android-sunflower-receivedtxt rename to plugin/src/test/resources/properties/android-sunflower.txt diff --git a/plugin/src/test/resources/properties/http4k-receivedtxt b/plugin/src/test/resources/properties/http4k.txt similarity index 94% rename from plugin/src/test/resources/properties/http4k-receivedtxt rename to plugin/src/test/resources/properties/http4k.txt index c1423bf3f..00110ee95 100644 --- a/plugin/src/test/resources/properties/http4k-receivedtxt +++ b/plugin/src/test/resources/properties/http4k.txt @@ -1,4 +1,4 @@ -# Dependencies and Plugin versions with their available updates + # Dependencies and Plugin versions with their available updates # Generated by $ ./gradlew refreshVersions # You can edit the rest of the file, it will be kept intact # See https://github.com/jmfayard/buildSrcVersions/issues/77 @@ -39,4 +39,4 @@ version.pebble=2.6.1 version.jsoup=1.10.3 version.argo=3.40 version.gson=2.8.5 -version.json=20180813 \ No newline at end of file +version.json=20180813 diff --git a/plugin/src/test/resources/properties/koin-receivedtxt b/plugin/src/test/resources/properties/koin.txt similarity index 100% rename from plugin/src/test/resources/properties/koin-receivedtxt rename to plugin/src/test/resources/properties/koin.txt diff --git a/plugin/src/test/resources/properties/material-dialogs-receivedtxt b/plugin/src/test/resources/properties/material-dialogs.txt similarity index 100% rename from plugin/src/test/resources/properties/material-dialogs-receivedtxt rename to plugin/src/test/resources/properties/material-dialogs.txt diff --git a/plugin/src/test/resources/properties/sample-synclibs-receivedtxt b/plugin/src/test/resources/properties/sample-synclibs.txt similarity index 100% rename from plugin/src/test/resources/properties/sample-synclibs-receivedtxt rename to plugin/src/test/resources/properties/sample-synclibs.txt diff --git a/plugin/src/test/resources/properties/simple-stack-receivedtxt b/plugin/src/test/resources/properties/simple-stack.txt similarity index 100% rename from plugin/src/test/resources/properties/simple-stack-receivedtxt rename to plugin/src/test/resources/properties/simple-stack.txt diff --git a/plugin/src/test/resources/properties/tachiyomi-receivedtxt b/plugin/src/test/resources/properties/tachiyomi.txt similarity index 100% rename from plugin/src/test/resources/properties/tachiyomi-receivedtxt rename to plugin/src/test/resources/properties/tachiyomi.txt diff --git a/plugin/src/test/resources/versions/KotlinAcademyApp.txt b/plugin/src/test/resources/versions/KotlinAcademyApp.txt index 35b6894a9..9bc0186c1 100644 --- a/plugin/src/test/resources/versions/KotlinAcademyApp.txt +++ b/plugin/src/test/resources/versions/KotlinAcademyApp.txt @@ -49,13 +49,12 @@ kotlinx_coroutines_core_native kotlinx_coroutines_javafx kotlinx_gradle_serialization_plugin kotlinx_html_js -kotlinx_serialization_runtime -kotlinx_serialization_runtime_js lint_gradle logback_classic mockk multidex multidex_instrumentation +org_jetbrains_kotlinx_kotlinx_serialization org_jetbrains_squash recyclerview_v7 retrofit2_kotlin_coroutines_experimental_adapter diff --git a/plugin/src/test/resources/versions/SdkSearch.txt b/plugin/src/test/resources/versions/SdkSearch.txt index 50259f782..30d6303b8 100644 --- a/plugin/src/test/resources/versions/SdkSearch.txt +++ b/plugin/src/test/resources/versions/SdkSearch.txt @@ -29,19 +29,14 @@ kotlin_test_annotations_common kotlin_test_common kotlin_test_js kotlin_test_junit -kotlinx_coroutines_android -kotlinx_coroutines_core -kotlinx_coroutines_core_common -kotlinx_coroutines_core_js -kotlinx_serialization_runtime -kotlinx_serialization_runtime_common -kotlinx_serialization_runtime_js ktlint ktlint_gradle lint_gradle material moshi okio +org_jetbrains_kotlinx_kotlinx_coroutines +org_jetbrains_kotlinx_kotlinx_serialization recyclerview retrofit2_kotlin_coroutines_adapter retrofit2_kotlinx_serialization_converter diff --git a/plugin/src/test/resources/versions/koin.txt b/plugin/src/test/resources/versions/koin.txt index 84849f191..da855542c 100644 --- a/plugin/src/test/resources/versions/koin.txt +++ b/plugin/src/test/resources/versions/koin.txt @@ -27,7 +27,7 @@ lint_gradle logback_classic mockito_inline org_jetbrains_kotlin -org_jetbrains_kotlinx +org_jetbrains_kotlinx_kotlinx_coroutines retrofit2_kotlin_coroutines_experimental_adapter rxandroid rxjava diff --git a/plugin/src/test/resources/versions/tachiyomi.txt b/plugin/src/test/resources/versions/tachiyomi.txt index 388eb63e9..e84280435 100644 --- a/plugin/src/test/resources/versions/tachiyomi.txt +++ b/plugin/src/test/resources/versions/tachiyomi.txt @@ -46,7 +46,7 @@ multidex_instrumentation okhttp okio org_jetbrains_kotlin -org_jetbrains_kotlinx +org_jetbrains_kotlinx_kotlinx_coroutines org_robolectric photoview play_services_gcm diff --git a/sample-groovy/build.gradle b/sample-groovy/build.gradle index 95e5fb4df..9dc5d2954 100644 --- a/sample-groovy/build.gradle +++ b/sample-groovy/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'de.fayard.buildSrcVersions' + id 'de.fayard.refreshVersions' id 'com.gradle.build-scan' id 'application' id 'idea' diff --git a/sample-groovy/buildSrc/src/main/kotlin/Libs.kt b/sample-groovy/buildSrc/src/main/kotlin/Libs.kt index f8fc2726a..6f9178399 100644 --- a/sample-groovy/buildSrc/src/main/kotlin/Libs.kt +++ b/sample-groovy/buildSrc/src/main/kotlin/Libs.kt @@ -7,14 +7,21 @@ import kotlin.String * `$ ./gradlew buildSrcVersions` */ object Libs { - const val com_gradle_build_scan_gradle_plugin: String = - "com.gradle.build-scan:com.gradle.build-scan.gradle.plugin:2.4.2" + const val androidx_annotation_annotation: String = "androidx.annotation:annotation:" + + Versions.androidx_annotation_annotation - const val androidx_annotation_annotation: String = "androidx.annotation:annotation:1.1.0" + const val org_jetbrains_annotation: String = "org.jetbrains:annotation:" + + Versions.org_jetbrains_annotation - const val org_jetbrains_annotation: String = "org.jetbrains:annotation:17.0.0" + /** + * http://code.google.com/p/google-guice/ + */ + const val com_google_inject_guice: String = "com.google.inject:guice:" + + Versions.com_google_inject_guice - const val com_google_inject_guice: String = "com.google.inject:guice:2.0" + const val com_gradle_build_scan_gradle_plugin: String = + "com.gradle.build-scan:com.gradle.build-scan.gradle.plugin:" + + Versions.com_gradle_build_scan_gradle_plugin - const val guava: String = "com.google.guava:guava:15.0" + const val guava: String = "com.google.guava:guava:" + Versions.guava } diff --git a/sample-groovy/buildSrc/src/main/kotlin/Versions.kt b/sample-groovy/buildSrc/src/main/kotlin/Versions.kt index ade0dd6f2..12b6b38e4 100644 --- a/sample-groovy/buildSrc/src/main/kotlin/Versions.kt +++ b/sample-groovy/buildSrc/src/main/kotlin/Versions.kt @@ -10,12 +10,16 @@ import kotlin.String * YOU are responsible for updating manually the dependency version. */ object Versions { + const val androidx_annotation_annotation: String = "1.1.0" + + const val org_jetbrains_annotation: String = "17.0.0" + + const val com_google_inject_guice: String = "2.0" + const val com_gradle_build_scan_gradle_plugin: String = "2.4.2" const val guava: String = "15.0" - const val guice: String = "2.0" - /** * Current version: "5.6.2" * See issue 19: How to update Gradle itself? diff --git a/sample-groovy/gradle.properties b/sample-groovy/gradle.properties index 9ddf71de0..7fafd20a7 100644 --- a/sample-groovy/gradle.properties +++ b/sample-groovy/gradle.properties @@ -8,7 +8,7 @@ resolutionStrategyConfig=verbose # You can edit the rest of the file, it will be kept intact # See https://github.com/jmfayard/buildSrcVersions/issues/77 plugin.com.github.ben-manes.versions=0.25.0 -plugin.de.fayard.buildSrcVersions=0.7.0 +plugin.de.fayard.refreshVersions=0.7.0 plugin.com.gradle.build-scan=2.4.2 version.androidx.annotation..annotation=1.1.0 version.org.jetbrains..annotation=17.0.0 diff --git a/sample-kotlin/build.gradle.kts b/sample-kotlin/build.gradle.kts index 6ef2e541b..37c2473e6 100644 --- a/sample-kotlin/build.gradle.kts +++ b/sample-kotlin/build.gradle.kts @@ -1,7 +1,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { - id("de.fayard.buildSrcVersions") + id("de.fayard.refreshVersions") kotlin("jvm") `build-scan` } diff --git a/sample-kotlin/buildSrc/src/main/kotlin/Libs.kt b/sample-kotlin/buildSrc/src/main/kotlin/Libs.kt index 6334aeee5..b0ce77de2 100644 --- a/sample-kotlin/buildSrc/src/main/kotlin/Libs.kt +++ b/sample-kotlin/buildSrc/src/main/kotlin/Libs.kt @@ -1,5 +1,3 @@ -import kotlin.String - /** * Generated by https://github.com/jmfayard/buildSrcVersions * @@ -7,24 +5,49 @@ import kotlin.String * `$ ./gradlew buildSrcVersions` */ object Libs { + /** + * https://github.com/square/okhttp + */ + const val okhttp: String = "com.squareup.okhttp3:okhttp:" + Versions.com_squareup_okhttp3 + + /** + * https://github.com/square/okhttp + */ + const val okhttp_urlconnection: String = "com.squareup.okhttp3:okhttp-urlconnection:" + + Versions.com_squareup_okhttp3 + + /** + * https://kotlinlang.org/ + */ + const val kotlin_scripting_compiler_embeddable: String = + "org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:" + + Versions.org_jetbrains_kotlin + + /** + * https://kotlinlang.org/ + */ + const val kotlin_stdlib_jdk8: String = "org.jetbrains.kotlin:kotlin-stdlib-jdk8:" + + Versions.org_jetbrains_kotlin + + /** + * http://www.mongodb.org + */ + const val org_mongodb_mongo_java_driver: String = "org.mongodb:mongo-java-driver:" + + Versions.org_mongodb_mongo_java_driver + + /** + * http://code.google.com/p/google-guice/ + */ + const val com_google_inject_guice: String = "com.google.inject:guice:" + + Versions.com_google_inject_guice + const val org_jetbrains_kotlin_jvm_gradle_plugin: String = - "org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:1.3.50" + "org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:" + + Versions.org_jetbrains_kotlin_jvm_gradle_plugin const val com_gradle_build_scan_gradle_plugin: String = - "com.gradle.build-scan:com.gradle.build-scan.gradle.plugin:2.4.2" - - const val org_mongodb_mongo_java_driver: String = "org.mongodb:mongo-java-driver:3.11.0" - - const val com_google_inject_guice: String = "com.google.inject:guice:2.0" - - const val okhttp: String = "com.squareup.okhttp3:okhttp:4.2.0" - - const val okhttp_urlconnection: String = "com.squareup.okhttp3:okhttp-urlconnection:4.2.0" - - const val kotlin_scripting_compiler_embeddable: String = - "org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:1.3.50" - - const val kotlin_stdlib_jdk8: String = "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.50" + "com.gradle.build-scan:com.gradle.build-scan.gradle.plugin:" + + Versions.com_gradle_build_scan_gradle_plugin - const val guava: String = "com.google.guava:guava:15.0" + const val guava: String = "com.google.guava:guava:" + Versions.guava } diff --git a/sample-kotlin/buildSrc/src/main/kotlin/Versions.kt b/sample-kotlin/buildSrc/src/main/kotlin/Versions.kt new file mode 100644 index 000000000..5c0ed34df --- /dev/null +++ b/sample-kotlin/buildSrc/src/main/kotlin/Versions.kt @@ -0,0 +1,31 @@ +/** + * Generated by https://github.com/jmfayard/buildSrcVersions + * + * Find which updates are available by running + * `$ ./gradlew buildSrcVersions` + * This will only update the comments. + * + * YOU are responsible for updating manually the dependency version. + */ +object Versions { + const val com_squareup_okhttp3: String = "4.2.0" + + const val org_jetbrains_kotlin: String = "1.3.50" + + const val org_mongodb_mongo_java_driver: String = "3.11.0" + + const val com_google_inject_guice: String = "2.0" + + const val org_jetbrains_kotlin_jvm_gradle_plugin: String = "1.3.50" + + const val com_gradle_build_scan_gradle_plugin: String = "2.4.2" + + const val guava: String = "15.0" + + /** + * Current version: "5.6.2" + * See issue 19: How to update Gradle itself? + * https://github.com/jmfayard/buildSrcVersions/issues/19 + */ + const val gradleLatestVersion: String = "5.6.2" +} diff --git a/sample-kotlin/gradle.properties b/sample-kotlin/gradle.properties index 21bfd2642..6c5111c35 100644 --- a/sample-kotlin/gradle.properties +++ b/sample-kotlin/gradle.properties @@ -8,12 +8,12 @@ resolutionStrategyConfig=verbose # You can edit the rest of the file, it will be kept intact # See https://github.com/jmfayard/buildSrcVersions/issues/77 plugin.com.github.ben-manes.versions=0.25.0 -plugin.de.fayard.buildSrcVersions=0.7.0 +plugin.de.fayard.refreshVersions=0.7.0 plugin.org.jetbrains.kotlin.jvm=1.3.50 plugin.com.gradle.build-scan=2.4.2 -version.org.mongodb..mongo-java-driver=3.11.0 -version.com.google.inject..guice=2.0 version.com.squareup.okhttp3=4.2.0 version.org.jetbrains.kotlin=1.3.50 +version.org.mongodb..mongo-java-driver=3.11.0 +version.com.google.inject..guice=2.0 version.gradleLatestVersion=5.6.2 version.guava=15.0 \ No newline at end of file diff --git a/sample-versionsOnlyMode/GROOVY_DEF.gradle b/sample-versionsOnlyMode/GROOVY_DEF.gradle index 75e9072e7..19f717406 100644 --- a/sample-versionsOnlyMode/GROOVY_DEF.gradle +++ b/sample-versionsOnlyMode/GROOVY_DEF.gradle @@ -3,13 +3,13 @@ // // Generated by ./gradle buildSrcVersions // See https://github.com/jmfayard/buildSrcVersions/issues/54 -def com_github_ben_manes_versions_gradle_plugin = '0.25.0' -def de_fayard_buildsrcversions_gradle_plugin = '0.7.0' -def org_jetbrains_kotlin_jvm_gradle_plugin = '1.3.50' def org_jetbrains_kotlin = '1.3.50' +def com_github_ben_manes_versions_gradle_plugin = '0.25.0' +def de_fayard_refreshversions_gradle_plugin = '0.7.0' def gradlelatestversion = '5.5.1' // available: '5.6.1' def okhttp = '4.1.0' // available: '4.1.1' def okio = '2.0.0' +def org_jetbrains_kotlin_jvm_gradle_plugin = '1.3.50' // diff --git a/sample-versionsOnlyMode/GROOVY_EXT.gradle b/sample-versionsOnlyMode/GROOVY_EXT.gradle index 313237a75..b7ff82421 100644 --- a/sample-versionsOnlyMode/GROOVY_EXT.gradle +++ b/sample-versionsOnlyMode/GROOVY_EXT.gradle @@ -4,13 +4,13 @@ // Generated by ./gradle buildSrcVersions // See https://github.com/jmfayard/buildSrcVersions/issues/54 ext { - com_github_ben_manes_versions_gradle_plugin = '0.25.0' - de_fayard_buildsrcversions_gradle_plugin = '0.7.0' - org_jetbrains_kotlin_jvm_gradle_plugin = '1.3.50' org_jetbrains_kotlin = '1.3.50' + com_github_ben_manes_versions_gradle_plugin = '0.25.0' + de_fayard_refreshversions_gradle_plugin = '0.7.0' gradlelatestversion = '5.5.1' // available: '5.6.1' okhttp = '4.1.0' // available: '4.1.1' okio = '2.0.0' + org_jetbrains_kotlin_jvm_gradle_plugin = '1.3.50' } // diff --git a/sample-versionsOnlyMode/KOTLIN_OBJECT.kt b/sample-versionsOnlyMode/KOTLIN_OBJECT.kt index 223fce869..8966a1838 100644 --- a/sample-versionsOnlyMode/KOTLIN_OBJECT.kt +++ b/sample-versionsOnlyMode/KOTLIN_OBJECT.kt @@ -10,14 +10,14 @@ import kotlin.String * YOU are responsible for updating manually the dependency version. */ object Versions { - const val org_jetbrains_kotlin_jvm_gradle_plugin: String = "1.3.50" - const val org_jetbrains_kotlin: String = "1.3.50" const val okhttp: String = "4.1.0" // available: "4.1.1" const val okio: String = "2.0.0" + const val org_jetbrains_kotlin_jvm_gradle_plugin: String = "1.3.50" + /** * Current version: "5.5.1" * See issue 19: How to update Gradle itself? diff --git a/sample-versionsOnlyMode/KOTLIN_VAL.gradle.kts b/sample-versionsOnlyMode/KOTLIN_VAL.gradle.kts index fa4bc2319..c02f8665c 100644 --- a/sample-versionsOnlyMode/KOTLIN_VAL.gradle.kts +++ b/sample-versionsOnlyMode/KOTLIN_VAL.gradle.kts @@ -3,13 +3,13 @@ // // Generated by ./gradle buildSrcVersions // See https://github.com/jmfayard/buildSrcVersions/issues/54 -val com_github_ben_manes_versions_gradle_plugin = "0.25.0" -val de_fayard_buildsrcversions_gradle_plugin = "0.7.0" -val org_jetbrains_kotlin_jvm_gradle_plugin = "1.3.50" val org_jetbrains_kotlin = "1.3.50" +val com_github_ben_manes_versions_gradle_plugin = "0.25.0" +val de_fayard_refreshversions_gradle_plugin = "0.7.0" val gradlelatestversion = "5.5.1" // available: "5.6.1" val okhttp = "4.1.0" // available: "4.1.1" val okio = "2.0.0" +val org_jetbrains_kotlin_jvm_gradle_plugin = "1.3.50" // diff --git a/sample-versionsOnlyMode/build.gradle.kts b/sample-versionsOnlyMode/build.gradle.kts index 353d583d0..d3661294c 100644 --- a/sample-versionsOnlyMode/build.gradle.kts +++ b/sample-versionsOnlyMode/build.gradle.kts @@ -1,4 +1,5 @@ import de.fayard.BuildSrcVersionsTask +import de.fayard.OrderBy import de.fayard.VersionsOnlyMode import org.jetbrains.kotlin.gradle.tasks.KotlinCompile @@ -15,6 +16,7 @@ group = "de.fayard" buildSrcVersions { // See configuration options at https://github.com/jmfayard/buildSrcVersions/issues/53 indent = " " + orderBy = OrderBy.GROUP_AND_ALPHABETICAL } repositories { @@ -27,8 +29,12 @@ repositories { dependencies { implementation("com.google.guava:guava:15.0") implementation("com.google.inject:guice:2.0") - implementation("com.wealthfront:magellan:_") + implementation("com.wealthfront:magellan:+") implementation("com.wealthfront:magellan-rx:+") + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.0.0") + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core-common:1.0.0") + implementation("org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.13.0") + implementation("com.jakewharton.timber:timber:4.7.0") } tasks.withType { diff --git a/sample-versionsOnlyMode/gradle.properties b/sample-versionsOnlyMode/gradle.properties index 1f2194498..1d35fcb2f 100644 --- a/sample-versionsOnlyMode/gradle.properties +++ b/sample-versionsOnlyMode/gradle.properties @@ -7,15 +7,19 @@ resolutionStrategyConfig=verbose # Generated by $ ./gradlew refreshVersions # You can edit the rest of the file, it will be kept intact # See https://github.com/jmfayard/buildSrcVersions/issues/77 -plugin.com.github.ben-manes.versions=0.25.0 -plugin.org.lovedev.greeting.kotlin=1.1 -plugin.de.fayard.buildSrcVersions=0.7.0 -plugin.org.jetbrains.kotlin.jvm=1.3.50 plugin.ch.tutteli.kotlin.utils=0.29.0 +plugin.com.github.ben-manes.versions=0.25.0 plugin.com.gradle.build-scan=2.4.2 +plugin.de.fayard.refreshVersions=0.7.0 plugin.nebula.kotlin=1.3.50 +plugin.org.jetbrains.kotlin.jvm=1.3.50 +plugin.org.lovedev.greeting.kotlin=1.1 +version.com.wealthfront=1.1.0 version.org.jetbrains.kotlin=1.3.50 +version.org.jetbrains.kotlinx.kotlinx-coroutines=1.0.0 +# # available=1.3.2 +version.org.jetbrains.kotlinx.kotlinx-serialization=0.13.0 version.gradleLatestVersion=5.6.2 -version.com.wealthfront=1.1.0 version.guava=15.0 -version.guice=2.0 \ No newline at end of file +version.guice=2.0 +version.timber=4.7.0 \ No newline at end of file