Skip to content

Commit 155868f

Browse files
Update to Gradle 7.4.2, Kotlin 1.6.21, other plugin updates (#3281)
1 parent 5896b73 commit 155868f

File tree

20 files changed

+72
-60
lines changed

20 files changed

+72
-60
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ build
1212
out
1313
target
1414
local.properties
15+
/kotlin-js-store

benchmarks/build.gradle.kts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import me.champeau.gradle.*
88
import org.jetbrains.kotlin.gradle.tasks.*
99

1010
plugins {
11-
id("net.ltgt.apt")
1211
id("com.github.johnrengelman.shadow")
1312
id("me.champeau.gradle.jmh") apply false
1413
}
@@ -31,8 +30,6 @@ tasks.named<KotlinCompile>("compileJmhKotlin") {
3130
}
3231
}
3332

34-
35-
3633
// It is better to use the following to run benchmarks, otherwise you may get unexpected errors:
3734
// ./gradlew --no-daemon cleanJmhJar jmh -Pjmh="MyBenchmark"
3835
extensions.configure<JMHPluginExtension>("jmh") {
@@ -54,6 +51,12 @@ val jmhJarTask = tasks.named<Jar>("jmhJar") {
5451
}
5552

5653
tasks {
54+
// For some reason the DuplicatesStrategy from jmh is not enough
55+
// and errors with duplicates appear unless I force it to WARN only:
56+
withType<Copy> {
57+
duplicatesStrategy = DuplicatesStrategy.WARN
58+
}
59+
5760
build {
5861
dependsOn(jmhJarTask)
5962
}

build.gradle

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ buildscript {
5454
classpath "org.jetbrains.dokka:dokka-gradle-plugin:$dokka_version"
5555
classpath "org.jetbrains.kotlinx:atomicfu-gradle-plugin:$atomicfu_version"
5656
classpath "org.jetbrains.kotlinx:kotlinx-knit:$knit_version"
57-
classpath "com.moowork.gradle:gradle-node-plugin:$gradle_node_version"
57+
classpath "com.github.node-gradle:gradle-node-plugin:$gradle_node_version"
5858
classpath "org.jetbrains.kotlinx:binary-compatibility-validator:$binary_compatibility_validator_version"
59-
classpath "ru.vyarus:gradle-animalsniffer-plugin:1.5.3" // Android API check
59+
classpath "ru.vyarus:gradle-animalsniffer-plugin:1.5.4" // Android API check
6060
classpath "org.jetbrains.kotlinx:kover:$kover_version"
6161

6262
// JMH plugins
63-
classpath "com.github.jengelman.gradle.plugins:shadow:5.1.0"
63+
classpath "gradle.plugin.com.github.johnrengelman:shadow:7.1.2"
6464
}
6565

6666
CacheRedirector.configureBuildScript(buildscript, rootProject)
@@ -130,6 +130,9 @@ allprojects {
130130
}
131131
}
132132

133+
// needs to be before evaluationDependsOn due to weird Gradle ordering
134+
apply plugin: "animalsniffer-conventions"
135+
133136
// Add dependency to core source sets. Core is configured in kx-core/build.gradle
134137
configure(subprojects.findAll { !sourceless.contains(it.name) && it.name != coreModule }) {
135138
evaluationDependsOn(":$coreModule")
@@ -232,7 +235,7 @@ def core_docs_url = "https://kotlin.github.io/kotlinx.coroutines/$coreModule/"
232235
def core_docs_file = "$projectDir/kotlinx-coroutines-core/build/dokka/htmlPartial/package-list"
233236
apply plugin: "org.jetbrains.dokka"
234237

235-
configure(subprojects.findAll { !unpublished.contains(it.name) }) {
238+
configure(subprojects.findAll { !unpublished.contains(it.name) && it.name != coreModule }) {
236239
if (it.name != 'kotlinx-coroutines-bom') {
237240
apply from: rootProject.file('gradle/dokka.gradle.kts')
238241
}
@@ -303,8 +306,6 @@ def publishTasks = getTasksByName("publish", true) + getTasksByName("publishNpm"
303306

304307
task deploy(dependsOn: publishTasks)
305308

306-
apply plugin: "animalsniffer-conventions"
307-
308309
clean.dependsOn gradle.includedBuilds.collect { it.task(':clean') }
309310

310311
// --------------- Knit configuration ---------------

buildSrc/src/main/kotlin/Publishing.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import org.gradle.api.Project
88
import org.gradle.api.artifacts.dsl.*
99
import org.gradle.api.publish.maven.*
10+
import org.gradle.kotlin.dsl.*
1011
import org.gradle.plugins.signing.*
1112
import java.net.*
1213

@@ -56,6 +57,11 @@ fun configureMavenPublication(rh: RepositoryHandler, project: Project) {
5657
password = project.getSensitiveProperty("libs.sonatype.password")
5758
}
5859
}
60+
61+
// Something that's easy to "clean" for development, not mavenLocal
62+
rh.maven("${project.rootProject.buildDir}/repo") {
63+
name = "buildRepo"
64+
}
5965
}
6066

6167
fun signPublicationIfKeyPresent(project: Project, publication: MavenPublication) {

buildSrc/src/main/kotlin/animalsniffer-conventions.gradle.kts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,19 @@
44

55
import ru.vyarus.gradle.plugin.animalsniffer.*
66

7-
subprojects {
7+
configure(subprojects) {
88
// Skip JDK 8 projects or unpublished ones
9-
if (!shouldSniff()) return@subprojects
9+
if (!shouldSniff()) return@configure
1010
apply(plugin = "ru.vyarus.animalsniffer")
11-
configure<AnimalSnifferExtension> {
12-
sourceSets = listOf((project.extensions.getByName("sourceSets") as SourceSetContainer).getByName("main"))
13-
}
14-
val signature: Configuration by configurations
15-
dependencies {
16-
signature("net.sf.androidscents.signature:android-api-level-14:4.0_r4@signature")
17-
signature("org.codehaus.mojo.signature:java17:1.0@signature")
11+
project.plugins.withType(JavaPlugin::class.java) {
12+
configure<AnimalSnifferExtension> {
13+
sourceSets = listOf((project.extensions.getByName("sourceSets") as SourceSetContainer).getByName("main"))
14+
}
15+
val signature: Configuration by configurations
16+
dependencies {
17+
signature("net.sf.androidscents.signature:android-api-level-14:4.0_r4@signature")
18+
signature("org.codehaus.mojo.signature:java17:1.0@signature")
19+
}
1820
}
1921
}
2022

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Kotlin
66
version=1.6.1-SNAPSHOT
77
group=org.jetbrains.kotlinx
8-
kotlin_version=1.6.20
8+
kotlin_version=1.6.21
99

1010
# Dependencies
1111
junit_version=4.12
@@ -35,7 +35,7 @@ baksmali_version=2.2.7
3535

3636
# JS
3737
kotlin.js.compiler=both
38-
gradle_node_version=1.2.0
38+
gradle_node_version=3.1.1
3939
node_version=10.0.0
4040
npm_version=5.7.1
4141
mocha_version=6.2.2

gradle/compile-js-multiplatform.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ compileTestJsLegacy.configure {
6060
task populateNodeModules(type: Copy, dependsOn: compileTestJsLegacy) {
6161
// we must copy output that is transformed by atomicfu
6262
from(kotlin.js().compilations.main.output.allOutputs)
63-
into "$node.nodeModulesDir/node_modules"
63+
into node.nodeProjectDir.dir("node_modules")
6464

6565
def configuration = configurations.hasProperty("jsLegacyTestRuntimeClasspath")
6666
? configurations.jsLegacyTestRuntimeClasspath

gradle/dokka.gradle.kts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@ tasks.withType(DokkaTaskPartial::class).configureEach {
3939

4040
if (!project.isMultiplatform) {
4141
dependsOn(project.configurations["compileClasspath"])
42-
doFirst {
43-
// resolve classpath only during execution
44-
classpath.from(project.configurations["compileClasspath"].files)// + project.sourceSets.main.output.files)
45-
}
4642
}
4743
}
4844
}

gradle/node-js.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
* Copyright 2016-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
33
*/
44

5-
apply plugin: 'com.moowork.node'
5+
apply plugin: 'com.github.node-gradle.node'
66

77
node {
88
version = "$node_version"
99
npmVersion = "$npm_version"
1010
download = true
11-
nodeModulesDir = file(buildDir)
11+
nodeProjectDir = file(buildDir)
1212
}
1313

1414
// Configures testing for JS modules
@@ -25,7 +25,7 @@ task prepareNodePackage(type: Copy) {
2525
from("npm") {
2626
exclude 'package.json'
2727
}
28-
into "$node.nodeModulesDir"
28+
into node.nodeProjectDir
2929
}
3030

3131
npmInstall.dependsOn prepareNodePackage

gradle/publish.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import org.gradle.util.VersionNumber
66

77
// Configures publishing of Maven artifacts to Maven Central
88

9-
apply plugin: 'maven'
109
apply plugin: 'maven-publish'
1110
apply plugin: 'signing'
1211

@@ -16,7 +15,9 @@ def isMultiplatform = project.name == "kotlinx-coroutines-core" || project.name
1615
def isBom = project.name == "kotlinx-coroutines-bom"
1716

1817
if (!isBom) {
19-
apply plugin: "com.github.johnrengelman.shadow"
18+
if (project.name == "kotlinx-coroutines-debug") {
19+
apply plugin: "com.github.johnrengelman.shadow"
20+
}
2021

2122
// empty xxx-javadoc.jar
2223
task javadocJar(type: Jar) {

0 commit comments

Comments
 (0)