https://kotlinlang.org logo
Docs
Join the conversationJoin Slack
Channels
100daysofcode
100daysofkotlin
100daysofkotlin-2021
advent-of-code
aem
ai
alexa
algeria
algolialibraries
amsterdam
android
android-architecture
android-databinding
android-studio
androidgithubprojects
androidthings
androidx
androidx-xprocessing
anime
anko
announcements
apollo-kotlin
appintro
arabic
argentina
arkenv
arksemdevteam
armenia
arrow
arrow-contributors
arrow-meta
ass
atlanta
atm17
atrium
austin
australia
austria
awesome-kotlin
ballast
bangladesh
barcelona
bayarea
bazel
beepiz-libraries
belgium
berlin
big-data
books
boston
brazil
brikk
budapest
build
build-tools
bulgaria
bydgoszcz
cambodia
canada
carrat
carrat-dev
carrat-feed
chicago
chile
china
chucker
cincinnati-user-group
cli
clikt
cloudfoundry
cn
cobalt
code-coverage
codeforces
codemash-precompiler
codereview
codingame
codingconventions
coimbatore
collaborations
colombia
colorado
communities
competitive-programming
competitivecoding
compiler
compose
compose-android
compose-desktop
compose-hiring
compose-ios
compose-mp
compose-ui-showcase
compose-wear
compose-web
connect-audit-events
corda
cork
coroutines
couchbase
coursera
croatia
cryptography
cscenter-course-2016
cucumber-bdd
cyprus
czech
dagger
data2viz
databinding
datascience
dckotlin
debugging
decompose
decouple
denmark
deprecated
detekt
detekt-hint
dev-core
dfw
docs-revamped
dokka
domain-driven-design
doodle
dsl
dublin
dutch
eap
eclipse
ecuador
edinburgh
education
effective-kotlin
effectivekotlin
emacs
embedded-kotlin
estatik
event21-community-content
events
exposed
failgood
fb-internal-demo
feed
firebase
flow
fluid-libraries
forkhandles
forum
fosdem
fp-in-kotlin
framework-elide
freenode
french
fritz2
fuchsia
functional
funktionale
gamedev
ge-kotlin
general-advice
georgia
geospatial
german-lang
getting-started
github-workflows-kt
glance
godot-kotlin
google-io
gradle
graphic
graphkool
graphql
graphql-kotlin
graviton-browser
greece
grpc
gsoc
gui
hackathons
hacktoberfest
hamburg
hamkrest
helios
helsinki
hexagon
hibernate
hikari-cp
hire-me
hiring
hongkong
hoplite
http4k
hungary
hyderabad
image-processing
india
indonesia
inkremental
intellij
intellij-plugins
intellij-tricks
internships
introduce-yourself
io
ios
iran
israel
istanbulcoders
italian
jackson-kotlin
jadx
japanese
jasync-sql
java-to-kotlin-refactoring
javadevelopers
javafx
javalin
javascript
jdbi
jhipster-kotlin
jobsworldwide
jpa
jshdq
juul-libraries
jvm-ir-backend-feedback
jxadapter
k2-early-adopters
kaal
kafka
kakao
kalasim
kapt
karachi
karg
karlsruhe
kash_shell
kaskade
kbuild
kdbc
kgen-doc-tools
kgraphql
kinta
klaxon
klock
kloudformation
kmdc
kmm-español
kmongo
knbt
knote
koalaql
koans
kobalt
kobweb
kodein
kodex
kohesive
koin
koin-dev
komapper
kondor-json
kong
kontent
kontributors
korau
korean
korge
korim
korio
korlibs
korte
kotest
kotest-contributors
kotless
kotlick
kotlin-asia
kotlin-beam
kotlin-by-example
kotlin-csv
kotlin-data-storage
kotlin-foundation
kotlin-fuel
kotlin-in-action
kotlin-inject
kotlin-latam
kotlin-logging
kotlin-multiplatform-contest
kotlin-mumbai
kotlin-native
kotlin-pakistan
kotlin-plugin
kotlin-pune
kotlin-roadmap
kotlin-samples
kotlin-sap
kotlin-serbia
kotlin-spark
kotlin-szeged
kotlin-website
kotlinacademy
kotlinbot
kotlinconf
kotlindl
kotlinforbeginners
kotlingforbeginners
kotlinlondon
kotlinmad
kotlinprogrammers
kotlinsu
kotlintest
kotlintest-devs
kotlintlv
kotlinultimatechallenge
kotlinx-datetime
kotlinx-files
kotlinx-html
kotrix
kotson
kovenant
kprompt
kraph
krawler
kroto-plus
ksp
ktcc
ktfmt
ktlint
ktor
ktp
kubed
kug-leads
kug-torino
kvision
kweb
lambdaworld_cadiz
lanark
language-evolution
language-proposals
latvia
leakcanary
leedskotlinusergroup
lets-have-fun
libgdx
libkgd
library-development
linkeddata
lithuania
london
losangeles
lottie
love
lychee
macedonia
machinelearningbawas
madrid
malaysia
mathematics
meetkotlin
memes
meta
metro-detroit
mexico
miami
micronaut
minnesota
minutest
mirror
mockk
moko
moldova
monsterpuzzle
montreal
moonbean
morocco
motionlayout
mpapt
mu
multiplatform
mumbai
munich
mvikotlin
mvrx
myndocs-oauth2-server
naming
navigation-architecture-component
nepal
new-mexico
new-zealand
newname
nigeria
nodejs
norway
npm-publish
nyc
oceania
ohio-kotlin-users
oldenburg
oolong
opensource
orbit-mvi
osgi
otpisani
package-search
pakistan
panamá
pattern-matching
pbandk
pdx
peru
philippines
phoenix
pinoy
pocketgitclient
polish
popkorn
portugal
practical-functional-programming
proguard
prozis-android-backup
pyhsikal
python
python-contributors
quasar
random
re
react
reaktive
realm
realworldkotlin
reductor
reduks
redux
redux-kotlin
refactoring-to-kotlin
reflect
refreshversions
reports
result
rethink
revolver
rhein-main
rocksdb
romania
room
rpi-pico
rsocket
russian
russian_feed
russian-kotlinasfirst
rx
rxjava
san-diego
science
scotland
scrcast
scrimage
script
scripting
seattle
serialization
server
sg-user-group
singapore
skia-wasm-interop-temp
skrape-it
slovak
snake
sofl-user-group
southafrica
spacemacs
spain
spanish
speaking
spek
spin
splitties
spotify-mobius
spring
spring-security
squarelibraries
stackoverflow
stacks
stayhungrystayfoolish
stdlib
stlouis
strife-discord-lib
strikt
students
stuttgart
sudan
swagger-gradle-codegen
swarm
sweden
swing
swiss-user-group
switzerland
talking-kotlin
tallinn
tampa
teamcity
tegal
tempe
tensorflow
terminal
test
testing
testtestest
texas
tgbotapi
thailand
tornadofx
touchlab-tools
training
tricity-kotlin-user-group
trójmiasto
truth
tunisia
turkey
turkiye
twitter-feed
uae
udacityindia
uk
ukrainian
uniflow
unkonf
uruguay
utah
uuid
vancouver
vankotlin
vertx
videos
vienna
vietnam
vim
vkug
vuejs
web-mpp
webassembly
webrtc
wimix_sentry
wwdc
zircon
Powered by Linen
refreshversions
  • n

    Nikky

    12/06/2020, 4:52 PM
    @Emil Butiri
    plugins {
        id("de.fayard.refreshVersions") 
    }
    
    // workaround for <https://github.com/jmfayard/refreshVersions/issues/265>
    @OptIn(de.fayard.refreshVersions.core.internal.InternalRefreshVersionsApi::class)
    val versionsMap = de.fayard.refreshVersions.core.internal.RefreshVersionsConfigHolder.readVersionProperties()
    kotlinCompilerVersion = versionsMap["version.kotlin"]
    e
    • 2
    • 1
  • n

    Nikky

    12/06/2020, 4:54 PM
    you can obviously also parse the properties file without using internal api of refreshVersions its just a little bit longer code
    l
    e
    • 3
    • 2
  • r

    Rafs

    12/28/2020, 10:32 AM
    is there a refreshVersion constant for the core desugaring library depencency?
    l
    • 2
    • 1
  • j

    Johan Reitan

    01/20/2021, 8:37 AM
    Hi, and thanks for this great tool! I'm trying to add some grouping rules for a couple of androidx libraries, but it seems to me that they are ignored. Here's my rules file:
    androidx.compose.*:*
    ^^^^^^^^^^^^^^^^
    
    androidx.paging:paging-compose
    ^^^^^^^^^^^^^^^.       ^^^^^^^
    
    com.google.dagger:hilt-compiler
        ^^^^^^^^^^^^^.^^^^
    Note that the last entry with the
    hilt-compiler
    is working fine, which indicates to me that I've set this up correctly. When I run gradle sync or refreshVersions, I get this in my `versions.properties`:
    version.androidx.compose.foundation=1.0.0-alpha10
    
    version.androidx.compose.material=1.0.0-alpha10
    
    version.androidx.compose.runtime=1.0.0-alpha10
    
    version.androidx.compose.ui=1.0.0-alpha10
    
    version.androidx.paging=2.1.2
    But I was expecting this:
    version.androidx.compose=1.0.0-alpha10
    
    version.androidx.paging=2.1.2
    
    version.androidx.paging.compose=1.0.0-alpha05
    Is there something wrong with my androidx rules, or do they conflict with the built-in ones maybe? Or have I misunderstood this feature completely? 😅
    n
    l
    • 3
    • 11
  • g

    gvetri

    01/22/2021, 3:37 PM
    Hi everyone, thanks for the time you have taken to create this tool 🙌. I'm trying to add Koin to my project using refreshVersions, but I'm unable to find the ID. I already found a few PR closed about adding koin 🤔 It's possible to add custom dependencies that don't exist on refresh versions? I didn't understand that part from the docs 😅
    l
    • 2
    • 7
  • g

    gammax

    01/22/2021, 9:37 PM
    Hey hey 👋 Just noticed that several pages on the website are 404-ing. Specifically al those under contributing (such as https://jmfayard.github.io/refreshVersions/contributing/code_of_conduct/).
    🔜 1
    l
    • 2
    • 3
  • e

    elect

    02/07/2021, 11:00 AM
    also, regarding writing the dependencyNotation, I went a step further by completing skipping the artifact name, ie
    implementation("org.koin:koin-core")
    , have you considered something like this? Edit: just saw this is actually resolving anyway, but I have no idea how..
    l
    • 2
    • 2
  • e

    elect

    02/07/2021, 11:01 AM
    also 2, what about importing all at once a set of dependencies? Instead of
    implementation(Square.okHttp3.loggingInterceptor)
        implementation(Square.okHttp3.mockWebServer)
        implementation(Square.okHttp3.okHttp)
        implementation(Square.retrofit2.converter.moshi)
        implementation(Square.retrofit2.retrofit)
    just
    implementation(Square.coreSet)
    or something similar
    l
    • 2
    • 1
  • e

    elect

    02/07/2021, 11:07 AM
    also 3, do you suggest me to use the
    migrateToRefreshVersionsDependenciesConstants
    task to port the pom linked above?
    l
    • 2
    • 2
  • s

    SimonT

    02/12/2021, 9:01 PM
    Hello, I just wanted to thank you for working in this project and tell you that I have been using the buildSrcVersions for around a year and I have been really happy with that. Now I will try to move to the refresh versions. I wanted to ask if you know of any example or guide on how to move from a groovy gradle Android project to the refresh versions. I have been working with the buildSrcVersions and I thought it would be similar, but I was having hard time finding how write in kotlin some things, like apply Apollo graph ql plugins, Google maps, and firebase crashalitics plugin and also I was using a maven library where I had to specify user and password of my credentials so I wasn't sure how to do it with kts.
    m
    • 2
    • 5
  • d

    dave

    02/20/2021, 10:04 AM
    Hi - I might be being a little blind and not looking properly, but is there a way to filter the refreshVersions from not picking up alpha/RCs/nightlies?
    l
    • 2
    • 1
  • n

    Nikky

    03/16/2021, 1:21 AM
    so i am guessing .. something in the gradle plugin repo died
    l
    • 2
    • 1
  • n

    Nikky

    03/25/2021, 9:38 AM
    Centralized dependency versions
    in gradle 7.x + looks interesting.. i am guessing refreshVersions will integrate into that? https://docs.gradle.org/7.0-rc-1/release-notes.html
    😍 1
    l
    • 2
    • 1
  • s

    SimonT

    03/29/2021, 1:27 PM
    const val hilt_android: String = "com.google.dagger:hilt-android:" + Versions.com_google_dagger
    
        const val hilt_android_compiler: String = "com.google.dagger:hilt-android-compiler:" +
                Versions.com_google_dagger
    
        const val hilt_android_gradle_plugin: String = "com.google.dagger:hilt-android-gradle-plugin:" +
                Versions.com_google_dagger
    
        const val hilt_android_testing: String = "com.google.dagger:hilt-android-testing:" +
                Versions.com_google_dagger
    
        const val hilt_compiler: String = "androidx.hilt:hilt-compiler:" + Versions.androidx_hilt
    
        const val hilt_lifecycle_viewmodel: String = "androidx.hilt:hilt-lifecycle-viewmodel:" +
                Versions.androidx_hilt
    const val com_google_dagger: String = "2.28.1-alpha"
    
        const val androidx_hilt: String = "1.0.0-alpha01"
    l
    • 2
    • 1
  • s

    SimonT

    03/29/2021, 1:29 PM
    It automatically takes all as dagger version
    • 1
    • 1
  • p

    pgreze

    04/22/2021, 1:46 AM
    Hello folks, just to let you know that I converted 1 personal project to refreshVersions recently. Compared with my previous trial last year, not sure what changed but it was really smooth this time 👍 Thx for the hard work 👏
    🙂 2
    n
    • 2
    • 5
  • p

    pgreze

    04/22/2021, 5:32 AM
    About https://kotlinlang.slack.com/archives/CP5659EL9/p1619056212006400?thread_ts=1619055976.006300&amp;cid=CP5659EL9 I’m now starting to migrate a bigger project and I’m really not looking forward to do each of them, one by one… Is there a way to
    generate the versions.properties for all dependencies used in the project
    , and just let me edit files without assistance?
    l
    • 2
    • 4
  • d

    dave08

    04/28/2021, 9:46 AM
    I guess there's no way to manage kotlin (or other plugin) versions with refreshVersions (or is there)?
    p
    • 2
    • 8
  • j

    jmfayard

    05/07/2021, 8:13 AM
    I will have a look later today
    d
    • 2
    • 7
  • d

    dave

    05/07/2021, 8:14 AM
    BTW - the sample-multi-module example also fails (when hardcoding the version number to 0.9.7) with:
    * Where:
    Settings file '/Users/david/dev/misc/refreshVersions/sample-multi-modules/settings.gradle.kts' line: 16
    
    * What went wrong:
    An exception occurred applying plugin request [id: 'de.fayard.refreshVersions', version: '0.9.7']
    > Failed to apply plugin 'de.fayard.refreshVersions'.
       > class org.gradle.initialization.DefaultSettings_Decorated cannot be cast to class org.gradle.api.Project (org.gradle.initialization.DefaultSettings_Decorated and org.gradle.api.Project are in unnamed module of loader org.gradle.internal.classloader.VisitableURLClassLoader @5b275dab)
    l
    • 2
    • 1
  • d

    dave08

    05/13/2021, 9:18 AM
    Is there support for Gradle 7's new catalogs? Could
    _
    be used there too as a version and be managed by refreshVersions?
    l
    • 2
    • 6
  • n

    Nikky

    05/13/2021, 3:18 PM
    i just upgraded to 0.10.0 too.. i wish the
    FeatureFlag
    were accessible from within the
    FeatureFlagExtension
    somehow.. so that there is no imports needed getting idea to parse the configuration initially.. to even get the IDE to help was a bit more challenging because of that missing import but i guess i am nitpicking
    l
    • 2
    • 3
  • l

    louiscad

    05/14/2021, 10:42 AM
    📢📢📢 Hello folks! I'm very happy for the 0.10.0 version, released yesterday morning. https://twitter.com/Louis_CAD/status/1393152173555470344?s=20 See the thread for the thanks to pair-programmers, contributors (like @Nikky), and to my sponsors. 🙏
    ❤️ 2
    m
    • 2
    • 5
  • j

    Jon Miller

    05/16/2021, 5:39 PM
    Tried to update to 0.10 yesterday but it failed so sticking to 0.9. anyone else having issues with 0.10?
    l
    • 2
    • 5
  • p

    pgreze

    05/17/2021, 7:22 AM
    👋 I’m finishing migrating a “large” project to refreshVersions and I’m wondering what’s the best way to add support for libraries I’m using in buildSrc. I’ve seen this website page about just declaring refreshVersion in
    buildSrc/settings.gradle.kts
    but it just didn’t work, whatever the expected behavior. I ended-up with this file in declaration in `buildSrc/settings.gradle.kts`:
    val versions = loadProperties(projectDir.resolve("../versions.properties").toString())
    dependencies {
        val refVerImpl: (String, String) -> Unit = { artifact, version ->
            implementation("$artifact:${versions["version.$version"]}")
        }
        // ...
        refVerImpl("com.github.triplet.gradle:play-publisher", "com.github.triplet.gradle..play-publisher")
    }
    and in the root `build.gradle.kts`:
    @Suppress("GradlePluginVersion") buildscript {
        repositories {
            gradlePluginPortal()
            google()
            mavenCentral()
        }
        dependencies { // Allowing to populate versions.properties with buildSrc dependencies
            classpath("com.android.tools.build:gradle:_")
            classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:_")
            classpath("com.github.triplet.gradle:play-publisher:_")
        }
    }
    Is there a better alternative approach I could use for buildSrc dependencies?
    l
    • 2
    • 3
  • k

    knthmn

    06/03/2021, 4:33 AM
    I am getting
    Cannot get version candidates with an empty fetchers list.
    Details in thread
    l
    • 2
    • 11
  • d

    dave08

    06/03/2021, 12:10 PM
    In an android project, when using
    _
    for the gradle android plugin version, AS makes me insert
    @Suppress("GradlePluginVersion")
    and still shows it as red... how can I get rid of the warning?
    j
    • 2
    • 1
  • n

    Nikky

    06/07/2021, 12:15 PM
    @louiscad i made a fix for that.. by detecting if it was initialized already and if it is a included build it does not override the
    versionsFile
    and such before it would overwrite and the parent would write to the included one
    l
    • 2
    • 6
  • n

    Nikky

    06/08/2021, 7:47 AM
    the only thing left is that idea sync is now broken in the sample-groovy from what i can tell it calls
    bootstrap
    for the buildSrc., succeeds and then calls it again and that somehow happens in a context where the config holder has no configs i tried just not removing them , intentionally leaking i guess.. but that did not fix it either.. so i think it executes it in a seperate classpath
    l
    • 2
    • 7
  • n

    Nikky

    06/08/2021, 12:03 PM
    i guess there is no way to change
    versionFor
    to add
    Project
    as a receiver in groovy code without changes to usages ? or some way to extract which buildscript the call came from with reflection ?
    l
    • 2
    • 13
Powered by Linen
Title
n

Nikky

06/08/2021, 12:03 PM
i guess there is no way to change
versionFor
to add
Project
as a receiver in groovy code without changes to usages ? or some way to extract which buildscript the call came from with reflection ?
l

louiscad

06/08/2021, 12:28 PM
Wait, there's a way to have receiver syntax in Groovy DSL?
Regardless, we can do a lot of magic as a settings plugin, including automatically migrating.
n

Nikky

06/08/2021, 1:12 PM
well this is code that would be in your
build.gradle
file
❓ 1
but honestly.. maybe just marking the old function as
@Deprecated
wit ha proper
ReplaceWith
might be enough
not sure how good the IDE integration is for groovy code.. i only know it never worked for me
l

louiscad

06/08/2021, 1:13 PM
Wait, there's a way to have receiver syntax in Groovy DSL?
n

Nikky

06/08/2021, 1:14 PM
aparently there is such a language feature in groovy.. but not sure if we have access to it..
l

louiscad

06/08/2021, 1:14 PM
I think it only works within classes.
n

Nikky

06/08/2021, 1:15 PM
https://dzone.com/articles/groovy-goodness-adding-extra
An extension module is a JAR file with classes that provide extra methods to existing other classes like in the JDK or third-party libraries. Groovy uses this mechanism to add for example extra methods to the
File
class.
so.. if we set this up right.. maybe we can provide
versionFor
extensions on
Project
seems like it needs a service entry in META-INF for discovery
l

louiscad

06/08/2021, 1:17 PM
Far from high priority for refreshVersions, but if you want and think you can make it work without drawbacks, feel free to send a PR.
n

Nikky

06/08/2021, 1:18 PM
i am only considering this because it would not break existing
0.10.0
groovy buildscripts
but .. all of that might not work on gradle buildscripts anyways..
View count: 3