Skip to content

Commit

Permalink
Merge pull request #253 from hannesa2/BuildKts
Browse files Browse the repository at this point in the history
Build kts
  • Loading branch information
hannesa2 authored Jan 2, 2025
2 parents 120444e + 29adfce commit 9633857
Show file tree
Hide file tree
Showing 7 changed files with 129 additions and 108 deletions.
41 changes: 0 additions & 41 deletions app/build.gradle

This file was deleted.

47 changes: 47 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
plugins {
id("com.android.application")
id("kotlin-android")
}

android {
namespace = "info.hannes.slidinguppanel.demo"
buildFeatures {
viewBinding = true
}
defaultConfig {
minSdk = 21
compileSdk = 35
targetSdk = 35

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
testInstrumentationRunnerArguments.putAll(
mapOf(
"clearPackageData" to "false",
"disableAnalytics" to "true",
"useTestStorageService" to "true",
),
)
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "17"
}
lint {
abortOnError = false
}
}

dependencies {
implementation(libs.appcompat)
implementation(project(":library"))
implementation(libs.core.ktx)
implementation(libs.kotlin.stdlib.jdk7)

testImplementation(libs.junit)
androidTestImplementation(libs.junit.ktx)
androidTestUtil(libs.test.services)
androidTestImplementation(libs.espresso.core)
}
25 changes: 0 additions & 25 deletions build.gradle

This file was deleted.

19 changes: 19 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath(libs.gradle)
classpath(libs.kotlin.gradle.plugin)
}
}

println("I use Java ${JavaVersion.current()}")

allprojects {
repositories {
google()
mavenCentral()
}
}
22 changes: 22 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[versions]
appcompat = "1.7.0"
coreKtx = "1.15.0"
espressoCore = "3.6.1"
gradle = "8.7.3"
junit = "4.13.2"
junitKtx = "1.2.1"
kotlinGradlePlugin = "2.1.0"
recyclerview = "1.3.2"
testServices = "1.5.0"

[libraries]
appcompat = { module = "androidx.appcompat:appcompat", version.ref = "appcompat" }
core-ktx = { module = "androidx.core:core-ktx", version.ref = "coreKtx" }
espresso-core = { module = "androidx.test.espresso:espresso-core", version.ref = "espressoCore" }
gradle = { module = "com.android.tools.build:gradle", version.ref = "gradle" }
junit = { module = "junit:junit", version.ref = "junit" }
junit-ktx = { module = "androidx.test.ext:junit-ktx", version.ref = "junitKtx" }
kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlinGradlePlugin" }
kotlin-stdlib-jdk7 = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk7", version.ref = "kotlinGradlePlugin" }
recyclerview = { module = "androidx.recyclerview:recyclerview", version.ref = "recyclerview" }
test-services = { module = "androidx.test.services:test-services", version.ref = "testServices" }
42 changes: 0 additions & 42 deletions library/build.gradle

This file was deleted.

41 changes: 41 additions & 0 deletions library/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
plugins {
id("com.android.library")
id("kotlin-android")
id("maven-publish")
}

android {
namespace = "com.sothree.slidinguppanel.library"
defaultConfig {
minSdk = 21
compileSdk = 35

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "17"
}
lint {
abortOnError = false
}
}

dependencies {
implementation(libs.recyclerview)
implementation(libs.core.ktx)
implementation(libs.kotlin.stdlib.jdk7)
}

afterEvaluate {
publishing {
publications {
create<MavenPublication>("maven") {
from(components["release"])
}
}
}
}

0 comments on commit 9633857

Please sign in to comment.