99 lines
2.7 KiB
Groovy
99 lines
2.7 KiB
Groovy
plugins {
|
|
id 'java'
|
|
id 'com.gradleup.shadow' version '8.3.9'
|
|
}
|
|
|
|
group = 'dev.itxiaohui.contentguard'
|
|
version = '0.2.0-dev'
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
maven {
|
|
url = uri('https://hub.spigotmc.org/nexus/content/repositories/snapshots/')
|
|
content { includeGroup('org.spigotmc') }
|
|
}
|
|
maven {
|
|
url = uri('https://repo.papermc.io/repository/maven-public/')
|
|
content {
|
|
includeGroup('io.papermc.paper')
|
|
includeModule('net.md-5', 'bungeecord-chat')
|
|
}
|
|
}
|
|
maven {
|
|
url = uri('https://libraries.minecraft.net/')
|
|
content { includeModule('com.mojang', 'brigadier') }
|
|
}
|
|
}
|
|
|
|
java {
|
|
toolchain { languageVersion = JavaLanguageVersion.of(21) }
|
|
}
|
|
|
|
dependencies {
|
|
compileOnly 'org.spigotmc:spigot-api:1.21.1-R0.1-SNAPSHOT'
|
|
implementation 'com.google.code.gson:gson:2.13.2'
|
|
implementation 'org.eclipse.angus:angus-mail:2.0.5'
|
|
implementation 'org.xerial:sqlite-jdbc:3.54.1.0'
|
|
compileOnly 'org.slf4j:slf4j-api:2.0.17'
|
|
testRuntimeOnly 'org.slf4j:slf4j-simple:2.0.17'
|
|
testImplementation 'org.spigotmc:spigot-api:1.21.1-R0.1-SNAPSHOT'
|
|
testImplementation platform('org.junit:junit-bom:5.13.4')
|
|
testImplementation 'org.junit.jupiter:junit-jupiter'
|
|
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
|
|
}
|
|
|
|
tasks.withType(JavaCompile).configureEach {
|
|
options.encoding = 'UTF-8'
|
|
options.release = 21
|
|
}
|
|
|
|
processResources {
|
|
inputs.property('version', project.version)
|
|
filesMatching('plugin.yml') { expand(version: project.version) }
|
|
}
|
|
|
|
test { useJUnitPlatform() }
|
|
|
|
jar { archiveClassifier = 'thin' }
|
|
shadowJar {
|
|
archiveClassifier = ''
|
|
mergeServiceFiles()
|
|
relocate 'com.google.gson', 'dev.itxiaohui.contentguard.internal.gson'
|
|
}
|
|
assemble.dependsOn shadowJar
|
|
|
|
sourceSets {
|
|
compatProbe {
|
|
compileClasspath += sourceSets.main.output + configurations.compileClasspath
|
|
}
|
|
mockTest {
|
|
compileClasspath += sourceSets.main.output
|
|
runtimeClasspath += sourceSets.main.output
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
mockTestImplementation 'org.mockbukkit.mockbukkit:mockbukkit-v1.21:4.0.0'
|
|
mockTestImplementation platform('org.junit:junit-bom:5.13.4')
|
|
mockTestImplementation 'org.junit.jupiter:junit-jupiter'
|
|
mockTestRuntimeOnly 'org.junit.platform:junit-platform-launcher'
|
|
}
|
|
|
|
tasks.register('mockTest', Test) {
|
|
testClassesDirs = sourceSets.mockTest.output.classesDirs
|
|
classpath = sourceSets.mockTest.runtimeClasspath
|
|
useJUnitPlatform()
|
|
}
|
|
|
|
check.dependsOn mockTest
|
|
|
|
tasks.register('compatProbeJar', Jar) {
|
|
archiveClassifier = 'compat-probe'
|
|
from sourceSets.compatProbe.output
|
|
}
|
|
|
|
tasks.withType(AbstractArchiveTask).configureEach {
|
|
preserveFileTimestamps = false
|
|
reproducibleFileOrder = true
|
|
}
|