Sfoglia il codice sorgente

feature:优化版本号的拼接

#Suyghur 4 anni fa
parent
commit
75411466a5

+ 2 - 2
README.md

@@ -2,8 +2,8 @@
 
 an application performance monitor framework of Android
 
-[Github](https://github.com/Suyghur/Dolin)
-[Gitee](https://gitee.com/suyghur/Dolin)
+- [Github](https://github.com/Suyghur/Dolin)
+- [Gitee](https://gitee.com/suyghur/Dolin)
 
 ## Zap
 

+ 18 - 0
library_crashlytics/src/main/java/com/dolin/crashlytics/Crashlytics.kt

@@ -1,13 +1,31 @@
 package com.dolin.crashlytics
 
+import android.app.Application
+import com.dolin.crashlytics.entity.Config
+
 /**
  * @author #Suyghur.
  * Created on 4/14/21
  */
 class Crashlytics {
 
+    fun initialize(application: Application, config: Config) {
+
+    }
+
     companion object {
 
+        @JvmStatic
+        fun getVersion(): String {
+            return Version.VERSION
+        }
+
+        @JvmStatic
+        fun getFullVersion(): String {
+            return Version.FULL_VERSION
+        }
+
+        @JvmStatic
         fun getInstance(): Crashlytics {
             return CrashlyticsHolder.INSTANCE
         }

+ 13 - 0
library_crashlytics/src/main/java/com/dolin/crashlytics/Version.kt

@@ -0,0 +1,13 @@
+package com.dolin.crashlytics
+
+/**
+ * @author #Suyghur.
+ * Created on 4/14/21
+ */
+object Version {
+
+    const val VERSION = "1.0.0"
+
+    const val FULL_VERSION = "Crashlytics_$VERSION"
+
+}

+ 8 - 0
library_crashlytics/src/main/java/com/dolin/crashlytics/catcher/AnrCatcher.kt

@@ -0,0 +1,8 @@
+package com.dolin.crashlytics.catcher
+
+/**
+ * @author #Suyghur.
+ * Created on 4/14/21
+ */
+class AnrCatcher {
+}

+ 8 - 0
library_crashlytics/src/main/java/com/dolin/crashlytics/catcher/JavaCrashCatcher.kt

@@ -0,0 +1,8 @@
+package com.dolin.crashlytics.catcher
+
+/**
+ * @author #Suyghur.
+ * Created on 4/14/21
+ */
+class JavaCrashCatcher {
+}

+ 12 - 0
library_crashlytics/src/main/java/com/dolin/crashlytics/catcher/NativeCatcher.kt

@@ -0,0 +1,12 @@
+package com.dolin.crashlytics.catcher
+
+/**
+ * @author #Suyghur.
+ * Created on 4/14/21
+ */
+class NativeCatcher : Thread.UncaughtExceptionHandler {
+
+    override fun uncaughtException(thread: Thread, throwable: Throwable) {
+        TODO("Not yet implemented")
+    }
+}

+ 17 - 0
library_crashlytics/src/main/java/com/dolin/crashlytics/entity/Config.kt

@@ -0,0 +1,17 @@
+package com.dolin.crashlytics.entity
+
+/**
+ * @author #Suyghur.
+ * Created on 4/14/21
+ */
+class Config private constructor(builder: Builder) {
+
+    init {
+
+    }
+
+    class Builder {
+
+    }
+
+}

+ 2 - 2
library_zap/src/main/java/com/dolin/zap/Version.kt

@@ -6,7 +6,7 @@ package com.dolin.zap
  */
 object Version {
 
-    const val VERSION_NAME = "1.0.0"
+    const val VERSION = "1.0.0"
 
-    const val VERSION_CODE = 100
+    const val FULL_VERSION = "Zap_$VERSION"
 }

+ 20 - 0
library_zap/src/main/java/com/dolin/zap/Zap.kt

@@ -13,54 +13,74 @@ object Zap {
     private lateinit var sZapPrint: ZapPrint
     private var hasInitialized = false
 
+    @JvmStatic
     fun initialize(application: Application, config: Config) {
         sZapPrint = ZapPrint.instance()
         sZapPrint.initialize(application, config)
         hasInitialized = true
     }
 
+    @JvmStatic
     fun recycle() {
         if (hasInitialized)
             sZapPrint.recycle()
     }
 
+    @JvmStatic
     fun d(any: Any?) {
         if (hasInitialized)
             sZapPrint.d(any)
     }
 
+    @JvmStatic
     fun d(tag: String, any: Any?) {
         if (hasInitialized)
             sZapPrint.d(tag, any)
     }
 
+    @JvmStatic
     fun i(any: Any?) {
         if (hasInitialized)
             sZapPrint.i(any)
     }
 
+    @JvmStatic
     fun i(tag: String, any: Any?) {
         if (hasInitialized)
             sZapPrint.i(tag, any)
     }
 
+    @JvmStatic
     fun w(any: Any?) {
         if (hasInitialized)
             sZapPrint.w(any)
     }
 
+    @JvmStatic
     fun w(tag: String, any: Any?) {
         if (hasInitialized)
             sZapPrint.w(tag, any)
     }
 
+    @JvmStatic
     fun e(any: Any?) {
         if (hasInitialized)
             sZapPrint.e(any)
     }
 
+    @JvmStatic
     fun e(tag: String, any: Any?) {
         if (hasInitialized)
             sZapPrint.e(tag, any)
     }
+
+    @JvmStatic
+    fun getVersion(): String {
+        return Version.VERSION
+    }
+
+    @JvmStatic
+    fun getFullVersion(): String {
+        return Version.FULL_VERSION
+    }
 }