greenrobot / greenDAO

greenDAO is a light & fast ORM solution for Android that maps objects to SQLite databases.
http://greenrobot.org/greendao/
12.63k stars 2.89k forks source link

Unresolved reference: greendao in build.gradle.kts #1076

Closed hoanv810 closed 3 years ago

hoanv810 commented 3 years ago

I'm trying to migrate my greendao build script from Groovy to Kotlin DSL. Everything is going well but greendao code to set schemaVersion in build.gradle.kts:

greendao { schemaVersion = 100 }

It shows me this error message:

e: build.gradle.kts:60:5: Unresolved reference: greendao

So is there any way to make these lines of code works with Kotlin DSL?

hoanv810 commented 3 years ago

I have found a solution for this problem. Firstly, create a new gradle file with Groovy greendao.gradle greendao { schemaVersion = 100 }

Secondly, import your newly created gradle file into your build.gradle.kts: apply(from = "$rootDir/greendao.gradle")

Done :D