-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
102 lines (82 loc) · 2.66 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
import org.apache.tools.ant.filters.ReplaceTokens
plugins {
id 'java'
id 'maven-publish'
}
sourceCompatibility = '11'
targetCompatibility = '11'
java {
withJavadocJar()
withSourcesJar()
}
publishing {
repositories {
maven {
url = "https://repo.codemc.io/repository/maven-releases/"
def mavenUsername = System.getenv("GRADLE_PROJECT_MAVEN_USERNAME") ?: null
def mavenPassword = System.getenv("GRADLE_PROJECT_MAVEN_PASSWORD") ?: null
if (mavenUsername != null && mavenPassword != null) {
credentials {
username = mavenUsername
password = mavenPassword
}
}
}
}
publications {
mavenJava(MavenPublication) {
groupId = project.group
artifactId = "CustomItems"
version = project.version
from components.java
}
}
}
repositories {
mavenCentral()
maven {
name = 'spigotmc-repo'
url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/'
}
maven {
name = 'sonatype'
url = 'https://oss.sonatype.org/content/groups/public/'
}
maven {
name = 'CodeMC'
url = 'https://repo.codemc.org/repository/maven-public/'
}
}
dependencies {
compileOnly 'org.spigotmc:spigot-api:1.16.5-R0.1-SNAPSHOT'
compileOnly 'org.jetbrains:annotations:16.0.2'
compileOnly 'de.tr7zw:item-nbt-api-plugin:2.7.1'
compileOnly 'org.projectlombok:lombok:1.18.16'
annotationProcessor 'org.projectlombok:lombok:1.18.16'
testCompileOnly 'org.projectlombok:lombok:1.18.16'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.16'
testImplementation 'com.github.seeseemelk:MockBukkit-v1.16:1.0.0'
testCompileOnly 'org.jetbrains:annotations:16.0.2'
testImplementation(platform('org.junit:junit-bom:5.7.2'))
testImplementation('org.junit.jupiter:junit-jupiter')
}
jar {
from {
configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
}
}
processResources {
from(sourceSets.main.resources.srcDirs) {
filter ReplaceTokens, tokens: [version: version]
}
}
test {
useJUnitPlatform()
}
tasks.register("moveToServerFolder") {
doLast {
pathToServer = project.hasProperty('pathToServer') ? project.property('pathToServer') : 'nosuchgroup'
print "Plugin location: " + pathToServer + "/plugins/" + project.name + "-" + version + ".jar"
ant.move(file: buildDir.getAbsolutePath() + "/libs/" + project.name + "-" + version + ".jar", tofile: pathToServer + "/plugins/" + project.name + "-" + version + ".jar")
}
}