Example usage for com.google.gwt.dev.shell ArtifactAcceptor ArtifactAcceptor

List of usage examples for com.google.gwt.dev.shell ArtifactAcceptor ArtifactAcceptor

Introduction

In this page you can find the example usage for com.google.gwt.dev.shell ArtifactAcceptor ArtifactAcceptor.

Prototype

ArtifactAcceptor

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 {//ww w .j a  v a 2s. 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);
    }
}