am using Kotlin Gradle DSL and am trying to extrac...
# gradle
m
am using Kotlin Gradle DSL and am trying to extract local module dependencies into Kotlin 
object
 and implement it in 
build.gradle.kts
 like this:
Copy code
object Modules {
    val DependencyHandlerScope.initializer: ProjectDependency
        get() = project(":initializer")
}
and implementation
Copy code
dependencies {
    implementation(Modules.initializer)
}
but it’s not working, it tries to import 
Modiles.initializer
. is it possible to do it like am trying to?
j

https://youtu.be/0FF19HJDqMo?t=818

What you want it is not possible at this moment
m
thank you
j
The only think you can do is create your own
implementation
extension function
m
didn’t think of that, I will try it
j
As I am seeing, you are trying to avoid using
project
m
yes
j
if you take a look to the project accessors feature, you can get this job done automatically and getting generated all your modules
m
just trying out of curiosity
can you explain it a bit more?
j
Copy code
// settings.gradle.kts (Gradle 7.0+)

enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")

include(":project-one")
include(":project-two")
Copy code
// build.gradle.kts

dependencies {
    implementation(projects.projectOne)
    implementation(projects.projectTwo)
}
projects.ProjectOne
and so on are generated automatically
m
thank you
🙂 1
I understand