-
-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
versionsOnlyMode for single-module Gradle projects #55
Comments
Merged
jmfayard
pushed a commit
that referenced
this issue
Sep 3, 2019
jmfayard
pushed a commit
that referenced
this issue
Sep 3, 2019
jmfayard
pushed a commit
that referenced
this issue
Sep 4, 2019
This was referenced Sep 4, 2019
jmfayard
pushed a commit
that referenced
this issue
Sep 5, 2019
This was referenced Sep 11, 2019
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Status:
Improved and now part of "gradle :refreshVersions" generates gradle.properties with versions and available updates
Status: released in v0.5.0
Context: my Gradle plugin buildSrcVersions extends the gradle-versions-plugin. It scan your Gradle builds to search for available updates to your dependencies and generate code to make it extra-convenient. This new feature is designed for simple (single-module) Gradle projects for which it provides an easy solution to a simple problem.
New feature: versionsOnlyMode
The plugin can now be configured like this
or
versionsOnlyMode
is an enum:KOTLIN_VAL
will generateval okhttp = "3.2.0"
KOTLIN_OBJECT
will generate the same file asVersions.kt
in the default modeGROOVY_DEF
will generatedef okhttp = '3.2.0'
GROOVY_EXT
will generateext { okhttp = '3.2.0' }
GRADLE_PROPERTIES
will generateokhttp=3.2.0
First run
The first time you run
./gradle buildSrcVersions
, it will print something like:Copy/paste this snippet in
versionsOnlyFile
at whichever place makes sense for your build.Use those versions like you already do.
Dependency updates
Next time you want to search for dependencies updates, run again
./gradle buildSrcVersions,
The plugin will regenerate the block
<buildSrcVersions>....</buildSrcVersions>
insidebuildFile
It's the same approach that works well for the default mode of the plugin: a comment inform you about the update. You can update the build:
(Press
Delete
to update.)Context and Motivation
The basic idea of the
Gradle buildSrcVersions
plugin has been until now to generate two files,Libs.kt
andVersions.kt
inside thebuildSrc
I'm coming from an android background where the build is by default multi-modules and where the Android Gradle Plugin in particular is very complex. In this context, the
buildSrc
is an elegant and powerful tool to maintain developer sanity. It solves thecomplex things should be possible
part.As I have migrated to the backend though, I now have much simpler, single-module Gradle builds. Sure, I can still extract my dependencies to
buildSrc
, but why, you may ask, is it useful to extract there my dependencies used exactly oncer?The correct answer: It is useless. I only need the
Versions
The
versionsOnlyMode
is the attempt to get right the part:Simple things should be easy part
The text was updated successfully, but these errors were encountered: