Skip to content

Better dependencies management with Gradle, IntelliJ & Android Studio

License

Notifications You must be signed in to change notification settings

luca992/refreshVersions

 
 

Repository files navigation

de.fayard.buildSrcVersions

Maven Central Kotlinlang Slack Code Triage GitHub GitHub issues GitHub pull requests

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.

Installation

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

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.

carbon Libs Versions

Requirements

  • Kotlin, JVM and Android projects.

  • Gradle 4.3+, 5+, 6+

  • The IDE integration works

    • for both build.gradle (Groovy) and build.gradle.kts (Kotlin) files.

    • in IntelliJ IDEA 2018.03 and better

    • in Android Studio 3.5 and better.

Exciting new features coming!

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

versions gradle properties

2) The plugin de.fayard.dependencies will provide a faster way to add new dependencies

68317452 6e70ec00 00bb 11ea 84c4 94d3ef0fb86f

3) The plugin com.louiscad.splitties will provide Android specific features

Should I use refreshVersions today?

No, we are not ready yet.

Design goals

  • 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.

FAQ

Questions? Look at the existing issues, then ask your own.

IDE Integration
Figure 1. FAQ

Changelog

If you migrate from an older version, two configuration options have been removed: rejectedVersionKeywords and useFdqnFor.

Contributing

  • 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.

Acknowledgments

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

About

Better dependencies management with Gradle, IntelliJ & Android Studio

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Kotlin 100.0%