diff --git a/build.gradle.kts b/build.gradle.kts index eae6281..56bf346 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -27,16 +27,51 @@ plugins { id("com.jithub.build.logic") apply false } -subprojects { - tasks.withType { +allprojects { + repositories { + google { + mavenContent { + includeGroupAndSubgroups("androidx") + includeGroupAndSubgroups("com.android") + includeGroupAndSubgroups("com.google") + } + } + mavenCentral() + maven("https://jitpack.io") + } + + tasks.withType().configureEach { sourceCompatibility = Versions.java.toString() targetCompatibility = Versions.java.toString() } - tasks.withType { + tasks.withType().configureEach { kotlinOptions { jvmTarget = Versions.java.toString() } + compilerOptions { + // Treat all Kotlin warnings as errors + allWarningsAsErrors = true + freeCompilerArgs.addAll( + // Enable default methods in interfaces + "-Xjvm-default=all", + // Enable context receivers + "-Xcontext-receivers", + // Enable K2 compiler + "-language-version=2.0", + "-Xsuppress-version-warnings" + ) + } + } +} + +gradle.taskGraph.whenReady { + tasks.forEach { task -> + /* Encountering the “Unable to make progress running work” Error in Gradle? */ + // gradle.startParameter.excludedTaskNames.addAll(listOf(":build-logic:convention:testClasses")) + if (task?.name?.contains(":testClasses", ignoreCase = false) == true) { + task.enabled = false + } } } diff --git a/settings.gradle.kts b/settings.gradle.kts index 8c8ed38..2a804e3 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -48,9 +48,6 @@ include(":redwood:schema:widget") include(":redwood:schema:testing") include(":redwood:shared-composeui") -/* Encountering the “Unable to make progress running work” Error in Gradle? */ -gradle.startParameter.excludedTaskNames.addAll(listOf(":build-logic:convention:testClasses")) - check(JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_17)) { "This project needs to be run with Java 17 or higher (found: ${JavaVersion.current()})." }