question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

$ ./gradlew buildSrcVersions generating Libs.kt

See original GitHub issue

Update: Pull request open https://github.com/jmfayard/refreshVersions/pull/245

Context

buildSrcVersions had two features

  • buildSrc/.../Versions.kt now replaced by versions.properties and the plugin refreshVersions-core
  • buildSrc/.../Libs.kt which provided auto-completion of the dependency notations in all Gradle modules for both the Kotlin and the Groovy DSL.

The plugin de.fayard.refreshVersions now contains dependencies constants for common libraries, which is a better solution especially for single-module Gradle projects using the Kotlin DSL.

But the buildSrc/.../Libs.kt alternative is still a good one for multi-modules projects, especially if they are large (we can’t have all the libraries in mavenCentral) or of they use the Groovy DSL - for the auto-completion currently does not work there and it would be a while until they fix Android Studio and IntelliJ.

Describe the solution you’d like

Proposal is to do a resurrection of buildSrcVersions in its version 0.7.0, keeping just Libs.kt, using the place holder version _ instead of Versions.kt

https://github.com/jmfayard/refreshVersions/tree/v0.7.0/plugin

Describe alternatives you’ve considered

The task should probably be called :buildSrcLibs with an alias :buildSrcVersions to not disturb the habits.

In which Gradle plugin should the code be? In the de.fayard.refreshVersions plugin or in the existing de.fayard.buildSrcVersions plugin? Latter is cleaner, former adds more configuration to do. Should the plugin versions be synchronized with refreshVersions or independant?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:15
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
nkieselcommented, Oct 23, 2020

tl;dr: great idea!

Bringing this back would be fantastic. I work in a rather large multi-module codebase with 250+ dependencies. We are still stuck at the old “buildSrcVersion” and one of the issues holding us back is the missing auto-completion for library names in the IDE. Another aspect is that I want to have a central place where all the libs are listed. That allows to have an automatically testable rule which mandates that modules are only allowed to use named dependencies.

0reactions
LouisCADcommented, Mar 23, 2021

There’s some remaining stuff to do. I’ll try to get to it next month or before and make a release.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Gradle buildSrcVersions - gradle refreshVersions
The constants generated in Libs.kt have the same name as they had in the buildSrcVersions plugin. This makes updating to refreshVersions pretty straightforward....
Read more >
How Kotlin makes editing your Gradle build less frustrating
Better dependencies management with Gradle buildSrcVersions ... This generated code is all we need to experience the much better IDE integration provided by ......
Read more >
Building Kotlin Libraries Sample - Gradle User Manual
This guide demonstrates how to create a Kotlin library with Gradle using gradle init . You can follow the guide step-by-step to create...
Read more >
Better dependency management in Android Studio 3.5 with ...
Dependencies management with Gradle buildSrcVersions #44 ... The files {Libs,Versions}.kt have been generated with the command $ ./gradlew ...
Read more >
Takeaways from migrating a complex Android project to ...
Now the issues are gone and the IDE support for Gradle Kotlin DSL is ... gradlew buildSrcVersions and edit the Versions.kt file generated...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found