mirror of
https://github.com/funkemunky/AntiVPN.git
synced 2026-05-31 01:21:55 +00:00
135 lines
4.0 KiB
Groovy
135 lines
4.0 KiB
Groovy
plugins {
|
|
id 'java'
|
|
id 'com.gradleup.shadow' version '9.4.1'
|
|
id 'com.diffplug.spotless' version '8.4.0' apply false
|
|
id 'xyz.jpenilla.run-velocity' version '3.0.2' apply false
|
|
}
|
|
|
|
def aggregateTestProjects = [
|
|
project(':Common:Source'),
|
|
project(':Bukkit:Plugin'),
|
|
project(':Bungee:BungeePlugin'),
|
|
project(':Sponge:SpongePlugin'),
|
|
project(':Velocity:VelocityPlugin')
|
|
]
|
|
|
|
allprojects {
|
|
group = 'dev.brighten.antivpn'
|
|
version = '1.10.1.2'
|
|
|
|
repositories {
|
|
maven { url 'https://repo.papermc.io/repository/maven-public/' }
|
|
maven { url 'https://nexus.funkemunky.cc/repository/papermc-public/' }
|
|
maven { url 'https://nexus.funkemunky.cc/repository/maven-public/' }
|
|
maven { url 'https://nexus.funkemunky.cc/repository/maven-central/' }
|
|
maven { url 'https://nexus.funkemunky.cc/content/repositories/releases/' }
|
|
maven { url 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/' }
|
|
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
|
|
maven { url 'https://repo.spongepowered.org/repository/maven-public/' }
|
|
maven { url 'https://jitpack.io' }
|
|
mavenCentral()
|
|
}
|
|
|
|
apply plugin: 'java'
|
|
apply plugin: 'com.diffplug.spotless'
|
|
|
|
java {
|
|
toolchain {
|
|
languageVersion = JavaLanguageVersion.of(21)
|
|
}
|
|
}
|
|
|
|
tasks.withType(JavaCompile).configureEach {
|
|
options.encoding = 'UTF-8'
|
|
options.compilerArgs << '-XDignore.symbol.file'
|
|
}
|
|
|
|
spotless {
|
|
java {
|
|
target 'src/**/*.java'
|
|
removeUnusedImports()
|
|
googleJavaFormat()
|
|
cleanthat()
|
|
|
|
trimTrailingWhitespace()
|
|
endWithNewline()
|
|
}
|
|
}
|
|
|
|
tasks.named('check') {
|
|
dependsOn tasks.named('spotlessCheck')
|
|
}
|
|
|
|
dependencies {
|
|
compileOnly 'org.projectlombok:lombok:1.18.44'
|
|
annotationProcessor 'org.projectlombok:lombok:1.18.44'
|
|
testImplementation 'org.junit.jupiter:junit-jupiter:5.11.4'
|
|
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
|
|
}
|
|
|
|
test {
|
|
useJUnitPlatform()
|
|
systemProperty 'mockito.mockmaker', 'subclass'
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
testImplementation 'org.junit.platform:junit-platform-suite:1.11.4'
|
|
}
|
|
|
|
sourceSets {
|
|
test {
|
|
compileClasspath += files(aggregateTestProjects.collect { it.sourceSets.test.output + it.sourceSets.test.compileClasspath })
|
|
runtimeClasspath += files(aggregateTestProjects.collect { it.sourceSets.test.output + it.sourceSets.test.runtimeClasspath })
|
|
}
|
|
}
|
|
|
|
tasks.named('test') {
|
|
dependsOn(aggregateTestProjects.collect { it.tasks.named('testClasses') })
|
|
jvmArgs("-XX:+EnableDynamicAgentLoading")
|
|
}
|
|
|
|
evaluationDependsOn(':Common:Source')
|
|
evaluationDependsOn(':Bukkit:Loader')
|
|
evaluationDependsOn(':Velocity:VelocityLoader')
|
|
evaluationDependsOn(':Bungee:BungeeLoader')
|
|
|
|
dependencies {
|
|
implementation project(':Bukkit:Loader')
|
|
implementation project(':Bungee:BungeeLoader')
|
|
}
|
|
|
|
shadowJar {
|
|
archiveFileName.set("AntiVPN-${project.version}-universal.jar")
|
|
|
|
// Include the shaded Common:Source jar as a single resource
|
|
from(project(':Common:Source').tasks.shadowJar) {
|
|
rename { 'antivpn-source.jarinjar' }
|
|
}
|
|
|
|
from({
|
|
zipTree(project(':Velocity:VelocityLoader').tasks.shadowJar.archiveFile.get().asFile)
|
|
})
|
|
}
|
|
|
|
tasks.named('shadowJar') {
|
|
dependsOn(':Common:Source:shadowJar')
|
|
dependsOn(':Bukkit:Loader:shadowJar')
|
|
dependsOn(':Velocity:VelocityLoader:shadowJar')
|
|
dependsOn(':Bungee:BungeeLoader:shadowJar')
|
|
}
|
|
|
|
tasks.build.dependsOn shadowJar
|
|
|
|
tasks.register('runVelocity') {
|
|
group = 'run'
|
|
description = 'Starts a local Velocity proxy with the AntiVPN Velocity loader installed.'
|
|
dependsOn(':Velocity:VelocityLoader:runVelocity')
|
|
}
|
|
|
|
tasks.register('debugVelocity') {
|
|
group = 'run'
|
|
description = 'Starts a local Velocity proxy suspended for debugger attach on port 5005.'
|
|
dependsOn(':Velocity:VelocityLoader:debugVelocity')
|
|
}
|