Fix for Qt Creator
This commit is contained in:
parent
656223f57d
commit
bf03f5c9ae
2 changed files with 15 additions and 1 deletions
|
|
@ -1,3 +1,5 @@
|
||||||
|
import com.android.build.gradle.internal.api.BaseVariantOutputImpl
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
alias(libs.plugins.android.application)
|
alias(libs.plugins.android.application)
|
||||||
alias(libs.plugins.kotlin.android)
|
alias(libs.plugins.kotlin.android)
|
||||||
|
|
@ -11,6 +13,7 @@ kotlin {
|
||||||
// get values from gradle or local properties
|
// get values from gradle or local properties
|
||||||
val qtTargetSdkVersion: String by gradleProperties
|
val qtTargetSdkVersion: String by gradleProperties
|
||||||
val qtTargetAbiList: String by gradleProperties
|
val qtTargetAbiList: String by gradleProperties
|
||||||
|
val outputBaseName: String by gradleProperties
|
||||||
|
|
||||||
android {
|
android {
|
||||||
namespace = "org.amnezia.vpn"
|
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 {
|
lint {
|
||||||
disable += "InvalidFragmentVersionForActivityResult"
|
disable += "InvalidFragmentVersionForActivityResult"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ private class PropertyDelegate(
|
||||||
private val localProperties: Properties = localProperties(rootDir)
|
private val localProperties: Properties = localProperties(rootDir)
|
||||||
) : ReadOnlyProperty<Any?, String> {
|
) : ReadOnlyProperty<Any?, String> {
|
||||||
override fun getValue(thisRef: Any?, property: KProperty<*>): 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>
|
private lateinit var settingsPropertyDelegate: ReadOnlyProperty<Any?, String>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue