you can use buildSrc to declare varibales that can be used within plugins block
Nikky
06/22/2019, 4:30 PM
i think you can also access varables from gradle.properties files there
l
Luke
06/22/2019, 9:55 PM
oh... ok. That's funny. I can access constants from buildSrc if they are in the root package since I don't have to import them.
n
Nikky
06/22/2019, 10:12 PM
i usualöly put them in something like Constants.kt and if i need to structure many constants i group whtm in objects
e
efemoney
06/27/2019, 2:57 AM
@Luke You can also access them if they are in the
org.gradle.kotlin.dsl
package. JVM takes care of importing the so-called default (ie empty) package implicitly, while the gradle kotlin DSL implicitly imports all declarations in
org.gradle.kotlin.dsl
. Thats why the extensions defined in that package work outta the box.