mirror of
https://github.com/pppscn/SmsForwarder
synced 2024-11-08 01:10:23 +00:00
整理:单元测试优化
This commit is contained in:
parent
75b356246c
commit
e131690ac7
1
.gitignore
vendored
1
.gitignore
vendored
@ -38,3 +38,4 @@
|
||||
/*.txt
|
||||
/pic/Troubleshooting_Process.vsdx
|
||||
/pic/working_principle_en.drawio
|
||||
/app/src/test
|
||||
|
@ -39,6 +39,10 @@ android {
|
||||
buildToolsVersion build_versions.build_tools
|
||||
compileSdkVersion build_versions.target_sdk
|
||||
|
||||
testOptions {
|
||||
unitTests.returnDefaultValues = true
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.idormy.sms.forwarder.utils
|
||||
|
||||
import android.content.Context
|
||||
import android.os.Build
|
||||
import com.idormy.sms.forwarder.App
|
||||
import java.io.File
|
||||
import java.io.FileWriter
|
||||
@ -40,6 +41,8 @@ object Log {
|
||||
}
|
||||
|
||||
fun logToFile(level: String, tag: String, message: String) {
|
||||
if (Build.DEVICE == null) return
|
||||
|
||||
if (!::appContext.isInitialized) {
|
||||
throw IllegalStateException("Log not initialized. Call init(context) first.")
|
||||
}
|
||||
|
@ -13,6 +13,7 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
|
||||
# org.gradle.parallel=true
|
||||
# 是否打包APK,打正式包时请设置为true,使用正式的签名
|
||||
isNeedPackage=true
|
||||
isNeedClean=false
|
||||
# 是否排除Frpc动态库,打正式包时请设置为true
|
||||
excludeFrpclib=true
|
||||
# 是否使用leakcanary检测内存泄漏,打正式包时请设置为false
|
||||
|
Loading…
Reference in New Issue
Block a user