Commit 5c77e437 authored by Russell Cohen's avatar Russell Cohen
Browse files

Add gradle files

parent 3ba6fe37
Loading
Loading
Loading
Loading

gradle.properties

0 → 100644
+25 −0
Original line number Diff line number Diff line
#
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0.
#

kotlin.code.style=official

# codegen
smithyVersion=1.3.0

# kotlin
kotlinVersion=1.3.72
kotlin.native.ignoreDisabledTargets=true

# kotlin libraries
coroutinesVersion=1.3.7
# TODO: probably remove
ktorVersion=1.3.2

# testing/utility
# FIXME - junit5 not working
junitVersion=4.12
ktlintVersion=0.36.0
kotestVersion=4.2.6

gradle/jvm.gradle

0 → 100644
+39 −0
Original line number Diff line number Diff line
/*
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * SPDX-License-Identifier: Apache-2.0.
 */

kotlin {
    targets {
        fromPreset(presets.jvm, 'jvm')
    }

    sourceSets {
        jvmMain.dependencies {
            api group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib', version: kotlinVersion
            implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion"
        }

        jvmTest.dependencies {
            api 'org.jetbrains.kotlin:kotlin-test'
            api 'org.jetbrains.kotlin:kotlin-test-junit'
            api 'junit:junit:$junitVersion'
//            api "org.junit.jupiter:junit-jupiter-api"

            api group: 'org.jetbrains.kotlin', name: 'kotlin-test-junit', version: kotlinVersion
//            api group: 'org.jetbrains.kotlin', name: 'kotlin-test-junit5', version: kotlinVersion
            api group: 'junit', name: 'junit', version: junitVersion
//            api group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: junitVersion
            implementation "org.jetbrains.kotlinx:kotlinx-coroutines-debug:$coroutinesVersion"
            implementation "io.kotest:kotest-assertions-core-jvm:$kotestVersion"
        }
    }

}

jvmTest {
    testLogging {
        events("passed", "skipped", "failed")
        showStandardStreams = true
    }
}
+71 −0
Original line number Diff line number Diff line
/*
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * SPDX-License-Identifier: Apache-2.0.
 */

allprojects {
    apply plugin: "jacoco"

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

subprojects {
    task testCoverageSubproject(type: JacocoReport) {
        group = "Reporting"
        description = "Generate Jacoco coverage reports."

        def coverageSourceDirs = [
                "common/src",
                "jvm/src",
                "src/main/kotlin"
        ]
        // Do not add example projects coverage info
        if (!project.name.contains("example")) {
            classDirectories.from files(fileTree(dir: "${buildDir}/classes/kotlin/jvm/"), fileTree(dir: "${buildDir}/classes/kotlin/"))
            sourceDirectories.from files(coverageSourceDirs)
            additionalSourceDirs.from files(coverageSourceDirs)
        }

        // Add corresponding test.exec file according to platforms in the project
        if ("codegen" == project.name) {
            executionData.from files("${buildDir}/jacoco/test.exec")
        } else {
            executionData.from files("${buildDir}/jacoco/jvmTest.exec")
        }

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

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

task testCoverageMain(type: JacocoReport) {
    group = "Reporting"
    description = "Generate Jacoco coverage reports."
    dependsOn subprojects.testCoverageSubproject
    dependsOn "jacocoMerge"

    def classes = files(subprojects.collect {
        files(fileTree(dir: "${it.buildDir}/classes/kotlin/jvm").filter({file -> !file.absolutePath.contains('design/example')}))
        files(fileTree(dir: "${it.buildDir}/classes/kotlin").filter({file -> !file.absolutePath.contains('design/example')}))
    })

    def samples = files(subprojects.testCoverageSubproject.executionData).findAll { it.exists() }

    classDirectories.from files(classes)
    executionData.from(samples)

    reports {
        xml.enabled true
        csv.enabled false
        html.enabled true
        html.destination file("${buildDir}/jacoco-reports/html")
    }
}
 No newline at end of file
+53.9 KiB

File added.

No diff preview for this file type.

+10 −0
Original line number Diff line number Diff line
#
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0.
#

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading