forked from divios/DailyShop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
165 lines (136 loc) · 5.41 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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
import org.ajoberstar.grgit.Credentials
import org.ajoberstar.grgit.Grgit
import org.apache.tools.ant.taskdefs.condition.Os
plugins {
id 'java'
id "idea"
id "eclipse"
id 'java-library'
id "maven-publish"
id "com.github.johnrengelman.shadow" version "7.1.1"
id 'org.ajoberstar.grgit' version '4.1.0' apply false
}
apply plugin: 'maven-publish'
group = 'io.github.divios'
def pluginVersion = "3.9.1"
version = pluginVersion
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
compileJava.options.encoding = 'UTF-8'
repositories {
mavenCentral()
mavenLocal()
maven { url "https://repo.dmulloy2.net/repository/public/" }
maven { url 'https://hub.spigotmc.org/nexus/content/repositories/public/' }
maven { url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/' }
maven { url = 'https://oss.sonatype.org/content/groups/public/' }
maven { url = 'https://repo.codemc.io/repository/maven-snapshots/' }
maven { url = 'https://repo.codemc.org/repository/maven-public/' }
maven { url = 'https://raw.githubusercontent.com/TeamVK/maven-repository/master/release/' }
maven { url = 'https://jitpack.io' }
maven { url = 'https://repo.extendedclip.com/content/repositories/placeholderapi/' }
maven { url = 'https://mvn.lumine.io/repository/maven-public/' }
maven { url = 'https://libraries.minecraft.net' }
maven { url 'https://hub.spigotmc.org/nexus/content/repositories/public/' }
maven { url 'https://repo.repsy.io/mvn/divios/core_lib' }
}
dependencies {
compileOnly group: "org.spigotmc", name: "spigot-api", version: "1.18-R0.1-SNAPSHOT"
compileOnly group: "org.spigotmc", name: "spigot", version: "1.18-R0.1-SNAPSHOT"
compileOnly 'com.github.MilkBowl:VaultAPI:1.7'
compileOnly 'me.clip:placeholderapi:2.11.1'
compileOnly 'com.mojang:authlib:1.5.21'
compileOnly group: "net.Indyuce", name: "MMOItems", version: "6.6.1"
compileOnly group: "net.Indyuce", name: "MMOLib", version: "1.7.3"
compileOnly group: "io.lumine", name: "MythicLib", version: "1.1.3"
compileOnly 'com.github.LoneDev6:API-ItemsAdder:2.5.5'
compileOnly 'com.willfp:EcoEnchants:8.21.0'
compileOnly "com.github.Rubix327:ItemsLangAPI:1.0.2"
implementation 'org.jetbrains:annotations:23.0.0'
implementation 'org.bstats:bstats-bukkit:3.0.0'
implementation 'io.github.divios:core_lib:6.5.9'
implementation 'io.github.divios:jCommands:1.8.3A'
implementation 'com.github.divios:JText:3.9.1'
compileOnly fileTree(dir: 'libs', include: ['*.jar'])
compileOnly fileTree(dir: 'libsI', include: ['*.jar'])
testImplementation('junit:junit:4.13.2')
testImplementation "org.mockito:mockito-core:1.9.5"
testImplementation 'org.powermock:powermock-module-junit4:2.0.9'
testImplementation 'org.powermock:powermock-api-mockito2:2.0.9'
testImplementation 'com.github.seeseemelk:MockBukkit-v1.16:1.5.2'
}
shadowJar {
relocate('org.jetbrains.annotations', 'io.github.divios.dependencies.annotations')
relocate('org.intellij', 'io.github.divios.dependencies.intellij')
relocate('me.pikamug.localelib', 'io.github.divios.dependencies.localeLib')
relocate('org.bstats', 'io.github.divios.dependencies.bstats')
relocate('de.tr7zw', 'io.github.divios.dependencies.nbt')
relocate('com.cryptomorin.xseries', 'io.github.divios.dependencies.XSeries')
relocate('net.kyori', 'io.github.divios.dependencies.miniText')
minimize()
}
task cloneDependencies {
doLast {
def dest = file("libsI")
if (dest.exists()) return
Grgit.clone {
dir = dest
uri = 'https://github.com/divios/DailyShopDepedencies.git'
credentials = new Credentials(gitToken)
}
}
}
task updateJars {
doLast {
// windows
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
[1.18, 1.17, 1.16].forEach(value -> {
copy {
from "build/libs/DailyShop-${pluginVersion}-all.jar"
into "C:/Users/serbe/OneDrive/Desktop/server_pruebas/server-${value}/plugins"
rename("DailyShop-${pluginVersion}-all.jar"
, "DailyShop-${pluginVersion}.jar")
}
})
} else if (Os.isFamily(Os.FAMILY_MAC)) { // MAC
[1.19, 1.18, 1.17, 1.16, 1.13, 1.12, 1.8].forEach(value -> {
copy {
from "build/libs/DailyShop-${pluginVersion}-all.jar"
into "/Users/sergiobernalparrondo/Desktop/servers/server-${value}/plugins"
rename("DailyShop-${pluginVersion}-all.jar"
, "DailyShop-${pluginVersion}.jar")
}
})
}
}
}
processResources {
filesNotMatching(["*.db"]) {
expand projectVersion: pluginVersion
}
}
task deploy(dependsOn: ["build", "updateJars"]) {
updateJars.mustRunAfter jar
}
compileJava.dependsOn clean, cloneDependencies
build.dependsOn shadowJar
publishing {
publications {
gpr(MavenPublication) {
groupId = group
artifactId = "dailyshop"
version = version
from components.java
}
}
repositories {
maven {
name = "GitHubPackages"
url = "https://maven.pkg.github.com/divios/DailyShop"
credentials {
username "divios"
password gitToken
}
}
}
}