-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
87 lines (68 loc) · 2.28 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
import java.net.URI
plugins {
id("java")
id("maven-publish")
}
allprojects {
apply(plugin = "java")
apply(plugin = "maven-publish")
this.group = rootProject.property("maven_group") as String
this.version = project.property("version") as String
base {
val baseName = project.property("archives_base_name") as String
this.archivesName.set(if (baseName.equals("endec")) baseName else "endec.${baseName}")
}
repositories {
mavenCentral()
}
dependencies {
compileOnly("org.jetbrains:annotations:24.1.0")
implementation("it.unimi.dsi:fastutil:8.5.12")
implementation("com.google.guava:guava:32.1.2-jre")
testImplementation("org.junit.jupiter:junit-jupiter:5.11.2")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
testImplementation(rootProject.project("gson"))
testImplementation(rootProject.project("jankson"))
testImplementation(rootProject.project("netty"))
testImplementation("org.jetbrains:annotations:24.1.0")
testImplementation("io.netty:netty-buffer:4.1.97.Final")
}
tasks.named<Test>("test") {
useJUnitPlatform()
maxHeapSize = "1G"
testLogging {
events("passed")
}
}
tasks.publish { dependsOn(tasks.check) }
tasks.publishToMavenLocal { dependsOn(tasks.check) }
val targetJavaVersion = 17
tasks.withType<JavaCompile>().configureEach {
this.options.encoding = "UTF-8"
if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) {
this.options.release = targetJavaVersion
}
}
java {
withSourcesJar()
}
publishing {
if (project.name == "endec_test") return@publishing;
publications {
create<MavenPublication>("mavenCommon") {
groupId = project.property("maven_group") as String;
from(components["java"])
}
}
repositories {
val env = System.getenv()
maven {
url = URI.create(env["MAVEN_URL"] ?: "")
credentials {
username = env["MAVEN_USER"]
password = env["MAVEN_PASSWORD"]
}
}
}
}
}