From c93e97f10f96ea2e61a16a339e189bcc49da8c6e Mon Sep 17 00:00:00 2001 From: cpfeiffer Date: Mon, 10 Apr 2017 21:36:44 +0200 Subject: [PATCH] Shave ~600KB off the apk size with the help of a FrankenDAO We use a patched version of greenDAO's DaoGenerator with a bugfix and additional support for - composite primary keys - WITHOUT_ROWID We used to use jitpack for including our own greendao dependency into Gadgetbridge. Since jitpack does not know how to build a real greenDAO release, it will simply include all artifacts, including ftl templates etc. which we do not need at runtime at all. We could fix this by patching greenDAO build, but we actually don't need to do that, since we can simply use the pristine greenDAO runtime dependency. It will happily use our custom DAOGenerator-generated entities. --- app/build.gradle | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index ce8ef8abf..5e4b69d0e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -75,7 +75,9 @@ dependencies { compile 'com.github.pfichtner:durationformatter:0.1.1' compile 'de.cketti.library.changelog:ckchangelog:1.2.2' compile 'net.e175.klaus:solarpositioning:0.0.9' - compile 'com.github.freeyourgadget:greendao:1998d7cd2d21f662c6044f6ccf3b3a251bbad341' + // use pristine greendao instead of our custom version, since our custom jitpack-packaged + // version contains way too much and our custom patches are in the generator only. + compile 'org.greenrobot:greendao:2.2.1' compile 'org.apache.commons:commons-lang3:3.5' // compile project(":DaoCore")