Exemple #1
0
 def SetGlobalSettings(self, globalSettings):
     settingsNode = XmlUtils.FindFirstByTagName(XmlUtils.GetRoot(self.doc),
                                                'Settings')
     oldSettings = XmlUtils.FindFirstByTagName(settingsNode,
                                               'GlobalSettings')
     if oldSettings:
         oldSettings.parentNode.removeChild(oldSettings)
     settingsNode.appendChild(globalSettings.ToXmlNode())
     self.DoSaveXmlFile()
     self.settings = ProjectSettings(settingsNode)
Exemple #2
0
    def GetDependencies(self, configuration):
        '''返回依赖的项目的名称列表(构建顺序)'''
        result = []  # 依赖的项目名称列表
        # dependencies are located directly under the root level
        rootNode = XmlUtils.GetRoot(self.doc)
        if not rootNode:
            return result

        for i in rootNode.childNodes:
            if i.nodeName == 'Dependencies' \
               and i.getAttribute('Name') == configuration:
                # have found it
                for j in i.childNodes:
                    if j.nodeName == 'Project':
                        result.append(XmlUtils.ReadString(j, 'Name'))
                return result

        # if we are here, it means no match for the given configuration
        # return the default dependencies
        node = XmlUtils.FindFirstByTagName(rootNode, 'Dependencies')
        if node:
            for i in node.childNodes:
                if i.nodeName == 'Project':
                    result.append(XmlUtils.ReadString(i, 'Name'))
        return result
Exemple #3
0
 def __init__(self, fileName=''):
     self.doc = minidom.Document()
     self.rootNode = XmlUtils.GetRoot(self.doc)
     self.name = ''
     self.fileName = ''  # 绝对路径
     self.dirName = ''  # 绝对路径
     self.baseName = ''  # 项目文件名
     # 用于判断是否重新生成 makefile,此标志为真时,必重新生成 makefile
     # FIXME: 如果此标志为真,但是此时关闭工作区,下次启动时不会重建 makefile
     self.isModified = False
     self.tranActive = False
     self.modifyTime = 0
     self.settings = None
     if fileName:
         try:
             self.doc = minidom.parse(fileName)
         except IOError:
             print 'Invalid fileName:', fileName
             raise IOError
         self.rootNode = XmlUtils.GetRoot(self.doc)
         self.name = XmlUtils.GetRoot(self.doc).getAttribute('Name')\
                 .encode('utf-8')
         self.fileName = os.path.abspath(fileName)  #绝对路径
         self.dirName, self.baseName = os.path.split(self.fileName)  #绝对路径
         self.modifyTime = Globals.GetFileModificationTime(fileName)
         self.settings = ProjectSettings(
             XmlUtils.FindFirstByTagName(self.rootNode, 'Settings'))
Exemple #4
0
 def GetDescription(self):
     rootNode = XmlUtils.GetRoot(self.doc)
     if rootNode:
         node = XmlUtils.FindFirstByTagName(rootNode, 'Description')
         if node:
             return XmlUtils.GetNodeContent(node)
     return ''
Exemple #5
0
 def SetSettings(self, settings, autoSave=True):
     '''设置项目设置,并保存xml文件'''
     oldSettings = XmlUtils.FindFirstByTagName(XmlUtils.GetRoot(self.doc),
                                               'Settings')
     if oldSettings:
         oldSettings.parentNode.removeChild(oldSettings)
     XmlUtils.GetRoot(self.doc).appendChild(settings.ToXmlNode())
     if autoSave:
         self.DoSaveXmlFile()
     self.settings = settings
Exemple #6
0
    def SetFiles(self, projectIns):
        '''copy files (and virtual directories) from src project to this project
        note that this call replaces the files that exists under this project'''
        # first remove all the virtual directories from this project
        # Remove virtual folders
        vdNode = XmlUtils.FindFirstByTagName(XmlUtils.GetRoot(self.doc),
                                             'VirtualDirectory')
        while vdNode:
            XmlUtils.GetRoot(self.doc).removeChild(vdNode)
            vdNode = XmlUtils.FindFirstByTagName(XmlUtils.GetRoot(self.doc),
                                                 'VirtualDirectory')

        # copy the virtual directories from the src project
        for i in XmlUtils.GetRoot(self.doc).childNodes:
            if i.nodeName == 'VirtualDirectory':
                # FIXME: deep?
                newNode = i.cloneNode(1)
                XmlUtils.GetRoot(self.doc).appendChild(newNode)

        self.DoSaveXmlFile()
