From 1b6b765c53aa407ef8397f8ad210d8612e0da1af Mon Sep 17 00:00:00 2001 From: "roman.aimaletdinov" Date: Fri, 19 Dec 2025 17:02:50 +0000 Subject: [PATCH] migrated to gradle.kts, updated libs with migration to toml and replaced buildSrc with build convention --- .gitignore | 4 +- build.gradle | 42 -------------- sample/.gitignore | 4 +- sample/build.gradle | 54 ------------------ sample/build.gradle.kts | 39 +++++++++++++ sample/buildSrc/build.gradle.kts | 20 ------- .../kotlin/com/dropbox/sample/Dependencies.kt | 25 --------- ...com.dropbox.affectedtasksplugin.properties | 1 - ...opbox.sample.AffectedTestPlugin.properties | 1 - sample/build_configuration/build.gradle.kts | 33 +++++++++++ .../build_configuration/settings.gradle.kts | 7 +++ .../AffectedTasksPlugin.kt | 19 +++---- .../AffectedTestsPlugin.kt | 5 +- sample/gradle/libs.versions.toml | 36 ++++++++++++ .../gradle/wrapper/gradle-wrapper.properties | 2 +- sample/sample-app/build.gradle | 55 ------------------- sample/sample-app/build.gradle.kts | 54 ++++++++++++++++++ sample/sample-app/proguard-rules.pro | 2 +- sample/sample-core/build.gradle | 54 ------------------ sample/sample-core/build.gradle.kts | 51 +++++++++++++++++ sample/sample-core/proguard-rules.pro | 2 +- sample/sample-jvm-module/build.gradle.kts | 8 +-- sample/sample-util/build.gradle | 50 ----------------- sample/sample-util/build.gradle.kts | 48 ++++++++++++++++ sample/sample-util/proguard-rules.pro | 2 +- sample/settings.gradle | 4 -- sample/settings.gradle.kts | 21 +++++++ settings.gradle | 1 - 28 files changed, 310 insertions(+), 334 deletions(-) delete mode 100644 build.gradle delete mode 100644 sample/build.gradle create mode 100644 sample/build.gradle.kts delete mode 100644 sample/buildSrc/build.gradle.kts delete mode 100644 sample/buildSrc/src/main/kotlin/com/dropbox/sample/Dependencies.kt delete mode 100644 sample/buildSrc/src/main/resources/META-INF/gradle-plugins/com.dropbox.affectedtasksplugin.properties delete mode 100644 sample/buildSrc/src/main/resources/META-INF/gradle-plugins/com.dropbox.sample.AffectedTestPlugin.properties create mode 100644 sample/build_configuration/build.gradle.kts create mode 100644 sample/build_configuration/settings.gradle.kts rename sample/{buildSrc/src/main/kotlin/com/dropbox/sample/tasks => build_configuration/src/main/kotlin/com/dropbox/affectedmoduledetector}/AffectedTasksPlugin.kt (86%) rename sample/{buildSrc/src/main/kotlin/com/dropbox/sample => build_configuration/src/main/kotlin/com/dropbox/affectedmoduledetector}/AffectedTestsPlugin.kt (86%) create mode 100644 sample/gradle/libs.versions.toml delete mode 100644 sample/sample-app/build.gradle create mode 100644 sample/sample-app/build.gradle.kts delete mode 100644 sample/sample-core/build.gradle create mode 100644 sample/sample-core/build.gradle.kts delete mode 100644 sample/sample-util/build.gradle create mode 100644 sample/sample-util/build.gradle.kts delete mode 100644 sample/settings.gradle create mode 100644 sample/settings.gradle.kts delete mode 100644 settings.gradle diff --git a/.gitignore b/.gitignore index 6c22dd3c..6fe9d013 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,6 @@ .externalNativeBuild .cxx local.properties -buildSrc/build -buildSrc/.idea/ +build_configuration/build +build_configuration/.idea/ affected_module_detector.log \ No newline at end of file diff --git a/build.gradle b/build.gradle deleted file mode 100644 index fef45bd2..00000000 --- a/build.gradle +++ /dev/null @@ -1,42 +0,0 @@ -// Top-level build file where you can add configuration options common to all sub-projects/modules. -buildscript { - ext.kotlin_version = "2.2.10" - repositories { - google() - mavenCentral() - maven { - url "https://plugins.gradle.org/m2/" - } - } - dependencies { - classpath "com.android.tools.build:gradle:8.13.0" - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath("org.jlleitschuh.gradle:ktlint-gradle:13.1.0") - classpath("org.jacoco:org.jacoco.core:0.8.13") - classpath "com.vanniktech:gradle-maven-publish-plugin:0.34.0" - } -} - -apply plugin: "org.jlleitschuh.gradle.ktlint" - -allprojects { - repositories { - google() - mavenCentral() - } -} - -allprojects { - plugins.withId("com.vanniktech.maven.publish") { - mavenPublishing { - // sonatypeHost = "CENTRAL_PORTAL" - publishToMavenCentral() - - signAllPublications() - } - } -} - -task clean(type: Delete) { - delete rootProject.buildDir -} diff --git a/sample/.gitignore b/sample/.gitignore index e335d8ee..bf1035dc 100644 --- a/sample/.gitignore +++ b/sample/.gitignore @@ -14,5 +14,5 @@ .externalNativeBuild .cxx local.properties -buildSrc/build -buildSrc/.idea/ \ No newline at end of file +build_configuration/build +build_configuration/.idea/ \ No newline at end of file diff --git a/sample/build.gradle b/sample/build.gradle deleted file mode 100644 index 035333d4..00000000 --- a/sample/build.gradle +++ /dev/null @@ -1,54 +0,0 @@ -import com.dropbox.affectedmoduledetector.AffectedModuleConfiguration -import com.dropbox.sample.Dependencies - -// Top-level build file where you can add configuration options common to all sub-projects/modules. -buildscript { - repositories { - google() - mavenCentral() - maven { - url "https://plugins.gradle.org/m2/" - } - mavenLocal() - } - dependencies { - classpath Dependencies.Libs.ANDROID_BUILD_TOOLS - classpath Dependencies.Libs.KOTLIN_GRADLE_PLUGIN - classpath Dependencies.Libs.KTLINT - classpath Dependencies.Libs.DETEKT - } -} - -apply plugin: "org.jlleitschuh.gradle.ktlint" -apply plugin: "com.dropbox.affectedmoduledetector" - -affectedModuleDetector { - baseDir = "${project.rootDir}" - pathsAffectingAllModules = [ - "buildSrc/" - ] - specifiedBranch = "origin/main" - compareFrom = "SpecifiedBranchCommitMergeBase" - customTasks = [ - new AffectedModuleConfiguration.CustomTask( - "runDetektByImpact", - "detekt", - "Run static analysis tool by Impact analysis" - ) - ] - logFolder = "${project.rootDir}" - excludedModules = [ - "sample-util" - ] -} - -allprojects { - repositories { - google() - mavenCentral() - } -} - -task clean(type: Delete) { - delete rootProject.buildDir -} diff --git a/sample/build.gradle.kts b/sample/build.gradle.kts new file mode 100644 index 00000000..de20435d --- /dev/null +++ b/sample/build.gradle.kts @@ -0,0 +1,39 @@ +import com.dropbox.affectedmoduledetector.AffectedModuleConfiguration + +plugins { + alias(libs.plugins.android.application) apply false + alias(libs.plugins.android.library) apply false + alias(libs.plugins.kotlin.android) apply false + alias(libs.plugins.ktlint) + alias(libs.plugins.detekt) apply false + alias(libs.plugins.affected.module.detector) + id("affected-tests-plugin") // custom plugin based on AMD + id("affected-tasks-plugin") // custom plugin based on AMD +} + +affectedModuleDetector { + baseDir = project.rootDir.toString() + pathsAffectingAllModules = + setOf( + "build_configuration/", + ) + specifiedBranch = "origin/main" + compareFrom = "SpecifiedBranchCommitMergeBase" + customTasks = + setOf( + AffectedModuleConfiguration.CustomTask( + "runDetektByImpact", + "detekt", + "Run static analysis tool by Impact analysis", + ), + ) + logFolder = project.rootDir.toString() + excludedModules = + setOf( + "sample-util", + ) +} + +tasks.register("clean") { + delete(rootProject.layout.buildDirectory) +} diff --git a/sample/buildSrc/build.gradle.kts b/sample/buildSrc/build.gradle.kts deleted file mode 100644 index 9c8afa89..00000000 --- a/sample/buildSrc/build.gradle.kts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2020, Dropbox, Inc. All rights reserved. - */ -plugins { - kotlin("jvm") version "2.2.10" - `java-gradle-plugin` -} - -repositories { - google() - mavenCentral() - mavenLocal() -} - -dependencies { - implementation("com.dropbox.affectedmoduledetector:affectedmoduledetector:0.6.3-SNAPSHOT") - testImplementation("junit:junit:4.13.1") - testImplementation("com.nhaarman:mockito-kotlin:1.5.0") - testImplementation("com.google.truth:truth:1.0.1") -} \ No newline at end of file diff --git a/sample/buildSrc/src/main/kotlin/com/dropbox/sample/Dependencies.kt b/sample/buildSrc/src/main/kotlin/com/dropbox/sample/Dependencies.kt deleted file mode 100644 index 9fc058c0..00000000 --- a/sample/buildSrc/src/main/kotlin/com/dropbox/sample/Dependencies.kt +++ /dev/null @@ -1,25 +0,0 @@ -package com.dropbox.sample - -object Dependencies { - - private object Versions { - const val KOTLIN_VERSION = "2.2.10" - const val DETEKT_VERSION = "1.23.8" - } - - object Libs { - const val KOTLIN_STDLIB = "org.jetbrains.kotlin:kotlin-stdlib:${Versions.KOTLIN_VERSION}" - const val KOTLIN_GRADLE_PLUGIN = "org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.KOTLIN_VERSION}" - const val ANDROIDX_CORE_KTX = "androidx.core:core-ktx:1.3.2" - const val ANDROIDX_APP_COMPAT = "androidx.appcompat:appcompat:1.2.0" - const val ANDROID_MATERIAL = "com.google.android.material:material:1.2.1" - const val ANDROIDX_CONSTRAINTLAYOUT = "androidx.constraintlayout:constraintlayout:1.1.3" - const val JUNIT = "junit:junit:4.13.1" - const val ANDROIDX_TEST_EXT = "androidx.test.ext:junit:1.1.2" - const val ANDROIDX_ESPRESSO = "androidx.test.espresso:espresso-core:3.3.0" - const val ANDROID_BUILD_TOOLS = "com.android.tools.build:gradle:8.6.1" - const val KTLINT = "org.jlleitschuh.gradle:ktlint-gradle:9.1.1" - const val DETEKT = "com.android.tools.build:gradle:${Versions.DETEKT_VERSION}" - const val DETEKT_PLUGIN = "io.gitlab.arturbosch.detekt" - } -} diff --git a/sample/buildSrc/src/main/resources/META-INF/gradle-plugins/com.dropbox.affectedtasksplugin.properties b/sample/buildSrc/src/main/resources/META-INF/gradle-plugins/com.dropbox.affectedtasksplugin.properties deleted file mode 100644 index 20b67559..00000000 --- a/sample/buildSrc/src/main/resources/META-INF/gradle-plugins/com.dropbox.affectedtasksplugin.properties +++ /dev/null @@ -1 +0,0 @@ -implementation-class=com.dropbox.affectedmoduledetector.tasks.AffectedTasksPlugin \ No newline at end of file diff --git a/sample/buildSrc/src/main/resources/META-INF/gradle-plugins/com.dropbox.sample.AffectedTestPlugin.properties b/sample/buildSrc/src/main/resources/META-INF/gradle-plugins/com.dropbox.sample.AffectedTestPlugin.properties deleted file mode 100644 index def29325..00000000 --- a/sample/buildSrc/src/main/resources/META-INF/gradle-plugins/com.dropbox.sample.AffectedTestPlugin.properties +++ /dev/null @@ -1 +0,0 @@ -implementation-class=com.dropbox.sample.AffectedTestsPlugin diff --git a/sample/build_configuration/build.gradle.kts b/sample/build_configuration/build.gradle.kts new file mode 100644 index 00000000..1ae0bdec --- /dev/null +++ b/sample/build_configuration/build.gradle.kts @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2020, Dropbox, Inc. All rights reserved. + */ +plugins { + alias(libs.plugins.kotlin.jvm) + `java-gradle-plugin` +} + +repositories { + google() + mavenCentral() + mavenLocal() +} + +gradlePlugin { + plugins { + register("affected-tests-plugin") { + id = "affected-tests-plugin" + implementationClass = "com.dropbox.affectedmoduledetector.AffectedTestsPlugin" + } + register("affected-tasks-plugin") { + id = "affected-tasks-plugin" + implementationClass = "com.dropbox.affectedmoduledetector.AffectedTasksPlugin" + } + } +} + +dependencies { + implementation(libs.affected.module.detector) + testImplementation(libs.junit) + testImplementation(libs.mockito.kotlin) + testImplementation(libs.google.truth) +} diff --git a/sample/build_configuration/settings.gradle.kts b/sample/build_configuration/settings.gradle.kts new file mode 100644 index 00000000..b5a0fabf --- /dev/null +++ b/sample/build_configuration/settings.gradle.kts @@ -0,0 +1,7 @@ +dependencyResolutionManagement { + versionCatalogs { + create("libs") { + from(files("../gradle/libs.versions.toml")) + } + } +} diff --git a/sample/buildSrc/src/main/kotlin/com/dropbox/sample/tasks/AffectedTasksPlugin.kt b/sample/build_configuration/src/main/kotlin/com/dropbox/affectedmoduledetector/AffectedTasksPlugin.kt similarity index 86% rename from sample/buildSrc/src/main/kotlin/com/dropbox/sample/tasks/AffectedTasksPlugin.kt rename to sample/build_configuration/src/main/kotlin/com/dropbox/affectedmoduledetector/AffectedTasksPlugin.kt index eba65261..51b6d7ea 100644 --- a/sample/buildSrc/src/main/kotlin/com/dropbox/sample/tasks/AffectedTasksPlugin.kt +++ b/sample/build_configuration/src/main/kotlin/com/dropbox/affectedmoduledetector/AffectedTasksPlugin.kt @@ -1,13 +1,8 @@ -package com.dropbox.affectedmoduledetector.tasks +package com.dropbox.affectedmoduledetector -import com.dropbox.affectedmoduledetector.AffectedModuleDetector -import com.dropbox.affectedmoduledetector.DependencyTracker -import com.dropbox.affectedmoduledetector.projectPath import org.gradle.api.Plugin import org.gradle.api.Project -import org.gradle.api.Task import org.gradle.api.tasks.testing.Test -import java.util.* var TEST_TASK_TO_RUN_EXTENSION = "TestTasks" @@ -23,9 +18,9 @@ open class TestTasks { * registers all affected test tasks. Advantage is speed in not needing to skip modules at a large scale * * Registers 3 tasks - * gradlew runAffectedUnitTests - runs jvm tests - * gradlew runAffectedAndroidTests - runs connected tests - * gradlew assembleAffectedAndroidTests - assembles but does not run on device tests, useful when working with device labs + * gradlew runCustomAffectedUnitTests - runs jvm tests + * gradlew runCustomAffectedAndroidUnitTests - runs connected tests + * gradlew customAssembleAffectedAndroidTests - assembles but does not run on device tests, useful when working with device labs */ class AffectedTasksPlugin : Plugin { var ANDROID_TEST_BUILD_VARIANT = "AndroidTest" @@ -39,7 +34,7 @@ class AffectedTasksPlugin : Plugin { project.extensions.findByName(TEST_TASK_TO_RUN_EXTENSION) ) as TestTasks registerAffectedTestTask( - "runAffectedUnitTests", + "runCustomAffectedUnitTests", testTasks.jvmTest, testTasks.jvmTestBackup, rootProject, ) @@ -92,7 +87,7 @@ class AffectedTasksPlugin : Plugin { rootProject: Project ) { registerAffectedTestTask( - "runAffectedAndroidUnitTests", + "runCustomAffectedAndroidUnitTests", testTasks.runAndroidTestTask, null, rootProject ) } @@ -101,7 +96,7 @@ class AffectedTasksPlugin : Plugin { rootProject: Project ) { registerAffectedTestTask( - "assembleAffectedAndroidTests", + "customAssembleAffectedAndroidTests", testTasks.assembleAndroidTestTask, null, rootProject ) } diff --git a/sample/buildSrc/src/main/kotlin/com/dropbox/sample/AffectedTestsPlugin.kt b/sample/build_configuration/src/main/kotlin/com/dropbox/affectedmoduledetector/AffectedTestsPlugin.kt similarity index 86% rename from sample/buildSrc/src/main/kotlin/com/dropbox/sample/AffectedTestsPlugin.kt rename to sample/build_configuration/src/main/kotlin/com/dropbox/affectedmoduledetector/AffectedTestsPlugin.kt index ae95aebb..7cef5e8b 100644 --- a/sample/buildSrc/src/main/kotlin/com/dropbox/sample/AffectedTestsPlugin.kt +++ b/sample/build_configuration/src/main/kotlin/com/dropbox/affectedmoduledetector/AffectedTestsPlugin.kt @@ -1,6 +1,5 @@ -package com.dropbox.sample +package com.dropbox.affectedmoduledetector -import com.dropbox.affectedmoduledetector.AffectedModuleDetector import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.api.tasks.testing.Test @@ -17,4 +16,4 @@ class AffectedTestsPlugin : Plugin { AffectedModuleDetector.configureTaskGuard(task) } } -} +} \ No newline at end of file diff --git a/sample/gradle/libs.versions.toml b/sample/gradle/libs.versions.toml new file mode 100644 index 00000000..12172777 --- /dev/null +++ b/sample/gradle/libs.versions.toml @@ -0,0 +1,36 @@ +[versions] +kotlin = "2.3.0" +detekt = "1.23.8" +coreKtx = "1.17.0" +appCompat = "1.7.1" +material = "1.13.0" +constraintlayout = "2.2.1" +junit = "4.13.2" +androidxTestExt = "1.3.0" +espressoCore = "3.7.0" +androidGradlePlugin = "8.13.2" +affectedModuleDetector = "0.6.2" +ktlint = "14.0.1" +mockitoKotlin = "1.6.0" +googleTruth = "1.4.5" + +[libraries] +kotlin-stdlib = { group = "org.jetbrains.kotlin", name = "kotlin-stdlib", version.ref = "kotlin" } +androidx-appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appCompat" } +android-material = { group = "com.google.android.material", name = "material", version.ref = "material" } +androidx-constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "constraintlayout" } +junit = { group = "junit", name = "junit", version.ref = "junit" } +androidx-test-ext-junit = { group = "androidx.test.ext", name = "junit", version.ref = "androidxTestExt" } +androidx-espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" } +affected-module-detector = { module = "com.dropbox.affectedmoduledetector:affectedmoduledetector", version.ref = "affectedModuleDetector" } +mockito-kotlin = { group = "com.nhaarman", name = "mockito-kotlin", version.ref = "mockitoKotlin" } +google-truth = { group = "com.google.truth", name = "truth", version.ref = "googleTruth" } + +[plugins] +android-application = { id = "com.android.application", version.ref = "androidGradlePlugin" } +android-library = { id = "com.android.library", version.ref = "androidGradlePlugin" } +kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } +ktlint = { id = "org.jlleitschuh.gradle.ktlint", version.ref = "ktlint" } +detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" } +kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } +affected-module-detector = { id = "com.dropbox.affectedmoduledetector", version.ref = "affectedModuleDetector" } diff --git a/sample/gradle/wrapper/gradle-wrapper.properties b/sample/gradle/wrapper/gradle-wrapper.properties index d30212c0..ac57dd15 100644 --- a/sample/gradle/wrapper/gradle-wrapper.properties +++ b/sample/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/sample/sample-app/build.gradle b/sample/sample-app/build.gradle deleted file mode 100644 index e3bec563..00000000 --- a/sample/sample-app/build.gradle +++ /dev/null @@ -1,55 +0,0 @@ -import com.dropbox.sample.Dependencies - -plugins { - id 'com.android.application' - id 'kotlin-android' -} - -affectedTestConfiguration { - assembleAndroidTestTask = "assembleAndroidTest" -} - - -android { - namespace "com.dropbox.detector.sample" - - compileSdk 34 - - defaultConfig { - applicationId "com.dropbox.detector.sample" - minSdkVersion 23 - targetSdkVersion 34 - versionCode 1 - versionName "1.0" - - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' - } - } - compileOptions { - sourceCompatibility JavaVersion.VERSION_17 - targetCompatibility JavaVersion.VERSION_17 - } - kotlinOptions { - jvmTarget = '17' - } -} - -dependencies { - - implementation project(":sample-core") - implementation project(":sample-util") - - implementation Dependencies.Libs.KOTLIN_STDLIB - implementation Dependencies.Libs.ANDROIDX_APP_COMPAT - implementation Dependencies.Libs.ANDROID_MATERIAL - implementation Dependencies.Libs.ANDROIDX_CONSTRAINTLAYOUT - testImplementation Dependencies.Libs.JUNIT - androidTestImplementation Dependencies.Libs.ANDROIDX_TEST_EXT - androidTestImplementation Dependencies.Libs.ANDROIDX_ESPRESSO -} \ No newline at end of file diff --git a/sample/sample-app/build.gradle.kts b/sample/sample-app/build.gradle.kts new file mode 100644 index 00000000..753367ba --- /dev/null +++ b/sample/sample-app/build.gradle.kts @@ -0,0 +1,54 @@ +import org.jetbrains.kotlin.gradle.dsl.JvmTarget +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + +plugins { + alias(libs.plugins.android.application) + alias(libs.plugins.kotlin.android) +} + +affectedTestConfiguration { + assembleAndroidTestTask = "assembleAndroidTest" +} + +android { + namespace = "com.dropbox.detector.sample" + compileSdk = 36 + + defaultConfig { + applicationId = "com.dropbox.detector.sample" + minSdk = 23 + targetSdk = 36 + versionCode = 1 + versionName = "1.0" + + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + getByName("release") { + isMinifyEnabled = false + proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } +} + +tasks.withType { + compilerOptions.jvmTarget.set(JvmTarget.JVM_17) +} + +dependencies { + implementation(project(":sample-core")) + implementation(project(":sample-util")) + + implementation(libs.kotlin.stdlib) + implementation(libs.androidx.appcompat) + implementation(libs.android.material) + implementation(libs.androidx.constraintlayout) + testImplementation(libs.junit) + androidTestImplementation(libs.androidx.test.ext.junit) + androidTestImplementation(libs.androidx.espresso.core) +} diff --git a/sample/sample-app/proguard-rules.pro b/sample/sample-app/proguard-rules.pro index 481bb434..bd4033dc 100644 --- a/sample/sample-app/proguard-rules.pro +++ b/sample/sample-app/proguard-rules.pro @@ -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 diff --git a/sample/sample-core/build.gradle b/sample/sample-core/build.gradle deleted file mode 100644 index b8107cfa..00000000 --- a/sample/sample-core/build.gradle +++ /dev/null @@ -1,54 +0,0 @@ -import com.dropbox.sample.Dependencies - -plugins { - id 'com.android.library' - id 'kotlin-android' - id("io.gitlab.arturbosch.detekt") version "1.20.0" -} - -affectedTestConfiguration { - jvmTestTask = "test" -} - -android { - namespace "com.dropbox.detector.sample_core" - - compileSdk 34 - - defaultConfig { - minSdkVersion 23 - targetSdkVersion 34 - versionCode 1 - versionName "1.0" - - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - consumerProguardFiles "consumer-rules.pro" - } - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' - } - } - compileOptions { - sourceCompatibility JavaVersion.VERSION_11 - targetCompatibility JavaVersion.VERSION_11 - } - kotlinOptions { - jvmTarget = '11' - } -} - -dependencies { - - implementation project(":sample-util") - - implementation Dependencies.Libs.KOTLIN_STDLIB - implementation Dependencies.Libs.ANDROIDX_APP_COMPAT - implementation Dependencies.Libs.ANDROID_MATERIAL - implementation Dependencies.Libs.ANDROIDX_CONSTRAINTLAYOUT - testImplementation Dependencies.Libs.JUNIT - androidTestImplementation Dependencies.Libs.ANDROIDX_TEST_EXT - androidTestImplementation Dependencies.Libs.ANDROIDX_ESPRESSO -} \ No newline at end of file diff --git a/sample/sample-core/build.gradle.kts b/sample/sample-core/build.gradle.kts new file mode 100644 index 00000000..9cb3d4b9 --- /dev/null +++ b/sample/sample-core/build.gradle.kts @@ -0,0 +1,51 @@ +import org.jetbrains.kotlin.gradle.dsl.JvmTarget +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + +plugins { + alias(libs.plugins.android.library) + alias(libs.plugins.kotlin.android) + alias(libs.plugins.detekt) +} + +affectedTestConfiguration { + jvmTestTask = "test" +} + +android { + namespace = "com.dropbox.detector.sample_core" + compileSdk = 36 + + defaultConfig { + minSdk = 23 + + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + consumerProguardFiles("consumer-rules.pro") + } + + buildTypes { + getByName("release") { + isMinifyEnabled = false + proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } +} + +tasks.withType { + compilerOptions.jvmTarget.set(JvmTarget.JVM_17) +} + +dependencies { + implementation(project(":sample-util")) + + implementation(libs.kotlin.stdlib) + implementation(libs.androidx.appcompat) + implementation(libs.android.material) + implementation(libs.androidx.constraintlayout) + testImplementation(libs.junit) + androidTestImplementation(libs.androidx.test.ext.junit) + androidTestImplementation(libs.androidx.espresso.core) +} diff --git a/sample/sample-core/proguard-rules.pro b/sample/sample-core/proguard-rules.pro index 481bb434..bd4033dc 100644 --- a/sample/sample-core/proguard-rules.pro +++ b/sample/sample-core/proguard-rules.pro @@ -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 diff --git a/sample/sample-jvm-module/build.gradle.kts b/sample/sample-jvm-module/build.gradle.kts index ebce4122..bc4c7a21 100644 --- a/sample/sample-jvm-module/build.gradle.kts +++ b/sample/sample-jvm-module/build.gradle.kts @@ -4,10 +4,10 @@ plugins { } java { - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 } kotlin { - jvmToolchain(11) -} \ No newline at end of file + jvmToolchain(17) +} diff --git a/sample/sample-util/build.gradle b/sample/sample-util/build.gradle deleted file mode 100644 index 54aebaa6..00000000 --- a/sample/sample-util/build.gradle +++ /dev/null @@ -1,50 +0,0 @@ -import com.dropbox.sample.Dependencies - -plugins { - id 'com.android.library' - id 'kotlin-android' -} - -affectedTestConfiguration { - assembleAndroidTestTask = "assembleDebugAndroidTest" -} - -android { - namespace "com.dropbox.detector.sample_util" - compileSdk 34 - - defaultConfig { - minSdkVersion 23 - targetSdkVersion 34 - versionCode 1 - versionName "1.0" - - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - consumerProguardFiles "consumer-rules.pro" - } - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' - } - } - compileOptions { - sourceCompatibility JavaVersion.VERSION_17 - targetCompatibility JavaVersion.VERSION_17 - } - kotlinOptions { - jvmTarget = '17' - } -} - -dependencies { - - implementation Dependencies.Libs.KOTLIN_STDLIB - implementation Dependencies.Libs.ANDROIDX_APP_COMPAT - implementation Dependencies.Libs.ANDROID_MATERIAL - implementation Dependencies.Libs.ANDROIDX_CONSTRAINTLAYOUT - testImplementation Dependencies.Libs.JUNIT - androidTestImplementation Dependencies.Libs.ANDROIDX_TEST_EXT - androidTestImplementation Dependencies.Libs.ANDROIDX_ESPRESSO -} \ No newline at end of file diff --git a/sample/sample-util/build.gradle.kts b/sample/sample-util/build.gradle.kts new file mode 100644 index 00000000..b97dfb05 --- /dev/null +++ b/sample/sample-util/build.gradle.kts @@ -0,0 +1,48 @@ +import org.jetbrains.kotlin.gradle.dsl.JvmTarget +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + +plugins { + alias(libs.plugins.android.library) + alias(libs.plugins.kotlin.android) +} + +affectedTestConfiguration { + assembleAndroidTestTask = "assembleDebugAndroidTest" +} + +android { + namespace = "com.dropbox.detector.sample_util" + compileSdk = 36 + + defaultConfig { + minSdk = 23 + + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + consumerProguardFiles("consumer-rules.pro") + } + + buildTypes { + getByName("release") { + isMinifyEnabled = false + proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } +} + +tasks.withType { + compilerOptions.jvmTarget.set(JvmTarget.JVM_17) +} + +dependencies { + implementation(libs.kotlin.stdlib) + implementation(libs.androidx.appcompat) + implementation(libs.android.material) + implementation(libs.androidx.constraintlayout) + testImplementation(libs.junit) + androidTestImplementation(libs.androidx.test.ext.junit) + androidTestImplementation(libs.androidx.espresso.core) +} diff --git a/sample/sample-util/proguard-rules.pro b/sample/sample-util/proguard-rules.pro index 481bb434..bd4033dc 100644 --- a/sample/sample-util/proguard-rules.pro +++ b/sample/sample-util/proguard-rules.pro @@ -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 diff --git a/sample/settings.gradle b/sample/settings.gradle deleted file mode 100644 index 1ea3d634..00000000 --- a/sample/settings.gradle +++ /dev/null @@ -1,4 +0,0 @@ -include ':sample-app' -include ':sample-core' -include ':sample-jvm-module' -include ':sample-util' \ No newline at end of file diff --git a/sample/settings.gradle.kts b/sample/settings.gradle.kts new file mode 100644 index 00000000..43f62b50 --- /dev/null +++ b/sample/settings.gradle.kts @@ -0,0 +1,21 @@ +pluginManagement { + repositories { + gradlePluginPortal() + google() + mavenCentral() + } +} + +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + } +} + +includeBuild("build_configuration") +include(":sample-app") +include(":sample-core") +include(":sample-jvm-module") +include(":sample-util") diff --git a/settings.gradle b/settings.gradle deleted file mode 100644 index d789a8e1..00000000 --- a/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -include ':affectedmoduledetector' \ No newline at end of file