--- commands.py +++ commands.py @@ -584,6 +584,9 @@ self.has_astyle_cfg = False if os.path.isfile(self.astyleconf): self.has_astyle_cfg = True + + #FML Entries + self.srcshared = os.path.normpath(os.path.join(self.dirsrc, 'common')) def creatergcfg(self, reobf=False, keep_lvt=False, keep_generics=False, rg_update=False): """Create the files necessary for RetroGuard""" @@ -1198,20 +1201,20 @@ with open(self.csvmethods, 'rb') as fh: methodsreader = csv.DictReader(fh) for row in methodsreader: - if int(row['side']) == side: + if int(row['side']) == side or int(row['side']) == 2: if row['name'] != row['searge']: names['methods'][row['searge']] = row['name'] with open(self.csvfields, 'rb') as fh: fieldsreader = csv.DictReader(fh) for row in fieldsreader: - if int(row['side']) == side: + if int(row['side']) == side or int(row['side']) == 2: if row['name'] != row['searge']: names['fields'][row['searge']] = row['name'] if self.has_param_csv: with open(self.csvparams, 'rb') as fh: paramsreader = csv.DictReader(fh) for row in paramsreader: - if int(row['side']) == side: + if int(row['side']) == side or int(row['side']) == 2: names['params'][row['param']] = row['name'] regexps = { @@ -1309,6 +1312,11 @@ # HINT: We pathwalk the sources for path, _, filelist in os.walk(pathsrclk[side], followlinks=True): + for cur_file in fnmatch.filter(filelist, '*.java'): + updatefile(os.path.normpath(os.path.join(path, cur_file))) + + # FML, copy of the above, for the common folder + for path, _, filelist in os.walk(self.srcshared, followlinks=True): for cur_file in fnmatch.filter(filelist, '*.java'): updatefile(os.path.normpath(os.path.join(path, cur_file))) return True @@ -1442,6 +1450,21 @@ if not self.has_astyle_cfg: self.logger.warning('!! reformatting disabled due to no config !!') return False + + #FML Recall this function on the common folder + #Potential bug: If this is called without a subsiquent rename call, will cause double comments + if pathsrclk[side] != self.srcshared: + if side == CLIENT: + tmp = self.srcclient + self.srcclient = self.srcshared + self.process_javadoc(side) + self.srcclient = tmp + else: + tmp = self.srcserver + self.srcserver = self.srcshared + self.process_javadoc(side) + self.srcserver = tmp + # HINT: We create the list of source directories based on the list of packages pkglist = filterdirs(pathsrclk[side], '*.java', append_pattern=True) @@ -1591,6 +1614,9 @@ return for entry in newfiles: + if 'commands.py' in entry[0]: #FML, Disable updating of Commands.py + print 'Update to runtime/commands.py found, but disbled due to using fml' + continue if entry[3] == 'U': self.logger.info('New version found for : %s', entry[0]) elif entry[3] == 'D':