From 4a410c8a0764d31efa65b1d8f4d58579f95a93b4 Mon Sep 17 00:00:00 2001 From: Martin Haye Date: Mon, 18 Jan 2016 17:00:31 -0800 Subject: [PATCH] Fixed circular dependencies at build time. --- .../PackPartitions/src/org/demo/PackPartitions.groovy | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Platform/Apple/tools/PackPartitions/src/org/demo/PackPartitions.groovy b/Platform/Apple/tools/PackPartitions/src/org/demo/PackPartitions.groovy index bb37bb1e..ee7c765a 100644 --- a/Platform/Apple/tools/PackPartitions/src/org/demo/PackPartitions.groovy +++ b/Platform/Apple/tools/PackPartitions/src/org/demo/PackPartitions.groovy @@ -64,6 +64,8 @@ class PackPartitions def currentContext = [] def nWarnings = 0 + def binaryStubsOnly = false + /** * Keep track of context within the XML file, so we can spit out more useful * error and warning messages. @@ -905,6 +907,8 @@ class PackPartitions { def inBuf = new byte[256] def outBuf = ByteBuffer.allocate(50000) + if (binaryStubsOnly) + return outBuf def stream = new File(path).withInputStream { stream -> while (true) { def got = stream.read(inBuf) @@ -927,6 +931,10 @@ class PackPartitions def num = modules.size() + 1 //println "Reading module #$num from '$path'." def bufObj = readBinary(path) + if (binaryStubsOnly) { + modules[name] = [num:num, buf:bufObj] + return + } def bufLen = bufObj.position() def buf = new byte[bufLen] @@ -1602,7 +1610,9 @@ class PackPartitions } // Produce a list of assembly and PLASMA code segments + binaryStubsOnly = true readAllCode() + binaryStubsOnly = false new File("src/plasma/gen_modules.plh").withWriter { out -> code.each { k, v -> out.println "const CODE_${humanNameToSymbol(k, true)} = ${v.num}"