Exemple #7
0
    def __init__(self, fileName=''):
        self.doc = minidom.Document()
        self.rootNode = XmlUtils.GetRoot(self.doc)
        self.name = ''
        self.fileName = ''  # 绝对路径
        self.dirName = ''  # 绝对路径
        self.baseName = ''  # 项目文件名
        # 用于判断是否重新生成 makefile,此标志为真时,必重新生成 makefile
        # FIXME: 如果此标志为真,但是此时关闭工作区,下次启动时不会重建 makefile
        self.isModified = False
        self.tranActive = False
        self.modifyTime = 0
        self.settings = None

        self.version = 0

        if fileName:
            try:
                self.doc = minidom.parse(fileName)
            except IOError:
                print 'Invalid fileName:', fileName
                raise IOError
            self.rootNode = XmlUtils.GetRoot(self.doc)
            self.name = self.rootNode.getAttribute('Name').encode('utf-8')

            # 添加版本号
            if self.rootNode.hasAttribute('Version'):
                self.version = int(self.rootNode.getAttribute('Version'))

            # 绝对路径
            self.fileName = os.path.abspath(fileName)
            # NOTE: 还必须是真实路径
            self.fileName = os.path.realpath(self.fileName)
            self.dirName, self.baseName = os.path.split(self.fileName)  #绝对路径
            self.modifyTime = GetMTime(fileName)
            self.settings = ProjectSettings(
                XmlUtils.FindFirstByTagName(self.rootNode, 'Settings'))

            self._ConvertSettings()
            self._CleanupSettings()
