static ProtoModule newProtoModule(String source, String output, String encoding,
            String outputDir, File baseDirForSource, File baseDirForOutput)
    {
        if (baseDirForSource != null)
        {
            if (baseDirForOutput != null)
            {
                return new ProtoModule(new File(baseDirForSource, source), output,
                        encoding, new File(baseDirForOutput, outputDir));
            }

            return new ProtoModule(new File(baseDirForSource, source), output,
                    encoding, new File(outputDir));
        }

        if (baseDirForOutput != null)
        {
            return new ProtoModule(new File(source), output,
                    encoding, new File(baseDirForOutput, outputDir));
        }

        return new ProtoModule(new File(source), output, encoding, new File(outputDir));
    }
The main execution point of compiling protos.

@author David Yu
@created Jan 5, 2010
protostuff-compiler/src/main/java/io/protostuff/compiler/CompilerMain.java