-
Notifications
You must be signed in to change notification settings - Fork 16
/
build.gradle.kts
139 lines (118 loc) · 4.07 KB
/
build.gradle.kts
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
plugins {
id("java")
id("checkstyle")
id("maven-publish")
}
dependencies {
testImplementation(libs.junit.api)
testRuntimeOnly(libs.junit.engine)
}
val downloadArtifact: Configuration by configurations.creating {
isTransitive = false
}
val identityHubVersion: String by project
val registrationServiceVersion: String by project
// task that downloads the RegSrv CLI and IH CLI
val getJars by tasks.registering(Copy::class) {
outputs.upToDateWhen { false } //always download
from(downloadArtifact)
// strip away the version string
.rename { s ->
s.replace("-${identityHubVersion}", "")
.replace("-${registrationServiceVersion}", "")
.replace("-all", "")
}
into(layout.projectDirectory.dir("libs/cli-tools"))
}
// run the download jars task after the "jar" task
tasks {
jar {
finalizedBy(getJars)
}
}
allprojects {
apply(plugin = "java")
apply(plugin = "checkstyle")
configurations.all {
resolutionStrategy.force("org.eclipse.edc:runtime-metamodel:0.2.1")
}
tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
sourceCompatibility = JavaVersion.VERSION_17.toString()
targetCompatibility = JavaVersion.VERSION_17.toString()
}
tasks.getByName<Test>("test") {
val runningOnGithub = System.getenv("GITHUB_CI")?.isNotBlank() ?: false
useJUnitPlatform {
if (runningOnGithub) {
excludeTags = setOf("not-on-github")
}
}
testLogging {
events = setOf(TestLogEvent.SKIPPED, TestLogEvent.FAILED)
exceptionFormat = TestExceptionFormat.FULL
showExceptions = true
showCauses = true
}
failFast = true
}
checkstyle {
toolVersion = "10.9.3"
configFile = rootProject.file("docs/dev/checkstyle/checkstyle-config.xml")
configDirectory.set(rootProject.file("docs/dev/checkstyle"))
maxErrors = 0 // does not tolerate errors
}
repositories {
mavenCentral()
mavenLocal()
maven {
url = uri("https://oss.sonatype.org/content/repositories/snapshots/")
}
maven {
url = uri("https://maven.pkg.github.com/truzzt/mds-ap3")
credentials {
username = project.findProperty("gpr.user") as String? ?: System.getenv("USERNAME")
password = project.findProperty("gpr.key") as String? ?: System.getenv("TOKEN")
}
}
maven {
url = uri("https://maven.pkg.github.com/ids-basecamp/ids-infomodel-java")
credentials {
username = project.findProperty("gpr.user") as String? ?: System.getenv("USERNAME")
password = project.findProperty("gpr.key") as String? ?: System.getenv("TOKEN")
}
}
maven {
url =
uri("https://pkgs.dev.azure.com/sovity/41799556-91c8-4df6-8ddb-4471d6f15953/_packaging/core-edc/maven/v1")
name = "AzureRepo"
}
}
}
subprojects {
apply(plugin = "maven-publish")
val sovityEdcExtensionsVersion: String by project
version = sovityEdcExtensionsVersion
publishing {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/sovity/edc-ce")
credentials {
username = project.findProperty("gpr.user") as String? ?: System.getenv("USERNAME")
password = project.findProperty("gpr.key") as String? ?: System.getenv("TOKEN")
}
}
}
}
tasks.register("printClasspath") {
group = libs.versions.edcGroup.get()
description = "The EdcRuntimeExtension JUnit Extension requires the gradle task 'printClasspath'"
println(sourceSets.main.get().runtimeClasspath.asPath)
}
java {
withSourcesJar()
}
}