Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def compile(self):
tmt.EclipseProject.compile(self)
# build the pruning and transition tables for the two phase algorithm
# iff they don't already exist
if not exists(self.fivephase_tables):
print "Generating %s" % self.fivephase_tables
assert 0 == tmt.java(
main="cg.fivestage444.Tools",
classpath=self.getClasspath(),
args=[ self.fivephase_tables ])
print "Successfully generated %s!" % self.fivephase_tables
# javadoc -public -verbose -sourcepath src -classpath "$(CLASSPATH)" -d doc -docletpath $(GWT_EXPORTER_JAR) -doclet org.timepedia.exporter.doclet.JsDoclet $(GWT_PACKAGES_DOCUMENT)
args = []
args.append('-strict')
war = join(self.name, 'war')
if not isdir(war):
os.mkdir(war)
args += [ '-war', war ]
# "-style PRETTY" makes the gwt code almost readable, but also more
# than doubles the size of the resulting code.
args += [ '-style', 'PRETTY' ]
args.append(GWT_MODULE)
retVal = tmt.java("com.google.gwt.dev.Compiler", classpath=classpath, args=args, maxMemory='512m')
assert retVal == 0
scramblejs = open(join(self.src, 'tnoodle.js')).read()
tnoodlejs_nocache_js = open(join(war, 'tnoodlejs/tnoodlejs.nocache.js')).read()
tnoodlejs_nocache_js = """function TNOODLEJS_GWT() {
%s
}
TNOODLEJS_GWT();""" % tnoodlejs_nocache_js
scramblejs = scramblejs.replace('//%%tnoodlejs.nocache.js%%', tnoodlejs_nocache_js)
with open(join(war, 'tnoodlejs/tnoodle.js'), 'w') as out:
out.write(scramblejs)