Skip to content

Commit 9633857

Browse files
authored
Merge pull request #253 from hannesa2/BuildKts
Build kts
2 parents 120444e + 29adfce commit 9633857

7 files changed

+129
-108
lines changed

app/build.gradle

-41
This file was deleted.

app/build.gradle.kts

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
plugins {
2+
id("com.android.application")
3+
id("kotlin-android")
4+
}
5+
6+
android {
7+
namespace = "info.hannes.slidinguppanel.demo"
8+
buildFeatures {
9+
viewBinding = true
10+
}
11+
defaultConfig {
12+
minSdk = 21
13+
compileSdk = 35
14+
targetSdk = 35
15+
16+
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
17+
testInstrumentationRunnerArguments.putAll(
18+
mapOf(
19+
"clearPackageData" to "false",
20+
"disableAnalytics" to "true",
21+
"useTestStorageService" to "true",
22+
),
23+
)
24+
}
25+
compileOptions {
26+
sourceCompatibility = JavaVersion.VERSION_17
27+
targetCompatibility = JavaVersion.VERSION_17
28+
}
29+
kotlinOptions {
30+
jvmTarget = "17"
31+
}
32+
lint {
33+
abortOnError = false
34+
}
35+
}
36+
37+
dependencies {
38+
implementation(libs.appcompat)
39+
implementation(project(":library"))
40+
implementation(libs.core.ktx)
41+
implementation(libs.kotlin.stdlib.jdk7)
42+
43+
testImplementation(libs.junit)
44+
androidTestImplementation(libs.junit.ktx)
45+
androidTestUtil(libs.test.services)
46+
androidTestImplementation(libs.espresso.core)
47+
}

build.gradle

-25
This file was deleted.

build.gradle.kts

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
buildscript {
2+
repositories {
3+
google()
4+
mavenCentral()
5+
}
6+
dependencies {
7+
classpath(libs.gradle)
8+
classpath(libs.kotlin.gradle.plugin)
9+
}
10+
}
11+
12+
println("I use Java ${JavaVersion.current()}")
13+
14+
allprojects {
15+
repositories {
16+
google()
17+
mavenCentral()
18+
}
19+
}

gradle/libs.versions.toml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[versions]
2+
appcompat = "1.7.0"
3+
coreKtx = "1.15.0"
4+
espressoCore = "3.6.1"
5+
gradle = "8.7.3"
6+
junit = "4.13.2"
7+
junitKtx = "1.2.1"
8+
kotlinGradlePlugin = "2.1.0"
9+
recyclerview = "1.3.2"
10+
testServices = "1.5.0"
11+
12+
[libraries]
13+
appcompat = { module = "androidx.appcompat:appcompat", version.ref = "appcompat" }
14+
core-ktx = { module = "androidx.core:core-ktx", version.ref = "coreKtx" }
15+
espresso-core = { module = "androidx.test.espresso:espresso-core", version.ref = "espressoCore" }
16+
gradle = { module = "com.android.tools.build:gradle", version.ref = "gradle" }
17+
junit = { module = "junit:junit", version.ref = "junit" }
18+
junit-ktx = { module = "androidx.test.ext:junit-ktx", version.ref = "junitKtx" }
19+
kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlinGradlePlugin" }
20+
kotlin-stdlib-jdk7 = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk7", version.ref = "kotlinGradlePlugin" }
21+
recyclerview = { module = "androidx.recyclerview:recyclerview", version.ref = "recyclerview" }
22+
test-services = { module = "androidx.test.services:test-services", version.ref = "testServices" }

library/build.gradle

-42
This file was deleted.

library/build.gradle.kts

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
plugins {
2+
id("com.android.library")
3+
id("kotlin-android")
4+
id("maven-publish")
5+
}
6+
7+
android {
8+
namespace = "com.sothree.slidinguppanel.library"
9+
defaultConfig {
10+
minSdk = 21
11+
compileSdk = 35
12+
13+
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
14+
}
15+
compileOptions {
16+
sourceCompatibility = JavaVersion.VERSION_17
17+
targetCompatibility = JavaVersion.VERSION_17
18+
}
19+
kotlinOptions {
20+
jvmTarget = "17"
21+
}
22+
lint {
23+
abortOnError = false
24+
}
25+
}
26+
27+
dependencies {
28+
implementation(libs.recyclerview)
29+
implementation(libs.core.ktx)
30+
implementation(libs.kotlin.stdlib.jdk7)
31+
}
32+
33+
afterEvaluate {
34+
publishing {
35+
publications {
36+
create<MavenPublication>("maven") {
37+
from(components["release"])
38+
}
39+
}
40+
}
41+
}

0 commit comments

Comments
 (0)