public static ProtoModule loadModule(Properties props,
            String name, CachingProtoLoader loader,
            File baseDirForSource, File baseDirForOutput,
            Properties globalOptions,
            String[] profileOptions, String[] rootProfileOptions)
    {
        String source = props.getProperty(name + ".source");
        if (source == null)
            throw new IllegalStateException(name + " must have a source");

        String output = props.getProperty(name + ".output");
        if (output == null)
            throw new IllegalStateException(name + " must have an output");

        String outputDir = props.getProperty(name + ".outputDir");
        if (outputDir == null)
            throw new IllegalStateException(name + " must have an outputDir");

        String encoding = props.getProperty(name + ".encoding");

        String options = props.getProperty(name + ".options");

        ProtoModule module = newProtoModule(source, output, encoding, outputDir,
                baseDirForSource, baseDirForOutput);

        module.setCachingProtoLoader(loader);

        module.getOptions().putAll(globalOptions);
        module.config = props;

        if (options != null)
            addOptionsTo(module.getOptions(), COMMA.split(options), props);

        // can override previous options
        if (profileOptions != null)
            addOptionsTo(module.getOptions(), profileOptions, props);

        if (rootProfileOptions != null)
            addOptionsTo(module.getOptions(), rootProfileOptions, props);

        return module;
    }
The main execution point of compiling protos.

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