I'm writing a plugin using the build convention ap...
# gradle
f
I'm writing a plugin using the build convention approach and I want to add a dependency to a module. For a library dependency, I can do this
Copy code
dependencies {
            val bom = libs.findLibrary("androidx-compose-compose-bom").get()
            add("implementation", platform(bom))
        }
what's the syntax to add a dependency to a module, the equivalent to
implementation(project(":core:coroutines:coroutines-api"))
?
after some trial and error it seems that this is the syntax
Copy code
val projectPath = requireNotNull(project.findProject(<path here>))
        dependencies.add("implementation", projectPath)
f
thanks, but unless I'm missreading your snippet, you only have library dependencies, no dependencies on other modules in your app
y
Ah. your question was how to get project instance on plugin. Yes. you can use
Project.findProject()
, or just use
Project.project()
, too.