2020-01-14 02:22:15 +01:00
|
|
|
plugins {
|
|
|
|
id 'com.moowork.node' version '1.3.1'
|
|
|
|
}
|
|
|
|
|
2019-11-02 17:23:48 +01:00
|
|
|
dependencies {
|
2020-08-23 12:36:29 +02:00
|
|
|
compile 'com.github.ben-manes.caffeine:caffeine:2.8.5'
|
2020-01-14 02:22:15 +01:00
|
|
|
compile 'com.google.code.gson:gson:2.8.0'
|
2020-07-29 16:26:58 +02:00
|
|
|
compile 'org.apache.commons:commons-lang3:3.6'
|
2020-04-06 17:55:35 +02:00
|
|
|
compile group: 'commons-io', name: 'commons-io', version: '2.5'
|
2020-01-14 02:22:15 +01:00
|
|
|
compile 'com.flowpowered:flow-math:1.0.3'
|
2020-08-30 01:25:10 +02:00
|
|
|
compile 'org.spongepowered:configurate-hocon:3.7.1'
|
|
|
|
compile 'org.spongepowered:configurate-gson:3.7.1'
|
2020-01-14 02:22:15 +01:00
|
|
|
compile 'com.github.Querz:NBT:4.0'
|
|
|
|
|
|
|
|
testCompile 'junit:junit:4.12'
|
|
|
|
}
|
|
|
|
|
2020-03-30 01:45:32 +02:00
|
|
|
processResources {
|
|
|
|
from(sourceSets.main.resources.srcDirs) {
|
2020-08-25 01:59:03 +02:00
|
|
|
include 'de/bluecolored/bluemap/version.json'
|
2020-03-30 01:45:32 +02:00
|
|
|
|
|
|
|
expand (
|
|
|
|
version: project.version
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-01-14 02:22:15 +01:00
|
|
|
node {
|
|
|
|
version = '12.14.1'
|
|
|
|
download = true
|
|
|
|
}
|
|
|
|
|
2020-08-03 17:51:07 +02:00
|
|
|
license {
|
|
|
|
exclude('**/AABB.java')
|
|
|
|
}
|
|
|
|
|
2020-01-15 20:57:51 +01:00
|
|
|
task fixPackageLock() {
|
|
|
|
if (!file("./package-lock.json").exists()) {
|
|
|
|
file("./package-lock.json").text = ""
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-01-14 02:22:15 +01:00
|
|
|
task cleanWebroot(type: Delete) {
|
|
|
|
delete 'build/generated/webroot/'
|
|
|
|
}
|
|
|
|
|
|
|
|
// Run WebPack build to generate resources into the generated resources
|
|
|
|
task webpackWebroot(type: NpmTask) {
|
|
|
|
args = ['run', 'build']
|
2019-11-02 17:23:48 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
task zipWebroot(type: Zip) {
|
2020-01-14 02:22:15 +01:00
|
|
|
from fileTree('build/generated/webroot/')
|
2019-11-02 17:23:48 +01:00
|
|
|
archiveName 'webroot.zip'
|
2020-08-25 01:39:21 +02:00
|
|
|
destinationDir(file('src/main/resources/de/bluecolored/bluemap/'))
|
2019-11-02 17:23:48 +01:00
|
|
|
outputs.upToDateWhen { false }
|
|
|
|
}
|
|
|
|
|
2020-01-14 02:22:15 +01:00
|
|
|
// removes tmp build directory, build project with webpack, zip contents for the shaded jar
|
|
|
|
task buildWebroot {
|
2020-01-15 20:57:51 +01:00
|
|
|
dependsOn 'fixPackageLock'
|
2020-01-14 23:38:03 +01:00
|
|
|
dependsOn 'npmInstall'
|
2020-01-14 02:22:15 +01:00
|
|
|
dependsOn 'cleanWebroot'
|
|
|
|
dependsOn 'webpackWebroot'
|
|
|
|
dependsOn 'zipWebroot'
|
|
|
|
}
|
|
|
|
|
2020-08-25 11:59:17 +02:00
|
|
|
//resource Extensions
|
|
|
|
task zipResourceExtensions {
|
|
|
|
dependsOn 'zipResourceExtensions1_12'
|
|
|
|
dependsOn 'zipResourceExtensions1_13'
|
|
|
|
dependsOn 'zipResourceExtensions1_15'
|
|
|
|
dependsOn 'zipResourceExtensions1_16'
|
|
|
|
}
|
|
|
|
|
|
|
|
task zipResourceExtensions1_12(type: Zip) {
|
|
|
|
from fileTree('src/main/resourceExtensions/mc1_12')
|
2019-12-29 16:23:43 +01:00
|
|
|
archiveName 'resourceExtensions.zip'
|
2020-08-25 11:59:17 +02:00
|
|
|
destinationDir(file('src/main/resources/de/bluecolored/bluemap/mc1_12/'))
|
|
|
|
outputs.upToDateWhen { false }
|
|
|
|
}
|
|
|
|
|
|
|
|
task zipResourceExtensions1_13(type: Zip) {
|
|
|
|
from fileTree('src/main/resourceExtensions/mc1_13')
|
|
|
|
archiveName 'resourceExtensions.zip'
|
|
|
|
destinationDir(file('src/main/resources/de/bluecolored/bluemap/mc1_13/'))
|
|
|
|
outputs.upToDateWhen { false }
|
|
|
|
}
|
|
|
|
|
|
|
|
task zipResourceExtensions1_15(type: Zip) {
|
|
|
|
from fileTree('src/main/resourceExtensions/mc1_15')
|
|
|
|
archiveName 'resourceExtensions.zip'
|
|
|
|
destinationDir(file('src/main/resources/de/bluecolored/bluemap/mc1_15/'))
|
|
|
|
outputs.upToDateWhen { false }
|
|
|
|
}
|
|
|
|
|
|
|
|
task zipResourceExtensions1_16(type: Zip) {
|
|
|
|
from fileTree('src/main/resourceExtensions/mc1_16')
|
|
|
|
archiveName 'resourceExtensions.zip'
|
|
|
|
destinationDir(file('src/main/resources/de/bluecolored/bluemap/mc1_16/'))
|
2019-12-29 16:23:43 +01:00
|
|
|
outputs.upToDateWhen { false }
|
|
|
|
}
|
|
|
|
|
2019-11-02 17:23:48 +01:00
|
|
|
//always update the zip before build
|
2020-01-14 02:22:15 +01:00
|
|
|
processResources.dependsOn(buildWebroot)
|
|
|
|
processResources.dependsOn(zipResourceExtensions)
|