Advanced-Portals/core/build.gradle

72 lines
2.4 KiB
Groovy

plugins {
id 'com.github.johnrengelman.shadow' version '7.1.2'
id 'maven-publish'
id 'idea'
id 'eclipse'
}
configurations {
}
repositories {
maven { url "https://repo.maven.apache.org/maven2" }
maven { url "https://hub.spigotmc.org/nexus/content/repositories/snapshots/" }
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
// includeLibs just says to include the library in the final jar
dependencies {
implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.9'
implementation group: 'com.google.inject', name: 'guice', version: '5.0.1'
implementation group: 'org.yaml', name: 'snakeyaml', version: '2.2'
implementation group: 'com.google.guava', name: 'guava', version: '33.2.0-jre'
implementation group: 'io.netty', name: 'netty-buffer', version: '4.1.109.Final'
implementation group: 'io.netty', name: 'netty-codec', version: '4.1.109.Final'
}
shadowJar {
relocate 'com.google.code.gson', 'com.sekwah.advancedportals.shadowed.gson'
relocate 'com.google.inject', 'com.sekwah.advancedportals.shadowed.inject'
relocate 'com.google.errorprone', 'com.sekwah.advancedportals.shadowed.errorprone'
relocate 'org.yaml.snakeyaml', 'com.sekwah.advancedportals.shadowed.snakeyaml'
relocate 'com.google.common', 'com.sekwah.advancedportals.shadowed.guava'
relocate 'io.netty', 'com.sekwah.advancedportals.shadowed.netty'
relocate 'javax.annotation', 'com.sekwah.advancedportals.shadowed.javax.annotation'
relocate 'javax.inject', 'com.sekwah.advancedportals.shadowed.javax.inject'
relocate 'org.aopalliance', 'com.sekwah.advancedportals.shadowed.aopalliance'
relocate 'org.checkerframework', 'com.sekwah.advancedportals.shadowed.checkerframework'
minimize()
archiveClassifier.set('')
}
tasks.named('jar') {
enabled = false
}
tasks.named('build') {
dependsOn tasks.named('shadowJar')
}
artifacts {
runtimeOnly shadowJar
}
def templateSource = file('src/main/templates')
def templateDest = layout.buildDirectory.dir('generated/sources/templates')
def generateTemplates = tasks.register('generateTemplates', Copy) { task ->
def props = [
'version': project.version
]
task.inputs.properties props
task.from templateSource
task.into templateDest
task.expand props
}
sourceSets.main.java.srcDir(generateTemplates.map { it.outputs })