plugins { id 'com.moowork.node' version '1.3.1' } dependencies { compile 'com.github.ben-manes.caffeine:caffeine:2.8.5' compile 'com.google.code.gson:gson:2.8.0' compile 'org.apache.commons:commons-lang3:3.6' compile group: 'commons-io', name: 'commons-io', version: '2.5' compile 'com.flowpowered:flow-math:1.0.3' compile 'org.spongepowered:configurate-hocon:3.7.1' compile 'org.spongepowered:configurate-gson:3.7.1' compile 'com.github.Querz:NBT:4.0' testCompile 'junit:junit:4.12' } processResources { from(sourceSets.main.resources.srcDirs) { include 'de/bluecolored/bluemap/version.json' expand ( version: project.version ) } } node { version = '12.14.1' download = true } license { exclude('**/AABB.java') } task fixPackageLock() { if (!file("./package-lock.json").exists()) { file("./package-lock.json").text = "" } } 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'] } task zipWebroot(type: Zip) { from fileTree('build/generated/webroot/') archiveName 'webroot.zip' destinationDir(file('src/main/resources/de/bluecolored/bluemap/')) outputs.upToDateWhen { false } } // removes tmp build directory, build project with webpack, zip contents for the shaded jar task buildWebroot { dependsOn 'fixPackageLock' dependsOn 'npmInstall' dependsOn 'cleanWebroot' dependsOn 'webpackWebroot' dependsOn 'zipWebroot' } //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') archiveName 'resourceExtensions.zip' 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/')) outputs.upToDateWhen { false } } //always update the zip before build processResources.dependsOn(buildWebroot) processResources.dependsOn(zipResourceExtensions)