diff --git a/build.gradle b/build.gradle index ae09f6947..4432b3ef2 100644 --- a/build.gradle +++ b/build.gradle @@ -27,7 +27,7 @@ allprojects { gdxControllersVersion = '2.2.4' robovmVersion = '2.3.23' - gdxTeaVMVersion = '1.2.4' + gdxTeaVMVersion = '1.3.1' teaVMVersion = '0.12.3' } version = appVersionName diff --git a/html/build.gradle b/html/build.gradle index ed7eff42c..370f001e0 100644 --- a/html/build.gradle +++ b/html/build.gradle @@ -29,17 +29,50 @@ tasks.register('compileClient', JavaExec) { task modifyHtml { doLast { - def htmlFile = file("../release/webapp/index.html") - def destinationDir = file("../release/webapp/assets") + def rootFS = file("../release/webapp") + def htmlFile = new File(rootFS, "index.html") + def assetsDir = new File(rootFS, "assets") + def faviconDest = new File(rootFS, "favicon.ico") def sourceFavicon = file("../desktop/src/main/assets/icons/windows.ico") - def sourceGif = file("../html/src/main/assets/logo.gif") - def destinationStartupLogo = file("../release/webapp/startup-logo.png") + def startupLogo = new File(assetsDir, "startup-logo.png") + def assetsTxt = new File(assetsDir, "assets.txt") - // copy windows.ico + // delete placeholder startup-logo.png + if (startupLogo.exists()) { + if (startupLogo.delete()) { + println "Deleted startup-logo.png from assets folder." + } else { + println "Failed to delete startup-logo.png. Check permissions." + } + } else { + println "startup-logo.png not found in assets folder. Nothing to delete." + } + + // remove lines containing the word 'frame' (case-insensitive) from assets.txt + if (assetsTxt.exists()) { + def originalLines = assetsTxt.readLines('UTF-8') + def filteredLines = originalLines.findAll { line -> + !(line =~ /(?i)frame/) + } + if (filteredLines.size() != originalLines.size()) { + assetsTxt.withWriter('UTF-8') { writer -> + filteredLines.eachWithIndex { l, i -> + writer.write(l) + if (i < filteredLines.size() - 1) writer.newLine() + } + } + println "Removed lines containing 'frame' from assets.txt." + } else { + println "No lines containing 'frame' found in assets.txt. No changes made." + } + } else { + println "assets.txt not found in assets folder. Skipping assets.txt cleanup." + } + + // copy windows.ico to favicon.ico if (sourceFavicon.exists()) { - def destinationFile = new File(destinationDir, "windows.ico") sourceFavicon.withInputStream { input -> - destinationFile.withOutputStream { output -> + faviconDest.withOutputStream { output -> output << input } } @@ -48,28 +81,9 @@ task modifyHtml { println "windows.ico does not exist. Skipping copy step." } - if (sourceGif.exists()) { - destinationStartupLogo.parentFile.mkdirs() - sourceGif.withInputStream { input -> - destinationStartupLogo.withOutputStream { output -> - output << input - } - } - println "Replaced startup-logo.png with a gif." - } else { - println "Gif does not exist. Skipping replacement step." - } - if (htmlFile.exists()) { - def faviconLink = '' def content = htmlFile.text - // add a link for the favicon - if (content.contains("")) { - content = content.replace("", faviconLink + "\n") - println "Favicon link added to index.html." - } - // Change page title if (content.contains("