Skip to content

Commit a183c22

Browse files
authored
Merge pull request #208 from esensar/version-catalog-migration
Migrate to versions catalog
2 parents aa381a8 + c25feb6 commit a183c22

File tree

7 files changed

+143
-113
lines changed

7 files changed

+143
-113
lines changed

app/build.gradle

Lines changed: 0 additions & 82 deletions
This file was deleted.

app/build.gradle.kts

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
import java.io.FileInputStream
2+
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
3+
import org.jetbrains.kotlin.konan.properties.Properties
4+
5+
plugins {
6+
alias(libs.plugins.android)
7+
alias(libs.plugins.kotlinAndroid)
8+
}
9+
10+
val keystorePropertiesFile: File = rootProject.file("keystore.properties")
11+
val keystoreProperties = Properties()
12+
if (keystorePropertiesFile.exists()) {
13+
keystoreProperties.load(FileInputStream(keystorePropertiesFile))
14+
}
15+
16+
android {
17+
compileSdk = project.libs.versions.app.build.compileSDKVersion.get().toInt()
18+
19+
defaultConfig {
20+
applicationId = libs.versions.app.version.appId.get()
21+
minSdk = project.libs.versions.app.build.minimumSDK.get().toInt()
22+
targetSdk = project.libs.versions.app.build.targetSDK.get().toInt()
23+
versionName = project.libs.versions.app.version.versionName.get()
24+
versionCode = project.libs.versions.app.version.versionCode.get().toInt()
25+
setProperty("archivesBaseName", "flashlight")
26+
}
27+
28+
signingConfigs {
29+
if (keystorePropertiesFile.exists()) {
30+
register("release") {
31+
keyAlias = keystoreProperties.getProperty("keyAlias")
32+
keyPassword = keystoreProperties.getProperty("keyPassword")
33+
storeFile = file(keystoreProperties.getProperty("storeFile"))
34+
storePassword = keystoreProperties.getProperty("storePassword")
35+
}
36+
}
37+
}
38+
39+
buildFeatures {
40+
viewBinding = true
41+
buildConfig = true
42+
}
43+
44+
buildTypes {
45+
debug {
46+
applicationIdSuffix = ".debug"
47+
}
48+
release {
49+
isMinifyEnabled = true
50+
proguardFiles(
51+
getDefaultProguardFile("proguard-android-optimize.txt"),
52+
"proguard-rules.pro"
53+
)
54+
if (keystorePropertiesFile.exists()) {
55+
signingConfig = signingConfigs.getByName("release")
56+
}
57+
}
58+
}
59+
60+
flavorDimensions.add("variants")
61+
productFlavors {
62+
register("core")
63+
register("fdroid")
64+
register("prepaid")
65+
}
66+
67+
sourceSets {
68+
getByName("main").java.srcDirs("src/main/kotlin")
69+
}
70+
71+
compileOptions {
72+
val currentJavaVersionFromLibs = JavaVersion.valueOf(libs.versions.app.build.javaVersion.get().toString())
73+
sourceCompatibility = currentJavaVersionFromLibs
74+
targetCompatibility = currentJavaVersionFromLibs
75+
}
76+
77+
tasks.withType<KotlinCompile> {
78+
kotlinOptions.jvmTarget = project.libs.versions.app.build.kotlinJVMTarget.get()
79+
}
80+
81+
namespace = libs.versions.app.version.appId.get()
82+
83+
lint {
84+
checkReleaseBuilds = false
85+
abortOnError = false
86+
}
87+
}
88+
89+
dependencies {
90+
implementation(libs.simple.tools.commons)
91+
92+
implementation(libs.androidx.constraintlayout)
93+
implementation(libs.eventbus)
94+
}

build.gradle

Lines changed: 0 additions & 30 deletions
This file was deleted.

build.gradle.kts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
plugins {
2+
alias(libs.plugins.android).apply(false)
3+
alias(libs.plugins.kotlinAndroid).apply(false)
4+
}

gradle/libs.versions.toml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
[versions]
2+
#jetbrains
3+
kotlin = "1.9.0"
4+
#AndroidX
5+
androidx-constraintlayout = "2.1.4"
6+
#EventBus
7+
eventbusVersion = "3.3.1"
8+
#Simple tools
9+
simple-commons = "de113ad025"
10+
#Gradle
11+
gradlePlugins-agp = "8.1.0"
12+
#build
13+
app-build-compileSDKVersion = "34"
14+
app-build-targetSDK = "34"
15+
app-build-minimumSDK = "23"
16+
app-build-javaVersion = "VERSION_17"
17+
app-build-kotlinJVMTarget = "17"
18+
#versioning
19+
app-version-appId = "com.simplemobiletools.flashlight"
20+
app-version-versionCode = "65"
21+
app-version-versionName = "5.10.0"
22+
[libraries]
23+
#Simple Mobile Tools
24+
androidx-constraintlayout = { module = "androidx.constraintlayout:constraintlayout", version.ref = "androidx-constraintlayout" }
25+
eventbus = { module = "org.greenrobot:eventbus", version.ref = "eventbusVersion" }
26+
simple-tools-commons = { module = "com.github.SimpleMobileTools:Simple-Commons", version.ref = "simple-commons" }
27+
[plugins]
28+
android = { id = "com.android.application", version.ref = "gradlePlugins-agp" }
29+
kotlinAndroid = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }

settings.gradle

Lines changed: 0 additions & 1 deletion
This file was deleted.

settings.gradle.kts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
pluginManagement {
2+
repositories {
3+
gradlePluginPortal()
4+
google()
5+
mavenCentral()
6+
}
7+
}
8+
dependencyResolutionManagement {
9+
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
10+
repositories {
11+
google()
12+
mavenCentral()
13+
maven { setUrl("https://jitpack.io") }
14+
}
15+
}
16+
include(":app")

0 commit comments

Comments
 (0)