mirror of
https://github.com/badvision/lawless-legends.git
synced 2024-08-17 05:29:02 +00:00
Added incremental build of map scripts.
This commit is contained in:
parent
e12555531a
commit
291d529d5a
@ -908,8 +908,9 @@ class PackPartitions
|
|||||||
|
|
||||||
def scriptDir = "build/"
|
def scriptDir = "build/"
|
||||||
ScriptModule module = new ScriptModule()
|
ScriptModule module = new ScriptModule()
|
||||||
module.packScripts(mapName, new File(new File(scriptDir), name+".pla"), mapEl.scripts ? mapEl.scripts[0] : [],
|
module.packScripts(mapName, new File(new File(scriptDir), name+".pla.new"), mapEl.scripts ? mapEl.scripts[0] : [],
|
||||||
totalWidth, totalHeight, xRange, yRange)
|
totalWidth, totalHeight, xRange, yRange)
|
||||||
|
replaceIfDiff(scriptDir + name + ".pla")
|
||||||
compileModule(name, scriptDir)
|
compileModule(name, scriptDir)
|
||||||
return [num, module.locationsWithTriggers]
|
return [num, module.locationsWithTriggers]
|
||||||
}
|
}
|
||||||
@ -1702,7 +1703,7 @@ class PackPartitions
|
|||||||
oldFile = new File(oldFile)
|
oldFile = new File(oldFile)
|
||||||
|
|
||||||
def newText = newFile.text
|
def newText = newFile.text
|
||||||
def oldText = oldFile.text
|
def oldText = oldFile.exists() ? oldFile.text : ""
|
||||||
|
|
||||||
if (newText == oldText) {
|
if (newText == oldText) {
|
||||||
//println "Same text, deleting $newFile"
|
//println "Same text, deleting $newFile"
|
||||||
@ -1793,15 +1794,24 @@ class PackPartitions
|
|||||||
replaceIfDiff("src/plasma/gen_modules.plh")
|
replaceIfDiff("src/plasma/gen_modules.plh")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def copyIfNewer(fromFile, toFile)
|
||||||
|
{
|
||||||
|
if (!toFile.exists())
|
||||||
|
Files.copy(fromFile.toPath(), toFile.toPath())
|
||||||
|
}
|
||||||
|
|
||||||
def createImage()
|
def createImage()
|
||||||
{
|
{
|
||||||
// Copy the PLASMA VM file to the output directory
|
// Copy the PLASMA VM file to the output directory
|
||||||
Files.copy(new File("PLVM02.SYSTEM.sys").toPath(), new File("build/root/PLVM02.SYSTEM.sys").toPath())
|
copyIfNewer(new File("PLVM02.SYSTEM.sys"), new File("build/root/PLVM02.SYSTEM.sys"))
|
||||||
|
|
||||||
// Copy the memory manager to the output directory
|
// Copy the memory manager to the output directory
|
||||||
Files.copy(new File("src/core/build/cmd.sys#2000").toPath(), new File("build/root/cmd.sys#2000").toPath())
|
copyIfNewer(new File("src/core/build/cmd.sys#2000"), new File("build/root/cmd.sys#2000"))
|
||||||
|
|
||||||
// Decompress the base image
|
// Decompress the base image
|
||||||
|
def dst = new File("build/game.2mg")
|
||||||
|
if (dst.exists())
|
||||||
|
dst.delete()
|
||||||
Files.copy(new GZIPInputStream(new FileInputStream("data/disks/base.2mg.gz")), new File("build/game.2mg").toPath())
|
Files.copy(new GZIPInputStream(new FileInputStream("data/disks/base.2mg.gz")), new File("build/game.2mg").toPath())
|
||||||
|
|
||||||
// Now put the files into the image
|
// Now put the files into the image
|
||||||
@ -1842,10 +1852,9 @@ class PackPartitions
|
|||||||
// Go for it.
|
// Go for it.
|
||||||
def inst = new PackPartitions()
|
def inst = new PackPartitions()
|
||||||
try {
|
try {
|
||||||
// Blow away everything in the build directory, and recreate it
|
// Create the build directory if necessary
|
||||||
def buildDir = new File("build")
|
def buildDir = new File("build")
|
||||||
if (buildDir.exists())
|
if (!buildDir.exists())
|
||||||
buildDir.deleteDir()
|
|
||||||
buildDir.mkdirs()
|
buildDir.mkdirs()
|
||||||
|
|
||||||
// Create PLASMA headers
|
// Create PLASMA headers
|
||||||
|
Loading…
Reference in New Issue
Block a user