-
Notifications
You must be signed in to change notification settings - Fork 26
/
build.gradle
127 lines (106 loc) · 3.29 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
import edu.sc.seis.launch4j.tasks.Launch4jLibraryTask
plugins {
id 'edu.sc.seis.launch4j' version '2.5.4'
id 'com.github.johnrengelman.shadow' version '7.1.2'
id 'java'
id 'application'
id 'maven-publish'
}
repositories {
mavenCentral()
}
group = "com.superzanti.serversync"
version = ss_version
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
configurations {
shadow
compile.extendsFrom shadow
}
dependencies {
// Use JUnit Jupiter API for testing.
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2', 'org.junit.jupiter:junit-jupiter-params:5.8.2'
// Use JUnit Jupiter Engine for testing.
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2', 'com.eclipsesource.minimal-json:minimal-json:0.9.5'
implementation fileTree(dir: 'libs', include: '*.jar')
annotationProcessor 'info.picocli:picocli-codegen:4.6.2'
shadow group: 'com.eclipsesource.minimal-json', name: 'minimal-json', version: '0.9.5'
shadow group: 'info.picocli', name: 'picocli', version: '4.6.2'
}
application {
mainClass = ss_main_class
}
test {
useJUnitPlatform()
afterTest { desc, result ->
logger.quiet "Ran test ${desc.name} [${desc.className}] with result: ${result.resultType}"
}
}
jar {
processResources {
exclude "css/application.css"
}
manifest {
attributes 'Main-Class': ss_main_class, 'Implementation-Version': ss_version
}
}
shadowJar {
inputs.file(jar.archiveFile)
configurations = [project.configurations.shadow]
minimize()
dependencies {
exclude 'forge*.jar'
}
}
createExe {
jarTask = shadowJar
mainClassName = ss_main_class
outfile = 'ServerSyncClient.exe'
icon = "${projectDir}/src/main/resources/ServersyncLogo.ico"
copyConfigurable = shadowJar.outputs.files
supportUrl = "https://github.com/superzanti/ServerSync"
productName = "ServerSync - Client"
fileDescription = "The client side for users."
version = ss_version
}
task createServerExe(type: Launch4jLibraryTask) {
jarTask = shadowJar
mainClassName = ss_main_class_server
outfile = 'ServerSyncServer.exe'
headerType = 'console'
icon = "${projectDir}/src/main/resources/ServersyncLogoServer.ico"
copyConfigurable = shadowJar.outputs.files
supportUrl = "https://github.com/superzanti/ServerSync"
productName = "ServerSync - Server"
fileDescription = "The server side for admins."
version = ss_version
}
publishing {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/${System.getenv('GPR_REPO')}")
credentials {
username = project.findProperty("gpr.user") as String ?: System.getenv("GPR_USERNAME")
password = project.findProperty("gpr.key") as String ?: System.getenv("GPR_TOKEN")
}
}
}
publications {
shadow(MavenPublication) { publication ->
project.shadow.component(publication)
}
}
}
tasks.register('cleanProject') {
def cleanupFiles = ["publish", "config", "logs", "mods", "clientmods"]
for (name in cleanupFiles) {
def f = file("$rootDir/$name")
if (f.exists() && f.canWrite()) {
f.deleteDir()
}
}
}