forked from FAForever/faf-moderator-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
97 lines (83 loc) · 3.74 KB
/
build.gradle
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
import org.gradle.internal.os.OperatingSystem
plugins {
id 'application'
id 'com.github.johnrengelman.shadow' version '8.1.1'
}
repositories {
mavenCentral()
maven { url = 'https://jitpack.io' }
}
compileJava() {
options.compilerArgs << "-Amapstruct.defaultComponentModel=jsr330"
}
project.ext.javafxPlatform = "${javafxPlatform}"
if (javafxPlatform == "unspecified") {
switch (OperatingSystem.current()) {
case OperatingSystem.LINUX:
project.ext.javafxPlatform = "linux"
break
case OperatingSystem.MAC_OS:
String arch = System.getProperty("os.arch")
if (arch == "aarch64") {
project.ext.javafxPlatform = "mac-aarch64"
} else {
project.ext.javafxPlatform = "mac"
}
break
case OperatingSystem.WINDOWS:
project.ext.javafxPlatform = "win"
break
}
}
println "Platform is: ${javafxPlatform}"
dependencies {
def springBootVersion = "3.3.5"
def mapStructVersion = "1.5.5.Final"
def commonsVersion = "9972c3d"
annotationProcessor(platform("org.springframework.boot:spring-boot-dependencies:${springBootVersion}"))
implementation(platform("org.springframework.boot:spring-boot-dependencies:${springBootVersion}"))
annotationProcessor("org.springframework.boot:spring-boot-configuration-processor")
annotationProcessor("org.projectlombok:lombok")
annotationProcessor("org.mapstruct:mapstruct-processor:${mapStructVersion}")
implementation("org.projectlombok:lombok")
implementation("org.jetbrains:annotations:26.0.1")
implementation("org.springframework.boot:spring-boot-starter")
implementation("org.springframework.boot:spring-boot-starter-validation")
implementation("org.springframework.boot:spring-boot-starter-oauth2-client:3.3.5")
implementation("javax.inject:javax.inject:1")
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310")
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jdk8")
implementation("com.github.jasminb:jsonapi-converter:0.14")
implementation("com.github.FAForever.faf-java-commons:data:${commonsVersion}")
implementation("com.github.FAForever.faf-java-commons:api:${commonsVersion}")
implementation("org.apache.httpcomponents:httpclient:4.5.14")
implementation("com.github.rutledgepaulv:q-builders:1.6")
implementation("com.google.guava:guava:33.3.1-jre")
implementation("org.mapstruct:mapstruct:${mapStructVersion}")
implementation("org.openjfx:javafx-base:${javafxVersion}:${javafxPlatform}")
implementation("org.openjfx:javafx-controls:${javafxVersion}:${javafxPlatform}")
implementation("org.openjfx:javafx-graphics:${javafxVersion}:${javafxPlatform}")
implementation("org.openjfx:javafx-fxml:${javafxVersion}:${javafxPlatform}")
implementation("org.openjfx:javafx-web:${javafxVersion}:${javafxPlatform}")
implementation("org.openjfx:javafx-media:${javafxVersion}:${javafxPlatform}")
testImplementation("org.springframework.boot:spring-boot-starter-test")
}
mainClassName = 'com.faforever.moderatorclient.Launcher'
group = 'com.faforever'
description = 'faf-moderator-client'
sourceCompatibility = '21'
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
// This fixes the "line too long" error when running the .bat with windows CLI
tasks.withType(CreateStartScripts).each { task ->
task.doLast {
String text = task.windowsScript.text
// Replaces the per file classpath (which are all jars in "lib") with a wildcard on lib
text = text.replaceFirst(/(set CLASSPATH=%APP_HOME%\\lib\\).*/, { "${it[1]}*" })
task.windowsScript.write text
}
}
distZip {
archiveClassifier.set(javafxPlatform)
}