diff --git a/aws-runtime/aws-config/build.gradle.kts b/aws-runtime/aws-config/build.gradle.kts index 4c59b53984d..f866514a7aa 100644 --- a/aws-runtime/aws-config/build.gradle.kts +++ b/aws-runtime/aws-config/build.gradle.kts @@ -245,6 +245,7 @@ listOf("apiElements", "runtimeElements").forEach { // suppress internal generated clients tasks.named("dokkaHtmlPartial") { + dependsOn(codegenTask) dokkaSourceSets.configureEach { perPackageOption { matchingRegex.set(""".*\.internal.*""") diff --git a/build.gradle.kts b/build.gradle.kts index 40bfa5e13b5..56d6d7d2805 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -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 @@ -42,6 +44,17 @@ allprojects { ) pluginsMapConfiguration.set(pluginConfigMap) } + + tasks.withType { + compilerOptions { + jvmTarget.set(JvmTarget.JVM_1_8) + } + } + + tasks.withType { + sourceCompatibility = JavaVersion.VERSION_1_8.toString() + targetCompatibility = JavaVersion.VERSION_1_8.toString() + } } subprojects { @@ -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 @@ -166,7 +181,7 @@ tasks.register("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") } @@ -175,7 +190,7 @@ tasks.register("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") } diff --git a/codegen/smithy-aws-kotlin-codegen/build.gradle.kts b/codegen/smithy-aws-kotlin-codegen/build.gradle.kts index 6fdbadfc477..936c28d4e1c 100644 --- a/codegen/smithy-aws-kotlin-codegen/build.gradle.kts +++ b/codegen/smithy-aws-kotlin-codegen/build.gradle.kts @@ -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 @@ -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 { @@ -56,12 +57,13 @@ val generateSdkRuntimeVersion by tasks.registering { } tasks.compileKotlin { - kotlinOptions.jvmTarget = kotlinJVMTargetVersion dependsOn(generateSdkRuntimeVersion) } -tasks.compileTestKotlin { - kotlinOptions.jvmTarget = kotlinJVMTargetVersion +tasks.withType { + compilerOptions { + freeCompilerArgs.add("-opt-in=kotlin.RequiresOptIn") + } } // Reusable license copySpec @@ -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")) } } @@ -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) } diff --git a/dokka-aws/src/main/kotlin/aws/sdk/kotlin/dokka/AwsDokkaPlugin.kt b/dokka-aws/src/main/kotlin/aws/sdk/kotlin/dokka/AwsDokkaPlugin.kt index b80787bd090..049787a86ea 100644 --- a/dokka-aws/src/main/kotlin/aws/sdk/kotlin/dokka/AwsDokkaPlugin.kt +++ b/dokka-aws/src/main/kotlin/aws/sdk/kotlin/dokka/AwsDokkaPlugin.kt @@ -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 @@ -22,4 +24,7 @@ class AwsDokkaPlugin : DokkaPlugin() { val filterInternalApis by extending { dokkaBase.preMergeDocumentableTransformer providing ::FilterInternalApis } + + @OptIn(DokkaPluginApiPreview::class) + override fun pluginApiPreviewAcknowledgement(): PluginApiPreviewAcknowledgement = PluginApiPreviewAcknowledgement } diff --git a/gradle.properties b/gradle.properties index 8f04c981785..e4b8fbb79d8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -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 @@ -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 @@ -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/ \ No newline at end of file +smithyKotlinDocBaseUrl=https://sdk.amazonaws.com/kotlin/api/smithy-kotlin/api/$smithyKotlinVersion/ diff --git a/gradle/codecoverage.gradle b/gradle/codecoverage.gradle index 09f45a9f571..1835f13ba1a 100644 --- a/gradle/codecoverage.gradle +++ b/gradle/codecoverage.gradle @@ -8,7 +8,7 @@ allprojects { jacoco { toolVersion = "$jacocoVersion" - reportsDir = file("${buildDir}/jacoco-reports") + reportsDirectory = file("${buildDir}/jacoco-reports") } } @@ -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") } } @@ -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") } } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 7454180f2ae..41d9927a4d4 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index aa991fceae6..84a0b92f9af 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -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 diff --git a/services/build.gradle.kts b/services/build.gradle.kts index 2e687e6c7e6..729084feb51 100644 --- a/services/build.gradle.kts +++ b/services/build.gradle.kts @@ -138,7 +138,6 @@ subprojects { tasks.withType { 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 } }