Prepacked flag, unit and building images in altas files, so they'll be readable from the jar files

This commit is contained in:
Yair Morgenstern
2020-11-22 21:47:46 +02:00
parent 038ac1e48b
commit 6d7d698dad
236 changed files with 1628 additions and 8 deletions

View File

@ -55,12 +55,12 @@ tasks.register<Jar>("dist") { // Compiles the jar file
from(files(sourceSets.main.get().output.resourcesDir))
from(files(sourceSets.main.get().output.classesDirs))
// see Laurent1967's comment on https://github.com/libgdx/libgdx/issues/5491
from({configurations.compileClasspath.get().resolve().map { if(it.isDirectory) it else zipTree(it) }})
from({ configurations.compileClasspath.get().resolve().map { if (it.isDirectory) it else zipTree(it) } })
from(files(assetsDir))
// This is for the .dll and .so files to make the Discord RPC work on all desktops
from(files(discordDir))
archiveFileName.set("${BuildConfig.appName}.jar")
manifest {
attributes(mapOf("Main-Class" to mainClassName, "Specification-Version" to BuildConfig.appVersion))
}

View File

@ -141,8 +141,13 @@ internal object DesktopLauncher {
settings.filterMag = Texture.TextureFilter.MipMapLinearLinear
settings.filterMin = Texture.TextureFilter.MipMapLinearLinear
if (File("../Images").exists()) // So we don't run this from within a fat JAR
if (File("../Images").exists()) { // So we don't run this from within a fat JAR
packImagesIfOutdated(settings, "../Images", ".", "game")
packImagesIfOutdated(settings, "../ImagesToPackSeparately/BuildingIcons", ".", "BuildingIcons")
packImagesIfOutdated(settings, "../ImagesToPackSeparately/FlagIcons", ".", "FlagIcons")
packImagesIfOutdated(settings, "../ImagesToPackSeparately/UnitIcons", ".", "UnitIcons")
}
// pack for mods as well
val modDirectory = File("mods")