-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle
83 lines (73 loc) · 2.81 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
plugins {
id 'java'
id 'eclipse'
id 'org.jetbrains.gradle.plugin.idea-ext' version '1.1.9'
id 'xyz.jpenilla.run-paper' version '2.3.1'
id 'xyz.jpenilla.run-velocity' version '2.3.1'
}
group = 'org.zeroBzeroT'
version = "${project.plugin_version}"
repositories {
mavenCentral()
maven {
url = 'https://repo.papermc.io/repository/maven-public/'
content {
includeGroup 'com.velocitypowered'
}
}
}
dependencies {
compileOnly group: 'com.velocitypowered', name: 'velocity-api', version: "${project.velocity_api_version}"
annotationProcessor group: 'com.velocitypowered', name: 'velocity-api', version: "${project.velocity_api_version}"
}
java {
toolchain.languageVersion = JavaLanguageVersion.of(21)
}
tasks.withType(JavaCompile).configureEach {
it.sourceCompatibility = it.targetCompatibility = JavaVersion.toVersion(21)
it.options.release = 21
it.options.encoding = 'UTF-8'
}
// template file for compile-time value injection
def templateSource = file('src/main/templates')
def templateDest = layout.buildDirectory.dir('generated/sources/templates')
def generateTemplates = tasks.register('generateTemplates', Copy) { task ->
def props = ['version': project.version]
task.inputs.properties props
task.from templateSource
task.into templateDest
task.expand props
}
sourceSets.main.java.srcDir(generateTemplates.map { it.outputs })
// put jar artifact in build/dist/
jar.destinationDirectory.set(layout.buildDirectory.dir('dist'))
// test setup
runPaper.disablePluginJarDetection()
tasks {
runVelocity {
runDirectory = layout.projectDirectory.dir('run').dir('proxy')
velocityVersion("${project.velocity_api_version}")
dependsOn('build')
}
}
tasks.register('runServerMain', runServer.getClass() as Class<Task>) {
minecraftVersion("${project.minecraft_version}")
systemProperty('com.mojang.eula.agree', 'true')
systemProperty('Paper.skipServerPropertiesComments', 'true')
runDirectory = layout.projectDirectory.dir('run').dir('main')
dependsOn('build')
}
tasks.register('runServerQueue', runServer.getClass() as Class<Task>) {
minecraftVersion("${project.minecraft_version}")
systemProperty('com.mojang.eula.agree', 'true')
systemProperty('Paper.skipServerPropertiesComments', 'true')
runDirectory = layout.projectDirectory.dir('run').dir('queue')
downloadPlugins {
github("zeroBzeroT", "QueueServerPlugin", "3.0.0-SNAPSHOT", "queueplugin-3.0.0-SNAPSHOT+1.20.6-paper.jar")
url("https://ci.dmulloy2.net/job/ProtocolLib/723/artifact/build/libs/ProtocolLib.jar")
}
dependsOn('build')
}
// eclipse + intellij hooks for generating template files
project.eclipse.synchronizationTasks(generateTemplates)
rootProject.idea.project.settings.taskTriggers.afterSync generateTemplates