Skip to content

Commit

Permalink
Update build config
Browse files Browse the repository at this point in the history
  • Loading branch information
syxc committed May 16, 2024
1 parent b7e3951 commit 18afe95
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 6 deletions.
41 changes: 38 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,51 @@ plugins {
id("com.jithub.build.logic") apply false
}

subprojects {
tasks.withType<JavaCompile> {
allprojects {
repositories {
google {
mavenContent {
includeGroupAndSubgroups("androidx")
includeGroupAndSubgroups("com.android")
includeGroupAndSubgroups("com.google")
}
}
mavenCentral()
maven("https://jitpack.io")
}

tasks.withType<JavaCompile>().configureEach {
sourceCompatibility = Versions.java.toString()
targetCompatibility = Versions.java.toString()
}

tasks.withType<KotlinCompile> {
tasks.withType<KotlinCompile>().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
}
}
}

Expand Down
3 changes: 0 additions & 3 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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()})."
}

0 comments on commit 18afe95

Please sign in to comment.