-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
87 lines (74 loc) · 1.98 KB
/
build.gradle.kts
File metadata and controls
87 lines (74 loc) · 1.98 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
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
plugins {
id("java-library")
id("maven-publish")
id("com.diffplug.spotless") version "6.25.0"
id("io.spring.dependency-management") version "1.1.6"
id("com.gradleup.shadow") version "8.3.3"
}
group = "pl.kodstark"
version = "1.0.0-SNAPSHOT"
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
repositories {
mavenCentral()
}
dependencyManagement {
testing {
imports {
mavenBom("org.junit:junit-bom:5.10.0")
}
dependencies {
dependency("org.mockito:mockito-core:5.14.2")
}
}
}
val mockitoAgent = configurations.create("mockitoAgent")
dependencies {
implementation("net.bytebuddy:byte-buddy:1.15.4")
testImplementation("org.junit.jupiter:junit-jupiter")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
testImplementation("org.mockito:mockito-core")
testImplementation("org.assertj:assertj-core:3.26.3")
testImplementation("io.reactivex.rxjava3:rxjava:3.1.9")
mockitoAgent("org.mockito:mockito-core") { isTransitive = false }
}
tasks.withType<ShadowJar> {
manifest {
attributes("Premain-Class" to "pl.kodstark.rxjava.agent.SubscriptionAgent")
}
}
tasks.register<Jar>("sources") {
archiveClassifier.set("sources")
from(sourceSets.main.get().allSource)
}
publishing {
repositories {
mavenLocal()
}
publications {
create<MavenPublication>("maven") {
from(components["java"])
}
}
}
tasks.withType<Test> {
useJUnitPlatform()
jvmArgs = listOf(
"-javaagent:${tasks.shadowJar.get().archiveFile.get().asFile}", "-javaagent:${mockitoAgent.asPath}"
)
}
tasks.test {
dependsOn("shadowJar")
}
spotless {
java {
removeUnusedImports()
googleJavaFormat().skipJavadocFormatting()
}
}