pablisco / auto-module

A Gradle plugin to generate a module graph and include them modules
MIT License
110 stars 11 forks source link

Module name in camelCase #7

Open boguszpawlowski opened 4 years ago

boguszpawlowski commented 4 years ago

I am using AutoModule v0.12 with android gradle plugin v4.0.0

settings.gradle.kts:

plugins {
    id("com.pablisco.gradle.automodule") version "0.12"
}

Code generated in modules.kt for module with name common-db:

val commonDb: CommonDb = CommonDb
object CommonDb : AutoModuleDependency by autoModuleDependency(":common-db")

Used in app level build.gradle (groovy dsl):

Implementation project(autoModules.commonDb)

Error: Project with path ':commonDb' could not be found in project ':app'.

Thus my question: are module names converted to camelCase, or maybe im using it in wrong way? Let me know if you need more info ;)

pablisco commented 4 years ago

Oh, that's a good one. In groovy, I was being lazy and just take the name of the property: https://github.com/pablisco/auto-module/blob/master/plugin/src/main/kotlin/com/pablisco/gradle/automodule/GroovyAutoModuleDependency.kt#L13

I'll see how to fix it in a more future proof way.

In the meantime, you should be able to import it by doing:

implementation project(autoModules.'common-db')

I haven't tested it but should do the trick for now 🤞