Skip to content

Commit

Permalink
Release 1.6.8 (#2885)
Browse files Browse the repository at this point in the history
* Migrate to Gradle Version Catalog

* KTOR-3935 Update versions
  • Loading branch information
e5l committed Mar 14, 2022
1 parent 80f9610 commit 36948cb
Show file tree
Hide file tree
Showing 89 changed files with 2,501 additions and 2,621 deletions.
20 changes: 20 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,23 @@
# 1.6.8
> Published 14 March 2022
* Update Gradle to 7.4
* Update Kotlin to 1.6.10
* Migrate gradle to version catalog
* Update logback version to 1.2.11 ([KTOR-3935](https://youtrack.jetbrains.com/issue/KTOR-3935))
* Update atomicfu to 0.17.1
* Update netty to 4.1.74.Final
* Update netty-tcnative to 2.0.45.Final
* Update jetty to 9.4.45.v20220203
* Update tomcat to 9.0.59
* Update apache to 4.1.5
* Update okhttp to 4.9.3
* Update gson to 2.9.0
* Update jackson 2.13.1
* Update slf4j to 1.7.36
* Update node-fetch to 2.6.7
* Update js ws package to 8.5.0

# 1.6.7
> Published 6 December 2021
Expand Down
96 changes: 14 additions & 82 deletions build.gradle.kts
Expand Up @@ -3,74 +3,11 @@
*/

import org.jetbrains.dokka.gradle.*
import org.jetbrains.kotlin.gradle.targets.js.nodejs.*
import org.jetbrains.kotlin.konan.target.*

buildscript {
/*
* These property group is used to build ktor against Kotlin compiler snapshot.
* How does it work:
* When build_snapshot_train is set to true, kotlin_version property is overridden with kotlin_snapshot_version,
* atomicfu_version, coroutines_version, serialization_version and kotlinx_io_version are overwritten by TeamCity environment.
* Additionally, mavenLocal and Sonatype snapshots are added to repository list and stress tests are disabled.
* DO NOT change the name of these properties without adapting kotlinx.train build chain.
*/
extra["build_snapshot_train"] = rootProject.properties["build_snapshot_train"].let { it != null && it != "" }
val build_snapshot_train: Boolean by extra
if (build_snapshot_train) {
extra["kotlin_version"] = rootProject.properties["kotlin_snapshot_version"]
val kotlin_version: String? by extra
if (kotlin_version == null) {
throw IllegalArgumentException(
"'kotlin_snapshot_version' should be defined when building with snapshot compiler"
)
}
repositories {
mavenLocal()
maven(url = "https://oss.sonatype.org/content/repositories/snapshots")
}

configurations.classpath {
resolutionStrategy.eachDependency {
if (requested.group == "org.jetbrains.kotlin") {
useVersion(kotlin_version!!)
}
}
}
}
// These three flags are enabled in train builds for JVM IR compiler testing
extra["jvm_ir_enabled"] = rootProject.properties["enable_jvm_ir"] != null
extra["jvm_ir_api_check_enabled"] = rootProject.properties["enable_jvm_ir_api_check"] != null
// This flag is also used in settings.gradle to exclude native-only projects
extra["native_targets_enabled"] = rootProject.properties["disable_native_targets"] == null

repositories {
mavenLocal()
mavenCentral()
google()
gradlePluginPortal()
}

val kotlin_version: String by extra
val atomicfu_version: String by extra
val validator_version: String by extra
val android_gradle_version: String by extra
val ktlint_version: String by extra

dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version")
classpath("org.jetbrains.kotlinx:atomicfu-gradle-plugin:$atomicfu_version")
classpath("org.jetbrains.kotlin:kotlin-serialization:$kotlin_version")
classpath("org.jetbrains.kotlinx:binary-compatibility-validator:$validator_version")
classpath("com.android.tools.build:gradle:$android_gradle_version")
classpath("org.jmailen.gradle:kotlinter-gradle:$ktlint_version")
}

CacheRedirector.configureBuildScript(rootProject, this)
}

val releaseVersion: String? by extra
val eapVersion: String? by extra
val native_targets_enabled: Boolean by extra
val projectVersion = project.version as String
val version = if (projectVersion.endsWith("-SNAPSHOT")) {
projectVersion.dropLast("-SNAPSHOT".length)
Expand Down Expand Up @@ -100,11 +37,7 @@ val experimentalAnnotations: List<String> by extra
* `darwin` is subset of `posix`.
* Don't create `posix` and `darwin` sourceSets in single project.
*/
val platforms = mutableListOf("common", "jvm", "js")

if (native_targets_enabled) {
platforms += listOf("posix", "darwin")
}
val platforms = mutableListOf("common", "jvm", "js", "posix", "darwin")

extra["skipPublish"] = mutableListOf<String>()
extra["nonDefaultProjectStructure"] = mutableListOf("ktor-bom")
Expand Down Expand Up @@ -134,30 +67,28 @@ val disabledExplicitApiModeProjects = listOf(
"ktor-server-tests"
)

apply(from = "gradle/compatibility.gradle")

plugins {
id("org.jetbrains.dokka") version "1.4.32"
id("org.jetbrains.kotlinx.binary-compatibility-validator") version "0.8.0"
id("kotlinx-atomicfu") version "0.17.1" apply false
}

apply(from = "gradle/compatibility.gradle")

allprojects {
group = "io.ktor"
version = configuredVersion
extra["hostManager"] = HostManager()

setupTrainForSubproject()

repositories {
mavenLocal()
mavenCentral()
maven(url = "https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven")
}

CacheRedirector.configure(this)

val nonDefaultProjectStructure: List<String> by rootProject.extra
if (nonDefaultProjectStructure.contains(project.name)) return@allprojects

apply(plugin = "kotlinx-atomicfu")
apply(plugin = "kotlin-multiplatform")

apply(from = rootProject.file("gradle/utility.gradle"))
Expand All @@ -166,7 +97,9 @@ allprojects {
extra["nativeCompilations"] = mutableListOf<String>()

platforms.forEach { platform ->
if (projectNeedsPlatform(this, platform)) {
val projectNeedsPlatform = projectNeedsPlatform(this, platform)

if (projectNeedsPlatform) {
if (platform == "js") {
configureJsModules()
} else {
Expand Down Expand Up @@ -214,11 +147,6 @@ if (project.hasProperty("enableCodeStyle")) {
}

println("Using Kotlin compiler version: ${org.jetbrains.kotlin.config.KotlinCompilerVersion.VERSION}")
filterSnapshotTests()

if (project.hasProperty("enable-coverage")) {
apply(from = "gradle/jacoco.gradle")
}

subprojects {
plugins.apply("org.jetbrains.dokka")
Expand All @@ -238,3 +166,7 @@ if (docs != null) {
pluginsMapConfiguration.set(mapOf("org.jetbrains.dokka.versioning.VersioningPlugin" to """{ "version": "$configuredVersion", "olderVersionsDir":"$docs" }"""))
}
}

rootProject.plugins.withType<NodeJsRootPlugin> {
rootProject.extensions.getByType<NodeJsRootExtension>().nodeVersion = "16.14.0"
}
35 changes: 2 additions & 33 deletions buildSrc/build.gradle.kts
Expand Up @@ -2,46 +2,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.utils.addToStdlib.*
import java.util.*

plugins {
`kotlin-dsl`
}

val cacheRedirectorEnabled = System.getenv("CACHE_REDIRECTOR_ENABLED")?.toBoolean() == true
val buildSnapshotTrain = properties["build_snapshot_train"]?.toString()?.toBoolean() == true

repositories {
if (cacheRedirectorEnabled) {
maven("https://cache-redirector.jetbrains.com/plugins.gradle.org/m2")
}

maven("https://plugins.gradle.org/m2")

if (buildSnapshotTrain) {
mavenLocal()
}
}

val props = Properties().apply {
file("../gradle.properties").inputStream().use { load(it) }
}

fun version(target: String): String {
// Intercept reading from properties file
if (target == "kotlin") {
val snapshotVersion = properties["kotlin_snapshot_version"]
if (snapshotVersion != null) return snapshotVersion.toString()
}
return properties["${target}_version"].safeAs<String>() ?: props.getProperty("${target}_version")
}

sourceSets.main {
}

dependencies {
println("Used kotlin version in buildSrc: " + version("kotlin"))
implementation(kotlin("gradle-plugin", version("kotlin")))
implementation("com.moowork.gradle:gradle-node-plugin:1.3.1")
implementation(kotlin("gradle-plugin", libs.versions.kotlin.version.get()))
implementation(kotlin("serialization", libs.versions.kotlin.version.get()))
}
8 changes: 8 additions & 0 deletions buildSrc/settings.gradle.kts
Expand Up @@ -16,3 +16,11 @@ pluginManagement {
}
}
}

dependencyResolutionManagement {
versionCatalogs {
val libs by creating {
from(files("../gradle/libs.versions.toml"))
}
}
}
137 changes: 0 additions & 137 deletions buildSrc/src/main/kotlin/CacheRedirector.kt

This file was deleted.

5 changes: 0 additions & 5 deletions buildSrc/src/main/kotlin/JsConfiguration.kt
Expand Up @@ -15,17 +15,12 @@ fun Project.configureJsModules() {
configureJsTasks()

kotlin {
val kotlin_version: String by extra
sourceSets {
val jsMain by getting {
dependencies {
api("org.jetbrains.kotlin:kotlin-stdlib-js:$kotlin_version")
}
}

val jsTest by getting {
dependencies {
api("org.jetbrains.kotlin:kotlin-test-js:$kotlin_version")
api(npm("puppeteer", "*"))
}
}
Expand Down

0 comments on commit 36948cb

Please sign in to comment.