Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
NeverGame authored Sep 10, 2024
1 parent 3c60790 commit 4c9dec8
Show file tree
Hide file tree
Showing 5 changed files with 299 additions and 308 deletions.
143 changes: 32 additions & 111 deletions build.gradle
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
}


Loading

0 comments on commit 4c9dec8

Please sign in to comment.