Exemplo n.º 1
0
    def buildWithDebug(self, isSimulator):
        if not self.backupFile():
            return

        xcodeProj = XcodeProject(self.m_projectPath, self.m_projectName)
        xcodeProj.parse()
        pbxProject = xcodeProj.getPBXProject()
        buildSettings = pbxProject.getBuildSettings(self.m_target, "Release")
        isSuccess = buildSettings.replaceGCC_PREPROCESSOR_DEFINITIONS("NDEBUG", "COCOS2D_DEBUG=1")

        if not isSuccess:
            defaultBuildSettings = xcodeProj.getDefaultBuildSettings("Release")
            isSuccess = defaultBuildSettings.replaceGCC_PREPROCESSOR_DEFINITIONS("NDEBUG", "COCOS2D_DEBUG=1")
            if not isSuccess:
                print "Can not find GCC_PREPROCESSOR_DEFINITIONS NDEBUG"
        xcodeProj.writeToFile(self.fullProjectPath(""), "")

        oldFullPath = self.fullProjectPath("")
        newFullPath = self.fullProjectPath("Debug")
        os.rename(oldFullPath, newFullPath)

        if isSimulator:
            command = "xcodebuild -sdk iphonesimulator -project " + newFullPath + " -target " + self.targetFilter() + " -configuration Release "
        else:
            command = "xcodebuild -project " + newFullPath + " -target " + self.targetFilter() + " -configuration Release"

        Process.execute(command)
        os.rename(newFullPath, oldFullPath)
        self.resumeFile()
 def initForFramework(self, frameworkPath):
     self.m_frameworkPath = frameworkPath
     self.m_model = XCodeProjectBatchModifier.FrameworkModel
     for projectName, target in XCodeProjectBatchModifier.FrameworkProject.items():
         fullPath = self.m_frameworkPath + "/" + projectName
         xcodeProject = XcodeProject("", "")
         xcodeProject.initWithFullPath(fullPath)
         xcodeProject.setTarget(target)
         if not xcodeProject.parse():
             print "Parse " + fullPath + " failure"
         self.m_frameworkXcodeProj.append(xcodeProject)