Skip to content

Commit a2b54b8

Browse files
committed
CHG from gradle to kotlin dsl
1 parent f300a5e commit a2b54b8

File tree

8 files changed

+246
-230
lines changed

8 files changed

+246
-230
lines changed

app/build.gradle

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

app/build.gradle.kts

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
plugins {
2+
id("com.android.application")
3+
id("kotlin-android")
4+
id("com.google.devtools.ksp")
5+
}
6+
7+
android {
8+
9+
compileOptions {
10+
sourceCompatibility = JavaVersion.VERSION_17
11+
targetCompatibility = JavaVersion.VERSION_17
12+
}
13+
14+
defaultConfig {
15+
applicationId = "de.raphaelebner.roomdatabasebackup.sample"
16+
minSdk = 21
17+
targetSdk = 34
18+
compileSdk = 34
19+
buildToolsVersion = "34.0.0"
20+
versionCode = 1
21+
versionName = "1.0.3"
22+
23+
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
24+
ksp {
25+
arg("room.schemaLocation", "$projectDir/schemas")
26+
arg("room.incremental", "true")
27+
arg("room.expandProjection", "true")
28+
}
29+
}
30+
31+
buildTypes {
32+
getByName("release") {
33+
isMinifyEnabled = false
34+
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
35+
}
36+
}
37+
38+
buildFeatures {
39+
viewBinding = true
40+
}
41+
42+
kotlinOptions {
43+
jvmTarget = JavaVersion.VERSION_17.toString()
44+
}
45+
namespace = "de.raphaelebner.roomdatabasebackup.sample"
46+
}
47+
48+
dependencies {
49+
implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar"))))
50+
implementation("androidx.core:core-ktx:1.12.0")
51+
implementation("androidx.appcompat:appcompat:1.6.1")
52+
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
53+
implementation(project(":core"))
54+
implementation("androidx.legacy:legacy-support-v4:1.0.0")
55+
testImplementation("junit:junit:4.13.2")
56+
androidTestImplementation("androidx.test.ext:junit:1.1.5")
57+
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
58+
59+
//ROOM SQLite
60+
val roomVersion = "2.6.1"
61+
62+
implementation("androidx.room:room-runtime:$roomVersion")
63+
ksp("androidx.room:room-compiler:$roomVersion")
64+
65+
// optional - Kotlin Extensions and Coroutines support for Room
66+
implementation("androidx.room:room-ktx:$roomVersion")
67+
68+
// optional - RxJava support for Room
69+
implementation("androidx.room:room-rxjava2:$roomVersion")
70+
71+
implementation("androidx.lifecycle:lifecycle-extensions:2.2.0")
72+
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2")
73+
74+
// optional - Guava support for Room, including Optional and ListenableFuture
75+
implementation("androidx.room:room-guava:$roomVersion")
76+
77+
// Test helpers
78+
testImplementation("androidx.room:room-testing:$roomVersion")
79+
80+
//Recyclerview Implementation
81+
implementation("androidx.recyclerview:recyclerview:1.3.2")
82+
83+
//Material Design Implementation
84+
implementation("com.google.android.material:material:1.11.0")
85+
86+
}
Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,33 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22
buildscript {
3-
ext.kotlin_version = '1.9.10'
3+
extra.set("kotlin_version", "1.9.10")
44
repositories {
55
google()
66
mavenCentral()
77
}
88
dependencies {
9-
classpath 'com.android.tools.build:gradle:8.2.1'
10-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
9+
val kotlinVersion = rootProject.extra.get("kotlin_version")
10+
classpath("com.android.tools.build:gradle:8.2.1")
11+
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
1112

1213
// NOTE: Do not place your application dependencies here; they belong
1314
// in the individual module build.gradle files
1415
}
1516
}
1617

1718
plugins {
18-
id('io.github.gradle-nexus.publish-plugin') version "1.3.0"
19+
id("io.github.gradle-nexus.publish-plugin") version "2.0.0-rc-1"
1920
id("org.jetbrains.dokka") version "1.9.10"
20-
id 'org.jetbrains.kotlin.android' version '1.9.10' apply false
21+
id("org.jetbrains.kotlin.android") version "1.9.10" apply false
2122
id("com.google.devtools.ksp") version "1.9.10-1.0.13" apply false
2223
}
2324

24-
apply from: "${rootDir}/scripts/publish-root.gradle"
25+
26+
apply {
27+
from("${rootDir}/scripts/publish-root.gradle")
28+
}
29+
30+
2531

2632
allprojects {
2733
repositories {
@@ -30,6 +36,6 @@ allprojects {
3036
}
3137
}
3238

33-
tasks.register('clean', Delete) {
34-
delete rootProject.buildDir
39+
tasks.register("clean", Delete::class) {
40+
delete(rootProject.buildDir)
3541
}

core/build.gradle

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

0 commit comments

Comments
 (0)