-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
78 lines (68 loc) · 2.64 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
plugins {
id("java-library")
id("net.minecrell.plugin-yml.paper") version "0.6.0"
id("com.gradleup.shadow") version "8.3.5"
}
group = "cloud.grabsky"
version = "1.21.4-${System.getenv("GITHUB_RUN_NUMBER") ?: "DEV"}"
repositories {
mavenLocal()
mavenCentral()
// Repository for the Paper API.
maven { url = "https://repo.papermc.io/repository/maven-public/" }
// Repository for the PlaceholderAPI, API.
maven { url = "https://repo.extendedclip.com/content/repositories/placeholderapi/" }
// Repository for the FancyAnalytics API.
maven { url = "https://repo.fancyplugins.de/releases" }
// Repository containing the 'bedrock' dependency.
maven { url = "https://maven.pkg.github.com/grabsky/bedrock"; fillCredentials(it) }
// Repository containing the 'configuration' dependency.
maven { url = "https://maven.pkg.github.com/grabsky/configuration"; fillCredentials(it) }
// Repository containing the 'commands' dependency.
maven { url = "https://maven.pkg.github.com/grabsky/commands"; fillCredentials(it) }
}
dependencies {
// Lombok
compileOnly("org.projectlombok:lombok:1.18.36")
annotationProcessor("org.projectlombok:lombok:1.18.36")
// Paper API
compileOnly("io.papermc.paper:paper-api:1.20.1-R0.1-SNAPSHOT")
// Plugin libraries, must be shaded.
implementation("cloud.grabsky:bedrock:1.20.1-47")
implementation("cloud.grabsky:commands:1.20.1-34")
implementation("cloud.grabsky:configuration-paper:1.20.1-42")
// FancyAnalytics
implementation("de.oliver.FancyAnalytics:api:0.1.6")
// Plugin dependencies, should be present in the classpath as required per 'paper-plugin.yml' file.
compileOnly("me.clip:placeholderapi:2.11.6")
}
tasks {
shadowJar { archiveFileName = "${rootProject.name}-${project.version}.jar" }
compileJava {
options.fork = true
// Setting compatibility to Java 21.
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
}
paper {
main = "cloud.grabsky.dialogs.Dialogs"
apiVersion = "1.20"
serverDependencies {
"PlaceholderAPI" { load = "BEFORE"; required = false }
}
}
/* FOR GITHUB ACTIONS */
tasks.register("release") {
print("${version.toString().split('-')[0]} #${System.getenv("GITHUB_RUN_NUMBER")}")
}
tasks.register("tag") {
print(version)
}
/* UTILITY METHODS */
private final def fillCredentials(final MavenArtifactRepository repository) {
repository.credentials {
username = findProperty("gpr.actor") ?: System.getenv("GITHUB_ACTOR")
password = findProperty("gpr.token") ?: System.getenv("GITHUB_TOKEN")
}
}