Gradle plugin for updating a project version catalog

Overview

Version catalog update plugin

Maven Central

This plugin helps to keep the versions in a Gradle version catalog toml file up to date. The version updates are determined by the versions plugin.

Getting started

This plugin requires Gradle 7.2 or up. Currently version catalogs are a Gradle incubating feature, check out the documentation on how to enable this feature.

The versions plugin needs to be applied in the root build.gradle or build.gradle.kts build file.

The version catalog plugin (including its snapshots) is hosted on Maven Central. Be sure to add mavenCentral() to your plugin repositories, for example in settings.gradle:

pluginManagement {
 dependencyResolutionManagement {
    repositories {
      mavenCentral()
    }
  }
}

The version catalog update plugin then needs to be applied after the versions plugin.

" } ">
plugins {
  id "com.github.ben-manes.versions" version "0.39.0"
  id "nl.littlerobots.version-catalog-update" version "
   
    "
}

   

When using the plugins block, the classpath dependency is nl.littlerobots.vcu:plugin:

Creating a libs.versions.toml file

If you don't have a catalog file yet, one can be created by using the --create command line option:

./gradlew versionCatalogUpdate --create

Note that this will use the latest applicable versions as detected / configured by the versions plugin. After running the build with --create gradle/libs.version.toml can be edited needed. You can rename and remove keys that are not applicable; the versions plugin may include dependencies that are internal to Gradle or added by other means, such as plugins adding a dependency.

The plugin will attempt to create versions for artifacts in the same group with a common version.

The catalog will be updated with the latest available version as determined by the versions plugin. You can configure the versions plugin on what versions are acceptable. A common case is to reject unstable versions like alphas.

After you have created the libs.versions.toml file you can update your dependency references to use the catalog in stead of direct dependency declarations.

Updating the libs.versions.toml file

To update the catalog file at any time run ./gradlew versionCatalogUpdate. This takes care of the following:

  • New available versions will be updated in the catalog, retaining existing version groups if they exist
  • Keys used in versions, libraries, bundles and plugins will be sorted by name configurable
  • bundles will be updated so that they only contain valid keys. Keys in a bundle will be sorted.

By default no new entries will be added to the catalog, but unused entries will be removed. Any dependency that is not reported by the versions plugin, but still appears in the version catalog file will be considered unused. This is configurable.

Configuration

The plugin can be configured using the versionCatalogUpdate block in the build file:

versionCatalogUpdate {
  sortyByKey = true
  addDependencies = false
  keepUnused = false
}

In addition, you can override configured values using command line arguments. Use ./gradlew versionCatalogUpdate --add to add dependencies or ./gradlew --keepUnused (or both).

Snapshot versions

For snapshots versions add the Sonatype snapshot repository https://oss.sonatype.org/content/repositories/snapshots/.

Known issues and limitations

  • When adding dependencies, "internal" dependencies or plugins might be added to the catalog. It is recommended to leave the default set to false for that reason. Usually after the initial version catalog has been setup, new dependencies should be added to the toml file manually anyway.
