Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: upgrade to gradle 8.2 #996

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions aws-runtime/aws-config/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ listOf("apiElements", "runtimeElements").forEach {

// suppress internal generated clients
tasks.named<DokkaTaskPartial>("dokkaHtmlPartial") {
dependsOn(codegenTask)
dokkaSourceSets.configureEach {
perPackageOption {
matchingRegex.set(""".*\.internal.*""")
Expand Down
21 changes: 18 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import java.net.URL
import java.time.Duration
import java.util.Properties
Expand Down Expand Up @@ -42,6 +44,17 @@ allprojects {
)
pluginsMapConfiguration.set(pluginConfigMap)
}

tasks.withType<KotlinCompile> {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_1_8)
}
}

tasks.withType<JavaCompile> {
sourceCompatibility = JavaVersion.VERSION_1_8.toString()
targetCompatibility = JavaVersion.VERSION_1_8.toString()
}
}

subprojects {
Expand Down Expand Up @@ -110,7 +123,9 @@ project.afterEvaluate {
// This is especially important for inter-repo linking (e.g., via externalDocumentationLink) because the
// package-list doesn't contain enough project path information to indicate where modules' documentation are
// located.
fileLayout.set { parent, child -> parent.outputDirectory.get().resolve(child.project.name) }
fileLayout.set { parent, child ->
parent.outputDirectory.dir(child.project.name)
}

includes.from(
// NOTE: these get concatenated
Expand Down Expand Up @@ -166,7 +181,7 @@ tasks.register<JavaExec>("ktlint") {
description = "Check Kotlin code style."
group = "Verification"
classpath = configurations.getByName("ktlint")
main = "com.pinterest.ktlint.Main"
mainClass.set("com.pinterest.ktlint.Main")
args = lintPaths
jvmArgs("--add-opens", "java.base/java.lang=ALL-UNNAMED")
}
Expand All @@ -175,7 +190,7 @@ tasks.register<JavaExec>("ktlintFormat") {
description = "Auto fix Kotlin code style violations"
group = "formatting"
classpath = configurations.getByName("ktlint")
main = "com.pinterest.ktlint.Main"
mainClass.set("com.pinterest.ktlint.Main")
args = listOf("-F") + lintPaths
jvmArgs("--add-opens", "java.base/java.lang=ALL-UNNAMED")
}
Expand Down
18 changes: 10 additions & 8 deletions codegen/smithy-aws-kotlin-codegen/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
Expand All @@ -18,7 +20,6 @@ val kotestVersion: String by project
val kotlinVersion: String by project
val junitVersion: String by project
val smithyKotlinVersion: String by project
val kotlinJVMTargetVersion: String by project
val slf4jVersion: String by project

dependencies {
Expand Down Expand Up @@ -56,12 +57,13 @@ val generateSdkRuntimeVersion by tasks.registering {
}

tasks.compileKotlin {
kotlinOptions.jvmTarget = kotlinJVMTargetVersion
dependsOn(generateSdkRuntimeVersion)
}

tasks.compileTestKotlin {
kotlinOptions.jvmTarget = kotlinJVMTargetVersion
tasks.withType<KotlinCompile> {
compilerOptions {
freeCompilerArgs.add("-opt-in=kotlin.RequiresOptIn")
}
}

// Reusable license copySpec
Expand Down Expand Up @@ -93,9 +95,9 @@ tasks.test {
// Configure jacoco (code coverage) to generate an HTML report
tasks.jacocoTestReport {
reports {
xml.isEnabled = false
csv.isEnabled = false
html.destination = file("$buildDir/reports/jacoco")
xml.required.set(false)
csv.required.set(false)
html.outputLocation.set(file("$buildDir/reports/jacoco"))
}
}

Expand All @@ -105,7 +107,7 @@ tasks["test"].finalizedBy(tasks["jacocoTestReport"])
val sourcesJar by tasks.creating(Jar::class) {
group = "publishing"
description = "Assembles Kotlin sources jar"
classifier = "sources"
archiveClassifier.set("sources")
from(sourceSets.getByName("main").allSource)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ package aws.sdk.kotlin.dokka
import aws.sdk.kotlin.dokka.transformers.FilterInternalApis
import org.jetbrains.dokka.base.DokkaBase
import org.jetbrains.dokka.plugability.DokkaPlugin
import org.jetbrains.dokka.plugability.DokkaPluginApiPreview
import org.jetbrains.dokka.plugability.PluginApiPreviewAcknowledgement

/**
* Dokka plugin for customizing the AWS Kotlin SDK generated API docs
Expand All @@ -22,4 +24,7 @@ class AwsDokkaPlugin : DokkaPlugin() {
val filterInternalApis by extending {
dokkaBase.preMergeDocumentableTransformer providing ::FilterInternalApis
}

@OptIn(DokkaPluginApiPreview::class)
override fun pluginApiPreviewAcknowledgement(): PluginApiPreviewAcknowledgement = PluginApiPreviewAcknowledgement
}
11 changes: 4 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ kotlin.mpp.stability.nowarn=true
kotlin.native.ignoreDisabledTargets=true
kotlin.mpp.enableCompatibilityMetadataVariant=true

# gradle
org.gradle.jvmargs=-Xmx6g -XX:MaxMetaspaceSize=2G
# gradle/build
org.gradle.jvmargs=-Xmx6g -XX:MaxMetaspaceSize=2G

# sdk
sdkVersion=0.29.1-SNAPSHOT
Expand All @@ -17,10 +17,7 @@ smithyKotlinVersion=0.23.0

# kotlin
kotlinVersion=1.8.10
dokkaVersion=1.7.10

# kotlin JVM
kotlinJVMTargetVersion=1.8
dokkaVersion=1.8.20

# kotlin libraries
coroutinesVersion=1.6.4
Expand All @@ -39,4 +36,4 @@ mockkVersion=1.13.3
slf4jVersion=2.0.6

# dokka config (values specified at build-time as needed)
smithyKotlinDocBaseUrl=https://sdk.amazonaws.com/kotlin/api/smithy-kotlin/api/$smithyKotlinVersion/
smithyKotlinDocBaseUrl=https://sdk.amazonaws.com/kotlin/api/smithy-kotlin/api/$smithyKotlinVersion/
19 changes: 10 additions & 9 deletions gradle/codecoverage.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ allprojects {

jacoco {
toolVersion = "$jacocoVersion"
reportsDir = file("${buildDir}/jacoco-reports")
reportsDirectory = file("${buildDir}/jacoco-reports")
}
}

Expand Down Expand Up @@ -48,11 +48,11 @@ subprojects {
}

reports {
xml.enabled true
csv.enabled false
html.enabled true
xml.required = true
csv.required = false
html.required = true

html.destination file("${buildDir}/jacoco-reports/html")
html.outputLocation = file("${buildDir}/jacoco-reports/html")
}
}

Expand Down Expand Up @@ -105,9 +105,10 @@ task testCoverage(type: JacocoReport) {
additionalSourceDirs.from files(coverageSources)

reports {
xml.enabled true
csv.enabled false
html.enabled true
html.destination file("${buildDir}/jacoco-reports/html")
xml.required = true
csv.required = false
html.required = true

html.outputLocation = file("${buildDir}/jacoco-reports/html")
}
}
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-7.4.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
1 change: 0 additions & 1 deletion services/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ subprojects {
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions {
allWarningsAsErrors = false // FIXME Tons of errors occur in generated code
jvmTarget = "1.8" // fixes outgoing variant metadata: https://github.com/awslabs/smithy-kotlin/issues/258
}
}

Expand Down