diff --git a/app/build.gradle b/app/build.gradle deleted file mode 100644 index 1d0321b..0000000 --- a/app/build.gradle +++ /dev/null @@ -1,41 +0,0 @@ -plugins { - id "com.android.application" - id "kotlin-android" -} - -android { - namespace "info.hannes.slidinguppanel.demo" - buildFeatures { - viewBinding = true - } - defaultConfig { - minSdkVersion 21 - compileSdk 35 - targetSdkVersion 35 - - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - testInstrumentationRunnerArguments useTestStorageService: "true" - } - compileOptions { - sourceCompatibility JavaVersion.VERSION_17 - targetCompatibility JavaVersion.VERSION_17 - } - kotlinOptions { - jvmTarget = "17" - } - lint { - abortOnError false - } -} - -dependencies { - implementation "androidx.appcompat:appcompat:1.7.0" - implementation project(":library") - implementation "androidx.core:core-ktx:1.15.0" - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" - - testImplementation "junit:junit:4.13.2" - androidTestImplementation "androidx.test.ext:junit-ktx:1.2.1" - androidTestUtil "androidx.test.services:test-services:1.5.0" - androidTestImplementation "androidx.test.espresso:espresso-core:3.6.1" -} diff --git a/app/build.gradle.kts b/app/build.gradle.kts new file mode 100644 index 0000000..fb4a1b7 --- /dev/null +++ b/app/build.gradle.kts @@ -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) +} diff --git a/build.gradle b/build.gradle deleted file mode 100644 index 2a4ffe4..0000000 --- a/build.gradle +++ /dev/null @@ -1,25 +0,0 @@ -buildscript { - ext.kotlin_version = '2.1.0' - repositories { - google() - mavenCentral() - } - dependencies { - classpath 'com.android.tools.build:gradle:8.7.3' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - } -} - -println "I use Java ${JavaVersion.current()}" - -allprojects { - repositories { - google() - mavenCentral() - } - - // show detailed warnings in gradle output - tasks.withType(JavaCompile) { - options.compilerArgs << "-Xlint:deprecation" << "-Xlint:unchecked" - } -} diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 0000000..05c881a --- /dev/null +++ b/build.gradle.kts @@ -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() + } +} diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 0000000..afac7e3 --- /dev/null +++ b/gradle/libs.versions.toml @@ -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" } diff --git a/library/build.gradle b/library/build.gradle deleted file mode 100644 index 2521aed..0000000 --- a/library/build.gradle +++ /dev/null @@ -1,42 +0,0 @@ -plugins { - id "com.android.library" - id "kotlin-android" - id "maven-publish" -} - -android { - namespace "com.sothree.slidinguppanel.library" - defaultConfig { - minSdkVersion 21 - compileSdk 35 - targetSdkVersion 35 - - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - compileOptions { - sourceCompatibility JavaVersion.VERSION_17 - targetCompatibility JavaVersion.VERSION_17 - } - kotlinOptions { - jvmTarget = "17" - } - lint { - abortOnError false - } -} - -dependencies { - implementation "androidx.recyclerview:recyclerview:1.3.2" - implementation "androidx.core:core-ktx:1.15.0" - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" -} - -project.afterEvaluate { - publishing { - publications { - release(MavenPublication) { - from components.release - } - } - } -} diff --git a/library/build.gradle.kts b/library/build.gradle.kts new file mode 100644 index 0000000..2fef65c --- /dev/null +++ b/library/build.gradle.kts @@ -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("maven") { + from(components["release"]) + } + } + } +}