Comments
  • `versionCatalogUpdate` task failing on `Collection contains no element matching the predicate`

    `versionCatalogUpdate` task failing on `Collection contains no element matching the predicate`

    It's unclear what collection is even being referenced... also, the update to libs.versions.toml happens nevertheless!

    > Task :versionCatalogUpdate FAILED
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Execution failed for task ':versionCatalogUpdate'.
    > Collection contains no element matching the predicate.
    

    Not much can be inferred from --info logs either.

    Full repro: the current state of https://github.com/VirtusLab/git-machete-intellij-plugin/pull/1009, i.e. https://github.com/VirtusLab/git-machete-intellij-plugin/tree/bffe9f95ef0b32e674c209ea58b07e0243ebdc80

    opened by PawelLipski 14
  • Wrong Jackson version getting picked up?

    Wrong Jackson version getting picked up?

    I had this working previously and now running into this issue locally and on CI (our own hosted Github runners). It looks like this project defines a newer version of Jackson (2.13.0) but our project is not loading that version. It looks like we are picking up Jackson 2.11.1

    Android Studio Chipmunk (stable) AGP 7.2.0 Gradle 7.4.2

    Generated report file build/dependencyUpdates/report.json
    Generated report file build/dependencyUpdates/report.xml
    Generated report file build/dependencyUpdates/report.txt
    
    > Task :versionCatalogUpdate FAILED
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Execution failed for task ':versionCatalogUpdate'.
    > com.fasterxml.jackson.dataformat.toml.TomlMapper.coercionConfigDefaults()Lcom/fasterxml/jackson/databind/cfg/MutableCoercionConfig;
    

    When I run with --stacktrace is points to https://github.com/littlerobots/version-catalog-update-plugin/blob/main/catalog/src/main/kotlin/nl/littlerobots/vcu/VersionCatalogParser.kt

    Let me know what other information is needed.

    opened by michaelcarrano 14
  • Keep comments in toml file

    Keep comments in toml file

    Environment:

    nl.littlerobots.version-catalog-update: 0.2.1 com.github.ben-manes.versions: 0.41.0 Gradle: 7.3.2

    libs.versions.toml:

    [versions]
    # An important explanation of choosing this version
    externalDependency = "1.0-fix"
    

    Scenario:

    ./gradlew versionCatalogUpdate --no-configuration-cache
    

    Result:

    libs.versions.toml:

    [versions]
    externalDependency = "<the latest version here>"
    

    Expected behavior:

    The plugin can't know about semantics but shouldn't erase it from the config. Here is the source of truth for versions. This is why we keep knowledge about versions here.

    libs.versions.toml:

    [versions]
    # An important explanation of choosing this version
    externalDependency = "<the latest version here>"
    
    opened by eugene-krivobokov 14
  • Upgrade to kotest not reflected

    Upgrade to kotest not reflected

    Running ./gradlew versionCatalogUpdate on main of https://github.com/oss-review-toolkit/ort shows

    The following dependencies have later milestone versions:
     - io.kotest:kotest-assertions-core [5.3.1 -> 5.3.2]
         https://github.com/kotest/kotest
     - io.kotest:kotest-assertions-json [5.3.1 -> 5.3.2]
         https://github.com/kotest/kotest
     - io.kotest:kotest-extensions-junitxml [5.3.1 -> 5.3.2]
         https://github.com/kotest/kotest
     - io.kotest:kotest-framework-api [5.3.1 -> 5.3.2]
         https://github.com/kotest/kotest
     - io.kotest:kotest-framework-engine [5.3.1 -> 5.3.2]
         https://github.com/kotest/kotest
    

    but still the upgrade of kotest is not reflected in the TOML changes. Any idea why? Is there a problem with test-only dependencies?

    opened by sschuberth 10
  • Failed when call versionCatalogUpdate method

    Failed when call versionCatalogUpdate method

    gradle: 7.5.1 Java 11 Android project using TOML file mixed gradle + kotlin DSL files (build.gradle + build.gradle.kts) kotlin: 1.7.10 Ben manes versions: 0.42.0 this plugin version: 0.5.3 / 0.6.0 (both same result)

    call ./gradlew versionCatalogUpdate --stacktrace:

    Failed to determine the latest version for the following dependencies (use --info for details):
     - androidx.security:security-crypto
         1.0.0
     - com.google.guava:guava
     - com.google.guava:listenablefuture
     - com.lokalise.android:sdk
         2.1.1
     - com.mapbox.common:common
     - com.mapbox.common:loader
     - com.mapbox.common:okhttp
     - com.mapbox.search:mapbox-search-android
     - com.mapbox.search:mapbox-search-android-common
     - com.mapbox.search:mapbox-search-android-native
     - net.yslibrary.keyboardvisibilityevent:keyboardvisibilityevent
         2.3.0
     - org.jetbrains.kotlin:kotlin-android-extensions-runtime
         1.7.10
     - org.jetbrains.kotlin:kotlin-stdlib-jdk8
         1.7.10
    
    Gradle release-candidate updates:
     - Gradle: [7.5.1: UP-TO-DATE]
    
    Generated report file D:\Projects\digilab\hoppygo\hoppygo\build\dependencyUpdates\report.json
    
    Generated report file D:\Projects\digilab\hoppygo\hoppygo\build\dependencyUpdates\report.xml
    
    Generated report file D:\Projects\digilab\hoppygo\hoppygo\build\dependencyUpdates\report.txt
    
    > Task :versionCatalogUpdate FAILED
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Execution failed for task ':versionCatalogUpdate'.
    > class nl.littlerobots.vcu.model.VersionDefinition$Unspecified cannot be cast to class nl.littlerobots.vcu.model.VersionDefinition$Simple (nl.littlerobots.vcu.model.VersionDefinition$Unspecified and nl.littlerobots.vcu.model.Versio
    nDefinition$Simple are in unnamed module of loader org.gradle.internal.classloader.VisitableURLClassLoader @2a756873)
    
    * Try:
    > Run with --info or --debug option to get more log output.
    > Run with --scan to get full insights.
    
    * Exception is:
    org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':versionCatalogUpdate'.
            at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$1(ExecuteActionsTaskExecuter.java:142)
            at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:282)
            at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:140)
            at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:128)
            at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:77)
            at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
            at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:51)
            at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
            at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56)
            at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
            at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
            at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
            at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
            at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)
            at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199)
            at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
            at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
            at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
            at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
            at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
            at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)
            at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
            at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:69)
            at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:327)
            at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:314)
            at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:307)
            at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:293)
            at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:420)
            at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:342)
            at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
            at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
    Caused by: java.lang.ClassCastException: class nl.littlerobots.vcu.model.VersionDefinition$Unspecified cannot be cast to class nl.littlerobots.vcu.model.VersionDefinition$Simple (nl.littlerobots.vcu.model.VersionDefinition$Unspecifi
    ed and nl.littlerobots.vcu.model.VersionDefinition$Simple are in unnamed module of loader org.gradle.internal.classloader.VisitableURLClassLoader @2a756873)
            at nl.littlerobots.vcu.model.VersionCatalogKt.collectVersionReferenceForGroups(VersionCatalog.kt:240)
            at nl.littlerobots.vcu.model.VersionCatalogKt.updateFrom(VersionCatalog.kt:128)
            at nl.littlerobots.vcu.plugin.VersionCatalogUpdateTask.updateCatalog(VersionCatalogUpdateTask.kt:129)
            at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
            at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:125)
            at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:58)
            at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:51)
            at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:29)
            at org.gradle.api.internal.tasks.execution.TaskExecution$3.run(TaskExecution.java:236)
            at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
            at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
            at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
            at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
            at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
            at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
            at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:47)
            at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:68)
            at org.gradle.api.internal.tasks.execution.TaskExecution.executeAction(TaskExecution.java:221)
            at org.gradle.api.internal.tasks.execution.TaskExecution.executeActions(TaskExecution.java:204)
            at org.gradle.api.internal.tasks.execution.TaskExecution.executeWithPreviousOutputFiles(TaskExecution.java:187)
            at org.gradle.api.internal.tasks.execution.TaskExecution.execute(TaskExecution.java:165)
            at org.gradle.internal.execution.steps.ExecuteStep.executeInternal(ExecuteStep.java:89)
            at org.gradle.internal.execution.steps.ExecuteStep.access$000(ExecuteStep.java:40)
            at org.gradle.internal.execution.steps.ExecuteStep$1.call(ExecuteStep.java:53)
            at org.gradle.internal.execution.steps.ExecuteStep$1.call(ExecuteStep.java:50)
            at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)
            at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199)
            at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
            at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
            at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
            at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
            at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
            at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)
            at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:50)
            at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:40)
            at org.gradle.internal.execution.steps.RemovePreviousOutputsStep.execute(RemovePreviousOutputsStep.java:68)
            at org.gradle.internal.execution.steps.RemovePreviousOutputsStep.execute(RemovePreviousOutputsStep.java:38)
            at org.gradle.internal.execution.steps.CancelExecutionStep.execute(CancelExecutionStep.java:41)
            at org.gradle.internal.execution.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:74)
            at org.gradle.internal.execution.steps.TimeoutStep.execute(TimeoutStep.java:55)
            at org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:51)
            at org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:29)
            at org.gradle.internal.execution.steps.CaptureStateAfterExecutionStep.executeDelegateBroadcastingChanges(CaptureStateAfterExecutionStep.java:124)
            at org.gradle.internal.execution.steps.CaptureStateAfterExecutionStep.execute(CaptureStateAfterExecutionStep.java:80)
            at org.gradle.internal.execution.steps.CaptureStateAfterExecutionStep.execute(CaptureStateAfterExecutionStep.java:58)
            at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:48)
            at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:36)
            at org.gradle.internal.execution.steps.BuildCacheStep.executeWithoutCache(BuildCacheStep.java:181)
            at org.gradle.internal.execution.steps.BuildCacheStep.lambda$execute$1(BuildCacheStep.java:71)
            at org.gradle.internal.Either$Right.fold(Either.java:175)
            at org.gradle.internal.execution.caching.CachingState.fold(CachingState.java:59)
            at org.gradle.internal.execution.steps.BuildCacheStep.execute(BuildCacheStep.java:69)
            at org.gradle.internal.execution.steps.BuildCacheStep.execute(BuildCacheStep.java:47)
            at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:36)
            at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:25)
            at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:36)
            at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:22)
            at org.gradle.internal.execution.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:110)
            at org.gradle.internal.execution.steps.SkipUpToDateStep.lambda$execute$2(SkipUpToDateStep.java:56)
            at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:56)
            at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:38)
            at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:73)
            at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:44)
            at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:37)
            at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:27)
            at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:89)
            at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:50)
            at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:114)
            at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:57)
            at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:76)
            at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:50)
            at org.gradle.internal.execution.steps.SkipEmptyWorkStep.executeWithNoEmptySources(SkipEmptyWorkStep.java:254)
            at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:91)
            at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:56)
            at org.gradle.internal.execution.steps.RemoveUntrackedExecutionStateStep.execute(RemoveUntrackedExecutionStateStep.java:32)
            at org.gradle.internal.execution.steps.RemoveUntrackedExecutionStateStep.execute(RemoveUntrackedExecutionStateStep.java:21)
            at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsStartedStep.execute(MarkSnapshottingInputsStartedStep.java:38)
            at org.gradle.internal.execution.steps.LoadPreviousExecutionStateStep.execute(LoadPreviousExecutionStateStep.java:43)
            at org.gradle.internal.execution.steps.LoadPreviousExecutionStateStep.execute(LoadPreviousExecutionStateStep.java:31)
            at org.gradle.internal.execution.steps.AssignWorkspaceStep.lambda$execute$0(AssignWorkspaceStep.java:40)
            at org.gradle.api.internal.tasks.execution.TaskExecution$4.withWorkspace(TaskExecution.java:281)
            at org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:40)
            at org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:30)
            at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:37)
            at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:27)
            at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:44)
            at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:33)
            at org.gradle.internal.execution.impl.DefaultExecutionEngine$1.execute(DefaultExecutionEngine.java:76)
            at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:139)
            at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:128)
            at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:77)
            at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
            at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:51)
            at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
            at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56)
            at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
            at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
            at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
            at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
            at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)
            at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199)
            at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
            at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
            at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
            at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
            at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
            at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)
            at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
            at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:69)
            at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:327)
            at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:314)
            at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:307)
            at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:293)
            at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:420)
            at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:342)
            at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
            at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
    
    
    * Get more help at https://help.gradle.org
    
    Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
    
    You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
    
    See https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings
    
    BUILD FAILED in 22s
    
    opened by mtrakal 9
  • Blacklist dependencies/versions

    Blacklist dependencies/versions

    Hi! I would like to know if you are thinking on adding blacklist for certain dependencies?

    Ie I may want to update manually compose and kotlin as I know they have a certain relationship, but update the rest automatically.

    I would be happy to work on this if you think it would be a nice addition to the plugin

    opened by dmarin 9
  • Optionally add new versions as comments

    Optionally add new versions as comments

    Hi,

    we are currently using "refreshVersions" in a rather large project (200+ dependencies). I started using this plugin as an alternative in some smaller projects, and it's working fine. However, we cannot afford to always handle upgrades to all 200+ dependencies in a single commit for the large project. The only options I see right now would thus be to use "git incremental add" (assuming libs.versions.timl is under Git control), or a git restore followed by a manual version upgrade. A better approach for us thus could be to run ./gradlew versionCatalogUpdate --propose (or perhaps ./gradlew versionCatalogPropose), which would add available upgrades as comments behind the outdated versions. We could then manually modify the file, shifting the comments to versions where we want to upgrade. Running the same command some time later would then upgrade the version numbers in the comments, or add new comments.

    This would allow running the command regularly to stay informed about possible upgrades, without being forced to accept all upgrades.

    opened by nkiesel 8
  • Consider to lift off root project requirement

    Consider to lift off root project requirement

    Thank you for your effort. I would like to initiate a discussion and share a snippet I find useful.

    By default ben-manes plugin sets a listener to copy every dependency at every configuration at every submodule with + version. Due to the limitation of Gradle resolving configuration can not be done in parallel. In a typical android kotlin project, google and jetbrains plugins set dozens of configurations per module. Multiplied by 10th of modules this becomes extremely slow to execute. And also pointless waste of resources as the same dependency would be resolved hundreds of times over and over again.

    For example, on a project I'm working on with 350 dependencies declared at libs.versions.toml running dependencyUpdates from root takes over 50 minutes to execute.

    As an optimization technic, I've found that creating a single configuration and looping through every dependency gives the same new-updates result in under a minute.

    Creating an artificial module, called dependency-updates-report with the next content:

    // dependency-updates-report/build.gradle
    plugins {
        id 'com.github.ben-manes.versions'
    }
    
    configurations {
        dependencyUpdateConfiguration
    }
    
    dependencies {
        def versionCatalog = project.extensions.getByType(VersionCatalogsExtension).named("libs")
        versionCatalog.dependencyAliases.each {
            versionCatalog.findDependency(it).ifPresent {
                dependencyUpdateConfiguration(it)
            }
        }
    }
    
    tasks.named("dependencyUpdates").configure {
        resolutionStrategy {
            componentSelection { rules ->
                rules.all { ComponentSelection selection ->
                    boolean rejected = ['alpha', 'beta', 'rc', 'm', 'eap'].any { qualifier ->
                        selection.candidate.version.toLowerCase().contains(qualifier)
                    }
                    if (rejected) {
                        selection.reject('Alpha, beta, release candidate, milestone and early access preview versions are rejected from report')
                    }
                }
            }
        }
    }
    

    And running the same ./gradlew dependencyUpdates task will now return updates report times faster.

    I believe you would lose the "find unused dependencies" functionality with this approach. This is why I want to initiate discussion, as I'm not sure how useful you consider that to be. I think that tools like https://github.com/autonomousapps/dependency-analysis-android-gradle-plugin could be more effective at findings as it actually checks usage in code, not just declaration at build.gradle files.

    Thanks again this plugin has been published at the perfect timing for me as I'm investigating switch to versions catalog.

    opened by plastiv 8
  • Whether there are options that only show the updateable version, and do not really perform the update.

    Whether there are options that only show the updateable version, and do not really perform the update.

    Whether there are options that only show the updateable version, and do not really perform the update.

    Because I found that executing the update would destroy my TOML file format.

    question 
    opened by lost22git 7
  • Update TOML files in dependency projects (without declaring dependencies)

    Update TOML files in dependency projects (without declaring dependencies)

    We use the version catalog, to share versions across multiple projects. For that we have a dependancy-managment project, which just publishs the toml file to our artifact repository.

    I now want to use the version-catalog-update plugin to update the toml file. To do so, I must define all versions in the catalog as a dependencie in my buidl.gradle.

    It would be great if I could just use the toml file and update everything that is defined in that file, no matter if it is used as a dependency or not.

    enhancement 
    opened by GeorgHoffmeyer 7
  • Ability to customise catalog file name and working with two or more catalog files

    Ability to customise catalog file name and working with two or more catalog files

    In my case I need to change catalog file name, because in project we have 3 file with different names. I can by myself reopen PR with file name customisation, but @hvisser, can you help me, can i update your plugin with ability to run it with several catalog files in a loop?

    opened by Strawely 7
  • Plugin ignores versions declared with

    Plugin ignores versions declared with "strictly"

    VersionCatalogParser doesn't handle strict versions. For example

    kotlin = { strictly = "1.7.21" }
    

    However com.github.ben-manes.versions takes such versions into account and writes them to output.

    opened by aintogarov 2
  • version 0.7.0 directly (and only partially) upgrades version numbers in libraries

    version 0.7.0 directly (and only partially) upgrades version numbers in libraries

    I have a gradle/libs.versions.toml which contains (among other entries)

    [versions]
    mockito = "4.8.0"
    
    [libraries]
    mockito-core = { module = "org.mockito:mockito-core", version.ref = "mockito" }
    mockito-junit-jupiter = { module = "org.mockito:mockito-junit-jupiter", version.ref = "mockito" }
    

    When running ./gradlew versionCatalogUpdate, it says:

    The following dependencies have later milestone versions:

    • org.mockito:mockito-junit-jupiter [4.8.0 -> 4.8.1] https://github.com/mockito/mockito

    but I end up with

    [versions]
    mockito = "4.8.0"
    
    [libraries]
    mockito-core = { module = "org.mockito:mockito-core", version.ref = "mockito" }
    mockito-junit-jupiter = "org.mockito:mockito-junit-jupiter:4.8.1"
    
    opened by nkiesel 13
  • Invalid catalog definition

    Invalid catalog definition

    Hi,

    First off, thanks for making this plugin. Has made the migration to version catalog easier even if I have to make manual adjustments.

    Just wanted to share some issues I have ran into. Depending on what dependencies you have, the name for it might not be valid, specifically, I ran into issues where dependencies ended in either plugin or versions.

    org.gradle.api.InvalidUserDataException: Invalid catalog definition:
      - Problem: In version catalog libs, alias 'com-github-ben-manes-versions' is not a valid alias.
    
    * Exception is:
    java.lang.RuntimeException: org.gradle.api.InvalidUserDataException: Invalid catalog definition:
      - Problem: In version catalog libs, alias 'com-github-ben-manes-versions' is not a valid alias.
        
        Reason: It shouldn't end with 'versions'.
        
        Possible solution: Use a different alias which doesn't end with 'bundle', 'bundles', 'plugin', 'plugins', 'version' or 'versions'.
        
    

    Looks like there are some reserved keywords that we should not be using, so wondering if there is a way to detect and provide an alternate naming? I'm not quite sure what the naming would look like.

    opened by michaelcarrano 4
