Example usage for com.google.gwt.dev.javac CompilationState getTypeOracle

List of usage examples for com.google.gwt.dev.javac CompilationState getTypeOracle

Introduction

In this page you can find the example usage for com.google.gwt.dev.javac CompilationState getTypeOracle.

Prototype

public TypeOracle getTypeOracle() 

Source Link

Usage

From source file:com.google.gdt.eclipse.designer.hosted.tdz.HostedModeSupport.java

License:Open Source License

public ModuleSpaceHost createModuleSpaceHost(final String moduleName) throws Exception {
    ClassLoader oldContextClassLoader = Thread.currentThread().getContextClassLoader();
    Thread.currentThread().setContextClassLoader(m_devClassLoader);
    try {/*from  ww w. ja v  a2 s .c om*/
        // Try to find an existing loaded version of the module def.
        //
        String outDir = getTemporaryDirectoryName(m_javaProject);
        m_moduleDef = loadModule(moduleName);
        assert m_moduleDef != null;
        fixUserAgentProperty(m_moduleDef);
        // TODO uncomment, if want to see/debug generators, like UiBinder
        //File genDir = new File(outDir);
        File genDir = null;
        // Create a sandbox for the module.
        m_shellDirectory = new File(outDir, ".tmp" + File.separator + "shell" + File.separator + moduleName);
        CompilationState compilationState = m_moduleDef.getCompilationState(getLogger());
        m_typeOracle = compilationState.getTypeOracle();
        m_moduleSpaceHost = new ShellModuleSpaceHost(getLogger(), compilationState, m_moduleDef, genDir,
                m_shellDirectory, new ArtifactAcceptor() {
                    public void accept(TreeLogger logger, ArtifactSet newlyGeneratedArtifacts)
                            throws UnableToCompleteException {
                        // TODO: does we need this?
                    }
                });
        return m_moduleSpaceHost;
    } finally {
        Thread.currentThread().setContextClassLoader(oldContextClassLoader);
    }
}