def main()

in Xcode/XcodeVersioner.py [0:0]


    def main(self):
        """Main."""
        main_version_string = self.env["version"]
        split_string = main_version_string.split(".")
        if len(split_string) < 2:
            raise ProcessorError(
                "Version string should be in format X.Y, unless Apple broke "
                "literally everything again."
            )
        self.env["major_version"] = str(split_string[0])
        self.output("Major version: %s" % self.env["major_version"])
        self.env["minor_version"] = str(split_string[1])
        self.output("Minor version: %s" % self.env["minor_version"])
        try:
            self.env["patch_version"] = split_string[2]
        except IndexError:
            self.output("Normalizing patch to 0")
            self.env["patch_version"] = str("0")
        self.env["is_beta"] = False
        xcode_info_results = self.xcode_info(self.env["app_path"])
        xcode_data = {}
        for info_pair in xcode_info_results:
            xcode_data[info_pair[0]] = info_pair[1]
        if xcode_data["is_beta"]:
            self.output("Beta version: %s" % xcode_data["beta_version"])
            self.env["is_beta"] = xcode_data["is_beta"]
            self.env["beta_version"] = xcode_data["beta_version"]
        self.output("Patch version: %s" % self.env["patch_version"])

        self.env["build_version"] = xcode_data["build_version"]
        self.output("Build version: %s" % self.env["build_version"])