-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
83 lines (72 loc) · 2.6 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
apply plugin: "java"
apply plugin: "eclipse"
apply plugin: "maven-publish"
version = "${plugin_version}"
group = "${maven_group}"
archivesBaseName = "${archives_base_name}"
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
println "Java: ${System.getProperty "java.version"}, JVM: ${System.getProperty "java.vm.version"} (${System.getProperty "java.vendor"}), Arch: ${System.getProperty "os.arch"}"
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
options.release = 17
}
java {
withSourcesJar()
}
repositories {
maven {
url "https://hub.spigotmc.org/nexus/content/repositories/snapshots/"
}
maven {
url "https://repo.papermc.io/repository/maven-public/"
}
maven {
url "https://oss.sonatype.org/content/repositories/snapshots/"
}
maven {
url "https://repo.skriptlang.org/releases/"
}
}
dependencies {
compileOnly "org.spigotmc:spigot-api:${mc_version}-${spigot_version}-SNAPSHOT"
compileOnly "com.github.SkriptLang:Skript:${skript_version}"
compileOnly fileTree(dir:'libs',includes:['*.jar'])
}
def resourceTargets = ["plugin.yml"]
def intoTargets = ["$rootDir/out/production/resources/", "$rootDir/out/production/${project.name}.main/", "$rootDir/${project.name}/bin/main/"]
def replaceProperties = [mc_version: mc_version,
plugin_version: plugin_version, plugin_name: plugin_name, plugin_description: plugin_description, plugin_license: plugin_license, plugin_homepage: plugin_homepage, plugin_source: plugin_source, plugin_issues: plugin_issues
]
processResources {
inputs.properties replaceProperties
replaceProperties.put "project", project
filesMatching(resourceTargets) {
expand replaceProperties
}
intoTargets.each { target ->
if (file(target).exists()) {
copy {
from(sourceSets.main.resources) {
include resourceTargets
expand replaceProperties
}
into target
}
}
}
}
jar {
manifest {
attributes([
"Specification-Title" : "soraxenitems",
"Specification-Vendor" : "gisellevonbingen",
"Specification-Version" : "1",
"Implementation-Title" : project.name,
"Implementation-Version" : project.jar.archiveVersion,
"Implementation-Vendor" : "gisellevonbingen",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
}