def main(): if len(sys.argv) != 3: print "usage: %s cbRoot mcpRoot" % (sys.argv[0], ) raise SystemExit cbRoot = sys.argv[1] #"../CraftBukkit" mcpRoot = sys.argv[2] #"../mcp725-pkgd" cbSrc = os.path.join(cbRoot, "src/main/java/net/minecraft/") mcpSrc = os.path.join(mcpRoot, "src/minecraft_server/net/minecraft/") for cbFilenamePath in srglib.getJavaSourceFiles(cbSrc): # Get corresponding MCP filename path commonPath = cbFilenamePath.replace( os.path.commonprefix((cbFilenamePath, cbSrc)), "") className = os.path.splitext(commonPath)[ 0] # class name including package path mcpFilenamePath = os.path.join(mcpSrc, commonPath) assert os.path.exists( cbFilenamePath), "CB source %s not found?" % (cbFilenamePath, ) if srglib.isPollution(mcpFilenamePath): continue assert os.path.exists( mcpFilenamePath ), "CB source %s has no corresponding MCP file at %s" % ( cbFilenamePath, mcpFilenamePath) neutralizeWhitespace(cbFilenamePath, mcpFilenamePath, className)
def neutralizeWhitespaceDirs(cbSrc, mcpSrc): for cbFilenamePath in srglib.getJavaSourceFiles(cbSrc): # Get corresponding MCP filename path commonPath = cbFilenamePath.replace(os.path.commonprefix((cbFilenamePath, cbSrc)), "")[1:].replace('\\', '/') className = os.path.splitext(commonPath)[0] # class name including package path mcpFilenamePath = os.path.join(mcpSrc, commonPath) assert os.path.exists(cbFilenamePath), "CB source %s not found?" % (cbFilenamePath,) if srglib.isPollution(mcpFilenamePath): continue assert os.path.exists(mcpFilenamePath), "CB source %s has no corresponding MCP file at %s" % (cbFilenamePath, mcpFilenamePath) neutralizeWhitespace(cbFilenamePath, mcpFilenamePath, className)
def main(): if len(sys.argv) != 3: print "usage: %s cbRoot mcpRoot" % (sys.argv[0],) raise SystemExit cbRoot = sys.argv[1] mcpRoot = sys.argv[2] cbSrc = os.path.join(cbRoot, "src/main/java/net/minecraft/") mcpSrc = os.path.join(mcpRoot, "src/minecraft_server/net/minecraft/") for cbFilenamePath in srglib.getJavaSourceFiles(cbSrc): # Get corresponding MCP filename path commonPath = cbFilenamePath.replace(os.path.commonprefix((cbFilenamePath, cbSrc)), "") className = os.path.splitext(commonPath)[0] # class name including package path mcpFilenamePath = os.path.join(mcpSrc, commonPath) assert os.path.exists(cbFilenamePath), "CB source %s not found?" % (cbFilenamePath,) if srglib.isPollution(mcpFilenamePath): continue assert os.path.exists(mcpFilenamePath), "CB source %s has no corresponding MCP file at %s" % (cbFilenamePath, mcpFilenamePath) addJavadoc(cbFilenamePath, mcpFilenamePath, className)