Skip to content

Commit 3e8818f

Browse files
authored
build: move app version to gradle.properties (#85)
1 parent 8e396fd commit 3e8818f

3 files changed

Lines changed: 9 additions & 8 deletions

File tree

app/build.gradle.kts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ android {
2525
compileSdk = project.libs.versions.app.build.compileSDKVersion.get().toInt()
2626

2727
defaultConfig {
28-
applicationId = libs.versions.app.version.appId.get()
28+
applicationId = project.property("APP_ID").toString()
2929
minSdk = project.libs.versions.app.build.minimumSDK.get().toInt()
3030
targetSdk = project.libs.versions.app.build.targetSDK.get().toInt()
31-
versionName = project.libs.versions.app.version.versionName.get()
32-
versionCode = project.libs.versions.app.version.versionCode.get().toInt()
31+
versionName = project.property("VERSION_NAME").toString()
32+
versionCode = project.property("VERSION_CODE").toString().toInt()
3333
setProperty("archivesBaseName", "camera-$versionCode")
3434
vectorDrawables.useSupportLibrary = true
3535
}
@@ -102,7 +102,7 @@ android {
102102
kotlinOptions.jvmTarget = project.libs.versions.app.build.kotlinJVMTarget.get()
103103
}
104104

105-
namespace = "org.fossify.camera"
105+
namespace = project.property("APP_ID").toString()
106106

107107
lint {
108108
checkReleaseBuilds = false

gradle.properties

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,8 @@ org.gradle.configureondemand=true
99
org.gradle.unsafe.configuration-cache=true
1010
org.gradle.unsafe.configuration-cache-problems=warn
1111
android.nonTransitiveRClass=true
12+
13+
# Versioning
14+
VERSION_NAME=1.0.1
15+
VERSION_CODE=2
16+
APP_ID=org.fossify.camera

gradle/libs.versions.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ app-build-targetSDK = "34"
1919
app-build-minimumSDK = "29"
2020
app-build-javaVersion = "VERSION_17"
2121
app-build-kotlinJVMTarget = "17"
22-
#versioning
23-
app-version-appId = "org.fossify.camera"
24-
app-version-versionCode = "2"
25-
app-version-versionName = "1.0.1"
2622
[libraries]
2723
#Android X
2824
androidx-camera-core = { module = "androidx.camera:camera-core", version.ref = "androidx-camera" }

0 commit comments

Comments
 (0)