Skip to content

Commit

Permalink
Update DSL usage of instrumentation projects to 1.9.x.x's changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mannodermaus committed Apr 29, 2023
1 parent fb8f5b5 commit e2047a2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 67 deletions.
21 changes: 2 additions & 19 deletions instrumentation/compose/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,28 +1,11 @@
import de.mannodermaus.gradle.plugins.junit5.junitPlatform
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent

buildscript {
repositories {
google()
mavenCentral()
sonatypeSnapshots()
}

dependencies {
val latest = Artifacts.Plugin.latestStableVersion
classpath("de.mannodermaus.gradle.plugins:android-junit5:$latest")
}
}

plugins {
id("com.android.library")
kotlin("android")
id("explicit-api-mode")
}

apply {
plugin("de.mannodermaus.android-junit5")
id("de.mannodermaus.android-junit5").version(Artifacts.Plugin.latestStableVersion)
}

val javaVersion = JavaVersion.VERSION_11
Expand Down Expand Up @@ -69,7 +52,7 @@ android {

junitPlatform {
// Using local dependency instead of Maven coordinates
instrumentationTests.integrityCheckEnabled = false
instrumentationTests.enabled = false
}

tasks.withType<Test> {
Expand Down
21 changes: 2 additions & 19 deletions instrumentation/core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,29 +1,12 @@
import de.mannodermaus.gradle.plugins.junit5.junitPlatform
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

buildscript {
repositories {
google()
mavenCentral()
sonatypeSnapshots()
}

dependencies {
val latest = Artifacts.Plugin.latestStableVersion
classpath("de.mannodermaus.gradle.plugins:android-junit5:$latest")
}
}

plugins {
id("com.android.library")
kotlin("android")
id("explicit-api-mode")
}

apply {
plugin("de.mannodermaus.android-junit5")
id("de.mannodermaus.android-junit5").version(Artifacts.Plugin.latestStableVersion)
}

val javaVersion = JavaVersion.VERSION_1_8
Expand Down Expand Up @@ -67,7 +50,7 @@ android {

junitPlatform {
// Using local dependency instead of Maven coordinates
instrumentationTests.integrityCheckEnabled = false
instrumentationTests.enabled = false
}

tasks.withType<KotlinCompile> {
Expand Down
31 changes: 2 additions & 29 deletions instrumentation/sample/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,37 +1,10 @@
import de.mannodermaus.gradle.plugins.junit5.junitPlatform
import org.gradle.api.tasks.testing.logging.TestLogEvent

buildscript {
repositories {
google()
mavenCentral()
sonatypeSnapshots()
}

dependencies {
// Use a local "Fat JAR" pointing to the Gradle plugin from the sibling project,
// falling back to the latest stable version if that cannot be located.
// This requires an explicit task to be executed in the plugin project,
// since the fat JAR is not generated by default upon building
val localPluginJar = findLocalPluginJar()
if (localPluginJar != null) {
project.logger.warn("!! Using local JAR to provide plugin to module 'sample' (built at ${localPluginJar.lastModifiedDate()}) !!")
classpath(files(localPluginJar))
} else {
val latest = Artifacts.Plugin.latestStableVersion
classpath("de.mannodermaus.gradle.plugins:android-junit5:$latest")
}
}
}

plugins {
id("com.android.application")
kotlin("android")
id("jacoco")
}

apply {
plugin("de.mannodermaus.android-junit5")
id("de.mannodermaus.android-junit5").version(Artifacts.Plugin.latestStableVersion)
}

val javaVersion = JavaVersion.VERSION_1_8
Expand Down Expand Up @@ -75,7 +48,7 @@ junitPlatform {
}

// Using local dependency instead of Maven coordinates
instrumentationTests.integrityCheckEnabled = false
instrumentationTests.enabled = false
}

tasks.withType<Test> {
Expand Down

0 comments on commit e2047a2

Please sign in to comment.