-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
120 lines (100 loc) · 2.85 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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath(kotlin("gradle-plugin", version = "2.0.0"))
}
}
plugins {
idea
jacoco
`maven-publish`
kotlin("jvm") version "2.0.0"
}
project.tasks.publish {
enabled = false
}
subprojects {
apply(plugin = "kotlin")
apply(plugin = "idea")
apply(plugin = "jacoco")
apply(plugin = "maven-publish")
ext {
set("releaseVersion", "2.4.1")
}
repositories {
mavenCentral()
}
dependencies {
//Standard Libraries
implementation(kotlin("stdlib-jdk8"))
implementation(kotlin("reflect"))
//Logging
compileOnly("org.slf4j:slf4j-api:2.0.13")
runtimeOnly("org.apache.logging.log4j:log4j-core:2.23.1")
runtimeOnly("org.apache.logging.log4j:log4j-slf4j-impl:2.23.1")
//Testing
testImplementation("org.junit.jupiter:junit-jupiter-api:5.10.2")
testImplementation("org.junit.jupiter:junit-jupiter-params:5.10.2")
testImplementation("com.willowtreeapps.assertk:assertk-jvm:0.28.1")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.10.2")
testRuntimeOnly("org.junit.platform:junit-platform-launcher:1.10.2")
}
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "18"
}
val sourcesJar by tasks.creating(Jar::class) {
val sourceSets: SourceSetContainer by project
from(sourceSets["main"].allJava)
archiveClassifier.set("sources")
}
publishing {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/tomplum/advent-of-code-libs")
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
publications {
create<MavenPublication>(project.name) {
from(components["java"])
artifact(sourcesJar)
}
}
}
tasks.test {
useJUnitPlatform { }
finalizedBy(tasks.jacocoTestReport)
}
tasks.jacocoTestReport {
dependsOn(tasks.test)
}
jacoco {
toolVersion = "0.8.12"
reportsDirectory.set(file("$buildDir/reports"))
}
tasks.jacocoTestReport {
group = "Reporting"
description = "Generate Jacoco test coverage report"
reports {
xml.required.set(true)
html.required.set(true)
csv.required.set(false)
}
}
tasks.jacocoTestCoverageVerification {
violationRules {
rule {
limit {
minimum = "0.9".toBigDecimal()
}
}
}
}
}