mirror of
https://gitlab.bixilon.de/bixilon/pixlyzer.git
synced 2025-09-27 05:59:53 -04:00
don't write all file if not requested
This commit is contained in:
parent
2c43a2ab59
commit
7d7d468b58
@ -95,21 +95,16 @@ object PixLyzer {
|
||||
|
||||
println("Done generating ${generator.name} in ${System.currentTimeMillis() - startTime}ms, generated ${generator.entries} entries.")
|
||||
}
|
||||
|
||||
println("Writing all to file...")
|
||||
|
||||
writData("${outputDirectory.absolutePath}/all", all)
|
||||
println("Eventually writing all to file...")
|
||||
|
||||
val tempFileOutputPath = System.getProperty("java.io.tmpdir") + "/" + UUID.randomUUID().toString()
|
||||
|
||||
val jsonHash = Util.saveHashFile(all.toJsonString().byteInputStream(), tempFileOutputPath, GZIPOutputStream(FileOutputStream(tempFileOutputPath)), hashDirectory.absolutePath + "/\${shortHash}/\${hash}.gz")
|
||||
|
||||
val mbfStream = ByteArrayOutputStream()
|
||||
MBFBinaryWriter(mbfStream).writeMBF(MBFData(dataInfo = MBFDataInfo(compression = MBFCompressionTypes.ZSDT, preferVariableTypes = true, variableLengthPrefix = true, compressionLevel = 22), data = all))
|
||||
|
||||
val mbfHash = Util.saveHashFile(ByteArrayInputStream(mbfStream.toByteArray()), tempFileOutputPath, FileOutputStream(tempFileOutputPath), hashDirectory.absolutePath + "/\${shortHash}/\${hash}.mbf")
|
||||
if (File(jsonAssetsIndex.absolutePath + ".json").exists()) {
|
||||
|
||||
writData("${outputDirectory.absolutePath}/all", all)
|
||||
|
||||
val jsonHash = Util.saveHashFile(all.toJsonString().byteInputStream(), tempFileOutputPath, GZIPOutputStream(FileOutputStream(tempFileOutputPath)), hashDirectory.absolutePath + "/\${shortHash}/\${hash}.gz")
|
||||
|
||||
val assetsIndexJson = Util.readJsonFile(jsonAssetsIndex.absolutePath + ".json")
|
||||
|
||||
assetsIndexJson[versionId] = jsonHash
|
||||
@ -120,6 +115,11 @@ object PixLyzer {
|
||||
}
|
||||
|
||||
if (File(mbfAssetsIndex.absolutePath + ".json").exists()) {
|
||||
val mbfStream = ByteArrayOutputStream()
|
||||
MBFBinaryWriter(mbfStream).writeMBF(MBFData(dataInfo = MBFDataInfo(compression = MBFCompressionTypes.ZSDT, preferVariableTypes = true, variableLengthPrefix = true, compressionLevel = 22), data = all))
|
||||
|
||||
val mbfHash = Util.saveHashFile(ByteArrayInputStream(mbfStream.toByteArray()), tempFileOutputPath, FileOutputStream(tempFileOutputPath), hashDirectory.absolutePath + "/\${shortHash}/\${hash}.mbf")
|
||||
|
||||
|
||||
val assetsIndexData = Util.readJsonFile(mbfAssetsIndex.absolutePath + ".json")
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user