-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
116 lines (100 loc) · 2.99 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
108
109
110
111
112
113
114
115
116
plugins {
id 'java'
id 'io.github.goooler.shadow' version '8.1.2'
id 'maven-publish'
id 'com.diffplug.spotless' version '6.25.0'
}
group = 'net.gensokyoreimagined'
version = '1.2.0-SNAPSHOT'
repositories {
mavenCentral()
maven {
name = "papermc-repo"
url = "https://repo.papermc.io/repository/maven-public/"
}
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/groups/public/"
}
maven {
name = "dmulloy2-repo"
url = "https://repo.dmulloy2.net/repository/public/"
}
}
dependencies {
implementation 'com.github.mizosoft.methanol:methanol:1.7.0'
implementation 'com.github.mizosoft.methanol:methanol-brotli:1.7.0'
implementation "org.xerial:sqlite-jdbc:3.45.0.0"
implementation "com.mysql:mysql-connector-j:8.3.0"
implementation "org.apache.commons:commons-dbcp2:2.11.0"
implementation "org.apache.commons:commons-pool2:2.12.0" // can't reload plugin without this
compileOnly "io.papermc.paper:paper-api:1.20.6-R0.1-SNAPSHOT"
}
shadowJar {
project.configurations.runtimeClasspath.canBeResolved = true
configurations = [project.configurations.runtimeClasspath]
archiveFileName.set("%s-%s.jar".formatted(project.name, project.version))
archiveClassifier.set("")
archiveVersion.set("")
}
def targetJavaVersion = 21
java {
def javaVersion = JavaVersion.toVersion(targetJavaVersion)
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
if (JavaVersion.current() < javaVersion) {
toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
}
}
tasks.withType(JavaCompile).configureEach {
if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) {
options.release.set(targetJavaVersion)
}
}
tasks.build.dependsOn(shadowJar)
processResources {
def props = [version: version]
inputs.properties props
filteringCharset 'UTF-8'
filesMatching('plugin.yml') {
expand props
}
}
configurations {
create("conf")
}
def jarFile = file("build/libs/%s-%s.jar".formatted(project.name, project.version))
def jarArtifact = artifacts.add("conf", jarFile) {
type = "jar"
builtBy("jar")
}
publishing {
publications {
maven(MavenPublication) {
artifact jarArtifact
group "plugins"
}
}
repositories {
maven {
name = "gensorepo"
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("USERNAME")
password = project.findProperty("gpr.key") ?: System.getenv("TOKEN")
}
// url to the releases maven repository
url = uri("https://repo.gensokyoreimagined.net/")
}
}
}
spotless {
format 'misc', {
target '*.gradle', '.gitattributes', '.gitignore'
trimTrailingWhitespace()
indentWithSpaces(4)
endWithNewline()
}
java {
licenseHeaderFile 'LICENSE_header.txt'
}
}