1
1
import org.everit.json.schema.Schema
2
2
import org.everit.json.schema.loader.SchemaLoader
3
3
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
4
+ import org.jetbrains.kotlin.gradle.dsl.JvmTarget
5
+ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
4
6
import org.json.JSONObject
5
7
6
- val jacksonVersion = " 2.14.1"
7
- val junitVersion = " 4.13.2"
8
- val kotlinVersion = " 1.3.20"
9
- val assertjVersion = " 3.24.2"
10
-
11
8
plugins {
12
- java
13
9
`kotlin- dsl`
14
- kotlin( " jvm " ) version " 1.8.0 "
10
+ alias(libs.plugins.kotlin.jvm)
15
11
`maven- publish`
16
12
signing
17
- id( " io.github.gradle- nexus.publish-plugin " ) version " 1.1.0 "
13
+ alias(libs.plugins. nexus.publishing)
18
14
}
19
15
20
16
java {
@@ -28,8 +24,7 @@ buildscript {
28
24
gradlePluginPortal()
29
25
}
30
26
dependencies {
31
- classpath(" com.github.erosb:everit-json-schema:1.14.1" )
32
- classpath(kotlin(" gradle-plugin" , version = " 1.3.20" ))
27
+ classpath(libs.json.schema)
33
28
}
34
29
}
35
30
@@ -40,24 +35,19 @@ repositories {
40
35
group = " software.aws.toolkits"
41
36
42
37
dependencies {
43
- implementation(kotlin(" stdlib-jdk8" ))
44
- implementation(" com.squareup:kotlinpoet:1.13.2" )
45
- implementation(" com.fasterxml.jackson.module:jackson-module-kotlin:$jacksonVersion " )
46
- implementation(" com.github.erosb:everit-json-schema:1.12.2" )
47
- testImplementation(" junit:junit:$junitVersion " )
48
- testImplementation(" org.assertj:assertj-core:$assertjVersion " )
38
+ implementation(libs.kotlin.poet)
39
+ implementation(libs.jackson.module.kotlin)
40
+ implementation(libs.json.schema)
41
+ testImplementation(libs.junit4)
42
+ testImplementation(libs.assertj)
49
43
}
50
44
51
45
tasks {
52
- compileKotlin {
53
- dependsOn(" :copyTelemetryResources" , " :validatePackagedSchema" )
54
- kotlinOptions.jvmTarget = " 1.8"
46
+ withType<KotlinCompile > {
47
+ compilerOptions.jvmTarget = JvmTarget .JVM_17
55
48
}
56
- compileTestKotlin {
57
- dependsOn(" :copyTestTelemetryResources" )
58
- kotlinOptions.jvmTarget = " 1.8"
59
- }
60
- register(" validatePackagedSchema" ) {
49
+
50
+ val validatePackagedSchema by registering {
61
51
group = " build"
62
52
description = " Validates that the packaged definition is compatable with the packaged schema"
63
53
doFirst {
@@ -74,16 +64,34 @@ tasks {
74
64
}
75
65
}
76
66
}
77
- task(name = " copyTelemetryResources" , type = Copy ::class ) {
67
+
68
+ val copyTelemetryResources by registering(Copy ::class ) {
78
69
from(" .." )
79
70
include(" *.json" , " definitions/*.json" )
80
71
into(" src/main/resources/" )
81
72
}
82
- task(name = " copyTestTelemetryResources" , type = Copy ::class ) {
73
+
74
+ val copyTestTelemetryResources by registering(Copy ::class ) {
83
75
from(" .." )
84
76
include(" *.json" , " definitions/*.json" )
85
77
into(" src/test/resources/" )
86
78
}
79
+
80
+ compileKotlin {
81
+ dependsOn(copyTelemetryResources, validatePackagedSchema)
82
+ }
83
+
84
+ compileTestKotlin {
85
+ dependsOn(copyTestTelemetryResources)
86
+ }
87
+
88
+ processResources {
89
+ dependsOn(copyTelemetryResources)
90
+ }
91
+
92
+ processTestResources {
93
+ dependsOn(copyTestTelemetryResources)
94
+ }
87
95
}
88
96
89
97
// maven can't handle this
0 commit comments