Releases(v0.7.0)
  • v0.7.0(Oct 14, 2022)

  • v0.6.1(Aug 28, 2022)

    • Fixed an issue with grouping versions https://github.com/littlerobots/version-catalog-update-plugin/issues/82
    • Fix: retain order of kept versions https://github.com/littlerobots/version-catalog-update-plugin/issues/78
    • Now also available from the Gradle Plugin portal (since 0.6.0 actually 😄 )
    Source code(tar.gz)
    Source code(zip)
  • v0.6.0(Aug 22, 2022)

    • New feature: --interactive command line option to stage changes without updating the TOML file https://github.com/littlerobots/version-catalog-update-plugin/issues/63
    • Shadow (bundle) dependencies to prevent conflicts with other plugins https://github.com/littlerobots/version-catalog-update-plugin/issues/39
    • Fix an issue with unused transitive dependencies causing unwanted changes to the TOML file https://github.com/littlerobots/version-catalog-update-plugin/issues/71
    • Removed --add option. https://github.com/littlerobots/version-catalog-update-plugin/issues/69
    Source code(tar.gz)
    Source code(zip)
  • v0.5.3(Jul 29, 2022)

    • Fix an issue with unused kept pinned dependencies causing the update task to fail https://github.com/littlerobots/version-catalog-update-plugin/issues/61
    Source code(tar.gz)
    Source code(zip)
  • v0.5.2(Jul 29, 2022)

  • v0.5.1(Jun 16, 2022)

  • v0.5.0(Jun 15, 2022)

  • v0.4.0(May 15, 2022)

    • Retain comments in TOML file (with some limitations) (#18)
    • Use @pin or @keep in a comment to pin/keep specific entries
    • Fixed: Adding dependencies to a version could lead to invalid definitions or update version references in unexpected ways (#36)
    Source code(tar.gz)
    Source code(zip)
  • v0.3.1(Feb 28, 2022)

    • Support plugin declarations without a version (#22)
    • Change sortByKey to a property so it matches the docs. Note that is is a breaking change vs 0.3.0, if you were using sortyByKey = false in your kts file, you should update it to sortByKey.set(false) as documented in the README.
    Source code(tar.gz)
    Source code(zip)
  • v0.3.0(Feb 2, 2022)

    • Create option now uses the current version used in the project vs the latest version (#13)
    • Emit a warning when version declared in the catalog does not match the version used in the project (#8)
    • Version conditions (rich versions) in the version block are now handled correctly. If updates are available for a version with a condition, no updates are done automatically, in stead a message will be logged to the console. (#17)
    • The keepUnused option has been removed from the command line and the plugin configuration and is replaced by the new keep option in the versionCatalogUpdate configuration block.
    • A new pin option has been added to the versionCatalogUpdate block that allows pinning of entries that should not be automatically updated. This can work in addition with rich version definitions. (#9)
    Source code(tar.gz)
    Source code(zip)
Owner
Little Robots
Little Robots
Gradle plugin to ease Kotlin IR plugin development and usage in multimodule gradle projects

Gradle plugin to ease Kotlin IR plugin development and usage in multimodule gradle projects. Former: kotlin-ir-plugin-adapter-gradle

null 2 Mar 8, 2022
Gradle Plugin to automatically upgrade your gradle project dependencies and send a GitHub pull request with the changes

Gradle Plugin to automatically upgrade your gradle project dependencies and send a GitHub pull request with the changes

Dipien 142 Dec 29, 2022
EasyVersion is a Gradle plugin that manage your app or library version.

EasyVersion EasyVersion is a Gradle plugin that manage your app or library version. Before Downloading Create easy_version.json in your root project d

Kosh Sergani 8 Nov 26, 2022
Gradle plugin that parses version updates and assigns them to groups of people.

Notifier Gradle Plugin This gradle plugin serves the need of automating how dependencies are handles in a project. More specifically, it functions usi

Plum 4 Oct 27, 2022
A Gradle plugin for generating multi-version packet wrappers for Minecraft: JE

tinyprotocol A Gradle plugin for generating multi-version packet class wrappers for Minecraft: Java Edition. Usage plugins { id("me.kcra.tinyproto

Matouš Kučera 2 Feb 21, 2022
Gradle Plugin that allows you to decompile bytecode compiled with Jetpack Compose Compiler Plugin into Java and check it

decomposer Gradle Plugin that allows you to decompile bytecode compiled with Jetpack Compose Compiler Plugin into Java and check it How to use Run bui

Takahiro Menju 56 Nov 18, 2022
Grazel is a Gradle plugin to automate generation of valid Bazel files for a given Android/Kotlin/Java project.

Grazel Grazel stands for Gradle to Bazel. It is a Gradle plugin that enables you to migrate Android projects to Bazel build system in an incremental a

Grab 228 Jan 2, 2023
A Gradle plugin helps to proxy all the BuildConfig fields in the Android project.

Readme A Gradle plugin helps to proxy all the BuildConfig fields in the Android project. Background In android BuildConfig, We might have different co

Jack Chen 4 Oct 11, 2021
Gradle plugin for adds support for integrating Carthage dependencies into a KMM project

Gradle plugin for adds support for integrating Carthage dependencies into a KMM project

Wire Swiss GmbH 34 Sep 27, 2022
Gradle Plugin to enable auto-completion and symbol resolution for all Kotlin/Native platforms.

CompleteKotlin Gradle Plugin to enable auto-completion and symbol resolution for all Kotlin/Native platforms. What this plugin provides This zero-conf

Louis CAD 235 Jan 3, 2023
A Gradle plugin that improves the experience when developing Android apps, especially system tools, that use hidden APIs.

A Gradle plugin that improves the experience when developing Android apps, especially system tools, that use hidden APIs.

Rikka apps 124 Dec 31, 2022
Gradle Plugin for Continuous Integration of AppSweep App Testing.

This Gradle plugin can be used to continuously integrate app scanning using AppSweep into your Android app build process

Guardsquare 28 Nov 13, 2022
Gradle plugin which validates the licenses of your dependency graph match what you expect

Gradle plugin which validates the licenses of your dependency graph match what you expect

Cash App 502 Dec 31, 2022
Artifactory is a gradle plugin to assist in developing Minecraft mods that can target different modloaders.

Artifactory Artifactory is a gradle plugin to assist in developing Minecraft mods that can target different modloaders. Currently, Fabric and Forge ar

Zach Kozar 3 Dec 29, 2021
Graphfity is a Gradle Plugin which creates a dependency node diagram graph about your internal modules dependencies, specially useful if you are developing a multi-module application

Graphfity creates a dependency nodes diagram graph about your internal modules dependencies, specially useful if you are developing a multi-module app

Iván Carrasco 27 Dec 20, 2022
A Gradle Plugin to determine which modules were affected by a set of files in a commit.

A Gradle Plugin to determine which modules were affected by a set of files in a commit. One use case for this plugin is for developers who would like to only run tests in modules which have changed in a given commit.

Dropbox 491 Dec 23, 2022
A Gradle plugin to help analyse the dependency between modules and run tasks only on modules impacted by specific set of changes.

Change Tracker Plugin A Gradle plugin to help analyse the dependency between modules and run tasks only on modules impacted by specific set of changes

Ismael Di Vita 110 Dec 19, 2022
Android Gradle Plugin -- Auto Check big image and compress image in building.

McImage I will continue to update, please rest assured to use 中文文档 Android优雅的打包时自动化获取全部res资源 McImage is a Non-invasive plugin for compress all res in

smallSohoSolo 1.1k Dec 28, 2022
Gradle plugin that generates a Swift Package Manager manifest and an XCFramework to distribute a Kotlin Multiplatform library for Apple platforms.

Multiplatform Swift Package This is a Gradle plugin for Kotlin Multiplatform projects that generates an XCFramework for your native Apple targets and

Georg Dresler 262 Jan 5, 2023