From 02d532fc31b621e5d7accd21e5187879e0afa626 Mon Sep 17 00:00:00 2001 From: niushuai233 Date: Mon, 24 Oct 2022 14:08:07 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=BC=95=E5=85=A5greendao?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle | 15 ++++++++++++++- build.gradle | 12 ++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 45f16fe..2277a92 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,5 +1,6 @@ plugins { id 'com.android.application' + id 'org.greenrobot.greendao' } android { @@ -46,5 +47,17 @@ dependencies { implementation 'androidx.gridlayout:gridlayout:1.0.0' // hutool - implementation 'cn.hutool:hutool-all:5.8.8' + implementation 'cn.hutool:hutool-core:5.8.8' + + // greendao + implementation 'org.greenrobot:greendao:3.3.0' +} + +greendao { + // 数据库版本号 + schemaVersion 1 + // 生成数据库文件的目录 + targetGenDir 'src/main/java' + // 生成的数据库相关文件的包名 + daoPackage 'cc.niushuai.project.devcontrol.db.greendao.gen' } \ No newline at end of file diff --git a/build.gradle b/build.gradle index 905d3bd..fcfdf99 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,16 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. + +buildscript { + repositories { + jcenter() + google() + mavenCentral() + } + dependencies { + classpath 'org.greenrobot:greendao-gradle-plugin:3.3.0' + } +} + plugins { id 'com.android.application' version '7.1.3' apply false id 'com.android.library' version '7.1.3' apply false