-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
78 lines (58 loc) · 2.47 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
import com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation
plugins {
id 'java'
id 'com.github.johnrengelman.shadow' version '7.1.2'
}
group 'dev.badbird'
version '1.0.0'
repositories {
mavenCentral()
maven {
url "https://packages.jetbrains.team/maven/p/teamcity-rest-client/teamcity-rest-client"
}
}
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
implementation 'com.google.code.gson:gson:2.9.0'
compileOnly 'org.projectlombok:lombok:1.18.24'
annotationProcessor 'org.projectlombok:lombok:1.18.24'
testCompileOnly 'org.projectlombok:lombok:1.18.24'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.24'
implementation 'com.offbytwo.jenkins:jenkins-client:0.3.8' // Jenkins API Wrapper
implementation 'org.jetbrains.teamcity:teamcity-rest-client:1.18.1' // TeamCity API Wrapper, provided by JetBrains
implementation 'org.kohsuke:github-api:1.307' // GitHub API Wrapper
}
test {
useJUnitPlatform()
}
shadowJar {
archiveClassifier = ''
manifest {
attributes "Main-Class": "dev.badbird.serverlauncher.ServerLauncher"
attributes "Launcher-Agent-Class": "dev.badbird.serverlauncher.util.JarLoader"
}
archiveFileName = 'ServerLauncher.jar'
relocate 'com.google.gson', 'dev.badbird.serverlauncher.shadow.gson'
// Relocate the jenkins dependency to the shadow jar
relocate 'com.offbytwo.jenkins', 'dev.badbird.serverlauncher.shadow.jenkins'
relocate 'org.kohsuke.github', 'dev.badbird.serverlauncher.shadow.github'
// Relocate the teamcity dependency to the shadow jar
relocate 'org.jetbrains.teamcity', 'dev.badbird.serverlauncher.shadow.teamcity'
}
task relocateShadowJar(type: ConfigureShadowRelocation) {
// Not sure why this is here but i dont want to break anything so i'll keep it
target = tasks.shadowJar
prefix = "dev.badbird.serverlauncher.shadow"
}
tasks.shadowJar.dependsOn tasks.relocateShadowJar
tasks.jar.dependsOn tasks.shadowJar
task runDev(type: JavaExec) {
main = 'dev.badbird.serverlauncher.ServerLauncher'
group = "Execution"
description = "Run the main class with JavaExecTask"
classpath = sourceSets.main.runtimeClasspath
// Redirect input
// Set the working directory to the run directory
workingDir = new File(project.rootDir, 'run') // gradle is weird and wouldn't let me do = file(File, string)
}