-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
KTOR-2763 Fix Warnings and Enable -Werror flag (#2496)
* KTOR-2763 Fix warnings in ktor-io * KTOR-2763 Fix warnings in ktor-utils * KTOR-2763 Fix warnings in ktor-http * KTOR-2763 Fix warnings in ktor-network * KTOR-2763 Fix warnings in ktor-features * KTOR-2763 Fix warnings in ktor-server * KTOR-2763 Fix warnings in ktor-client * KTOR-2763 Fix warnings in ktor-shared & ktor-test-dispatcher * KTOR-2763 Update configuration
- Loading branch information
Showing
467 changed files
with
1,861 additions
and
1,741 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* | ||
* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. | ||
*/ | ||
|
||
import org.jetbrains.kotlin.gradle.dsl.* | ||
import org.jetbrains.kotlin.gradle.plugin.* | ||
|
||
fun KotlinCompilation<KotlinCommonOptions>.configureCompilation() { | ||
kotlinOptions { | ||
if (platformType == KotlinPlatformType.jvm) { | ||
allWarningsAsErrors = true | ||
} | ||
freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,25 @@ | ||
import org.gradle.api.* | ||
import org.gradle.kotlin.dsl.* | ||
import org.jetbrains.kotlin.gradle.dsl.* | ||
/* | ||
* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. | ||
*/ | ||
import org.gradle.api.* | ||
import org.gradle.kotlin.dsl.* | ||
import org.jetbrains.kotlin.gradle.dsl.* | ||
import org.jetbrains.kotlin.gradle.plugin.* | ||
|
||
fun Project.kotlin(block: KotlinMultiplatformExtension.() -> Unit) { | ||
configure(block) | ||
} | ||
|
||
val Project.kotlin: KotlinMultiplatformExtension get() = the() | ||
|
||
val NamedDomainObjectContainer<KotlinSourceSet>.jvmMain: NamedDomainObjectProvider<KotlinSourceSet> | ||
get() = named<KotlinSourceSet>("jvmMain") | ||
|
||
val NamedDomainObjectContainer<KotlinSourceSet>.jvmTest: NamedDomainObjectProvider<KotlinSourceSet> | ||
get() = named<KotlinSourceSet>("jvmTest") | ||
|
||
val NamedDomainObjectContainer<KotlinSourceSet>.commonMain: NamedDomainObjectProvider<KotlinSourceSet> | ||
get() = named<KotlinSourceSet>("commonMain") | ||
|
||
val NamedDomainObjectContainer<KotlinSourceSet>.commonTest: NamedDomainObjectProvider<KotlinSourceSet> | ||
get() = named<KotlinSourceSet>("commonTest") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import KtorBuildProperties.jdk8Modules | ||
import org.gradle.api.* | ||
|
||
/* | ||
* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. | ||
*/ | ||
|
||
private val java_version: String = System.getProperty("java.version", "8.0.0") | ||
|
||
private val versionComponents = java_version | ||
.split(".") | ||
.take(2) | ||
.filter { it.isNotBlank() } | ||
.map { Integer.parseInt(it) } | ||
|
||
object KtorBuildProperties { | ||
|
||
val jettyAlpnBootVersion: String? = when (java_version) { | ||
"1.8.0_191", | ||
"1.8.0_192", | ||
"1.8.0_201", | ||
"1.8.0_202", | ||
"1.8.0_211", | ||
"1.8.0_212", | ||
"1.8.0_221", | ||
"1.8.0_222", | ||
"1.8.0_231", | ||
"1.8.0_232", | ||
"1.8.0_241", | ||
"1.8.0_242" -> "8.1.13.v20181017" | ||
else -> null | ||
} | ||
|
||
@JvmStatic | ||
val ideaActive: Boolean = System.getProperty("idea.active") == "true" | ||
|
||
@JvmStatic | ||
val currentJdk = if (versionComponents[0] == 1) versionComponents[1] else versionComponents[0] | ||
|
||
val jdk8Modules = listOf( | ||
"ktor-client-tests", | ||
|
||
"ktor-server-core", "ktor-server-host-common", "ktor-server-servlet", "ktor-server-netty", "ktor-server-tomcat", | ||
"ktor-server-test-host", "ktor-server-test-suites", | ||
|
||
"ktor-websockets", "ktor-webjars", "ktor-metrics", "ktor-server-sessions", "ktor-auth", "ktor-auth-jwt", | ||
|
||
"ktor-network-tls-certificates" | ||
) | ||
|
||
val jdk7Modules = listOf( | ||
"ktor-http", | ||
"ktor-utils", | ||
"ktor-network-tls", | ||
"ktor-websockets" | ||
) | ||
|
||
val jdk11Modules = listOf( | ||
"ktor-client-java" | ||
) | ||
|
||
@JvmStatic | ||
fun projectJdk(name: String): Int = when (name) { | ||
in jdk8Modules -> 8 | ||
in jdk11Modules -> 11 | ||
in jdk7Modules -> 7 | ||
else -> 6 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.