Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: sitescripts/extensions/bin/updateUpdateManifests.py

Issue 29354748: Fixes 4464 - Restore get_min_sdk_version() function from sitescripts.extensions.android module that… (Closed) Base URL: https://hg.adblockplus.org/sitescripts
Patch Set: Add a test Created Sept. 23, 2016, 4:26 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sitescripts/extensions/bin/updateUpdateManifests.py
===================================================================
--- a/sitescripts/extensions/bin/updateUpdateManifests.py
+++ b/sitescripts/extensions/bin/updateUpdateManifests.py
@@ -19,27 +19,34 @@
This script generates update manifests for all extensions and apps
"""
import os
import re
import sys
import subprocess
+import xml.dom.minidom as dom
from ConfigParser import SafeConfigParser
from buildtools.packagerGecko import KNOWN_APPS
from buildtools.packagerSafari import get_developer_identifier
from buildtools.xarfile import read_certificates_and_key
from sitescripts.utils import get_config, get_template
from sitescripts.extensions.utils import (
Configuration, getDownloadLinks,
writeIEUpdateManifest, writeAndroidUpdateManifest)
-from sitescripts.extensions.android import get_min_sdk_version
+
+
+def get_min_sdk_version(repo, version):
+ command = ['hg', 'cat', '-r', version, 'AndroidManifest.xml']
+ result = subprocess.check_output(command, cwd=repo.repository)
+ uses_sdk = dom.parseString(result).getElementsByTagName('uses-sdk')[0]
+ return uses_sdk.attributes['android:minSdkVersion'].value
def readMetadata(repo, version):
"""
reads extension ID and compatibility information from metadata file in the
extension's repository
"""
if repo.type == 'android':
« no previous file with comments | « no previous file | sitescripts/extensions/test/adblockplussafari.pem » ('j') | sitescripts/extensions/test/test_updateManifests.py » ('J')

Powered by Google App Engine
This is Rietveld