Skip to content

Commit

Permalink
Merge pull request #354 from Jean-BaptisteC/kts
Browse files Browse the repository at this point in the history
Migrate gradle script to Kotlin DSL
  • Loading branch information
Bnyro authored Oct 16, 2023
2 parents 04a4be9 + c7a1f66 commit 6a5e53f
Show file tree
Hide file tree
Showing 6 changed files with 118 additions and 120 deletions.
101 changes: 0 additions & 101 deletions app/build.gradle

This file was deleted.

105 changes: 105 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
id("kotlinx-serialization")
id("com.google.devtools.ksp")
}

android {
compileSdk = 33

defaultConfig {
applicationId = "com.bnyro.translate"
minSdk = 21
targetSdk = 33
versionCode = 38
versionName = "7.1"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary = true
}

ksp {
arg("room.schemaLocation", "$projectDir/schemas".toString())
}
}

buildTypes {
release {
isMinifyEnabled = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}

debug {
isDebuggable = true
applicationIdSuffix = ".debug"
}
}

flavorDimensions.add("version")
productFlavors {
create("libre") {
dimension = "version"
}
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "17"
}
buildFeatures {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = "1.4.2"
}
packagingOptions {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
}
namespace = "com.bnyro.translate"
}

dependencies {
val compose_version: String by rootProject.extra
// Android Core
implementation("androidx.core:core-ktx:1.10.1")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.1")
implementation("androidx.activity:activity-compose:1.7.2")
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")

// Compose
implementation("androidx.compose.ui:ui:$compose_version")
implementation("androidx.compose.ui:ui-tooling-preview:$compose_version")
implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.6.1")
implementation("androidx.compose.material3:material3:1.2.0-alpha02")
implementation("androidx.compose.material:material-icons-extended:$compose_version")
androidTestImplementation("androidx.compose.ui:ui-test-junit4:$compose_version")
debugImplementation("androidx.compose.ui:ui-tooling:$compose_version")
debugImplementation("androidx.compose.ui:ui-test-manifest:$compose_version")
implementation("androidx.navigation:navigation-compose:2.5.3")

// Retrofit
implementation("com.squareup.retrofit2:retrofit:2.9.0")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0")
implementation("com.jakewharton.retrofit:retrofit2-kotlinx-serialization-converter:1.0.0")
implementation("com.squareup.retrofit2:converter-scalars:2.9.0")
implementation("com.squareup.okhttp3:logging-interceptor:4.11.0")

// Room database
implementation("androidx.room:room-runtime:2.5.1")
ksp("androidx.room:room-compiler:2.5.1")

// Tesseract OCR
implementation("cz.adaptech.tesseract4android:tesseract4android-openmp:4.3.0")
}
2 changes: 1 addition & 1 deletion app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
# proguardFiles setting in build.gradle.kts.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
Expand Down
16 changes: 0 additions & 16 deletions build.gradle

This file was deleted.

10 changes: 10 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
buildscript {
val compose_version by extra("1.5.0-beta01")
}// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id("com.android.application") version "8.0.1" apply false
id("com.android.library") version "8.0.1" apply false
id("org.jetbrains.kotlin.android") version "1.8.10" apply false
id("org.jetbrains.kotlin.plugin.serialization") version "1.8.10"
id("com.google.devtools.ksp") version "1.8.10-1.0.9" apply false
}
4 changes: 2 additions & 2 deletions settings.gradle → settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ dependencyResolutionManagement {
google()
mavenCentral()
// used for OCR
maven { url 'https://jitpack.io' }
maven { setUrl("https://jitpack.io") }
}
}
rootProject.name = "Translate You"
include ':app'
include(":app")

0 comments on commit 6a5e53f

Please sign in to comment.