-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
92 lines (80 loc) · 2.87 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
plugins {
id 'java-library'
id 'maven-publish'
id("io.papermc.paperweight.userdev") version "1.7.1"
id("xyz.jpenilla.run-paper") version "2.3.0"
}
// Suppiled by Jenkins
ext.majorVersion = 2
ext.minorVersion = 14
ext.minecraftVersion = "1.20.4"
ext.buildNumber = System.env.BUILD_NUMBER == null ? "dev" : "build" + "$System.env.BUILD_NUMBER"
ext.mavenDirectory = System.env.MAVEN_DIR == null ? "$projectDir/repo" : "$System.env.MAVEN_DIR"
ext.jdDirectory = System.env.JAVADOCS_DIR == null ? null : "$System.env.JAVADOCS_DIR"
// differet version convension from Nyaa plugins
group = "de.greensurvivors"
archivesBaseName = "Padlock"
version = "$majorVersion.$minorVersion.$buildNumber".toString()
/*
// comment this in, if you want to test with a specific Mc version instead of the one defined in minecraftVersion
runServer {
minecraftVersion("1.20.4")
}
*/
java {
// Configure the java toolchain. This allows gradle to auto-provision JDK 17 on systems that only have JDK 8 installed for example.
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
}
// extra compile warnings
compileJava {
options.compilerArgs += ["-Xlint:deprecation"]
options.encoding = 'UTF-8'
// Set the release flag. This configures what version bytecode the compiler will emit, as well as what JDK APIs are usable.
// See https://openjdk.java.net/jeps/247 for more information.
options.release.set(17)
}
repositories {
mavenCentral()
maven { name 'Paper'; url 'https://repo.papermc.io/repository/maven-public/' }
maven { name 'sk89q-repo'; url "https://maven.enginehub.org/repo/" } //worldguard
maven { url 'https://jitpack.io' } // vault
}
dependencies {
implementation 'org.apache.commons:commons-collections4:4.4'
implementation 'org.jetbrains:annotations:24.1.0'
implementation("com.github.ben-manes.caffeine:caffeine:3.1.8") // caches
implementation("de.mkammerer:argon2-jvm:2.11") // native password hashing with argon2
paperweight.paperDevBundle("$minecraftVersion-R0.1-SNAPSHOT")
compileOnly ('com.sk89q.worldguard:worldguard-bukkit:7.1.0-SNAPSHOT') { transitive = false }
compileOnly('com.github.MilkBowl:VaultAPI:1.7') { transitive = false }
}
processResources {
expand version: project.version,
mcVersion: "$minecraftVersion"
}
// maven publications
tasks.register('sourcesJar', Jar) {
archiveClassifier.set("sources")
from sourceSets.main.java.srcDirs
}
tasks {
// Configure reobfJar to run when invoking the build task
assemble {
dependsOn(reobfJar)
}
}
publishing {
publications {
mavenJava(MavenPublication) {
artifact sourcesJar
artifactId "padlock"
version "$majorVersion.$minorVersion-SNAPSHOT"
from components.java
}
}
repositories {
maven {
url "$mavenDirectory"
}
}
}