Exemple #8
0
    def ToXmlNode(self):
        # Create the common nodes
        node = self.commonConfig.ToXmlNode()
        
        node.setAttribute('Name', self.name)
        node.setAttribute('CompilerType', self.compilerType)
        node.setAttribute('DebuggerType', self.debuggerType)
        node.setAttribute('Type', self.projectType)
        node.setAttribute('BuildCmpWithGlobalSettings', self.buildCmpWithGlobalSettings)
        node.setAttribute('BuildLnkWithGlobalSettings', self.buildLnkWithGlobalSettings)
        node.setAttribute('BuildResWithGlobalSettings', self.buildResWithGlobalSettings)
        
        compilerNode = XmlUtils.FindFirstByTagName(node, 'Compiler')
        if compilerNode:
            compilerNode.setAttribute('Required', Macros.BoolToString(self.compilerRequired))
            compilerNode.setAttribute('PreCompiledHeader', self.precompiledHeader)
        
        linkerNode = XmlUtils.FindFirstByTagName(node, 'Linker')
        if linkerNode:
            linkerNode.setAttribute('Required', Macros.BoolToString(self.linkerRequired))
        
        resCmpNode = XmlUtils.FindFirstByTagName(node, 'ResourceCompiler')
        if resCmpNode:
            resCmpNode.setAttribute('Required', Macros.BoolToString(self.isResCmpNeeded))
            
        generalNode = minidom.Document().createElement('General')
        generalNode.setAttribute('OutputFile', self.outputFile)
        generalNode.setAttribute('IntermediateDirectory', self.intermediateDirectory)
        generalNode.setAttribute('Command', self.command)
        generalNode.setAttribute('CommandArguments', self.commandArguments)
        generalNode.setAttribute('UseSeparateDebugArgs', Macros.BoolToString(self.useSeparateDebugArgs))
        generalNode.setAttribute('DebugArguments', self.debugArgs)
        generalNode.setAttribute('WorkingDirectory', self.workingDirectory)
        generalNode.setAttribute('PauseExecWhenProcTerminates', Macros.BoolToString(self.pauseWhenExecEnds))
        node.appendChild(generalNode)
        
        debuggerNode = minidom.Document().createElement('Debugger')
        debuggerNode.setAttribute('IsRemote', Macros.BoolToString(self.isDbgRemoteTarget))
        debuggerNode.setAttribute('RemoteHostName', self.dbgHostName)
        debuggerNode.setAttribute('RemoteHostPort', self.dbgHostPort)
        debuggerNode.setAttribute('DebuggerPath', self.debuggerPath)
        # node.appendChild(debuggerNode) #?
        
        envNode = minidom.Document().createElement('Environment')
        envNode.setAttribute('EnvVarSetName', self.envVarSet)
        envNode.setAttribute('DbgSetName', self.dbgEnvSet)
        node.appendChild(envNode)
        
        dbgStartupCommands = minidom.Document().createElement('StartupCommands')
        XmlUtils.SetNodeContent(dbgStartupCommands, self.debuggerStartupCmds)
        dbgPostCommands = minidom.Document().createElement('PostConnectCommands')
        XmlUtils.SetNodeContent(dbgPostCommands, self.debuggerPostRemoteConnectCmds)
        
        debuggerNode.appendChild(dbgStartupCommands)
        debuggerNode.appendChild(dbgPostCommands)
        node.appendChild(debuggerNode)
        
        dom = minidom.Document()
        # Add prebuild commands
        preBuildNode = dom.createElement('PreBuild')
        node.appendChild(preBuildNode)
        for i in self.preBuildCommands:
            commandNode = dom.createElement('Command')
            commandNode.setAttribute('Enabled', Macros.BoolToString(i.enabled))
            XmlUtils.SetNodeContent(commandNode, i.command)
            preBuildNode.appendChild(commandNode)
        
        # Add postbuild commands
        postBuildNode = dom.createElement('PostBuild')
        node.appendChild(postBuildNode)
        for i in self.postBuildCommands:
            commandNode = dom.createElement('Command')
            commandNode.setAttribute('Enabled', Macros.BoolToString(i.enabled))
            XmlUtils.SetNodeContent(commandNode, i.command)
            postBuildNode.appendChild(commandNode)
        
        # Add custom build commands
        customBuildNode = dom.createElement('CustomBuild')
        node.appendChild(customBuildNode)
        customBuildNode.setAttribute('Enabled', Macros.BoolToString(self.enableCustomBuild))
        
        # Add the working directory of the cutstom build
        customBuildWDNode = dom.createElement('WorkingDirectory')
        XmlUtils.SetNodeContent(customBuildWDNode, self.customBuildWorkingDir)
        customBuildNode.appendChild(customBuildWDNode)
        
        toolName = dom.createElement('ThirdPartyToolName')
        XmlUtils.SetNodeContent(toolName, self.toolName)
        customBuildNode.appendChild(toolName)
        
        # add the makefile generation command
        makeGenCmd = dom.createElement('MakefileGenerationCommand')
        XmlUtils.SetNodeContent(makeGenCmd, self.makeGenerationCommand)
        customBuildNode.appendChild(makeGenCmd)
        
        singleFileCmd = dom.createElement('SingleFileCommand')
        XmlUtils.SetNodeContent(singleFileCmd, self.singleFileBuildCommand)
        customBuildNode.appendChild(singleFileCmd)
        
        preprocFileCmd = dom.createElement('PreprocessFileCommand')
        XmlUtils.SetNodeContent(preprocFileCmd, self.preprocessFileCommand)
        customBuildNode.appendChild(preprocFileCmd)
        
        # add build and clean commands
        bldCmd = dom.createElement('BuildCommand')
        XmlUtils.SetNodeContent(bldCmd, self.customBuildCmd)
        customBuildNode.appendChild(bldCmd)
        
        clnCmd = dom.createElement('CleanCommand')
        XmlUtils.SetNodeContent(clnCmd, self.customCleanCmd)
        customBuildNode.appendChild(clnCmd)
        
        rebldCmd = dom.createElement('RebuildCommand')
        XmlUtils.SetNodeContent(rebldCmd, self.customRebuildCmd)
        customBuildNode.appendChild(rebldCmd)
        
        # add all 'Targets'
        for k, v in self.customTargets.items():
            customTgtNode = dom.createElement('Target')
            customTgtNode.setAttribute('Name', k)
            XmlUtils.SetNodeContent(customTgtNode, v)
            customBuildNode.appendChild(customTgtNode)
        
        # add the additional rules
        addtionalCmdsNode = dom.createElement('AdditionalRules')
        node.appendChild(addtionalCmdsNode)
        
        preCmd = dom.createElement('CustomPreBuild')
        XmlUtils.SetNodeContent(preCmd, self.customPreBuildRule)
        addtionalCmdsNode.appendChild(preCmd)
        
        postCmd = dom.createElement('CustomPostBuild')
        XmlUtils.SetNodeContent(postCmd, self.customPostBuildRule)
        addtionalCmdsNode.appendChild(postCmd)

        # add "IgnoredFiles" node
        ignoredFilesNode = dom.createElement('IgnoredFiles')
        for i in self.ignoredFiles:
            ignoredFileNode = dom.createElement('IgnoredFile')
            ignoredFileNode.setAttribute('Name', i)
            ignoredFilesNode.appendChild(ignoredFileNode)
        node.appendChild(ignoredFilesNode)
        
        return node
