예제 #1
0
 def scanQmlImports(self):
     qmlImportCommandFile = os.path.join(self.qtRootPath,
                                         'bin/qmlimportscanner')
     system = platform.system()
     if 'Windows' == system:
         qmlImportCommandFile += ".exe"
     if not os.path.isfile(qmlImportCommandFile):
         raise RuntimeError("Couldn't find qml import scanner")
     qmlRootPath = hifi_utils.scriptRelative('interface/resources/qml')
     qmlImportPath = os.path.join(self.qtRootPath, 'qml')
     commandResult = hifi_utils.executeSubprocessCapture([
         qmlImportCommandFile, '-rootPath', qmlRootPath, '-importPath',
         qmlImportPath
     ])
     qmlImportResults = json.loads(commandResult)
     for item in qmlImportResults:
         if 'path' not in item:
             continue
         path = os.path.realpath(item['path'])
         if not os.path.exists(path):
             continue
         basePath = path
         if os.path.isfile(basePath):
             basePath = os.path.dirname(basePath)
         basePath = os.path.normcase(basePath)
         if basePath.startswith(qmlRootPath):
             continue
         self.files.extend(
             hifi_utils.recursiveFileList(path, excludeNamePattern=r"^\."))
예제 #2
0
 def scanQmlImports(self):
     qmlImportCommandFile = os.path.join(self.qtRootPath, 'bin/qmlimportscanner')
     system = platform.system()
     if 'Windows' == system:
         qmlImportCommandFile += ".exe"
     if not os.path.isfile(qmlImportCommandFile):
         raise RuntimeError("Couldn't find qml import scanner")
     qmlRootPath = hifi_utils.scriptRelative('interface/resources/qml')
     qmlImportPath = os.path.join(self.qtRootPath, 'qml')
     commandResult = hifi_utils.executeSubprocessCapture([
         qmlImportCommandFile, 
         '-rootPath', qmlRootPath, 
         '-importPath', qmlImportPath
     ])
     qmlImportResults = json.loads(commandResult)
     for item in qmlImportResults:
         if 'path' not in item:
             print("Warning: QML import could not be resolved in any of the import paths: {}".format(item['name']))
             continue
         path = os.path.realpath(item['path'])
         if not os.path.exists(path):
             continue
         basePath = path
         if os.path.isfile(basePath):
             basePath = os.path.dirname(basePath)
         basePath = os.path.normcase(basePath)
         if basePath.startswith(qmlRootPath):
             continue
         self.files.extend(hifi_utils.recursiveFileList(path))
예제 #3
0
    def copyQtDeps(self):
        for lib in QT5_DEPS:
            libfile = os.path.join(self.qtRootPath, "lib/lib{}.so".format(lib))
            if not os.path.exists(libfile):
                continue
            self.files.append(libfile)
            androidDeps = os.path.join(
                self.qtRootPath, "lib/{}-android-dependencies.xml".format(lib))
            if not os.path.exists(androidDeps):
                continue

            tree = ET.parse(androidDeps)
            root = tree.getroot()
            for item in root.findall('./dependencies/lib/depends/*'):
                if (item.tag == 'lib') or (item.tag == 'bundled'):
                    relativeFilename = item.attrib['file']
                    if (relativeFilename.startswith('qml')):
                        continue
                    filename = os.path.join(self.qtRootPath, relativeFilename)
                    self.files.extend(
                        hifi_utils.recursiveFileList(
                            filename, excludeNamePattern=r"^\."))
                elif item.tag == 'jar' and 'bundling' in item.attrib and item.attrib[
                        'bundling'] == "1":
                    self.files.append(
                        os.path.join(self.qtRootPath, item.attrib['file']))
                elif item.tag == 'permission':
                    self.permissions.append(item.attrib['name'])
                elif item.tag == 'feature':
                    self.features.append(item.attrib['name'])
예제 #4
0
    def copyQtDeps(self):
        for lib in QT5_DEPS:
            libfile = os.path.join(self.qtRootPath, "lib/lib{}.so".format(lib))
            if not os.path.exists(libfile):
                continue
            self.files.append(libfile)
            androidDeps = os.path.join(self.qtRootPath, "lib/{}-android-dependencies.xml".format(lib))
            if not os.path.exists(androidDeps):
                continue

            tree = ET.parse(androidDeps)
            root = tree.getroot()                
            for item in root.findall('./dependencies/lib/depends/*'):
                if (item.tag == 'lib') or (item.tag == 'bundled'):
                    relativeFilename = item.attrib['file']
                    if (relativeFilename.startswith('qml')):
                        continue
                    filename = os.path.join(self.qtRootPath, relativeFilename)
                    self.files.extend(hifi_utils.recursiveFileList(filename))
                elif item.tag == 'jar' and 'bundling' in item.attrib and item.attrib['bundling'] == "1":
                    self.files.append(os.path.join(self.qtRootPath, item.attrib['file']))
                elif item.tag == 'permission':
                    self.permissions.append(item.attrib['name'])
                elif item.tag == 'feature':
                    self.features.append(item.attrib['name'])