repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'org.greenrobot:greendao-gradle-plugin:3.2.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
1.jpg
2
apply plugin: 'org.greenrobot.greendao'
greendao {
//數(shù)據(jù)庫(kù)schema版本笨鸡,也可以理解為數(shù)據(jù)庫(kù)版本號(hào)
schemaVersion 2
//設(shè)置DaoMaster 败玉、DaoSession、Dao包名
daoPackage 'com.weilong.lw.mygreendaodemo.db'
//設(shè)置DaoMaster 瞳遍、DaoSession、Dao目錄
targetGenDir 'src/main/java'
//設(shè)置生成單元測(cè)試目錄
// targetGenDirTest
//設(shè)置自動(dòng)生成單元測(cè)試用例
// generateTests
}
導(dǎo)入依賴(lài)
compile 'org.greenrobot:greendao:3.2.2'
5.jpg