forked from ProtocolSupport/ProtocolSupportBungee
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
299 additions
and
308 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,111 +1,32 @@ | ||
buildscript { | ||
repositories { | ||
mavenCentral() | ||
maven { | ||
url 'https://jitpack.io' | ||
} | ||
} | ||
dependencies { | ||
classpath group: 'com.github.HurricaneGamesOrg', name: 'ManualGradleDependencySupplier', version: '1e9e953fb4' | ||
} | ||
} | ||
|
||
plugins { | ||
id 'com.github.johnrengelman.shadow' version '5.0.0' | ||
id 'java' | ||
} | ||
|
||
apply plugin: 'org.hurricanegames.ManualGradleDependencySupplier' | ||
|
||
|
||
defaultTasks 'build' | ||
|
||
|
||
group 'protocolsupport' | ||
version '1.16.3-1' | ||
|
||
|
||
import java.nio.file.Path | ||
import java.nio.file.Paths | ||
import java.nio.file.Files | ||
|
||
import org.hurricanegames.manualgradledependencysupplier.DependencySupplier | ||
import org.hurricanegames.manualgradledependencysupplier.DownloadDependencySupplier | ||
import org.hurricanegames.manualgradledependencysupplier.ManualGradleDependencySupplier | ||
|
||
|
||
Path projectDirectoryPath = projectDir.toPath().toAbsolutePath() | ||
|
||
|
||
sourceCompatibility = JavaVersion.VERSION_1_8 | ||
|
||
sourceSets { | ||
main { | ||
java { | ||
srcDirs = ['src'] | ||
} | ||
resources { | ||
srcDirs = ['resources'] | ||
} | ||
} | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.8.1' | ||
compile group: 'it.unimi.dsi', name: 'fastutil', version: '8.2.2' | ||
|
||
compileOnly ManualGradleDependencySupplier.supplyDependecies( | ||
projectDirectoryPath.resolve('libraries_runtime'), | ||
[ | ||
new DownloadDependencySupplier( | ||
'bungeecord-1.16.4-1.jar', | ||
new URL('https://papermc.io/api/v1/travertine/1.16/163/download') | ||
) | ||
], | ||
true | ||
) | ||
} | ||
|
||
compileJava { | ||
doFirst { | ||
classpath -= configurations.compileOnly | ||
classpath += configurations.compileOnly | ||
} | ||
|
||
options.encoding = 'UTF-8' | ||
options.incremental = false | ||
} | ||
|
||
|
||
shadowJar { | ||
from sourceSets.main.java.srcDirs | ||
from 'LICENSE' | ||
|
||
archiveName = jar.archiveName | ||
|
||
exclude 'META-INF/**' | ||
relocate 'org.apache', 'protocolsupport.libs.org.apache' | ||
relocate 'it.unimi.dsi.fastutil', 'protocolsupport.libs.it.unimi.dsi.fastutil' | ||
|
||
minimize() | ||
} | ||
|
||
|
||
task copyFinalJarToTarget(type: DefaultTask) {doLast{ | ||
Path targetJarDirectory = projectDirectoryPath.resolve("target") | ||
Files.createDirectories(targetJarDirectory) | ||
Files.copy( | ||
shadowJar.archivePath.toPath().toAbsolutePath(), | ||
targetJarDirectory.resolve(shadowJar.baseName + '.jar'), | ||
java.nio.file.StandardCopyOption.REPLACE_EXISTING | ||
) | ||
}} | ||
|
||
|
||
jar.enabled = false | ||
jar.finalizedBy(shadowJar) | ||
shadowJar.finalizedBy(copyFinalJarToTarget) | ||
plugins { | ||
id 'java' | ||
} | ||
|
||
group = 'de.test' | ||
version = '1.0-SNAPSHOT' | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
implementation('org.apache.commons:commons-lang3:3.12.0') | ||
implementation('it.unimi.dsi:fastutil:8.5.8') | ||
|
||
compileOnly(files("./lib/waterfall.jar")) | ||
} | ||
|
||
compileJava.options.encoding = 'UTF-8' | ||
|
||
tasks.withType(JavaCompile) { | ||
options.encoding = 'UTF-8' | ||
} | ||
|
||
task customFatJar(type: Jar) { | ||
archiveBaseName = 'plugin' | ||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE | ||
from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } } | ||
with jar | ||
} | ||
|
||
|
Oops, something went wrong.