Skip to content

Commit 0a28f5f

Browse files
committed
A more-reliable way of generating assets.txt .
Thanks to Discord user "chelome." for pointing out that changing only assets wouldn't trigger a rewrite of assets.txt .
1 parent 3f6bad1 commit 0a28f5f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

SquidSquad/DawnlikeDemo-beta2/build.gradle

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,15 @@ configure(subprojects) {
3333
compileJava {
3434
options.incremental = true
3535
}
36+
3637
// From https://lyze.dev/2021/04/29/libGDX-Internal-Assets-List/
3738
// The article can be helpful when using assets.txt in your project.
38-
compileJava.doLast {
39+
tasks.register('generateAssetList') {
40+
inputs.dir("${project.rootDir}/assets/")
3941
// projectFolder/assets
40-
def assetsFolder = new File("${project.rootDir}/assets/")
42+
File assetsFolder = new File("${project.rootDir}/assets/")
4143
// projectFolder/assets/assets.txt
42-
def assetsFile = new File(assetsFolder, "assets.txt")
44+
File assetsFile = new File(assetsFolder, "assets.txt")
4345
// delete that file in case we've already created it
4446
assetsFile.delete()
4547

@@ -50,6 +52,7 @@ configure(subprojects) {
5052
assetsFile.append(it + "\n")
5153
}
5254
}
55+
processResources.dependsOn 'generateAssetList'
5356
}
5457

5558
subprojects {

0 commit comments

Comments
 (0)