Exemple #9
0
    def __init__(self, xmlNode = None, confType = 'Configuration'):
        '''字符串类型的变量都是以分号分割的字符串'''
        self.includePath = ''   # 分号分割的字符串
        self.compileOptions = '' # 这是 C++ 的编译选项
        self.linkOptions = ''
        self.libs = ''  # 分号分割的字符串
        self.libPath = ''   # 分号分割的字符
        self.preprocessor = ''   # 分号分割的字符
        self.resCompileOptions = ''
        self.resCompileIncludePath = ''
        self.cCompileOptions = ''
        self.confType = confType  # xml node name
        # added on 2012-10-06
        self.cCxxCmplOpts = '' # 同时用于 C 和 C++ 的编译选项
        
        if xmlNode:
            # 读取编译器设置
            compilerNode = XmlUtils.FindFirstByTagName(xmlNode, 'Compiler')
            if compilerNode:
                self.compileOptions = compilerNode.getAttribute('Options')\
                        .encode('utf-8')
                self.cCompileOptions = compilerNode.getAttribute('C_Options')\
                        .encode('utf-8')
                if compilerNode.hasAttribute('C_Cpp_Options'): # 同时用于 C/C++
                    self.cCxxCmplOpts = compilerNode.getAttribute('C_Cpp_Options')\
                            .encode('utf-8')
                #if not self.cCompileOptions:
                    # the attribute "C_Options" does not exist,
                    # copy the values from the "Options" attribute
                    # 只有这个属性不存在时才复制值, python 的实现不需要如此处理
                    #self.cCompileOptions = self.compileOptions
                
                li1 = []
                li2 = []
                for i in compilerNode.childNodes:
                    if i.nodeName == 'IncludePath':
                        li1.append(XmlUtils.ReadString(i, 'Value'))
                    elif i.nodeName == 'Preprocessor':
                        li2.append(XmlUtils.ReadString(i, 'Value'))
                self.includePath = Globals.JoinToSmclStr(li1)
                self.preprocessor = Globals.JoinToSmclStr(li2)

            # 读取链接器设置
            linkerNode = XmlUtils.FindFirstByTagName(xmlNode, 'Linker')
            if linkerNode:
                self.linkOptions = XmlUtils.ReadString(linkerNode, 'Options')
                li1 = []
                li2 = []
                for i in linkerNode.childNodes:
                    if i.nodeName == 'Library':
                        li1.append(XmlUtils.ReadString(i, 'Value'))
                    elif i.nodeName == 'LibraryPath':
                        li2.append(XmlUtils.ReadString(i, 'Value'))
                self.libs = Globals.JoinToSmclStr(li1)
                self.libPath = Globals.JoinToSmclStr(li2)

            # 读取资源编译器设置
            resCmpNode = XmlUtils.FindFirstByTagName(xmlNode, 'ResourceCompiler')
            if resCmpNode:
                self.resCompileOptions = XmlUtils.ReadString(resCmpNode, 'Options')
                li1 = []
                for i in resCmpNode.childNodes:
                    if i.nodeName == 'IncludePath':
                        li1.append(XmlUtils.ReadString(i, 'Value'))
                self.resCompileIncludePath = Globals.JoinToSmclStr(li1)
        else:
            if self.includePath:
                self.includePath += ';.'
            else:
                self.includePath += '.'
            if self.libPath:
                self.libPath += ';.'
            else:
                self.libPath += '.'
