This repository was archived by the owner on Apr 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
99 lines (81 loc) · 1.79 KB
/
build.gradle
File metadata and controls
99 lines (81 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
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
import org.apache.tools.ant.filters.ReplaceTokens
plugins {
id 'java'
id 'idea'
id 'maven-publish'
}
group = 'net.skeagle'
version = '1.3.1'
description = 'manhunt'
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
}
Version mc = new Version("18", "2")
String vrnlib = '2.1'
repositories {
mavenCentral()
maven { url = 'https://oss.sonatype.org/content/repositories/snapshots' }
mavenLocal()
}
sourceSets {
main {
java {
srcDir 'src'
}
resources {
srcDir 'resources'
}
}
}
dependencies {
implementation "net.skeagle:VRNLib:${vrnlib}"
compileOnly "org.spigotmc:spigot-api:${mc.getVersion()}-R0.1-SNAPSHOT"
}
task updatePlugins {
doLast {
copy {
from 'build/libs'
into "C:/Users/Skeagle/Documents/VRN Stuff/Dev ${mc.getMain()}/plugins"
rename { "${rootProject.name} ${version}.jar" }
}
}
}
task deploy(dependsOn: ["jar", "updatePlugins"]) {
updatePlugins.mustRunAfter jar
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
processResources {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
from(sourceSets.main.resources.srcDirs) {
filter ReplaceTokens, tokens: [version: version]
}
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
repositories {
mavenLocal()
}
}
class Version {
private String main
private String sub
Version(String main) {
this(main, null)
}
Version(String main, String sub) {
this.main = "1." + main
this.sub = sub
}
String getVersion() {
return main + (sub != null ? ".$sub" : "")
}
String getMain() {
return main
}
}