diff --git a/.buildsystem/deploy.sh b/.buildsystem/deploy.sh index 887b4f47b..f5fe881a4 100755 --- a/.buildsystem/deploy.sh +++ b/.buildsystem/deploy.sh @@ -1,16 +1,13 @@ #!/usr/bin/env bash cd `dirname $0`/.. -TARGETS="" -for i in ":core" ":vendor:vendor-android:base" ":vendor:vendor-android:ddmlib" ":marathon-gradle-plugin" ":report:execution-timeline" ":report:html-report"; do - TARGETS="$TARGETS $i:publishDefaultPublicationToMavenLocal" -done - -if [ ! -z "$TRAVIS_TAG" ] +if [ -n "$TRAVIS_TAG" ] then echo "on a tag -> deploy release version $TRAVIS_TAG" - ./gradlew $TARGETS -PreleaseMode=RELEASE + release_mode="RELEASE" else echo "not on a tag -> deploy snapshot version" - ./gradlew $TARGETS -PreleaseMode=SNAPSHOT + release_mode="SNAPSHOT" fi + +./gradlew -PreleaseMode="$release_mode" publishToMavenLocal diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a88747789..6c385a065 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,6 +26,6 @@ jobs: restore-keys: | ${{ runner.os }}-gradle- - name: Build - run: ./gradlew build + run: ./gradlew build publishToMavenLocal - name: Build sample run: ./gradlew -p sample marathon --dry-run diff --git a/build.gradle.kts b/build.gradle.kts index 21bd7f45a..fe97416f6 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,49 +1,3 @@ -import io.gitlab.arturbosch.detekt.extensions.DetektExtension -import org.jetbrains.kotlin.gradle.dsl.JvmTarget -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile - -plugins { - id("org.jetbrains.kotlin.jvm") apply false - id("io.gitlab.arturbosch.detekt") apply false -} - -allprojects { - group = "com.github.badoo.marathon" - - plugins.withId("org.jetbrains.kotlin.jvm") { - plugins.apply("io.gitlab.arturbosch.detekt") - - dependencies.add("implementation", dependencies.platform(Libraries.kotlinBom)) - dependencies.add("implementation", dependencies.platform(Libraries.kotlinCoroutinesBom)) - } - - plugins.withId("java") { - extensions.configure { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 - withJavadocJar() - withSourcesJar() - } - } - - plugins.withId("io.gitlab.arturbosch.detekt") { - configure { - buildUponDefaultConfig = true - config.from("$rootDir/detekt.yml") - } - } - - tasks.withType().configureEach { - compilerOptions { - jvmTarget.set(JvmTarget.JVM_17) - freeCompilerArgs.addAll( - "-Xjvm-default=all", - "-opt-in=kotlin.RequiresOptIn" - ) - } - } -} - tasks.register("clean") { delete(layout.buildDirectory) } diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 876c922b2..a8a2a75ca 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -1,7 +1,22 @@ plugins { + `java-gradle-plugin` `kotlin-dsl` } repositories { mavenCentral() } + +dependencies { + implementation(libs.detekt.gradle.plugin) + implementation(libs.kotlin.gradle.plugin) +} + +gradlePlugin { + plugins { + create("marathonConventionsPlugin") { + id = "com.badoo.marathon.conventions" + implementationClass = "com.badoo.marathon.conventions.MarathonConventionsPlugin" + } + } +} diff --git a/buildSrc/gradle/libs.versions.toml b/buildSrc/gradle/libs.versions.toml new file mode 120000 index 000000000..d9b1d4e68 --- /dev/null +++ b/buildSrc/gradle/libs.versions.toml @@ -0,0 +1 @@ +../../gradle/libs.versions.toml \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/Deployment.kt b/buildSrc/src/main/kotlin/Deployment.kt deleted file mode 100644 index ff82ff374..000000000 --- a/buildSrc/src/main/kotlin/Deployment.kt +++ /dev/null @@ -1,68 +0,0 @@ -import org.gradle.api.Project -import org.gradle.api.publish.PublishingExtension -import org.gradle.api.publish.maven.MavenPom -import org.gradle.api.publish.maven.MavenPublication -import org.gradle.kotlin.dsl.configure -import org.gradle.kotlin.dsl.create -import org.gradle.kotlin.dsl.get -import org.gradle.kotlin.dsl.provideDelegate - -object Deployment { - var releaseMode: String? = null - var versionSuffix: String? = null - - fun initialize(project: Project) { - val releaseMode: String? by project - val versionSuffix = when (releaseMode) { - "RELEASE" -> "" - else -> "-SNAPSHOT" - } - - Deployment.releaseMode = releaseMode - Deployment.versionSuffix = versionSuffix - - initializePublishing(project) - } - - private fun initializePublishing(project: Project) { - project.version = Versions.marathon + versionSuffix - - project.plugins.apply("maven-publish") - - project.configure { - publications { - create("default") { - Deployment.customizePom(project, pom) - from(project.components["java"]) - } - } - } - } - - fun customizePom(project: Project, pom: MavenPom?) { - pom?.apply { - name.set(project.name) - url.set("https://github.com/badoo/marathon") - description.set("Android test runner") - - licenses { - license { - name.set("The Apache License, Version 2.0") - url.set("http://www.apache.org/licenses/LICENSE-2.0.txt") - } - } - - developers { - developer { - id.set("marathon-team") - name.set("Marathon team") - email.set("anton@malinskiy.com") - } - } - - scm { - url.set("https://github.com/badoo/marathon") - } - } - } -} diff --git a/buildSrc/src/main/kotlin/Testing.kt b/buildSrc/src/main/kotlin/Testing.kt deleted file mode 100644 index 6d62437a9..000000000 --- a/buildSrc/src/main/kotlin/Testing.kt +++ /dev/null @@ -1,24 +0,0 @@ -import org.gradle.api.Project -import org.gradle.api.tasks.testing.Test -import org.gradle.kotlin.dsl.dependencies -import org.gradle.kotlin.dsl.withType - -object Testing { - fun configure(project: Project) { - project.dependencies { - add("testImplementation", TestLibraries.kluent) - add("testImplementation", TestLibraries.mockitoKotlin) - add("testImplementation", TestLibraries.spekAPI) - add("testImplementation", TestLibraries.junit5) - add("testImplementation", TestLibraries.junitJupiterApi) - add("testRuntimeOnly", TestLibraries.junitJupiterEngine) - add("testRuntimeOnly", TestLibraries.spekJUnitPlatformEngine) - } - - project.tasks.withType().configureEach { - useJUnitPlatform { - includeEngines("spek", "junit-jupiter") - } - } - } -} diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt deleted file mode 100644 index 8c006fd37..000000000 --- a/buildSrc/src/main/kotlin/Versions.kt +++ /dev/null @@ -1,82 +0,0 @@ -object Versions { - val marathon = System.getenv("DEPLOY_VERSION_OVERRIDE") ?: "0.5.4" - - val coroutines = "1.7.3" - val ktor = "2.0.3" - - val ddmlib = "31.0.2" - val dexTestParser = "2.3.4" - val kotlinLogging = "1.4.9" - val slf4jAPI = "1.0.0" - val logbackClassic = "1.2.3" - val axmlParser = "1.0" - - val androidGradleVersion = "8.4.2" - - val spek = "1.1.5" - val junit5 = "5.6.0" - val kluent = "1.64" - - val junit = "4.12" - val gson = "2.8.5" - val apacheCommonsText = "1.3" - val apacheCommonsIO = "2.6" - val apacheCommonsCollections = "4.4" - val jacksonDatabind = "2.9.5" - val testContainers = "1.15.3" - val junitJupiter = "5.10.3" - val scalr = "4.2" - val allureJava = "2.28.0" - val allureEnvironment = "1.0.0" - val mockitoKotlin = "4.0.0" - val koin = "2.0.1" - val jsonAssert = "1.5.0" -} - -object BuildPlugins { - val androidGradle = "com.android.tools.build:gradle-api:${Versions.androidGradleVersion}" -} - -object Libraries { - val ddmlib = "com.android.tools.ddms:ddmlib:${Versions.ddmlib}" - val androidCommon = "com.android.tools:common:${Versions.ddmlib}" - val dexTestParser = "com.linkedin.dextestparser:parser:${Versions.dexTestParser}" - val kotlinBom = "org.jetbrains.kotlin:kotlin-bom" - val kotlinCoroutinesBom = "org.jetbrains.kotlinx:kotlinx-coroutines-bom:${Versions.coroutines}" - val kotlinReflect = "org.jetbrains.kotlin:kotlin-reflect" - val kotlinLogging = "io.github.microutils:kotlin-logging:${Versions.kotlinLogging}" - val slf4jAPI = "com.github.nfrankel:slf4k:${Versions.slf4jAPI}" - val logbackClassic = "ch.qos.logback:logback-classic:${Versions.logbackClassic}" - val kotlinCoroutines = "org.jetbrains.kotlinx:kotlinx-coroutines-core" - val ktorClient = "io.ktor:ktor-client-core:${Versions.ktor}" - val ktorAuth = "io.ktor:ktor-client-auth-jvm:${Versions.ktor}" - val ktorApacheClient = "io.ktor:ktor-client-apache:${Versions.ktor}" - val axmlParser = "com.shazam:axmlparser:${Versions.axmlParser}" - val gson = "com.google.code.gson:gson:${Versions.gson}" - val apacheCommonsText = "org.apache.commons:commons-text:${Versions.apacheCommonsText}" - val apacheCommonsIO = "commons-io:commons-io:${Versions.apacheCommonsIO}" - val apacheCommonsCollections = "org.apache.commons:commons-collections4:${Versions.apacheCommonsCollections}" - val jacksonAnnotations = "com.fasterxml.jackson.core:jackson-annotations:${Versions.jacksonDatabind}" - val scalr = "org.imgscalr:imgscalr-lib:${Versions.scalr}" - val allure = "io.qameta.allure:allure-java-commons:${Versions.allureJava}" - val allureEnvironment = "com.github.automatedowl:allure-environment-writer:${Versions.allureEnvironment}" - val koin = "io.insert-koin:koin-core:${Versions.koin}" -} - -object TestLibraries { - val spekAPI = "org.jetbrains.spek:spek-api:${Versions.spek}" - val spekJUnitPlatformEngine = "org.jetbrains.spek:spek-junit-platform-engine:${Versions.spek}" - val junit5 = "org.junit.jupiter:junit-jupiter:${Versions.junit5}" - val kluent = "org.amshove.kluent:kluent:${Versions.kluent}" - val ktorClientMock = "io.ktor:ktor-client-mock-jvm:${Versions.ktor}" - val kotlinCoroutinesTest = "org.jetbrains.kotlinx:kotlinx-coroutines-test" - - val junit = "junit:junit:${Versions.junit}" - val mockitoKotlin = "org.mockito.kotlin:mockito-kotlin:${Versions.mockitoKotlin}" - val junitJupiterApi = "org.junit.jupiter:junit-jupiter-api:${Versions.junitJupiter}" - val junitJupiterEngine = "org.junit.jupiter:junit-jupiter-engine:${Versions.junitJupiter}" - val koin = "io.insert-koin:koin-test:${Versions.koin}" - val jsonAssert = "org.skyscreamer:jsonassert:${Versions.jsonAssert}" - - val testContainers = "org.testcontainers:testcontainers:${Versions.testContainers}" -} diff --git a/buildSrc/src/main/kotlin/com/badoo/marathon/conventions/MarathonConventionsPlugin.kt b/buildSrc/src/main/kotlin/com/badoo/marathon/conventions/MarathonConventionsPlugin.kt new file mode 100644 index 000000000..3bb4ad796 --- /dev/null +++ b/buildSrc/src/main/kotlin/com/badoo/marathon/conventions/MarathonConventionsPlugin.kt @@ -0,0 +1,172 @@ +package com.badoo.marathon.conventions + +import io.gitlab.arturbosch.detekt.extensions.DetektExtension +import org.gradle.api.Plugin +import org.gradle.api.Project +import org.gradle.api.artifacts.VersionCatalog +import org.gradle.api.artifacts.VersionCatalogsExtension +import org.gradle.api.attributes.Usage +import org.gradle.api.plugins.JavaPluginExtension +import org.gradle.api.provider.ProviderFactory +import org.gradle.api.publish.PublishingExtension +import org.gradle.api.publish.maven.MavenPublication +import org.gradle.api.publish.tasks.GenerateModuleMetadata +import org.gradle.api.tasks.testing.Test +import org.gradle.jvm.toolchain.JavaLanguageVersion +import org.gradle.kotlin.dsl.configure +import org.gradle.kotlin.dsl.create +import org.gradle.kotlin.dsl.dependencies +import org.gradle.kotlin.dsl.get +import org.gradle.kotlin.dsl.getByType +import org.gradle.kotlin.dsl.withType +import org.jetbrains.kotlin.gradle.dsl.KotlinJvmProjectExtension + +class MarathonConventionsPlugin : Plugin { + override fun apply(project: Project) { + val versionCatalog = project.extensions.getByType().named("libs") + + project.group = "com.github.badoo.marathon" + project.version = getMarathonVersion(project.providers, versionCatalog) + + project.plugins.withId("java") { + project.plugins.apply("maven-publish") + project.configureJava(versionCatalog) + project.configureTesting(versionCatalog) + } + + project.plugins.withId("org.jetbrains.kotlin.jvm") { + project.plugins.apply("io.gitlab.arturbosch.detekt") + project.configureKotlin() + } + + project.plugins.withId("io.gitlab.arturbosch.detekt") { + project.configureDetekt() + } + + project.plugins.withId("maven-publish") { + project.configurePublishing() + } + + // Disable Gradle module metadata to avoid publishing BOM dependencies + project.tasks.withType().configureEach { + enabled = false + } + } + + private fun Project.configureJava(versionCatalog: VersionCatalog) { + extensions.configure { + toolchain { + languageVersion.set(JVM_TARGET) + } + withJavadocJar() + withSourcesJar() + } + + dependencies { + add("implementation", platform(versionCatalog.findLibrary("kotlin-bom").get())) + add("implementation", platform(versionCatalog.findLibrary("kotlinx-coroutines-bom").get())) + add("implementation", platform(versionCatalog.findLibrary("ktor-bom").get())) + } + } + + private fun Project.configureKotlin() { + extensions.configure { + jvmToolchain { + languageVersion.set(JVM_TARGET) + } + compilerOptions { + freeCompilerArgs.addAll( + "-Xjvm-default=all", + "-opt-in=kotlin.RequiresOptIn" + ) + } + } + } + + private fun Project.configureDetekt() { + configure { + buildUponDefaultConfig = true + config.from(rootDir.resolve("detekt.yml")) + } + } + + private fun Project.configureTesting(versionCatalog: VersionCatalog) { + dependencies { + add("implementation", platform(versionCatalog.findLibrary("junit-bom").get())) + add("testImplementation", versionCatalog.findLibrary("kluent").get()) + add("testImplementation", versionCatalog.findLibrary("mockito-kotlin").get()) + add("testImplementation", versionCatalog.findLibrary("junit-jupiter-api").get()) + add("testImplementation", versionCatalog.findLibrary("spek-api").get()) + add("testRuntimeOnly", versionCatalog.findLibrary("junit-jupiter-engine").get()) + add("testRuntimeOnly", versionCatalog.findLibrary("spek-engine").get()) + } + + tasks.withType().configureEach { + useJUnitPlatform { + includeEngines("spek", "junit-jupiter") + } + } + } + + private fun Project.configurePublishing() { + configure { + publications { + if (!plugins.hasPlugin("java-gradle-plugin")) { + create("maven") { + from(components["java"]) + customizePom() + } + } + withType().configureEach { + versionMapping { + usage(Usage.JAVA_API) { + fromResolutionResult() + } + usage(Usage.JAVA_RUNTIME) { + fromResolutionResult() + } + } + customizePom() + } + } + } + } + + private fun MavenPublication.customizePom() { + pom { + description.set("Android test runner") + url.set("https://github.com/badoo/marathon") + withXml { + // Avoid publishing BOM dependencies + val node = asElement() + val children = node.getElementsByTagName("dependencyManagement") + for (i in 0 until children.length) { + node.removeChild(children.item(i)) + } + } + + licenses { + license { + name.set("The Apache License, Version 2.0") + url.set("http://www.apache.org/licenses/LICENSE-2.0.txt") + } + } + + scm { + url.set("https://github.com/badoo/marathon") + } + } + } + + private fun getMarathonVersion(providers: ProviderFactory, versionCatalog: VersionCatalog): String { + val version = providers.environmentVariable("DEPLOY_VERSION_OVERRIDE") + .orElse(versionCatalog.findVersion("marathon").get().requiredVersion) + val releaseMode = providers.gradleProperty("releaseMode") + val versionSuffix = if (releaseMode.orNull == "RELEASE") "" else "-SNAPSHOT" + return version.get() + versionSuffix + } + + companion object { + private val JVM_TARGET = JavaLanguageVersion.of(17) + } +} diff --git a/core/build.gradle.kts b/core/build.gradle.kts index 7dfdcc839..4c8126fbf 100644 --- a/core/build.gradle.kts +++ b/core/build.gradle.kts @@ -1,7 +1,6 @@ plugins { - idea - `java-library` id("org.jetbrains.kotlin.jvm") + id("com.badoo.marathon.conventions") } sourceSets { @@ -20,44 +19,41 @@ dependencies { implementation(project(":report:html-report")) implementation(project(":report:execution-timeline")) - implementation(Libraries.allure) - implementation(Libraries.allureEnvironment) - - implementation(Libraries.ktorClient) - implementation(Libraries.ktorAuth) - implementation(Libraries.ktorApacheClient) - implementation(Libraries.gson) - implementation(Libraries.jacksonAnnotations) - implementation(Libraries.apacheCommonsText) - implementation(Libraries.apacheCommonsIO) - implementation(Libraries.apacheCommonsCollections) - implementation(Libraries.kotlinCoroutines) - implementation(Libraries.kotlinLogging) - implementation(Libraries.slf4jAPI) - implementation(Libraries.logbackClassic) - api(Libraries.koin) + implementation(libs.allure.java.commons) + implementation(libs.allure.environment.writer) + implementation(libs.apache.commons.collections) + implementation(libs.apache.commons.io) + implementation(libs.apache.commons.text) + implementation(libs.gson) + implementation(libs.kotlin.logging) + implementation(libs.kotlinx.coroutines.core) + implementation(libs.ktor.client.core) + implementation(libs.ktor.client.auth) + implementation(libs.ktor.client.apache) + implementation(libs.jackson.annotations) + implementation(libs.logback.classic) + implementation(libs.slf4j.api) + api(libs.koin.core) + testImplementation(project(":vendor:vendor-test")) - testImplementation(TestLibraries.kotlinCoroutinesTest) - testImplementation(TestLibraries.testContainers) - testImplementation(TestLibraries.ktorClientMock) - testImplementation(TestLibraries.koin) + testImplementation(libs.kotlinx.coroutines.test) + testImplementation(libs.koin.test) + testImplementation(libs.ktor.client.mock) + testImplementation(libs.testcontainers) } val integrationTest = task("integrationTest") { description = "Runs integration tests." - group = "verification" + group = JavaBasePlugin.VERIFICATION_GROUP testClassesDirs = sourceSets["integrationTest"].output.classesDirs classpath = sourceSets["integrationTest"].runtimeClasspath exclude("**/resources/**") - shouldRunAfter("test") + shouldRunAfter(tasks.named("test")) } tasks.named("check") { dependsOn(integrationTest) } - -Deployment.initialize(project) -Testing.configure(project) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 000000000..a5eb29669 --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,70 @@ +[versions] +allure-java = "2.28.0" +allure-environment-writer = "1.0.0" +android-gradle-plugin = "8.4.2" +android-tools = "31.0.2" +apache-commons-collections = "4.4" +apache-commons-io = "2.6" +apache-commons-text = "1.3" +axmlparser = "1.0" +detekt = "1.23.6" +dextestparser = "2.3.4" +gson = "2.8.5" +imgscalr = "4.2" +jackson = "2.9.5" +junit5 = "5.10.3" +jsonassert = "1.5.0" +kluent = "1.64" +koin = "2.0.1" +kotlin = "1.9.23" +kotlin-logging = "1.4.9" +kotlinx-coroutines = "1.8.1" +ktor = "2.0.3" +logback = "1.2.3" +marathon = "0.5.4" +mockito = "5.4.0" +slf4j = "1.7.36" +spek = "1.1.5" +testcontainers = "1.15.3" + +[libraries] +allure-java-commons = { module = "io.qameta.allure:allure-java-commons", version.ref = "allure-java" } +allure-environment-writer = { module = "com.github.automatedowl:allure-environment-writer", version.ref = "allure-environment-writer" } +android-gradle-api = { module = "com.android.tools.build:gradle-api", version.ref = "android-gradle-plugin" } +android-tools-common = { module = "com.android.tools:common", version.ref = "android-tools" } +android-tools-ddmlib = { module = "com.android.tools.ddms:ddmlib", version.ref = "android-tools" } +apache-commons-collections = { module = "org.apache.commons:commons-collections4", version.ref = "apache-commons-collections" } +apache-commons-io = { module = "commons-io:commons-io", version.ref = "apache-commons-io" } +apache-commons-text = { module = "org.apache.commons:commons-text", version.ref = "apache-commons-text" } +axmlparser = { module = "com.shazam:axmlparser", version.ref = "axmlparser" } +detekt-gradle-plugin = { module = "io.gitlab.arturbosch.detekt:detekt-gradle-plugin", version.ref = "detekt" } +dextestparser = { module = "com.linkedin.dextestparser:parser", version.ref = "dextestparser" } +gson = { module = "com.google.code.gson:gson", version.ref = "gson" } +imgscalr = { module = "org.imgscalr:imgscalr-lib", version.ref = "imgscalr" } +jackson-annotations = { module = "com.fasterxml.jackson.core:jackson-annotations", version.ref = "jackson" } +junit-bom = { module = "org.junit:junit-bom", version.ref = "junit5" } +junit-jupiter-api = { module = "org.junit.jupiter:junit-jupiter-api" } +junit-jupiter-engine = { module = "org.junit.jupiter:junit-jupiter-engine" } +jsonassert = { module = "org.skyscreamer:jsonassert", version.ref = "jsonassert" } +kluent = { module = "org.amshove.kluent:kluent", version.ref = "kluent" } +koin-core = { module = "io.insert-koin:koin-core", version.ref = "koin" } +koin-test = { module = "io.insert-koin:koin-test", version.ref = "koin" } +kotlin-bom = { module = "org.jetbrains.kotlin:kotlin-bom", version.ref = "kotlin" } +kotlin-gradle-api = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin-api", version.ref = "kotlin" } +kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" } +kotlin-logging = { module = "io.github.microutils:kotlin-logging", version.ref = "kotlin-logging" } +kotlinx-coroutines-bom = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-bom", version.ref = "kotlinx-coroutines" } +kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core" } +kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test" } +kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect" } +ktor-bom = { module = "io.ktor:ktor-bom", version.ref = "ktor" } +ktor-client-core = { module = "io.ktor:ktor-client-core" } +ktor-client-auth = { module = "io.ktor:ktor-client-auth" } +ktor-client-apache = { module = "io.ktor:ktor-client-apache" } +ktor-client-mock = { module = "io.ktor:ktor-client-mock" } +logback-classic = { module = "ch.qos.logback:logback-classic", version.ref = "logback" } +mockito-kotlin = { module = "org.mockito.kotlin:mockito-kotlin", version.ref = "mockito" } +slf4j-api = { module = "org.slf4j:slf4j-api", version.ref = "slf4j" } +spek-api = { module = "org.jetbrains.spek:spek-api", version.ref = "spek" } +spek-engine = { module = "org.jetbrains.spek:spek-junit-platform-engine", version.ref = "spek" } +testcontainers = { module = "org.testcontainers:testcontainers", version.ref = "testcontainers" } diff --git a/marathon-gradle-plugin/build.gradle.kts b/marathon-gradle-plugin/build.gradle.kts index 65d545ea7..015ef8504 100644 --- a/marathon-gradle-plugin/build.gradle.kts +++ b/marathon-gradle-plugin/build.gradle.kts @@ -1,26 +1,25 @@ plugins { `java-gradle-plugin` `kotlin-dsl` + id("com.badoo.marathon.conventions") } gradlePlugin { plugins { - create("marathonPlugin") { + create("marathon") { id = "com.badoo.marathon" implementationClass = "com.malinskiy.marathon.MarathonPlugin" } } } -Deployment.initialize(project) - dependencies { implementation(gradleApi()) - implementation(Libraries.kotlinLogging) - implementation(Libraries.kotlinCoroutines) implementation(project(":core")) implementation(project(":vendor:vendor-android:base")) implementation(project(":vendor:vendor-android:ddmlib")) - implementation(Libraries.androidCommon) - implementation(BuildPlugins.androidGradle) + implementation(libs.android.gradle.api) + implementation(libs.android.tools.common) + implementation(libs.kotlin.logging) + implementation(libs.kotlinx.coroutines.core) } diff --git a/report/execution-timeline/build.gradle.kts b/report/execution-timeline/build.gradle.kts index 6e7ba6f23..1e6deb5f8 100644 --- a/report/execution-timeline/build.gradle.kts +++ b/report/execution-timeline/build.gradle.kts @@ -1,12 +1,10 @@ plugins { - `java-library` id("org.jetbrains.kotlin.jvm") + id("com.badoo.marathon.conventions") } dependencies { - implementation(Libraries.gson) - implementation(Libraries.kotlinCoroutines) - implementation(Libraries.kotlinLogging) + implementation(libs.kotlinx.coroutines.core) + implementation(libs.kotlin.logging) + implementation(libs.gson) } - -Deployment.initialize(project) diff --git a/report/html-report/build.gradle.kts b/report/html-report/build.gradle.kts index 6e7ba6f23..1e6deb5f8 100644 --- a/report/html-report/build.gradle.kts +++ b/report/html-report/build.gradle.kts @@ -1,12 +1,10 @@ plugins { - `java-library` id("org.jetbrains.kotlin.jvm") + id("com.badoo.marathon.conventions") } dependencies { - implementation(Libraries.gson) - implementation(Libraries.kotlinCoroutines) - implementation(Libraries.kotlinLogging) + implementation(libs.kotlinx.coroutines.core) + implementation(libs.kotlin.logging) + implementation(libs.gson) } - -Deployment.initialize(project) diff --git a/settings.gradle.kts b/settings.gradle.kts index bf410ae46..71b2b483c 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -3,10 +3,6 @@ pluginManagement { gradlePluginPortal() mavenCentral() } - plugins { - id("org.jetbrains.kotlin.jvm") version "1.9.23" - id("io.gitlab.arturbosch.detekt") version "1.23.6" - } } dependencyResolutionManagement { diff --git a/vendor/vendor-android/base/build.gradle.kts b/vendor/vendor-android/base/build.gradle.kts index cf0dde7c4..830885cf1 100644 --- a/vendor/vendor-android/base/build.gradle.kts +++ b/vendor/vendor-android/base/build.gradle.kts @@ -1,22 +1,20 @@ plugins { - `java-library` id("org.jetbrains.kotlin.jvm") + id("com.badoo.marathon.conventions") } dependencies { - implementation(Libraries.allure) - implementation(Libraries.kotlinCoroutines) - implementation(Libraries.kotlinLogging) - implementation(Libraries.dexTestParser) - implementation(Libraries.axmlParser) - implementation(Libraries.jacksonAnnotations) - implementation(Libraries.scalr) implementation(project(":core")) - implementation(Libraries.logbackClassic) - implementation(Libraries.androidCommon) + implementation(libs.allure.java.commons) + implementation(libs.android.tools.common) + implementation(libs.axmlparser) + implementation(libs.dextestparser) + implementation(libs.imgscalr) + implementation(libs.jackson.annotations) + implementation(libs.kotlinx.coroutines.core) + implementation(libs.kotlin.logging) + implementation(libs.logback.classic) + testImplementation(project(":vendor:vendor-test")) - testImplementation(TestLibraries.koin) + testImplementation(libs.koin.test) } - -Deployment.initialize(project) -Testing.configure(project) diff --git a/vendor/vendor-android/ddmlib/build.gradle.kts b/vendor/vendor-android/ddmlib/build.gradle.kts index 1cd909a3b..bccb88882 100644 --- a/vendor/vendor-android/ddmlib/build.gradle.kts +++ b/vendor/vendor-android/ddmlib/build.gradle.kts @@ -1,25 +1,23 @@ plugins { - `java-library` id("org.jetbrains.kotlin.jvm") + id("com.badoo.marathon.conventions") } dependencies { - implementation(Libraries.allure) - implementation(Libraries.kotlinCoroutines) - implementation(Libraries.kotlinLogging) - implementation(Libraries.androidCommon) - implementation(Libraries.ddmlib) - implementation(Libraries.dexTestParser) - implementation(Libraries.axmlParser) - implementation(Libraries.jacksonAnnotations) - implementation(Libraries.scalr) - implementation(Libraries.apacheCommonsIO) implementation(project(":core")) implementation(project(":vendor:vendor-android:base")) - implementation(Libraries.logbackClassic) + implementation(libs.allure.java.commons) + implementation(libs.android.tools.common) + implementation(libs.android.tools.ddmlib) + implementation(libs.apache.commons.io) + implementation(libs.axmlparser) + implementation(libs.dextestparser) + implementation(libs.imgscalr) + implementation(libs.jackson.annotations) + implementation(libs.kotlinx.coroutines.core) + implementation(libs.kotlin.logging) + implementation(libs.logback.classic) + testImplementation(project(":vendor:vendor-test")) - testImplementation(TestLibraries.koin) + testImplementation(libs.koin.test) } - -Deployment.initialize(project) -Testing.configure(project) diff --git a/vendor/vendor-test/build.gradle.kts b/vendor/vendor-test/build.gradle.kts index 2616a69b1..b0c587d1b 100644 --- a/vendor/vendor-test/build.gradle.kts +++ b/vendor/vendor-test/build.gradle.kts @@ -1,15 +1,13 @@ plugins { - `java-library` id("org.jetbrains.kotlin.jvm") + id("com.badoo.marathon.conventions") } dependencies { - implementation(Libraries.kotlinCoroutines) - implementation(Libraries.kotlinLogging) - implementation(Libraries.kotlinReflect) - implementation(TestLibraries.jsonAssert) - implementation(TestLibraries.spekAPI) - implementation(TestLibraries.kluent) - implementation(TestLibraries.mockitoKotlin) implementation(project(":core")) + implementation(libs.jsonassert) + implementation(libs.kotlinx.coroutines.core) + implementation(libs.kotlin.logging) + implementation(libs.kotlin.reflect) + implementation(libs.spek.api) }