Lines Matching refs:doc
77 def parse_manifest(doc): argument
80 manifest = doc.documentElement
86 def ensure_manifest_android_ns(doc): argument
89 manifest = parse_manifest(doc)
93 attr = doc.createAttributeNS(minidom.XMLNS_NAMESPACE, 'xmlns:android')
147 def raise_min_sdk_version(doc, min_sdk_version, target_sdk_version, library): argument
158 manifest = parse_manifest(doc)
167 element = doc.createElement('uses-sdk')
173 manifest.insertBefore(doc.createTextNode(indent), manifest.firstChild)
179 min_attr = doc.createAttributeNS(android_ns, 'android:minSdkVersion')
190 target_attr = doc.createAttributeNS(android_ns, 'android:targetSdkVersion')
203 def add_uses_libraries(doc, new_uses_libraries, required): argument
214 manifest = parse_manifest(doc)
220 application = doc.createElement('application')
223 manifest.insertBefore(doc.createTextNode(indent), first)
239 ul = doc.createElement('uses-library')
243 application.insertBefore(doc.createTextNode(indent), last)
250 application.appendChild(doc.createTextNode(indent))
252 def add_uses_non_sdk_api(doc): argument
261 manifest = parse_manifest(doc)
267 application = doc.createElement('application')
270 manifest.insertBefore(doc.createTextNode(indent), first)
275 attr = doc.createAttributeNS(android_ns, 'android:usesNonSdkApi')
280 def add_use_embedded_dex(doc): argument
281 manifest = parse_manifest(doc)
287 application = doc.createElement('application')
290 manifest.insertBefore(doc.createTextNode(indent), first)
295 attr = doc.createAttributeNS(android_ns, 'android:useEmbeddedDex')
302 def add_extract_native_libs(doc, extract_native_libs): argument
303 manifest = parse_manifest(doc)
309 application = doc.createElement('application')
312 manifest.insertBefore(doc.createTextNode(indent), first)
318 attr = doc.createAttributeNS(android_ns, 'android:extractNativeLibs')
326 def write_xml(f, doc): argument
328 for node in doc.childNodes:
337 doc = minidom.parse(args.input)
339 ensure_manifest_android_ns(doc)
342 raise_min_sdk_version(doc, args.min_sdk_version, args.target_sdk_version, args.library)
345 add_uses_libraries(doc, args.uses_libraries, True)
348 add_uses_libraries(doc, args.optional_uses_libraries, False)
351 add_uses_non_sdk_api(doc)
354 add_use_embedded_dex(doc)
357 add_extract_native_libs(doc, args.extract_native_libs)
360 write_xml(f, doc)