mirror of
				https://github.com/SimpleMobileTools/Simple-Dialer.git
				synced 2025-06-05 21:49:23 +02:00 
			
		
		
		
	migrate to gradle kts and version catalog
This commit is contained in:
		| @@ -1,86 +0,0 @@ | |||||||
| plugins { |  | ||||||
|     id 'com.android.application' |  | ||||||
|     id 'kotlin-android' |  | ||||||
|     id 'org.jetbrains.kotlin.plugin.serialization' version "$kotlin_version" |  | ||||||
| } |  | ||||||
|  |  | ||||||
| def keystorePropertiesFile = rootProject.file("keystore.properties") |  | ||||||
| def keystoreProperties = new Properties() |  | ||||||
| if (keystorePropertiesFile.exists()) { |  | ||||||
|     keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) |  | ||||||
| } |  | ||||||
|  |  | ||||||
| android { |  | ||||||
|     namespace "com.simplemobiletools.dialer" |  | ||||||
|     compileSdk 34 |  | ||||||
|  |  | ||||||
|     defaultConfig { |  | ||||||
|         applicationId "com.simplemobiletools.dialer" |  | ||||||
|         minSdk 23 |  | ||||||
|         targetSdk 34 |  | ||||||
|         versionCode 56 |  | ||||||
|         versionName "5.18.0" |  | ||||||
|         setProperty("archivesBaseName", "dialer") |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     signingConfigs { |  | ||||||
|         if (keystorePropertiesFile.exists()) { |  | ||||||
|             release { |  | ||||||
|                 keyAlias keystoreProperties['keyAlias'] |  | ||||||
|                 keyPassword keystoreProperties['keyPassword'] |  | ||||||
|                 storeFile file(keystoreProperties['storeFile']) |  | ||||||
|                 storePassword keystoreProperties['storePassword'] |  | ||||||
|             } |  | ||||||
|         } |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     buildFeatures { |  | ||||||
|         buildConfig true |  | ||||||
|         viewBinding true |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     buildTypes { |  | ||||||
|         debug { |  | ||||||
|             applicationIdSuffix ".debug" |  | ||||||
|         } |  | ||||||
|         release { |  | ||||||
|             minifyEnabled true |  | ||||||
|             proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' |  | ||||||
|             if (keystorePropertiesFile.exists()) { |  | ||||||
|                 signingConfig signingConfigs.release |  | ||||||
|             } |  | ||||||
|         } |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     compileOptions { |  | ||||||
|         sourceCompatibility JavaVersion.VERSION_17 |  | ||||||
|         targetCompatibility JavaVersion.VERSION_17 |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     kotlinOptions { |  | ||||||
|         jvmTarget = '17' |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     flavorDimensions = ["variants"] |  | ||||||
|     productFlavors { |  | ||||||
|         core {} |  | ||||||
|         fdroid {} |  | ||||||
|         prepaid {} |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     sourceSets { |  | ||||||
|         main.java.srcDirs += 'src/main/kotlin' |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     lintOptions { |  | ||||||
|         checkReleaseBuilds false |  | ||||||
|         abortOnError false |  | ||||||
|     } |  | ||||||
| } |  | ||||||
|  |  | ||||||
| dependencies { |  | ||||||
|     implementation 'com.github.SimpleMobileTools:Simple-Commons:565200547d' |  | ||||||
|     implementation 'com.github.tibbi:IndicatorFastScroll:4524cd0b61' |  | ||||||
|     implementation 'me.grantland:autofittextview:0.2.1' |  | ||||||
|     implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.4.1" |  | ||||||
| } |  | ||||||
							
								
								
									
										95
									
								
								app/build.gradle.kts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										95
									
								
								app/build.gradle.kts
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,95 @@ | |||||||
|  | import org.jetbrains.kotlin.gradle.tasks.KotlinCompile | ||||||
|  | import org.jetbrains.kotlin.konan.properties.Properties | ||||||
|  | import java.io.FileInputStream | ||||||
|  |  | ||||||
|  | plugins { | ||||||
|  |     alias(libs.plugins.android) | ||||||
|  |     alias(libs.plugins.kotlinAndroid) | ||||||
|  |     alias(libs.plugins.kotlinSerialization) | ||||||
|  | } | ||||||
|  |  | ||||||
|  | val keystorePropertiesFile: File = rootProject.file("keystore.properties") | ||||||
|  | val keystoreProperties = Properties() | ||||||
|  | if (keystorePropertiesFile.exists()) { | ||||||
|  |     keystoreProperties.load(FileInputStream(keystorePropertiesFile)) | ||||||
|  | } | ||||||
|  |  | ||||||
|  | android { | ||||||
|  |     compileSdk = project.libs.versions.app.build.compileSDKVersion.get().toInt() | ||||||
|  |  | ||||||
|  |     defaultConfig { | ||||||
|  |         applicationId = libs.versions.app.version.appId.get() | ||||||
|  |         minSdk = project.libs.versions.app.build.minimumSDK.get().toInt() | ||||||
|  |         targetSdk = project.libs.versions.app.build.targetSDK.get().toInt() | ||||||
|  |         versionName = project.libs.versions.app.version.versionName.get() | ||||||
|  |         versionCode = project.libs.versions.app.version.versionCode.get().toInt() | ||||||
|  |         setProperty("archivesBaseName", "dialer") | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     signingConfigs { | ||||||
|  |         if (keystorePropertiesFile.exists()) { | ||||||
|  |             register("release") { | ||||||
|  |                 keyAlias = keystoreProperties.getProperty("keyAlias") | ||||||
|  |                 keyPassword = keystoreProperties.getProperty("keyPassword") | ||||||
|  |                 storeFile = file(keystoreProperties.getProperty("storeFile")) | ||||||
|  |                 storePassword = keystoreProperties.getProperty("storePassword") | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     buildFeatures { | ||||||
|  |         viewBinding = true | ||||||
|  |         buildConfig = true | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     buildTypes { | ||||||
|  |         debug { | ||||||
|  |             applicationIdSuffix = ".debug" | ||||||
|  |         } | ||||||
|  |         release { | ||||||
|  |             isMinifyEnabled = true | ||||||
|  |             proguardFiles( | ||||||
|  |                 getDefaultProguardFile("proguard-android-optimize.txt"), | ||||||
|  |                 "proguard-rules.pro" | ||||||
|  |             ) | ||||||
|  |             if (keystorePropertiesFile.exists()) { | ||||||
|  |                 signingConfig = signingConfigs.getByName("release") | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     flavorDimensions.add("variants") | ||||||
|  |     productFlavors { | ||||||
|  |         register("core") | ||||||
|  |         register("fdroid") | ||||||
|  |         register("prepaid") | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     sourceSets { | ||||||
|  |         getByName("main").java.srcDirs("src/main/kotlin") | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     compileOptions { | ||||||
|  |         val currentJavaVersionFromLibs = JavaVersion.valueOf(libs.versions.app.build.javaVersion.get().toString()) | ||||||
|  |         sourceCompatibility = currentJavaVersionFromLibs | ||||||
|  |         targetCompatibility = currentJavaVersionFromLibs | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     tasks.withType<KotlinCompile> { | ||||||
|  |         kotlinOptions.jvmTarget = project.libs.versions.app.build.kotlinJVMTarget.get() | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     namespace = libs.versions.app.version.appId.get() | ||||||
|  |  | ||||||
|  |     lint { | ||||||
|  |         checkReleaseBuilds = false | ||||||
|  |         abortOnError = false | ||||||
|  |     } | ||||||
|  | } | ||||||
|  |  | ||||||
|  | dependencies { | ||||||
|  |     implementation(libs.simple.tools.commons) | ||||||
|  |     implementation(libs.indicator.fast.scroll) | ||||||
|  |     implementation(libs.autofit.text.view) | ||||||
|  |     implementation(libs.kotlinx.serialization.json) | ||||||
|  | } | ||||||
							
								
								
									
										28
									
								
								build.gradle
									
									
									
									
									
								
							
							
						
						
									
										28
									
								
								build.gradle
									
									
									
									
									
								
							| @@ -1,28 +0,0 @@ | |||||||
| // Top-level build file where you can add configuration options common to all sub-projects/modules. |  | ||||||
|  |  | ||||||
| buildscript { |  | ||||||
|     ext.kotlin_version = '1.9.0' |  | ||||||
|     repositories { |  | ||||||
|         google() |  | ||||||
|         mavenCentral() |  | ||||||
|     } |  | ||||||
|     dependencies { |  | ||||||
|         classpath 'com.android.tools.build:gradle:8.1.0' |  | ||||||
|         classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" |  | ||||||
|  |  | ||||||
|         // NOTE: Do not place your application dependencies here; they belong |  | ||||||
|         // in the individual module build.gradle files |  | ||||||
|     } |  | ||||||
| } |  | ||||||
|  |  | ||||||
| allprojects { |  | ||||||
|     repositories { |  | ||||||
|         google() |  | ||||||
|         mavenCentral() |  | ||||||
|         maven { url 'https://jitpack.io' } |  | ||||||
|     } |  | ||||||
| } |  | ||||||
|  |  | ||||||
| task clean(type: Delete) { |  | ||||||
|     delete rootProject.buildDir |  | ||||||
| } |  | ||||||
							
								
								
									
										5
									
								
								build.gradle.kts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								build.gradle.kts
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,5 @@ | |||||||
|  | plugins { | ||||||
|  |     alias(libs.plugins.android).apply(false) | ||||||
|  |     alias(libs.plugins.kotlinAndroid).apply(false) | ||||||
|  |     alias(libs.plugins.kotlinSerialization).apply(false) | ||||||
|  | } | ||||||
							
								
								
									
										33
									
								
								gradle/libs.versions.toml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										33
									
								
								gradle/libs.versions.toml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,33 @@ | |||||||
|  | [versions] | ||||||
|  | #jetbrains | ||||||
|  | kotlin = "1.9.0" | ||||||
|  | kotlinxSerializationJson = "1.5.1" | ||||||
|  | #Simple tools | ||||||
|  | simple-commons = "565200547d" | ||||||
|  | #Gradle | ||||||
|  | gradlePlugins-agp = "8.1.0" | ||||||
|  | #Other | ||||||
|  | indicatorFastScroll = "4524cd0b61" | ||||||
|  | autofitTextView = "0.2.1" | ||||||
|  | #build | ||||||
|  | app-build-compileSDKVersion = "34" | ||||||
|  | app-build-targetSDK = "34" | ||||||
|  | app-build-minimumSDK = "23" | ||||||
|  | app-build-javaVersion = "VERSION_17" | ||||||
|  | app-build-kotlinJVMTarget = "17" | ||||||
|  | #versioning | ||||||
|  | app-version-appId = "com.simplemobiletools.dialer" | ||||||
|  | app-version-versionCode = "56" | ||||||
|  | app-version-versionName = "5.18.0" | ||||||
|  | [libraries] | ||||||
|  | #Simple Mobile Tools | ||||||
|  | simple-tools-commons = { module = "com.github.SimpleMobileTools:Simple-Commons", version.ref = "simple-commons" } | ||||||
|  | #Kotlin | ||||||
|  | kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinxSerializationJson" } | ||||||
|  | #Other | ||||||
|  | indicator-fast-scroll = { module = "com.github.tibbi:IndicatorFastScroll", version.ref = "indicatorFastScroll" } | ||||||
|  | autofit-text-view = { module = "me.grantland:autofittextview", version.ref = "autofitTextView" } | ||||||
|  | [plugins] | ||||||
|  | android = { id = "com.android.application", version.ref = "gradlePlugins-agp" } | ||||||
|  | kotlinAndroid = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } | ||||||
|  | kotlinSerialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" } | ||||||
| @@ -1,2 +0,0 @@ | |||||||
| rootProject.name='Simple-Dialer' |  | ||||||
| include ':app' |  | ||||||
							
								
								
									
										17
									
								
								settings.gradle.kts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								settings.gradle.kts
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,17 @@ | |||||||
|  | rootProject.name = "Simple-Dialer" | ||||||
|  | pluginManagement { | ||||||
|  |     repositories { | ||||||
|  |         gradlePluginPortal() | ||||||
|  |         google() | ||||||
|  |         mavenCentral() | ||||||
|  |     } | ||||||
|  | } | ||||||
|  | dependencyResolutionManagement { | ||||||
|  |     repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) | ||||||
|  |     repositories { | ||||||
|  |         google() | ||||||
|  |         mavenCentral() | ||||||
|  |         maven { setUrl("https://jitpack.io") } | ||||||
|  |     } | ||||||
|  | } | ||||||
|  | include(":app") | ||||||
		Reference in New Issue
	
	Block a user