Slackbot
05/22/2023, 6:45 PMRoberto Fuentes
05/22/2023, 6:47 PMpluginManagement from settings.gradle.kts
• Save the result in my ext gradle object
• Get the ext property in build.gradle.kts
Of course, this is very dirty, but wanted to double check that I would need to follow this approach if I don’t want to duplicate the function.Adam
05/22/2023, 6:48 PMbuildSrc/main/kotlin/utils.ktephemient
05/22/2023, 6:48 PMVampire
05/22/2023, 6:49 PMbuildSrc is still done before the setting script evaluation, but that is looong ago 😄Vampire
05/22/2023, 6:50 PMpluginManagement you cannot use something external in any way I'm aware of.ephemient
05/22/2023, 6:50 PMVampire
05/22/2023, 6:51 PMephemient
05/22/2023, 6:51 PMplugins block results in faster script compilation, and that could be extended to the other blocks as wellAdam
05/22/2023, 6:51 PMAdam
05/22/2023, 6:53 PMbuildscript but not pluginManagementRoberto Fuentes
05/22/2023, 6:55 PMUnless you have an ancient Gradle version whereYup, from what I’ve read this used to work previous to gradle version 6.0is still done before the setting script evaluationbuildSrc
IMO you should treat those blocks as very limited declarative DSLs, not for general code anywayAbsolutely. Don’t want to add much boilerplate. I just want to add a dependency/repo or not based on the current flavor.
a buildSrc util function works forYes! I had tested it, thanks for double checking,but notbuildscriptpluginManagement
pluginManagement goes separately
Maybe you could hack something with an init scriptTrust me, I tried!
Adam
05/22/2023, 6:57 PMChris Lee
05/22/2023, 6:58 PMephemient
05/22/2023, 6:59 PMI just want to add a dependency/repo or not based on the current flavor.that doesn't sound right, this these configure the classpath for the buildscripts as a whole
Roberto Fuentes
05/22/2023, 7:00 PMsettings.gradle.kts & classpath for build.gradle.kts rootephemient
05/22/2023, 7:01 PMRoberto Fuentes
05/22/2023, 7:03 PMclasspath and thus we add some repositories in settings.gradle.kts so these classpath can be foundRoberto Fuentes
05/22/2023, 7:04 PMephemient
05/22/2023, 7:06 PMRoberto Fuentes
05/22/2023, 7:11 PMgradle.properties in order to configure it.
Clearly by writing it, I see it doesn’t seem to be right..Roberto Fuentes
05/22/2023, 7:11 PMRoberto Fuentes
05/22/2023, 7:12 PMRoberto Fuentes
05/22/2023, 7:12 PMAdam
05/22/2023, 7:21 PM