https://kotlinlang.org logo
#android
Title
# android
m

Matiasdelbel

06/24/2020, 3:03 PM
Hello! I've created a
src/main
folder inside the
buildSrc
folder... Is there a way I can access to the files inside
src/main
from the
build.gradle.kts
file?
l

louiscad

06/24/2020, 3:11 PM
Yes, out of the box, except for the
build.gradle.kts
file of the
buildSrc
itself.
m

Matiasdelbel

06/24/2020, 3:15 PM
Ok! I meant to the
build.gradle.kts
 file of the 
buildSrc
... So, there isn't a way to access to the
src
content from that file 👎 😢
l

louiscad

06/24/2020, 3:16 PM
@Matiasdelbel The
build.gradle.kts
of the buildSrc defines how the files in buildSrc will be treated, so that's expectable.
👍 1
I think you want both the egg and the chicken to be the origin.
m

Matiasdelbel

06/24/2020, 3:20 PM
hahaha yeah! My idea was to split the
build.gradle.kts
, and I thought I could do it this way
l

louiscad

06/24/2020, 3:21 PM
You can make a gradle plugin (in another project) and use it in buildSrc if that's worth the effort.
m

Matiasdelbel

06/24/2020, 3:25 PM
Yes, I was able to do that. And also, I was able to define the plugin inside the
src/main
on the
buildSrc
of the same project. But I can't find the way to do the same with the dependencies...
I want to move all the dependencies out of the build.gradle file
l

louiscad

06/24/2020, 3:26 PM
Why, and where do you want to put them?
m

Matiasdelbel

06/24/2020, 3:33 PM
Where: I don't know 😆 Why: Some plugins versions need to be consistent with the dependencies that then I added to the modules. For example hilt:
implementation("com.google.dagger:hilt-android-gradle-plugin:2.28-alpha")
When a stable version of hilt is been released, I only want to change a single file
l

louiscad

06/24/2020, 3:36 PM
I think you'd greatly benefit from #gradle-refresh-versions that does exactly that and also finds the updated dependencies. I need to publish a (half breaking) release this weekend with some improvements, should I let you know when it's up?
m

Matiasdelbel

06/24/2020, 3:45 PM
Yes, please! Thanks... If I want to use it , must all my dependencies be on a
build.gradle.kts
?
l

louiscad

06/24/2020, 3:47 PM
Specified there, I think it's preferrable. Now, the string values can be defined elsewhere, including in a gradle plugin, and the versions can be defined in another place.
👍 1
m

Matiasdelbel

06/24/2020, 3:51 PM
Ok, thanks for the answer! And please let me know when you release a new version 🙂
l

louiscad

06/24/2020, 3:52 PM
I set up a reminder 🙂
Hi @Matiasdelbel! I spent some time updating the docs, and making a few changes this weekend, but I didn't have the time to publish a plain release yet (it requires to write the changelog and a few other things). There's a dev version though (0.9.5-dev-003) that you can use. All the new docs for setup (including for dev versions) and usage are reachable from there: https://github.com/jmfayard/refreshVersions/tree/378be818c3e2583582214ad41309063ebb01f0ca Please, let me know if you have any questions or encounter any friction point.
m

Matiasdelbel

06/29/2020, 12:32 PM
Great! Thanks, Louis!