mirror of
https://gitee.com/zhangsken/AndroidIDE.git
synced 2026-10-16 07:49:44 +08:00
build(build-logic): fix invalid publishing version when building for F-Droid (#1620)
This commit is contained in:
@@ -45,12 +45,6 @@ val Project.isFDroidBuild: Boolean
|
|||||||
return FDroidConfig.isFDroidBuild
|
return FDroidConfig.isFDroidBuild
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Whether split APKs should be enabled.
|
|
||||||
*/
|
|
||||||
val Project.areSplitApksEnabled: Boolean
|
|
||||||
get() = !isFDroidBuild
|
|
||||||
|
|
||||||
val Project.simpleVersionName: String
|
val Project.simpleVersionName: String
|
||||||
get() {
|
get() {
|
||||||
|
|
||||||
@@ -99,6 +93,13 @@ val Project.publishingVersion: String
|
|||||||
get() {
|
get() {
|
||||||
|
|
||||||
var publishing = simpleVersionName
|
var publishing = simpleVersionName
|
||||||
|
if (isFDroidBuild) {
|
||||||
|
// when building for F-Droid, the release is already published so we should have
|
||||||
|
// the maven dependencies already published
|
||||||
|
// simply return the simple version name here.
|
||||||
|
return publishing
|
||||||
|
}
|
||||||
|
|
||||||
if (CI.isCiBuild && CI.branchName != "main") {
|
if (CI.isCiBuild && CI.branchName != "main") {
|
||||||
publishing += "-${CI.commitHash}-SNAPSHOT"
|
publishing += "-${CI.commitHash}-SNAPSHOT"
|
||||||
}
|
}
|
||||||
@@ -110,12 +111,12 @@ val Project.publishingVersion: String
|
|||||||
* The version name which is used to download the artifacts at runtime.
|
* The version name which is used to download the artifacts at runtime.
|
||||||
*
|
*
|
||||||
* The value varies based on the following cases :
|
* The value varies based on the following cases :
|
||||||
* - For CI builds: same as [publishingVersion].
|
* - For CI and F-Droid builds: same as [publishingVersion].
|
||||||
* - For local builds: `latest.integration` to make sure that Gradle downloads the latest snapshots.
|
* - For local builds: `latest.integration` to make sure that Gradle downloads the latest snapshots.
|
||||||
*/
|
*/
|
||||||
val Project.downloadVersion: String
|
val Project.downloadVersion: String
|
||||||
get() {
|
get() {
|
||||||
return if (CI.isCiBuild) {
|
return if (CI.isCiBuild || isFDroidBuild) {
|
||||||
publishingVersion
|
publishingVersion
|
||||||
} else {
|
} else {
|
||||||
// sometimes, when working locally, Gradle fails to download the latest snapshot version
|
// sometimes, when working locally, Gradle fails to download the latest snapshot version
|
||||||
|
|||||||
@@ -32,7 +32,5 @@ const val KEY_BIN = "IDE_SIGNING_KEY_BIN"
|
|||||||
*/
|
*/
|
||||||
const val AGP_VERSION_MINIMUM = "7.2.0"
|
const val AGP_VERSION_MINIMUM = "7.2.0"
|
||||||
|
|
||||||
const val PROP_IDE_BUILD_FDROID = "ide.build.fdroid"
|
|
||||||
|
|
||||||
val Project.signingKey: Provider<RegularFile>
|
val Project.signingKey: Provider<RegularFile>
|
||||||
get() = rootProject.layout.buildDirectory.file("signing/signing-key.jks")
|
get() = rootProject.layout.buildDirectory.file("signing/signing-key.jks")
|
||||||
Reference in New Issue
Block a user