def WorkHorse(cls, rules): """Runs the workhorse for the command. Args: rules: list: List of rules to be handled. Return: (list, list): Returns a tuple of list in the form (successful_rules, failed_rules) specifying rules that succeeded and ones that failed. """ # Create the user friendly link to bin dir if it doesn't already exist. FileUtils.CreateLink(FileUtils.GetEDir(), FileUtils.GetBinDir()) # Create the link to the web test directory if it exists if os.path.exists(FileUtils.GetWebTestHtmlLink()): FileUtils.CreateLink(FileUtils.GetWebTestHtmlLink(), FileUtils.GetWebTestHtmlDir()) gen_makefile = GenMakefile(Flags.ARGS.debug) gen_makefile.GenMainMakeFile() (success_genmake, failed_genmake) = gen_makefile.GenAutoMakeFileFromRules( rules, Flags.ARGS.allowed_rule_types) (success_make, failed_make) = cls._MakeRules(success_genmake, gen_makefile.GetMakeFileName()) return (success_make, failed_genmake + failed_make)
def __init__(self, rule_name): """initializes the state Args: rule_name (string) - the rule name Raises: UnsupportedRuleError: raises exception if the rule type is not yet supported. add to the RULE_TYPES lists """ # Create the user friendly link to bin dir if it doesn't already exist. FileUtils.CreateLink(FileUtils.GetEDir(), FileUtils.GetBinDir()) rule_name = Utils.RuleNormalizedName(rule_name) Rules.LoadRule(rule_name) self._rule = Rules.GetRule(rule_name) if not self._rule['_type'] in Packager.RULE_PACKAGER: err = 'Rule type %s not supported' % self._rule._type TermColor.Error(err) raise UnsupportedRuleError(err) self._packager = Packager.RULE_PACKAGER[self._rule['_type']]
def GetSwigOutDir(cls): """Returns the swig output dir.""" return os.path.join(FileUtils.GetEDir(), 'swig')