MCPcopy Create free account
hub / github.com/defold/defold / write_generated

Function write_generated

engine/jni/scripts/gen_java.py:201–209  ·  view source on GitHub ↗
(path, text)

Source from the content-addressed store, hash-verified

199 return '\n'
200
201def write_generated(path, text):
202 newline = detect_newline(path)
203 data = text.replace('\n', newline).encode('utf-8')
204 if os.path.exists(path):
205 with open(path, 'rb') as f_inp:
206 if f_inp.read() == data:
207 return
208 with open(path, 'wb') as f_outp:
209 f_outp.write(data)
210
211def as_zig_prim_type(s):
212 return prim_types[s]

Callers 1

generateFunction · 0.85

Calls 6

detect_newlineFunction · 0.85
replaceMethod · 0.80
existsMethod · 0.65
encodeMethod · 0.45
readMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected