Skip to content

Commit

Permalink
Upgrade Gradle to version 7.3.3 (#1822)
Browse files Browse the repository at this point in the history
* Upgrade to Gradle 7.3.3

Necessary changes include:
- Rename configurations created by the `java` plugin.
- Upgrade the `protobuf-gradle-plugin` to avoid the "Configuration with
  name 'compile' not found" error.
- Remove the deprecated `kotlin.parallel.tasks.in.project` property, which
  got replaced by the Gradle parallel project execution option.
- Stop using the deprecated `maven` plugin in favor of only the
  `maven-publish` plugin [1].
- Remove the deprecated / inactive `GRADLE_METADATA` feature preview
  flag [2] [3].
- For yet unclear reasons the JUnit imports in the HOCON tests needed to
  be made explicit to avoid compile errors.

[1]: https://docs.gradle.org/4.8/release-notes.html
[2]: gradle/gradle#16118
[3]: https://kotlinlang.org/docs/migrating-multiplatform-project-to-14.html#simplify-your-build-configuration

* Gradle: Remove an unused import

* Gradle: Use single quotes where no variable interpolation is required

* Gradle: Use the compact string notation to declare dependencies

This creates consistency with the majority of declarations.
  • Loading branch information
sschuberth committed Jan 28, 2022
1 parent a27c365 commit ece9fdd
Show file tree
Hide file tree
Showing 22 changed files with 446 additions and 340 deletions.
18 changes: 9 additions & 9 deletions benchmark/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ apply plugin: 'java'
apply plugin: 'kotlin'
apply plugin: 'kotlinx-serialization'
apply plugin: 'idea'
apply plugin: "net.ltgt.apt"
apply plugin: "com.github.johnrengelman.shadow"
apply plugin: "me.champeau.gradle.jmh"
apply plugin: 'net.ltgt.apt'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'me.champeau.gradle.jmh'

sourceCompatibility = 1.8
targetCompatibility = 1.8
Expand All @@ -22,11 +22,11 @@ jmhJar {
}

dependencies {
compile "org.openjdk.jmh:jmh-core:1.22"
implementation 'org.openjdk.jmh:jmh-core:1.22'
implementation 'com.google.guava:guava:24.1.1-jre'
compile 'com.fasterxml.jackson.core:jackson-databind:2.12.1'
compile 'com.fasterxml.jackson.module:jackson-module-kotlin:2.12.1'
compile project(':kotlinx-serialization-core')
compile project(':kotlinx-serialization-json')
compile project(':kotlinx-serialization-protobuf')
implementation 'com.fasterxml.jackson.core:jackson-databind:2.12.1'
implementation 'com.fasterxml.jackson.module:jackson-module-kotlin:2.12.1'
implementation project(':kotlinx-serialization-core')
implementation project(':kotlinx-serialization-json')
implementation project(':kotlinx-serialization-protobuf')
}
2 changes: 1 addition & 1 deletion bom/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ dependencies {
// It shouldn't be a problem as usually consumers need to use generic *-native artifact
// Gradle will choose correct variant by using metadata attributes
if (it.artifacts.any { it.extension == 'klib' }) return
api(group: it.groupId, name: it.artifactId, version: it.version)
api("${it.groupId}:${it.artifactId}:${it.version}")
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ buildscript {
classpath "org.jetbrains.kotlinx:kotlinx-knit:$knit_version"
classpath 'ru.vyarus:gradle-animalsniffer-plugin:1.5.3' // Android API check

classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.8'
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.18'

// Various benchmarking stuff
classpath "com.github.jengelman.gradle.plugins:shadow:4.0.2"
Expand Down
2 changes: 1 addition & 1 deletion core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ kotlin {
dependencies {
implementation 'io.kotlintest:kotlintest:2.0.7'
implementation 'com.google.guava:guava:24.1.1-jre'
implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.5'
implementation 'com.google.code.gson:gson:2.8.5'
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version"
}
}
Expand Down
10 changes: 5 additions & 5 deletions formats/cbor/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ kotlin {
jvmTest {
dependencies {
implementation 'io.kotlintest:kotlintest:2.0.7'
implementation group: 'com.upokecenter', name: 'cbor', version: '4.2.0'
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: jackson_version
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: jackson_version
implementation group: 'com.fasterxml.jackson.module', name: 'jackson-module-kotlin', version: jackson_version
implementation group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-cbor', version: jackson_version
implementation 'com.upokecenter:cbor:4.2.0'
implementation "com.fasterxml.jackson.core:jackson-core:$jackson_version"
implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_version"
implementation "com.fasterxml.jackson.module:jackson-module-kotlin:$jackson_version"
implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:$jackson_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version"
}
}
Expand Down
6 changes: 3 additions & 3 deletions formats/hocon/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ java {


dependencies {
compile project(':kotlinx-serialization-core')
implementation project(':kotlinx-serialization-core')
api 'org.jetbrains.kotlin:kotlin-stdlib'

api 'com.typesafe:config:1.4.1'

testCompile "org.jetbrains.kotlin:kotlin-test"
testCompile group: 'junit', name: 'junit', version: '4.12'
testImplementation 'org.jetbrains.kotlin:kotlin-test'
testImplementation 'junit:junit:4.12'
}

Java9Modularity.configureJava9ModuleInfo(project)
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package kotlinx.serialization.hocon

import kotlinx.serialization.*
import org.junit.*
import org.junit.Test
import kotlin.test.*

class HoconEncoderTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ package kotlinx.serialization.hocon

import com.typesafe.config.*
import kotlinx.serialization.*
import org.junit.*
import org.junit.Ignore
import org.junit.Test
import kotlin.test.*

class HoconRootMapTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ package kotlinx.serialization.hocon
import kotlin.test.*
import kotlinx.serialization.*
import kotlinx.serialization.builtins.*
import org.junit.*
import org.junit.Assert.*
import org.junit.Test

class HoconValuesTest {

Expand Down
2 changes: 1 addition & 1 deletion formats/json/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ kotlin {

jvmTest {
dependencies {
implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.5'
implementation 'com.google.code.gson:gson:2.8.5'
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version"
}
}
Expand Down
10 changes: 5 additions & 5 deletions formats/properties/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ kotlin {
jvmTest {
dependencies {
implementation 'io.kotlintest:kotlintest:2.0.7'
implementation group: 'com.upokecenter', name: 'cbor', version: '4.0.0-beta1'
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: jackson_version
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: jackson_version
implementation group: 'com.fasterxml.jackson.module', name: 'jackson-module-kotlin', version: jackson_version
implementation group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-cbor', version: jackson_version
implementation 'com.upokecenter:cbor:4.0.0-beta1'
implementation "com.fasterxml.jackson.core:jackson-core:$jackson_version"
implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_version"
implementation "com.fasterxml.jackson.module:jackson-module-kotlin:$jackson_version"
implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:$jackson_version"
}
}
}
Expand Down
1 change: 0 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ kotlin.mpp.enableCompatibilityMetadataVariant=true
kotlin.mpp.stability.nowarn=true

kotlin.js.compiler=both
kotlin.parallel.tasks.in.project=true
kotlin.incremental.multiplatform=true

org.gradle.parallel=true
Expand Down
3 changes: 0 additions & 3 deletions gradle/publishing.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import org.gradle.util.VersionNumber

/*
* Copyright 2017-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
*/

// Configures publishing of Maven artifacts to MavenCentral

apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'signing'

Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

0 comments on commit ece9fdd

Please sign in to comment.