mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
Fix debug exceptions in releases (#1168)
This commit is contained in:
parent
d17111c1c1
commit
5f64e40a7e
2 changed files with 14 additions and 4 deletions
|
@ -14,7 +14,6 @@ plugins {
|
|||
|
||||
val tmpFilePath = System.getProperty("user.home") + "/work/_temp/keystore/"
|
||||
val prereleaseStoreFile: File? = File(tmpFilePath).listFiles()?.first()
|
||||
var isLibraryDebug = false
|
||||
|
||||
fun String.execute() = ByteArrayOutputStream().use { baot ->
|
||||
if (project.exec {
|
||||
|
@ -105,7 +104,6 @@ android {
|
|||
)
|
||||
}
|
||||
debug {
|
||||
isLibraryDebug = true
|
||||
isDebuggable = true
|
||||
applicationIdSuffix = ".debug"
|
||||
proguardFiles(
|
||||
|
@ -236,7 +234,14 @@ dependencies {
|
|||
implementation("com.github.Blatzar:NiceHttp:0.4.11") // HTTP Lib
|
||||
|
||||
implementation(project(":library") {
|
||||
this.extra.set("isDebug", isLibraryDebug)
|
||||
// There does not seem to be a good way of getting the android flavor.
|
||||
val isDebug = gradle.startParameter.taskRequests.any { task ->
|
||||
task.args.any { arg ->
|
||||
arg.contains("debug", true)
|
||||
}
|
||||
}
|
||||
|
||||
this.extra.set("isDebug", isDebug)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -38,6 +38,11 @@ buildkonfig {
|
|||
|
||||
defaultConfigs {
|
||||
val isDebug = kotlin.runCatching { extra.get("isDebug") }.getOrNull() == true
|
||||
if (isDebug) {
|
||||
logger.quiet("Compiling library with debug flag")
|
||||
} else {
|
||||
logger.quiet("Compiling library with release flag")
|
||||
}
|
||||
buildConfigField(FieldSpec.Type.BOOLEAN, "DEBUG", isDebug.toString())
|
||||
}
|
||||
}
|
||||
|
@ -65,4 +70,4 @@ publishing {
|
|||
groupId = "com.lagradost.api"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue