File tree Expand file tree Collapse file tree
multiplatform-settings-no-arg
multiplatform-settings-test
appleMain/kotlin/com/russhwolf/settings
jvmMain/kotlin/com/russhwolf/settings Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -83,6 +83,11 @@ private fun KotlinMultiplatformExtension.buildAllTargets(targetPresets: NamedDom
8383 useExperimentalAnnotation(" kotlin.RequiresOptIn" )
8484 }
8585 }
86+ targets.configureEach {
87+ it.compilations.configureEach {
88+ it.kotlinOptions.allWarningsAsErrors = true
89+ }
90+ }
8691
8792 linkNativeSourceSets()
8893}
@@ -163,6 +168,10 @@ private fun BaseExtension.configureAndroidApiLevel() {
163168 defaultConfig.apply {
164169 minSdkVersion(15 )
165170 }
171+ lintOptions.apply {
172+ isAbortOnError = true
173+ isWarningsAsErrors = true
174+ }
166175}
167176
168177private fun Project.configureTests () {
Original file line number Diff line number Diff line change @@ -67,10 +67,10 @@ kotlin {
6767 dependencies {
6868 implementation(kotlin(" test" ))
6969 implementation(kotlin(" test-junit" ))
70- implementation(" junit:junit:4.12 " )
70+ implementation(" junit:junit:4.13 " )
7171 implementation(" androidx.test:core:1.2.0" )
7272 implementation(" androidx.test.ext:junit:1.1.1" )
73- implementation(" org.robolectric:robolectric:4.3" )
73+ implementation(" org.robolectric:robolectric:4.3.1 " )
7474
7575 implementation(" androidx.preference:preference:1.1.1" )
7676 }
@@ -82,10 +82,11 @@ kotlin {
8282 }
8383 }
8484 val jvmTest by getting {
85+ languageSettings.useExperimentalAnnotation(" com.russhwolf.settings.ExperimentalJvm" )
8586 dependencies {
8687 implementation(kotlin(" test" ))
8788 implementation(kotlin(" test-junit" ))
88- implementation(" junit:junit:4.12 " )
89+ implementation(" junit:junit:4.13 " )
8990 }
9091 }
9192
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ kotlin {
5353 dependencies {
5454 implementation(kotlin(" test" ))
5555 implementation(kotlin(" test-junit" ))
56- implementation(" junit:junit:4.12 " )
56+ implementation(" junit:junit:4.13 " )
5757 }
5858 }
5959
@@ -66,7 +66,7 @@ kotlin {
6666 dependencies {
6767 implementation(kotlin(" test" ))
6868 implementation(kotlin(" test-junit" ))
69- implementation(" junit:junit:4.12 " )
69+ implementation(" junit:junit:4.13 " )
7070 }
7171 }
7272
Original file line number Diff line number Diff line change @@ -51,10 +51,10 @@ kotlin {
5151 dependencies {
5252 implementation(kotlin(" test" ))
5353 implementation(kotlin(" test-junit" ))
54- implementation(" junit:junit:4.12 " )
54+ implementation(" junit:junit:4.13 " )
5555 implementation(" androidx.test:core:1.2.0" )
5656 implementation(" androidx.test.ext:junit:1.1.1" )
57- implementation(" org.robolectric:robolectric:4.3" )
57+ implementation(" org.robolectric:robolectric:4.3.1 " )
5858 }
5959 }
6060
@@ -67,7 +67,7 @@ kotlin {
6767 dependencies {
6868 implementation(kotlin(" test" ))
6969 implementation(kotlin(" test-junit" ))
70- implementation(" junit:junit:4.12 " )
70+ implementation(" junit:junit:4.13 " )
7171 }
7272 }
7373
Original file line number Diff line number Diff line change @@ -84,6 +84,7 @@ public class AppleSettings public constructor(
8484 }
8585 }
8686
87+ @Suppress(" UNCHECKED_CAST" )
8788 public override val keys: Set <String > get() = delegate.dictionaryRepresentation().keys as Set <String >
8889 public override val size: Int get() = delegate.dictionaryRepresentation().keys.count()
8990
Original file line number Diff line number Diff line change @@ -61,6 +61,7 @@ public class JvmPropertiesSettings public constructor(
6161 private val onModify : (Properties ) -> Unit = {}
6262) : Settings {
6363
64+ @Suppress(" UNCHECKED_CAST" )
6465 public override val keys: Set <String > get() = delegate.propertyNames().toList().toSet() as Set <String >
6566 public override val size: Int get() = delegate.size
6667
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ kotlin {
4242
4343 implementation(kotlin(" test" ))
4444 implementation(kotlin(" test-junit" ))
45- implementation(" junit:junit:4.12 " )
45+ implementation(" junit:junit:4.13 " )
4646 }
4747 }
4848
@@ -52,7 +52,7 @@ kotlin {
5252
5353 implementation(kotlin(" test" ))
5454 implementation(kotlin(" test-junit" ))
55- implementation(" junit:junit:4.12 " )
55+ implementation(" junit:junit:4.13 " )
5656 }
5757 }
5858
You can’t perform that action at this time.
0 commit comments