Browse Source

增加dokit工具

zk 1 year ago
parent
commit
7fc62cdde2
3 changed files with 19 additions and 0 deletions
  1. 7 0
      app/build.gradle
  2. 10 0
      app/src/main/java/com/datarecovery/master/App.java
  3. 2 0
      build.gradle

+ 7 - 0
app/build.gradle

@@ -2,6 +2,7 @@ plugins {
     id 'com.android.application'
     id 'dagger.hilt.android.plugin'
     id 'stringfog'
+    id 'com.didi.dokit'
 }
 
 def LOCAL = "local", TEST = "test", PROD = "prod"
@@ -229,4 +230,10 @@ dependencies {
     //网易七鱼客服
     implementation 'com.qiyukf.unicorn:unicorn:9.2.0'
 
+    //dokit
+    debugImplementation("io.github.didi.dokit:dokitx:$rootProject.dokit_version")
+            {
+                exclude group: 'com.google.zxing', module: 'core'
+            }
+    releaseImplementation("io.github.didi.dokit:dokitx-no-op:$rootProject.dokit_version")
 }

+ 10 - 0
app/src/main/java/com/datarecovery/master/App.java

@@ -11,6 +11,7 @@ import com.datarecovery.master.sdk.gravity.GravityHelper;
 import com.datarecovery.master.sdk.qiyu.QiYuHelper;
 import com.datarecovery.master.sdk.umeng.UmengHelper;
 import com.datarecovery.master.utils.ToastUtil;
+import com.didichuxing.doraemonkit.DoKit;
 
 import java.util.Objects;
 
@@ -40,6 +41,15 @@ public class App extends BaseApplication {
     public void onCreate() {
         super.onCreate();
         checkServerRuntime();
+        initDokit();
+    }
+
+    private void initDokit() {
+        if (!BuildConfig.DEBUG) {
+            return;
+        }
+        new DoKit.Builder(this)
+                .build();
     }
 
     private void checkServerRuntime() {

+ 2 - 0
build.gradle

@@ -27,6 +27,7 @@ buildscript {
         recyclerview_version = "1.3.0"
         constraintlayout_version = "2.1.4"
         stringfog_verstion = "4.0.1"
+        dokit_version = "3.5.0"
     }
 
     dependencies {
@@ -37,6 +38,7 @@ buildscript {
 
         classpath 'com.github.megatronking.stringfog:gradle-plugin:4.0.1'
         classpath 'com.github.megatronking.stringfog:xor:4.0.1'
+        classpath "io.github.didi.dokit:dokitx-plugin:${dokit_version}"
     }
 
     configurations.configureEach {