Exemple #10
0
    def __init__(self, xmlNode = None):
        '''麻烦,直接访问变量修改'''
        self.commonConfig = BuildConfigCommon(xmlNode)
        self.name = ''
        self.preBuildCommands = []
        self.postBuildCommands = []
        self.compilerRequired = True
        self.linkerRequired = True
        self.enableCustomBuild = False
        self.outputFile = ''
        self.intermediateDirectory = ''
        self.command = ''
        self.commandArguments = ''
        self.workingDirectory = ''
        self.compilerType = ''
        # 虽然写着是 project type,但是每个构建设置都有自己独立的类型
        self.projectType = ''       
        self.customBuildCmd = ''
        self.customCleanCmd = ''
        self.customRebuildCmd = ''
        self.isResCmpNeeded = False
        self.debuggerType = ''
        self.customPostBuildRule = ''
        self.customPreBuildRule = ''
        self.customBuildWorkingDir = ''
        self.pauseWhenExecEnds = True
        self.toolName = ''
        self.makeGenerationCommand = ''
        self.singleFileBuildCommand = ''
        self.preprocessFileCommand = ''
        self.debuggerStartupCmds = ''
        self.debuggerPostRemoteConnectCmds = ''
        self.isDbgRemoteTarget = False
        self.dbgHostName = ''
        self.dbgHostPort = ''
        self.customTargets = {}
        self.debuggerPath = ''
        self.buildCmpWithGlobalSettings = ''
        self.buildLnkWithGlobalSettings = ''
        self.buildResWithGlobalSettings = ''
        self.precompiledHeader = ''
        self.envVarSet = ''
        self.dbgEnvSet = ''
        self.useSeparateDebugArgs = False
        self.debugArgs = ''

        # added on 2011-12-08
        self.ignoredFiles = set() # 忽略的文件集合,元素为文件的工作区路径字符串
                                  # 保存的是工作区路径的相对路径

        if xmlNode:
            self.name = XmlUtils.ReadString(xmlNode, 'Name')
            self.compilerType = XmlUtils.ReadString(xmlNode, 'CompilerType')
            self.debuggerType = XmlUtils.ReadString(xmlNode, 'DebuggerType')
            self.projectType = XmlUtils.ReadString(xmlNode, 'Type')
            self.buildCmpWithGlobalSettings = XmlUtils.ReadString(
                xmlNode, 'BuildCmpWithGlobalSettings',
                BuildConfig.APPEND_TO_GLOBAL_SETTINGS)
            self.buildLnkWithGlobalSettings = XmlUtils.ReadString(
                xmlNode, 'BuildLnkWithGlobalSettings',
                BuildConfig.APPEND_TO_GLOBAL_SETTINGS)
            self.buildResWithGlobalSettings = XmlUtils.ReadString(
                xmlNode, 'BuildResWithGlobalSettings',
                BuildConfig.APPEND_TO_GLOBAL_SETTINGS)
            
            compileNode = XmlUtils.FindFirstByTagName(xmlNode, 'Compiler')
            if compileNode:
                self.compilerRequired = XmlUtils.ReadBool(
                    compileNode, 'Required', True)
                self.precompiledHeader = XmlUtils.ReadString(
                    compileNode, 'PreCompiledHeader')
            
            linkerNode = XmlUtils.FindFirstByTagName(xmlNode, 'Linker')
            if linkerNode:
                self.linkerRequired = XmlUtils.ReadBool(linkerNode, 'Required',
                                                        True)
            
            resCmpNode = XmlUtils.FindFirstByTagName(xmlNode,
                                                     'ResourceCompiler')
            if resCmpNode:
                self.isResCmpNeeded = XmlUtils.ReadBool(resCmpNode, 'Required',
                                                        True)
            
            debuggerNode = XmlUtils.FindFirstByTagName(xmlNode, 'Debugger')
            self.isDbgRemoteTarget = False
            
            if debuggerNode:
                self.isDbgRemoteTarget = XmlUtils.ReadBool(debuggerNode,
                                                           'IsRemote')
                self.dbgHostName = XmlUtils.ReadString(debuggerNode,
                                                       'RemoteHostName')
                self.dbgHostPort = XmlUtils.ReadString(debuggerNode,
                                                       'RemoteHostPort')
                self.debuggerPath = XmlUtils.ReadString(debuggerNode,
                                                        'DebuggerPath')
                
                for i in debuggerNode.childNodes:
                    if i.nodeName == 'StartupCommands':
                        self.debuggerStartupCmds = XmlUtils.GetNodeContent(i)
                    elif i.nodeName == 'PostConnectCommands':
                        self.debuggerPostRemoteConnectCmds = \
                                XmlUtils.GetNodeContent(i)
            
            # read the prebuild commands
            preBuildNode = XmlUtils.FindFirstByTagName(xmlNode, 'PreBuild')
            if preBuildNode:
                for i in preBuildNode.childNodes:
                    if i.nodeName == 'Command':
                        enabled = XmlUtils.ReadBool(i, 'Enabled')
                        cmd = BuildCommand(XmlUtils.GetNodeContent(i), enabled)
                        self.preBuildCommands.append(cmd)
            
            # read the postbuild commands
            postBuildNode = XmlUtils.FindFirstByTagName(xmlNode, 'PostBuild')
            if postBuildNode:
                for i in postBuildNode.childNodes:
                    if i.nodeName == 'Command':
                        enabled = XmlUtils.ReadBool(i, 'Enabled')
                        cmd = BuildCommand(XmlUtils.GetNodeContent(i), enabled)
                        self.postBuildCommands.append(cmd)
            
            self.envVarSet = Macros.USE_WORKSPACE_ENV_VAR_SET
            self.dbgEnvSet = Macros.USE_GLOBAL_SETTINGS
            
            # read the environment page
            envNode = XmlUtils.FindFirstByTagName(xmlNode, 'Environment')
            if envNode:
                self.envVarSet = XmlUtils.ReadString(envNode, 'EnvVarSetName')
                self.dbgEnvSet = XmlUtils.ReadString(envNode, 'DbgSetName')
            
            customBuildNode = XmlUtils.FindFirstByTagName(xmlNode, 'CustomBuild')
            if customBuildNode:
                self.enableCustomBuild = XmlUtils.ReadBool(customBuildNode,
                                                           'Enabled', False)
                for i in customBuildNode.childNodes:
                    if i.nodeName == 'BuildCommand':
                        self.customBuildCmd = XmlUtils.GetNodeContent(i)
                    elif i.nodeName == 'CleanCommand':
                        self.customCleanCmd = XmlUtils.GetNodeContent(i)
                    elif i.nodeName == 'RebuildCommand':
                        self.customRebuildCmd = XmlUtils.GetNodeContent(i)
                    elif i.nodeName == 'SingleFileCommand':
                        self.singleFileBuildCommand = XmlUtils.GetNodeContent(i)
                    elif i.nodeName == 'PreprocessFileCommand':
                        self.preprocessFileCommand = XmlUtils.GetNodeContent(i)
                    elif i.nodeName == 'WorkingDirectory':
                        self.customBuildWorkingDir = XmlUtils.GetNodeContent(i)
                    elif i.nodeName == 'ThirdPartyToolName':
                        self.toolName = XmlUtils.GetNodeContent(i)
                    elif i.nodeName == 'MakefileGenerationCommand':
                        self.makeGenerationCommand = XmlUtils.GetNodeContent(i)
                    elif i.nodeName == 'Target':
                        tgtName = i.getAttribute('Name').encode('utf-8')
                        tgtCmd = XmlUtils.GetNodeContent(i)
                        if tgtName:
                            self.customTargets[tgtName] = tgtCmd
            else:
                self.enableCustomBuild = False
            
            # read pre and post build rules
            customPreBuildNode = XmlUtils.FindFirstByTagName(xmlNode,
                                                             'AdditionalRules')
            if customPreBuildNode:
                for i in customPreBuildNode.childNodes:
                    if i.nodeName == 'CustomPreBuild':
                        self.customPreBuildRule = XmlUtils.GetNodeContent(i)
                        self.customPreBuildRule = self.customPreBuildRule.strip()
                    elif i.nodeName == 'CustomPostBuild':
                        self.customPostBuildRule = XmlUtils.GetNodeContent(i)
                        self.customPostBuildRule = self.customPostBuildRule.strip()
            
            generalNode = XmlUtils.FindFirstByTagName(xmlNode, 'General')
            if generalNode:
                self.outputFile = XmlUtils.ReadString(generalNode, 'OutputFile')
                self.intermediateDirectory = XmlUtils.ReadString(
                    generalNode, 'IntermediateDirectory', '.')
                self.command = XmlUtils.ReadString(generalNode, 'Command')
                self.commandArguments = XmlUtils.ReadString(
                    generalNode, 'CommandArguments')
                self.workingDirectory = XmlUtils.ReadString(
                    generalNode, 'WorkingDirectory')
                self.pauseWhenExecEnds = XmlUtils.ReadBool(
                    generalNode, 'PauseExecWhenProcTerminates', True)
                self.useSeparateDebugArgs = XmlUtils.ReadBool(
                    generalNode, 'UseSeparateDebugArgs', False)
                self.debugArgs = XmlUtils.ReadString(
                    generalNode, 'DebugArguments')

            # <IgnoredFiles><IgnoredFile Name = "xxx/yyy.c"/></IgnoredFiles>
            ignoredFilesNode = XmlUtils.FindFirstByTagName(
                xmlNode, 'IgnoredFiles')
            if ignoredFilesNode:
                for i in ignoredFilesNode.childNodes:
                    if i.nodeName == 'IgnoredFile':
                        self.ignoredFiles.add(i.getAttribute('Name').encode('utf-8'))
            
        else:
            # create default project settings
            self.commonConfig.SetCCompileOptions('-g;-Wall')
            self.commonConfig.SetCompileOptions('-g;-Wall')
            self.commonConfig.SetLinkOptions('-O0')
            self.commonConfig.SetLibPath('.;Debug')
            
            self.name = 'Debug'
            self.compilerRequired = True
            self.linkerRequired = True
            self.intermediateDirectory = './Debug'
            self.workingDirectory = './Debug'
            self.projectType = Project.Project.EXECUTABLE
            self.enableCustomBuild = False
            self.customBuildCmd = ''
            self.customCleanCmd = ''
            self.isResCmpNeeded = False
            self.customPreBuildRule = ''
            self.customPostBuildRule = ''
            self.makeGenerationCommand = ''
            self.toolName = ''
            self.singleFileBuildCommand = ''
            self.preprocessFileCommand = ''
            self.debuggerStartupCmds = ''
            self.debuggerPostRemoteConnectCmds = ''
            self.isDbgRemoteTarget = False
            self.debugArgs = ''
            
            self.envVarSet = '<Use Workspace Settings>'
            self.dbgEnvSet = '<Use Global Settings>'

            # 获取第一个编译器设置作为默认,故若想修改默认编译器,修改默认配置文件
            #compiler = BuildSettings.BuildSettingsST.Get()\
                    #.GetFirstCompiler()
            #if compiler:
                #self.compilerType = compiler.name
            self.compilerType = 'unknown'
            
            # TODO: DebuggerMgr 暂不支持
            self.debuggerType = 'GNU gdb debugger'

            self.buildCmpWithGlobalSettings = BuildConfig.APPEND_TO_GLOBAL_SETTINGS
            self.buildLnkWithGlobalSettings = BuildConfig.APPEND_TO_GLOBAL_SETTINGS
            self.buildResWithGlobalSettings = BuildConfig.APPEND_TO_GLOBAL_SETTINGS