-
-
Notifications
You must be signed in to change notification settings - Fork 17
/
build.gradle.kts
108 lines (92 loc) · 3.11 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
import org.ajoberstar.grgit.Grgit
import org.cadixdev.gradle.licenser.LicenseExtension
plugins {
id("java-library")
id("org.cadixdev.licenser")
id("maven-publish")
id("eclipse")
id("idea")
id("com.jfrog.artifactory")
id("checkstyle")
}
logger.lifecycle("""
*******************************************
You are building SquirrelID!
If you encounter trouble:
1) Read README.md if you haven't yet
2) Try running 'build' in a separate Gradle run
3) Use gradlew and not gradle
4) If you still need help, ask on Discord! https://discord.gg/enginehub
Output files will be in build/libs
*******************************************
""")
repositories {
mavenCentral()
maven { url = uri("https://repo.papermc.io/repository/maven-public/") }
maven { url = uri("https://maven.enginehub.org/repo/") }
}
configurations.all {
resolutionStrategy {
force("com.google.guava:guava:${Versions.GUAVA}")
}
}
dependencies {
"implementation"("com.google.guava:guava:${Versions.GUAVA}")
"implementation"("com.google.code.findbugs:jsr305:1.3.9")
"implementation"("org.xerial:sqlite-jdbc:3.36.0.3")
"implementation"("io.papermc.paper:paper-api:1.19.3-R0.1-SNAPSHOT")
"testImplementation"("com.google.guava:guava:${Versions.GUAVA}")
"testImplementation"("com.google.code.findbugs:jsr305:1.3.9")
"testImplementation"("org.xerial:sqlite-jdbc:3.36.0.3")
"testImplementation"("com.googlecode.json-simple:json-simple:1.1")
"testImplementation"("junit:junit:${Versions.JUNIT}")
"testImplementation"("org.junit.jupiter:junit-jupiter-api:${Versions.JUPITER}")
"testImplementation"("org.junit.jupiter:junit-jupiter-params:${Versions.JUPITER}")
"testImplementation"("org.hamcrest:hamcrest:2.2")
"testRuntimeOnly"("org.junit.jupiter:junit-jupiter-engine:${Versions.JUPITER}")
}
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
withSourcesJar()
withJavadocJar()
}
// Java 8 turns on doclint which we fail
tasks.withType<Javadoc>().configureEach {
(options as StandardJavadocDocletOptions).apply {
addStringOption("Xdoclint:none", "-quiet")
tags(
"apiNote:a:API Note:",
"implSpec:a:Implementation Requirements:",
"implNote:a:Implementation Note:"
)
}
}
configure<PublishingExtension> {
publications {
register<MavenPublication>("maven") {
from(components["java"])
versionMapping {
usage("java-api") {
fromResolutionOf("runtimeClasspath")
}
usage("java-runtime") {
fromResolutionResult()
}
}
}
}
}
applyArtifactoryConfig()
configure<LicenseExtension> {
header.set(resources.text.fromFile(file("HEADER.txt")))
include("**/*.java")
}
if (!project.hasProperty("gitCommitHash")) {
apply(plugin = "org.ajoberstar.grgit")
ext["gitCommitHash"] = try {
extensions.getByName<Grgit>("grgit").head()?.abbreviatedId
} catch (e: Exception) {
logger.warn("Error getting commit hash", e)
"no.git.id"
}
}