Fix for Qt Creator

This commit is contained in:
albexk 2023-12-05 23:53:49 +03:00
parent 656223f57d
commit bf03f5c9ae
2 changed files with 15 additions and 1 deletions

View file

@ -1,3 +1,5 @@
import com.android.build.gradle.internal.api.BaseVariantOutputImpl
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
@ -11,6 +13,7 @@ kotlin {
// get values from gradle or local properties
val qtTargetSdkVersion: String by gradleProperties
val qtTargetAbiList: String by gradleProperties
val outputBaseName: String by gradleProperties
android {
namespace = "org.amnezia.vpn"
@ -76,6 +79,17 @@ android {
}
}
// fix for Qt Creator to allow deploying the application to a device
// to enable this fix, add the line outputBaseName=android-build to local.properties
if (outputBaseName.isNotEmpty()) {
applicationVariants.all {
outputs.map { it as BaseVariantOutputImpl }
.forEach { output ->
output.outputFileName = "$outputBaseName-${buildType.name}.apk"
}
}
}
lint {
disable += "InvalidFragmentVersionForActivityResult"
}

View file

@ -24,7 +24,7 @@ private class PropertyDelegate(
private val localProperties: Properties = localProperties(rootDir)
) : ReadOnlyProperty<Any?, String> {
override fun getValue(thisRef: Any?, property: KProperty<*>): String =
providers.gradleProperty(property.name).orNull ?: localProperties.getProperty(property.name)
providers.gradleProperty(property.name).orNull ?: localProperties.getProperty(property.name).orEmpty()
}
private lateinit var settingsPropertyDelegate: ReadOnlyProperty<Any?, String>