示例#1
0
    def reconfigure(self):
        # See if we need to reconfigure.
        files = []
        reconfigure_needed = False
        self.db.query_scripts(lambda row, path, stamp: files.append(
            (path, stamp)))
        for path, stamp in files:
            if not os.path.exists(path) or os.path.getmtime(path) > stamp:
                reconfigure_needed = True
                break

        if not reconfigure_needed:
            return True

        util.con_out(util.ConsoleHeader, 'Reparsing build scripts.',
                     util.ConsoleNormal)

        # The database should be upgraded here, so we should always have an
        # API version set.
        api_version = Version(self.db.query_var('api_version'))
        assert api_version is not None

        if api_version >= '2.2':
            from ambuild2.frontend.v2_2.context_manager import ContextManager
        elif api_version >= '2.1':
            from ambuild2.frontend.v2_1.context_manager import ContextManager
        elif api_version >= '2.0':
            from ambuild2.frontend.v2_0.context_manager import ContextManager

        # Backwards compatibility: for an automatic reconfigure on an older build,
        # just assume the source path is the cwd. If the AMBuildScript suddenly
        # has decided to depend on originalCwd, then the user may have to manually
        # run configure.py again, until we remove configure.py entirely.
        if 'originalCwd' in self.vars:
            originalCwd = self.vars['originalCwd']
        else:
            originalCwd = self.vars['sourcePath']

        cm = ContextManager(sourcePath=self.vars['sourcePath'],
                            buildPath=self.vars['buildPath'],
                            originalCwd=originalCwd,
                            options=self.vars['options'],
                            args=self.vars['args'])
        cm.db = self.db
        cm.refactoring = self.options.refactor
        try:
            cm.generate('ambuild2')
        except:
            traceback.print_exc()
            util.con_err(util.ConsoleRed, 'Failed to reparse build scripts.',
                         util.ConsoleNormal)
            return False

        # We flush the node cache after this, since database.py expects to get
        # never-before-seen items at the start. We could change this and make
        # nodes individually import, which might be cleaner.
        self.db.flush_caches()

        return True
示例#2
0
 def __init__(self, name, version, behavior, command, objSuffix):
     self.name = name
     self.version = version
     self.behavior = behavior
     self.command = command
     self.objSuffix = objSuffix
     self.debuginfo_argv = []
     self.extra_props = {}
     self.versionObject = Version('{0}-{1}'.format(name, self.version))
示例#3
0
 def __init__(self, version):
     super(Vendor, self).__init__()
     self.version_string = version
     self.version = Version('{0}-{1}'.format(self.name, version))
     self.extra_props = {}
示例#4
0
 def __init__(self, version, path):
     self.version = Version(version)
     self.path = path
     self.vcvars = {}
示例#5
0
 def apiVersion(self):
     return Version('2.1.1')
示例#6
0
 def GetVersionFromVS(vs_version):
     if vs_version >= 14:
         return Version((vs_version * 100) + 500)
     return Version((vs_version * 100) + 600)
示例#7
0
 def apiVersion(self):
     return Version('2.2')
示例#8
0
 def GetVersionFromVS(vs_version):
   return Version((vs_version * 100) + 600)