Unverified Commit ae52b695 authored by John DiSanti's avatar John DiSanti Committed by GitHub
Browse files

Upgrade Smithy Gradle Plugin to 0.9 (#3394)

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
parent 5761d1fe
Loading
Loading
Loading
Loading
+4 −9
Original line number Diff line number Diff line
@@ -9,7 +9,9 @@ extra["moduleName"] = "software.amazon.smithy.rust.awssdk.adhoc.test"
tasks["jar"].enabled = false

plugins {
    id("software.amazon.smithy")
    java
    id("software.amazon.smithy.gradle.smithy-base")
    id("software.amazon.smithy.gradle.smithy-jar")
}

java {
@@ -28,13 +30,6 @@ configure<software.amazon.smithy.gradle.SmithyExtension> {
    outputDirectory = layout.buildDirectory.dir(workingDirUnderBuildDir).get().asFile
}

buildscript {
    val smithyVersion: String by project
    dependencies {
        classpath("software.amazon.smithy:smithy-cli:$smithyVersion")
    }
}

dependencies {
    implementation(project(":aws:sdk-codegen"))
    implementation("software.amazon.smithy:smithy-aws-protocol-tests:$smithyVersion")
@@ -79,7 +74,7 @@ project.registerGenerateSmithyBuildTask(rootProject, pluginName, allCodegenTests
project.registerGenerateCargoWorkspaceTask(rootProject, pluginName, allCodegenTests, workingDirUnderBuildDir)
project.registerGenerateCargoConfigTomlTask(layout.buildDirectory.dir(workingDirUnderBuildDir).get().asFile)

tasks["smithyBuildJar"].dependsOn("generateSmithyBuild")
tasks["jar"].dependsOn("generateSmithyBuild")
tasks["assemble"].finalizedBy("generateCargoWorkspace")

project.registerModifyMtimeTask()
+0 −13
Original line number Diff line number Diff line
@@ -7,7 +7,6 @@ import org.gradle.api.tasks.testing.logging.TestExceptionFormat

plugins {
    kotlin("jvm")
    jacoco
    `maven-publish`
}

@@ -85,18 +84,6 @@ if (isTestingEnabled.toBoolean()) {
            showStackTraces = true
        }
    }

    // Configure jacoco (code coverage) to generate an HTML report
    tasks.jacocoTestReport {
        reports {
            xml.required.set(false)
            csv.required.set(false)
            html.outputLocation.set(layout.buildDirectory.dir("reports/jacoco"))
        }
    }

    // Always run the jacoco test report after testing.
    tasks["test"].finalizedBy(tasks["jacocoTestReport"])
}

publishing {
+11 −17
Original line number Diff line number Diff line
@@ -15,7 +15,9 @@ extra["moduleName"] = "software.amazon.smithy.rust.awssdk"
tasks["jar"].enabled = false

plugins {
    id("software.amazon.smithy")
    java
    id("software.amazon.smithy.gradle.smithy-base")
    id("software.amazon.smithy.gradle.smithy-jar")
}

java {
@@ -39,14 +41,6 @@ val outputDir = layout.buildDirectory.dir("aws-sdk").get()
val sdkOutputDir = outputDir.dir("sdk")
val examplesOutputDir = outputDir.dir("examples")

buildscript {
    val smithyVersion: String by project
    dependencies {
        classpath("software.amazon.smithy:smithy-aws-traits:$smithyVersion")
        classpath("software.amazon.smithy:smithy-cli:$smithyVersion")
    }
}

dependencies {
    implementation(project(":aws:sdk-codegen"))
    implementation("software.amazon.smithy:smithy-protocol-test-traits:$smithyVersion")
@@ -157,7 +151,7 @@ tasks.register("generateSmithyBuild") {
}

tasks.register("generateIndexMd") {
    dependsOn("smithyBuildJar")
    dependsOn("jar")

    inputs.property("servicelist", awsServices.services.toString())
    val indexMd = outputDir.file("index.md").asFile
@@ -169,7 +163,7 @@ tasks.register("generateIndexMd") {

tasks.register("relocateServices") {
    description = "relocate AWS services to their final destination"
    dependsOn("smithyBuildJar")
    dependsOn("jar")

    doLast {
        awsServices.services.forEach {
@@ -196,7 +190,7 @@ tasks.register("relocateServices") {

tasks.register("relocateExamples") {
    description = "relocate the examples folder & rewrite path dependencies"
    dependsOn("smithyBuildJar")
    dependsOn("jar")

    doLast {
        if (awsServices.examples.isNotEmpty()) {
@@ -220,7 +214,7 @@ tasks.register("relocateExamples") {

tasks.register("relocateTests") {
    description = "relocate the root integration tests and rewrite path dependencies"
    dependsOn("smithyBuildJar")
    dependsOn("jar")

    doLast {
        if (awsServices.rootTests.isNotEmpty()) {
@@ -272,7 +266,7 @@ fun rewritePathDependency(line: String): String {
}

tasks.register<Copy>("copyAllRuntimes") {
    dependsOn("smithyBuildJar")
    dependsOn("jar")
    from("$rootDir/aws/rust-runtime") {
        CrateSet.AWS_SDK_RUNTIME.forEach { include("${it.name}/**") }
    }
@@ -309,7 +303,7 @@ tasks.register("relocateRuntime") {
}

tasks.register<Copy>("relocateChangelog") {
    dependsOn("smithyBuildJar")
    dependsOn("jar")
    from("$rootDir/aws")
    include("SDK_CHANGELOG.md")
    into(outputDir)
@@ -413,7 +407,7 @@ tasks.register<ExecRustBuildTool>("generateVersionManifest") {
    }
}

tasks["smithyBuildJar"].apply {
tasks["jar"].apply {
    inputs.file(layout.buildDirectory.file("smithy-build.json"))
    inputs.dir(projectDir.resolve("aws-models"))
    dependsOn("generateSmithyBuild")
@@ -423,7 +417,7 @@ tasks["smithyBuildJar"].apply {
tasks["assemble"].apply {
    dependsOn(
        "deleteSdk",
        "smithyBuildJar",
        "jar",
        "relocateServices",
        "relocateRuntime",
        "relocateAwsRuntime",
+0 −11
Original line number Diff line number Diff line
@@ -14,8 +14,6 @@ buildscript {
    }
}

plugins { }

allprojects {
    repositories {
        // mavenLocal()
@@ -24,15 +22,6 @@ allprojects {
    }
}

allprojects.forEach {
    it.apply(plugin = "jacoco")

    it.the<JacocoPluginExtension>().apply {
        toolVersion = "0.8.8"
        reportsDirectory.set(layout.buildDirectory.dir("jacoco-reports"))
    }
}

val ktlint by configurations.creating
val ktlintVersion: String by project

+0 −13
Original line number Diff line number Diff line
@@ -8,7 +8,6 @@ import java.util.Properties

plugins {
    `kotlin-dsl`
    jacoco
}
repositories {
    mavenCentral()
@@ -52,15 +51,3 @@ tasks.test {
        showStandardStreams = true
    }
}

// Configure jacoco (code coverage) to generate an HTML report
tasks.jacocoTestReport {
    reports {
        xml.required.set(false)
        csv.required.set(false)
        html.outputLocation.set(layout.buildDirectory.dir("reports/jacoco"))
    }
}

// Always run the jacoco test report after testing.
tasks["test"].finalizedBy(tasks["jacocoTestReport"])
Loading