-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle
124 lines (110 loc) · 4.13 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
plugins {
id("com.gradleup.shadow") version "8.3.3"
id ("base")
id("java-library")
id("maven-publish")
id("io.papermc.paperweight.userdev") version "1.7.3"
}
repositories {
maven { url 'https://hub.spigotmc.org/nexus/content/repositories/snapshots' } // Spigot
maven { url 'https://repo.dmulloy2.net/nexus/repository/public/' } // ProtocolLib
maven { url 'https://mvnrepository.com/artifact/org.json/json' } // DataWatcher
maven { url 'https://jitpack.io' }
maven { url 'https://repo.skriptlang.org/releases' } // Skript
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
maven { url 'https://oss.sonatype.org/content/repositories/central' }
maven {
name = "jeffMediaPublic"
url = uri("https://repo.jeff-media.com/public")
}
mavenCentral()
maven { url 'https://libraries.minecraft.net' } // must be last to avoid conflicts
}
base {
archivesName = "Skript-Packet"
}
group = 'fr.anarchick.skriptpacket'
version = '2.2.2'
def mcVersion = '1.21'
def mcSubVersion = '.1'
def skriptVersion = '2.9.2'
def protocolLibVersion = '5.3.0'
def skriptReflectVersion = '2.4-dev1'
dependencies {
compileOnly (group: 'com.github.SkriptLang', name: 'Skript', version: skriptVersion) {
exclude group: 'com.sk89q.worldguard', module: 'worldguard-legacy'
exclude group: 'net.milkbowl.vault', module: 'Vault'
}
compileOnly group: 'net.md-5', name: 'bungeecord-api', version: mcVersion + '-R0.1-SNAPSHOT'
compileOnly group: 'com.github.SkriptLang', name: 'skript-reflect', version: skriptReflectVersion
compileOnly group: 'org.eclipse.jdt', name: 'org.eclipse.jdt.annotation', version: '2.2.600'
compileOnly group: 'com.mojang', name: 'datafixerupper', version: '1.0.20' // ExprPair
compileOnly group: "com.comphenix.protocol", name: "ProtocolLib", version: protocolLibVersion
compileOnly group: 'org.json', name: 'json', version: '20231013'
implementation("com.jeff_media:SpigotUpdateChecker:3.0.3")
paperweight.paperDevBundle(mcVersion + mcSubVersion +'-R0.1-SNAPSHOT')
}
java {
toolchain.languageVersion = JavaLanguageVersion.of(21)
}
tasks {
compileJava {
// 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 = 21
}
}
tasks.named('shadowJar', com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
relocate 'com.jeff_media.updatechecker', 'fr.anarchick.skriptpacket.updatechecker'
}
sourceSets {
main {
java {
exclude 'fr/anarchick/skriptpacket/elements/deprecated/**'
}
}
}
processResources {
def props = [version: version]
inputs.properties props
filteringCharset 'UTF-8'
filesMatching('plugin.yml') {
expand props
}
// Ensure filtering is applied correctly
filter(org.apache.tools.ant.filters.ReplaceTokens, tokens: props)
}
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
}
tasks.register('export') {
group = "other"
description = "build gradle into external folder"
def userHome = System.getenv('USERPROFILE').replace('\\', '/')
def fromFile = 'build/libs/' + base.archivesName.get() + '-' + version + '-dev-all.jar'
// List of version folder to export the jar
def versions = ['1.17', '1.18', '1.19', '1.20.4', '1.21.1']
doLast {
versions.each { ver ->
def destDir = file(userHome + '/Documents/minecraft/SkriptPacket/' + ver + '/plugins')
if (destDir.exists()) {
copy {
from fromFile
into destDir
rename { String fileName ->
fileName.replace('-dev-all.jar', '.jar')
}
}
} else {
println "The folder '" + destDir + "' does not exist"
}
}
}
}
tasks.build.finalizedBy(tasks.export)
tasks.shadowJar.finalizedBy(tasks.export)