Пример #1
0
    def buildTarget(self, configuration, args, target):
        configs = [configuration.config]

        if args.config != None:
            configs = [args.config]

        if target == None and args.target != None:
            target = args.target

        isSingleConfigBuildSystem = self.generatorInfo.isSingleConfigBuildSystem(
            configuration.buildsystem)

        if not isSingleConfigBuildSystem and args.config == None:
            configs = []
            for cmakeConfiguration in self.cmake.codeModel["configurations"]:
                configs += [cmakeConfiguration["name"]]

        for config in configs:
            buildDirectory = self.buildFolder.getBuildDir(configuration)
            commandArguments = [
                "\"%s\"" % self.cmake.cmakeExecutable, "--build",
                "\"%s\"" % buildDirectory
            ]

            if target:
                commandArguments += ["--target", target]

            if not isSingleConfigBuildSystem:
                commandArguments += ["--config", config]

            if args.jobs != None:
                generatorName = self.generatorInfo.getCMakeGeneratorName(
                    configuration.buildsystem)
                if "Visual Studio" in generatorName:
                    os.environ["CL"] = "/MP" + args.jobs
                elif "Xcode" in generatorName:
                    pass  # Can' specify multicore via command line :(
                else:
                    commandArguments += ["--", "-j%s" % (args.jobs)]

            commandLine = " ".join(commandArguments)
            self.logger.info("Calling: %s", commandLine)

            exitCode = subprocess.call(commandLine,
                                       shell=True,
                                       cwd=buildDirectory)
            if exitCode != 0:
                raise error.ToolFailedError(commandLine, exitCode)
Пример #2
0
    def buildTargetAndroidStudio(self, configuration, args, target, androidAbi, androidHome, buildDir):

        gradlePath = self.gradle.getGradlePath()
        gradleWrapperPath = self.getBuildToolPath(buildDir, "gradlew")

        arguments = ["\"" + gradleWrapperPath + "\""]

        if target == "clean":
            arguments += ["clean"]
        else:
            if args.config=="Release":
                arguments += ["assembleRelease"]
            else:
                arguments += ["assembleDebug"]

        self.logger.debug("Starting: %s", arguments)

        exitCode = subprocess.call(" ".join(arguments), shell=True, cwd=buildDir, env=self.getToolEnv());
        if exitCode!=0:
            raise error.ToolFailedError("%s" %(arguments), exitCode);