This repository has been archived by the owner on Jan 25, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathbuild.gradle
107 lines (89 loc) · 3.77 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
import org.apache.tools.ant.filters.ReplaceTokens
plugins {
id 'java'
id 'com.github.johnrengelman.shadow' version '8.1.1'
id 'org.cadixdev.licenser' version '0.6.1'
id 'org.ajoberstar.grgit' version '5.2.1'
}
group 'net.william278'
version "$ext.plugin_version${versionMetadata()}"
description "$ext.plugin_description"
defaultTasks 'licenseFormat', 'build'
ext {
set 'version', version.toString()
set 'description', description.toString()
}
repositories {
mavenCentral()
maven { url 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/' }
maven { url 'https://jitpack.io/' }
maven { url 'https://repo.minebench.de/' }
maven { url 'https://repo.codemc.io/repository/maven-snapshots/' }
maven { url 'https://repo.william278.net/releases' }
maven { url 'https://repo.william278.net/snapshots' }
}
dependencies {
compileOnly 'org.spigotmc:spigot-api:1.16.5-R0.1-SNAPSHOT'
compileOnly 'org.jetbrains:annotations:24.0.1'
compileOnly 'net.william278:huskhomes:4.5.3'
implementation 'de.themoep:inventorygui:1.6.1-SNAPSHOT'
implementation 'org.apache.commons:commons-text:1.11.0'
implementation 'de.themoep:minedown-adventure:1.7.2-SNAPSHOT'
implementation 'net.kyori:adventure-text-serializer-legacy:4.14.0'
implementation 'net.kyori:adventure-platform-bukkit:4.3.1'
implementation 'dev.dejvokep:boosted-yaml:1.3.1'
implementation 'net.wesjd:anvilgui:1.9.1-SNAPSHOT'
implementation 'net.william278:annotaml:2.0.7'
implementation 'net.william278:desertwell:2.0.4'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.1'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.1'
}
compileJava.options.encoding = 'UTF-8'
compileJava.options.release.set 16
processResources {
filesNotMatching(['**/*.png', '**/*.svg']) {
filter ReplaceTokens as Class, beginToken: '${', endToken: '}',
tokens: rootProject.ext.properties
}
}
shadowJar {
relocate 'org.apache.commons.io', 'net.william278.huskhomes.gui.libraries.commons.io'
relocate 'org.apache.commons.text', 'net.william278.huskhomes.gui.libraries.commons.text'
relocate 'org.apache.commons.lang3', 'net.william278.huskhomes.gui.libraries.commons.lang3'
relocate 'org.jetbrains', 'net.william278.huskhomes.gui.libraries'
relocate 'org.intellij', 'net.william278.huskhomes.gui.libraries'
relocate 'de.themoep.inventorygui', 'net.william278.huskhomes.gui.libraries.inventorygui'
relocate 'de.themoep.minedown', 'net.william278.huskhomes.gui.libraries.minedown'
relocate 'net.kyori', 'net.william278.huskhomes.gui.libraries'
relocate 'net.wesjd', 'net.william278.huskhomes.gui.libraries'
relocate 'net.william278.annotaml', 'net.william278.huskhomes.gui.libraries.annotaml'
relocate 'net.william278.desertwell', 'net.william278.huskhomes.gui.libraries.desertwell'
relocate 'dev.dejvokep', 'net.william278.huskhomes.gui.libraries.boostedyaml'
destinationDirectory.set(file("$rootDir/target"))
archiveClassifier.set('')
}
jar {
dependsOn('shadowJar')
}
test {
useJUnitPlatform()
}
license {
header = rootProject.file('HEADER')
include '**/*.java'
newLine = true
}
logger.lifecycle("Building HuskHomesGUI ${version} by William278")
@SuppressWarnings('GrMethodMayBeStatic')
def versionMetadata() {
// Get if there is a tag for this commit
def tag = grgit.tag.list().find { it.commit.id == grgit.head().id }
if (tag != null) {
return ''
}
// Otherwise, get the last commit hash and if it's a clean head
if (grgit == null) {
return '-' + System.getenv("GITHUB_RUN_NUMBER") ? 'build.' + System.getenv("GITHUB_RUN_NUMBER") : 'unknown'
}
return '-' + grgit.head().abbreviatedId + (grgit.status().clean ? '' : '-indev')
}