-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
57 lines (46 loc) · 1.79 KB
/
Copy pathbuild.gradle
File metadata and controls
57 lines (46 loc) · 1.79 KB
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
plugins {
id 'java'
}
group 'spigot.zanos.plugin'
version '1.0.0'
def minecraftVersion = '1.20'
repositories {
mavenCentral()
maven {
url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/'
// As of Gradle 5.1, you can limit this to only those
// dependencies you expect from it
content {
includeGroup 'org.spigotmc'
}
/*
As Spigot-API depends on the BungeeCord ChatComponent-API,
we need to add the Sonatype OSS repository, as Gradle,
in comparison to maven, doesn't want to understand the ~/.m2
directory unless added using mavenLocal(). Maven usually just gets
it from there, as most people have run the BuildTools at least once.
This is therefore not needed if you're using the full Spigot/CraftBukkit,
or if you're using the Bukkit API.
*/
maven { url = 'https://oss.sonatype.org/content/repositories/snapshots' }
maven { url = 'https://oss.sonatype.org/content/repositories/central' }
}
}
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.2'
compileOnly 'org.spigotmc:spigot-api:1.20.2-R0.1-SNAPSHOT' // The Spigot API with no shadowing. Requires the OSS repo.
}
test {
useJUnitPlatform()
}
jar {
// Include the Minecraft version in the JAR file name
archiveFileName = "${rootProject.name}-${minecraftVersion}-v${version}.jar"
from sourceSets.main.output
}
task copyJar(type: Copy) {
from jar // here it automatically reads jar file produced from jar task
into 'D:/Documents/coding/Spigot/MySpigotServer/plugins' // replace with your plugin folder
}
build.dependsOn copyJar