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