I'm trying give dependencies to every subproject w...
# gradle
m
I'm trying give dependencies to every subproject with
subprojects { dependencies { implementation(kotlin("stdlib-jdk8")) }}
. However, when I do that, I get this from Gradle:
Unresolved reference: implementation
. Playing around with
project.the<DependencyHandlerScope>().run { /* stuff here */}
produces the same result. Any ideas?
o
implementation
is a generated accessor, it may not exist but intellij likely thinks it does due to either sharing the script dependencies wrong or caching see https://docs.gradle.org/current/userguide/kotlin_dsl.html#type-safe-accessors
m
yeah, that's why I tried explicitly accessing the right type via
project.the...
. 🤷‍♂️
o
but they're not defined on the type
they're extensions
and if they don't get generated, you can't use them
m
I see.
For now I'm just doing that stuff via a
.gradle
(not
kts
) script I import, which is an acceptable workaround, but if you know of a way to make the relevant codegen work inside
subprojects
, I'm all ears
j
Use
"implementation"(...)
instead of
implementation(...)