File tree Expand file tree Collapse file tree 8 files changed +26
-22
lines changed Expand file tree Collapse file tree 8 files changed +26
-22
lines changed Original file line number Diff line number Diff line change @@ -21,3 +21,6 @@ org.gradle.workers.max=2
2121
2222kotlin.incremental =false
2323kotlin.compiler.execution.strategy =in-process
24+
25+ # Controls KotlinOptions.allWarningsAsErrors. This is used in CI and can be set in local properties.
26+ warningsAsErrors =true
Original file line number Diff line number Diff line change @@ -60,8 +60,8 @@ subprojects {
6060
6161 tasks. withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile ). configureEach {
6262 kotlinOptions {
63- // Treat all Kotlin warnings as errors
64- allWarningsAsErrors = true
63+ // Treat all Kotlin warnings as errors (disabled by default)
64+ allWarningsAsErrors = project . hasProperty( " warningsAsErrors " ) ? project . warningsAsErrors : false
6565
6666 jvmTarget = " 1.8"
6767
Original file line number Diff line number Diff line change @@ -57,11 +57,6 @@ android {
5757 targetCompatibility JavaVersion . VERSION_1_8
5858 }
5959
60- kotlinOptions {
61- jvmTarget = ' 1.8'
62- allWarningsAsErrors = true
63- }
64-
6560 buildFeatures {
6661 compose true
6762 }
@@ -115,8 +110,9 @@ dependencies {
115110
116111tasks. withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile ). configureEach {
117112 kotlinOptions {
118- // Treat all Kotlin warnings as errors
119- allWarningsAsErrors = true
113+ // Treat all Kotlin warnings as errors (disabled by default)
114+ allWarningsAsErrors = project. hasProperty(" warningsAsErrors" ) ? project. warningsAsErrors : false
115+
120116 freeCompilerArgs + = ' -Xopt-in=kotlin.RequiresOptIn'
121117 // Enable experimental coroutines APIs, including Flow
122118 freeCompilerArgs + = ' -Xopt-in=kotlin.Experimental'
Original file line number Diff line number Diff line change @@ -61,8 +61,8 @@ subprojects {
6161
6262 tasks. withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile ). configureEach {
6363 kotlinOptions {
64- // Treat all Kotlin warnings as errors
65- allWarningsAsErrors = true
64+ // Treat all Kotlin warnings as errors (disabled by default)
65+ allWarningsAsErrors = project . hasProperty( " warningsAsErrors " ) ? project . warningsAsErrors : false
6666
6767 freeCompilerArgs + = ' -Xopt-in=kotlin.RequiresOptIn'
6868
Original file line number Diff line number Diff line change @@ -61,8 +61,8 @@ subprojects {
6161
6262 tasks. withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile ). configureEach {
6363 kotlinOptions {
64- // Treat all Kotlin warnings as errors
65- allWarningsAsErrors = true
64+ // Treat all Kotlin warnings as errors (disabled by default)
65+ allWarningsAsErrors = project . hasProperty( " warningsAsErrors " ) ? project . warningsAsErrors : false
6666
6767 freeCompilerArgs + = ' -Xopt-in=kotlin.RequiresOptIn'
6868
Original file line number Diff line number Diff line change @@ -47,12 +47,15 @@ subprojects {
4747
4848 tasks. withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile ). configureEach {
4949 kotlinOptions {
50- jvmTarget = ' 1.8 '
51- allWarningsAsErrors = true
52- // Opt-in to experimental compose APIs
50+ // Treat all Kotlin warnings as errors (disabled by default)
51+ allWarningsAsErrors = project . hasProperty( " warningsAsErrors " ) ? project . warningsAsErrors : false
52+
5353 freeCompilerArgs + = ' -Xopt-in=kotlin.RequiresOptIn'
54- // Enable experimental coroutines APIs, including collectAsState()
55- freeCompilerArgs + = ' -Xopt-in=kotlinx.coroutines.ExperimentalCoroutinesApi'
54+ // Enable experimental coroutines APIs, including Flow
55+ freeCompilerArgs + = ' -Xopt-in=kotlin.Experimental'
56+
57+ // Set JVM target to 1.8
58+ jvmTarget = " 1.8"
5659 }
5760 }
5861
Original file line number Diff line number Diff line change @@ -59,8 +59,8 @@ subprojects {
5959
6060 tasks. withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile ). configureEach {
6161 kotlinOptions {
62- // Treat all Kotlin warnings as errors
63- allWarningsAsErrors = true
62+ // Treat all Kotlin warnings as errors (disabled by default)
63+ allWarningsAsErrors = project . hasProperty( " warningsAsErrors " ) ? project . warningsAsErrors : false
6464
6565 freeCompilerArgs + = ' -Xopt-in=kotlin.RequiresOptIn'
6666
Original file line number Diff line number Diff line change @@ -47,10 +47,12 @@ subprojects {
4747
4848 tasks. withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile ). configureEach {
4949 kotlinOptions {
50- jvmTarget = ' 1.8 '
51- allWarningsAsErrors = true
50+ // Treat all Kotlin warnings as errors (disabled by default)
51+ allWarningsAsErrors = project . hasProperty( " warningsAsErrors " ) ? project . warningsAsErrors : false
5252 // Opt-in to experimental compose APIs
5353 freeCompilerArgs + = ' -Xopt-in=kotlin.RequiresOptIn'
54+
55+ jvmTarget = ' 1.8'
5456 }
5557 }
5658
You can’t perform that action at this time.
0 commit comments