forked from oraxen/oraxen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
144 lines (128 loc) · 5.96 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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
import java.text.SimpleDateFormat
plugins {
id 'java'
id 'idea'
id 'eclipse'
id 'maven-publish'
id 'com.github.johnrengelman.shadow' version '7.1.2'
}
apply plugin: 'maven-publish'
group 'io.th0rgal'
def pluginVersion = '1.137.1'
ext.jitpackGroup = group + '.oraxen'
ext.jitpackVersion = 'main-' + pluginVersion
version = pluginVersion
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
}
repositories {
mavenCentral()
// Paper
maven { url = uri("https://papermc.io/repo/repository/maven-public/") }
// Spigot
maven { url 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/' }
// Because Spigot depends on Bungeecord ChatComponent-API
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
// JitPack
maven { url 'https://jitpack.io' }
// ProtocolLib
maven { url 'https://repo.dmulloy2.net/nexus/repository/public/' }
// Minecraft repo (commodore)
maven { url 'https://libraries.minecraft.net/' }
// PlaceHolderAPI
maven { url 'https://repo.extendedclip.com/content/repositories/placeholderapi/' }
// EffectLib
maven { url 'https://maven.elmakers.com/repository/' }
// CodeMc (bstats)
maven { url 'https://repo.codemc.org/repository/maven-public' }
// CustomBlockData
maven { url 'https://hub.jeff-media.com/nexus/repository/jeff-media-public/' }
// actions-code, actions-spigot
maven { url 'https://repo.triumphteam.dev/snapshots' }
// MythicMobs
maven { url 'https://mvn.lumine.io/repository/maven-public/' }
// commandAPI snapshots
maven { url = 'https://s01.oss.sonatype.org/content/repositories/snapshots' }
// WorldEdit
maven { url 'https://maven.enginehub.org/repo/' }
}
compileJava {
options.encoding = 'UTF-8'
}
dependencies {
def actionsVersion = '1.0.0-SNAPSHOT'
compileOnly group: 'org.spigotmc', name: 'spigot-api', version: '1.19-R0.1-SNAPSHOT'
compileOnly("io.papermc.paper:paper-api:1.19-R0.1-SNAPSHOT") { exclude group: 'net.kyori' }
compileOnly group: 'com.github.dmulloy2', name: 'ProtocolLib', version: '4.8.0'
compileOnly group: 'com.github.Hazebyte', name: 'CrateReloadedAPI', version: 'd7ae2a14c6'
compileOnly group: 'com.github.jojodmo', name: 'ItemBridge', version: '-SNAPSHOT'
compileOnly group: 'me.clip', name: 'placeholderapi', version: '2.11.1'
compileOnly group: 'com.github.BeYkeRYkt', name: 'LightAPI', version: '5.2.0-Bukkit'
compileOnly group: 'me.gabytm.util', name: 'actions-core', version: actionsVersion
compileOnly group: 'org.springframework', name: 'spring-expression', version: '5.3.16'
compileOnly group: 'io.lumine', name: 'Mythic-Dist', version: '5.0.2-SNAPSHOT'
compileOnly group: 'com.sk89q.worldedit', name: 'worldedit-bukkit', version: '7.2.0'
compileOnly fileTree(dir: 'libs/compile', include: ['*.jar'])
implementation fileTree(dir: 'libs/implement', include: ['*.jar'])
implementation group: 'org.bstats', name: 'bstats-bukkit', version: '2.2.1'
implementation group: 'com.github.oraxen', name: 'protectionlib', version: '1.1.1'
implementation group: 'net.kyori', name: 'adventure-text-minimessage', version: '4.2.0-SNAPSHOT'
implementation group: 'net.kyori', name: 'adventure-platform-bukkit', version: '4.0.0'
implementation group: 'com.github.stefvanschie.inventoryframework', name: 'IF', version: '0.10.0'
implementation group: 'dev.jorel', name: 'commandapi-shade', version: '8.4.0-SNAPSHOT'
implementation "com.jeff_media:CustomBlockData:2.0.0"
implementation "com.jeff_media:MorePersistentDataTypes:2.3.1"
implementation(group: 'me.gabytm.util', name: 'actions-spigot', version: actionsVersion) { exclude group: 'com.google.guava' }
}
processResources {
filesNotMatching(['**/*.png', '**/*.ogg', '**/models/**', '**/textures/**']) {
expand projectVersion: pluginVersion
}
}
shadowJar {
archiveClassifier = null
relocate 'org.bstats', 'io.th0rgal.oraxen.shaded.bstats'
relocate 'net.kyori', 'io.th0rgal.oraxen.shaded.kyori'
relocate 'com.jeff_media.customblockdata', 'io.th0rgal.oraxen.shaded.customblockdata'
relocate 'com.jeff_media.morepersistentdatatypes', 'io.th0rgal.oraxen.shaded.morepersistentdatatypes'
relocate 'com.github.stefvanschie.inventoryframework', 'io.th0rgal.oraxen.shaded.if'
relocate 'dev.jorel.commandapi', 'io.th0rgal.oraxen.shaded.commandapi'
relocate 'me.gabytm.util.actions', 'io.th0rgal.oraxen.shaded.actions'
relocate 'org.intellij.lang.annotations', 'io.th0rgal.oraxen.shaded.intellij.annotations'
relocate 'org.jetbrains.annotations', 'io.th0rgal.oraxen.shaded.jetbrains.annotations'
relocate 'com.udojava.evalex', 'io.th0rgal.oraxen.shaded.evalex'
manifest {
attributes(
'Built-By': System.properties['user.name'],
'Version': pluginVersion,
'Build-Timestamp': new SimpleDateFormat("yyyy-MM-dd' 'HH:mm:ss.SSSZ").format(new Date()),
'Created-By': "Gradle ${gradle.gradleVersion}",
'Build-Jdk': "${System.properties['java.version']} " +
"(${System.properties['java.vendor']} ${System.properties['java.vm.version']})",
'Build-OS': "${System.properties['os.name']} ${System.properties['os.arch']} " +
"${System.properties['os.version']}"
)
}
}
compileJava.dependsOn clean
build.dependsOn shadowJar
publishing {
publications {
shadow(MavenPublication) {
artifact shadowJar
}
}
}
boolean copyJar = project.findProperty('copyJar')
String pluginPath = project.findProperty('oraxen_plugin_path')
if (copyJar && pluginPath != null) {
task copyJarTask(type: Copy) {
from 'build/libs/oraxen-' + pluginVersion + '.jar'
into pluginPath
doLast {
println('Copied to plugin directory ' + pluginPath)
}
}
copyJarTask.dependsOn('shadowJar')
tasks.named('build', DefaultTask).get().dependsOn('copyJarTask')
}