-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
35 lines (32 loc) · 1.36 KB
/
build.gradle.kts
File metadata and controls
35 lines (32 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
plugins {
kotlin("jvm") version "2.1.21" apply false
id("org.jetbrains.compose") version "1.9.3" apply false
id("org.jetbrains.kotlin.plugin.compose") version "2.1.21" apply false
id("com.android.library") version "8.5.2" apply false
id("com.vanniktech.maven.publish") version "0.30.0" apply false
}
// Version format: MAJOR.MINOR.PATCH
// - If APP_VERSION env var is set (from CI), use it directly
// - Otherwise: MAJOR.MINOR from VERSION file + PATCH from BUILD_NUMBER
// - Local builds get "-SNAPSHOT" suffix
val isReleaseBuild = System.getenv("RELEASE_BUILD") != null || System.getenv("INTELLIJ_DEPENDENCIES_BOT") != null
val projectVersion = System.getenv("APP_VERSION")?.let { appVersion ->
// Use pre-computed version from CI (ensures consistency with artifact naming)
appVersion + if (!isReleaseBuild) "-SNAPSHOT" else ""
} ?: run {
// Fallback: compute from VERSION file + BUILD_NUMBER (local builds)
val baseVersion = rootProject.projectDir.resolve("VERSION").readText().trim()
val buildNumber = System.getenv("BUILD_NUMBER") ?: "0"
"$baseVersion.$buildNumber" + if (!isReleaseBuild) "-SNAPSHOT" else ""
}
allprojects {
version = projectVersion
group = "ai.rever.bossterm"
layout.buildDirectory = rootProject.projectDir.resolve(".gradleBuild/" + project.name)
}
subprojects {
repositories {
mavenCentral()
google()
}
}