-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
104 lines (88 loc) · 2.74 KB
/
build.gradle.kts
File metadata and controls
104 lines (88 loc) · 2.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
import aws.sdk.kotlin.gradle.publishing.configurePublishing
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id(libs.plugins.kotlin.jvm.get().pluginId)
jacoco
`maven-publish`
}
val sdkVersion: String by project
description = "Smithy codegen support for AWS protocols"
group = "aws.smithy.kotlin"
version = sdkVersion
dependencies {
api(project(":codegen:codegen"))
api(libs.smithy.aws.traits)
api(libs.smithy.aws.iam.traits)
api(libs.smithy.aws.cloudformation.traits)
api(libs.smithy.protocol.test.traits)
api(libs.smithy.protocol.traits)
implementation(libs.smithy.aws.endpoints)
testImplementation(libs.kotest.assertions.core.jvm)
testImplementation(libs.kotlin.test)
testImplementation(project(":codegen:codegen-testutils"))
testImplementation(libs.slf4j.api)
testImplementation(libs.slf4j.simple)
testImplementation(libs.kotlinx.serialization.json)
}
tasks.withType<KotlinCompile> {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_17)
}
}
tasks.withType<JavaCompile> {
sourceCompatibility = JavaVersion.VERSION_17.toString()
targetCompatibility = JavaVersion.VERSION_17.toString()
}
// Reusable license copySpec
val licenseSpec = copySpec {
from("${project.rootDir}/LICENSE")
from("${project.rootDir}/NOTICE")
}
// Configure jars to include license related info
tasks.jar {
metaInf.with(licenseSpec)
inputs.property("moduleName", project.name)
manifest {
attributes["Automatic-Module-Name"] = project.name
}
}
tasks.test {
useJUnitPlatform()
testLogging {
events("passed", "skipped", "failed")
showStandardStreams = true
showStackTraces = true
showExceptions = true
exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
}
}
// 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"])
val sourcesJar by tasks.creating(Jar::class) {
group = "publishing"
description = "Assembles Kotlin sources jar"
archiveClassifier.set("sources")
from(sourceSets.getByName("main").allSource)
}
publishing {
publications {
create<MavenPublication>("codegen") {
from(components["java"])
artifact(sourcesJar)
}
}
}
configurePublishing("smithy-kotlin", "smithy-lang")