summaryrefslogtreecommitdiff
path: root/build.gradle.kts
blob: f4dd1c85dd1b92edfb53c48090fc531c4078767b (plain)
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
import com.diffplug.spotless.LineEnding

plugins {
	id("java")
	application
	id("gg.jte.gradle") version "3.2.1"
	id("com.diffplug.spotless") version "8.0.0"
}

group = "moe.nea.prickly"
version = "1.0.0"

repositories {
	mavenCentral()
}

dependencies {
	compileOnly("org.projectlombok:lombok:1.18.42")
	annotationProcessor("org.projectlombok:lombok:1.18.42")

	val javalinVersion = "6.7.0"

	implementation("io.javalin:javalin:$javalinVersion")
	implementation("io.javalin:javalin-rendering:$javalinVersion")

	implementation("gg.jte:jte:3.2.1")

	implementation("org.jspecify:jspecify:1.0.0")
	implementation("com.auth0:java-jwt:4.5.0")
	implementation("com.google.guava:guava:33.3.1-jre")
	runtimeOnly("org.slf4j:slf4j-simple:2.0.17")
	testImplementation(platform("org.junit:junit-bom:5.10.0"))
	testImplementation("org.junit.jupiter:junit-jupiter")
	testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}

application {
	mainClass.set("moe.nea.prickly.Main")
}

tasks.test {
	useJUnitPlatform()
}

val jteTargetDir = layout.buildDirectory.dir("jte-classes")

jte {
	precompile()
	targetDirectory.set(jteTargetDir.map { it.asFile.toPath() })
}

tasks.jar {
	dependsOn(tasks.precompileJte)
	from(jteTargetDir) {
		include("**/*.class")
		include("**/*.bin")
	}
}

spotless {
	val licenseHeader = "(C) \$YEAR Linnea Gräf - Licensed to everyone under the BSD 3 Clause License"
	format("jte") {
		target("src/main/jte/**/*.jte")
		licenseHeader("<%-- $licenseHeader --%>", "@.*")
		leadingSpacesToTabs()
		trimTrailingWhitespace()
		endWithNewline()
		lineEndings = LineEnding.UNIX
	}
	java {
		palantirJavaFormat()
		formatAnnotations()
		leadingSpacesToTabs()
		licenseHeader("/* $licenseHeader */")
	}
}