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.
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.
Edit your root build.gradle(.kts)
file
We recommend to use the plugins
block:
buildscript {
//...
}
plugins {
id("de.fayard.buildSrcVersions") version "0.7.0"
}
// Don't put any code before the buildscripts {} and plugins {} block
Updating Gradle is usually a good idea. You get less bugs, more features and more build speed, and it’s as simple as this:
$ ./gradlew wrapper --gradle-version 5.6.4
The task :buildSrcVersions
is well suited for complex multi-module Gradle projects: Android, Kotlin multi-platform, …
It generates this kind of code inside the Gradle buildSrc
module.
-
Kotlin, JVM and Android projects.
-
Gradle 4.3+, 5+, 6+
-
The IDE integration works
-
for both
build.gradle
(Groovy) andbuild.gradle.kts
(Kotlin) files. -
in IntelliJ IDEA 2018.03 and better
-
in Android Studio 3.5 and better.
-
Not only code, but also good documentation can help you upgrade an old project to the latest and greatest.
I have a series of articles called Built with Gradle
:
You can follow me at https://dev.to/jmfayard
buildSrcVersions
will be replaced by three better plugins
1) The plugin de.fayard.refreshVersions
and its task gradle refreshVersions
will provide a better alternative to buildSrc/…/Versions.kt
2) The plugin de.fayard.dependencies
will provide a faster way to add new dependencies
3) The plugin com.louiscad.splitties
will provide Android specific features
No, we are not ready yet.
-
First, to do no harm. The plugin should never update itself or otherwise break an existing build. The plugin should do nothing unless it’s explicitly called.
-
Be Lazy. Use code generation to avoid writing tedious code manually. Find available updates automatically instead of googling them. The plugin should do the right thing by default, no configuration should be mandatory. Leverage IDE tooling support (auto-completion, …).
-
Be Humble. Render to the programmer the things that are the programmer’s. This include using the generated code and updating the dependencies.
Questions? Look at the existing issues, then ask your own.
See CHANGELOG.md
If you migrate from an older version, two configuration options have been removed: rejectedVersionKeywords
and useFdqnFor
.
-
This project is licensed under the MIT License. See LICENSE.txt
-
Explain your use case and start the discussion before your submit a pull-request
-
Your feature request or bug report may be better adressed by the parent plugin. Check out ben-manes/gradle-versions-plugin.
-
CONTRIBUTING.md describes the process for submitting pull requests.
Gradle and JetBrains have made this plugin possible
by working on improving the IDE support for Kotlin code from the buildSrc
module.
This plugin embraces and extends Ben Manes’s wonderful "Versions" plugin.
The Kotlin code generation is powered by Square’s Kotlinpoet