Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Repetition of the CDT Global Build Console When Using The CDT CBuildConsole Extension

With the latest EPP, I've noticed an issue with an Autotools project.

The Autotools uses the CDT CBuildConsole extension to create a separate console for the configuration step output.

The extension specifies an Autotools class which implements IConsole nearly identical to the CDT internal class CBuildConsole except we specify a console name and context id in the call to the console manager. See code attached.

The problem is that there are two CDT Global Build Consoles appearing. One that mirrors the contents of our configure console and one that mirrors the contents of the build console. Both are named: CDT Global Build Console.

The question is: what can be done to stop the repetition of the global console from occurring?

-- Jeff J.

/*******************************************************************************
 * Copyright (c) 2002, 2004 QNX Software Systems and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 * QNX Software Systems - Initial API and implementation
 *******************************************************************************/
package org.eclipse.linuxtools.internal.cdt.autotools.ui;

import org.eclipse.cdt.core.ConsoleOutputStream;
import org.eclipse.cdt.core.resources.IConsole;
import org.eclipse.cdt.ui.CUIPlugin;
import org.eclipse.cdt.ui.IBuildConsoleManager;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;

public class Console implements IConsole {
	IProject project;
	IBuildConsoleManager fConsoleManager;
	
	public Console(String consoleName, String contextId) {
		fConsoleManager = CUIPlugin.getDefault().getConsoleManager(consoleName, 
				contextId);
	}
	
//	/**
//	 * Constructor for ConfigureConsole.
//	 */
//	public CConfigureConsole() {
//		fConsoleManager = AutotoolsPlugin.getDefault().getConsoleManager();
//	}
//

	public void start(IProject project ) {
		this.project = project;
		fConsoleManager.getConsole(project).start(project);
	}
	
	/**
	 * @throws CoreException
	 * @see org.eclipse.cdt.core.resources.IConsole#getOutputStream()
	 */
	public ConsoleOutputStream getOutputStream() throws CoreException {
		return fConsoleManager.getConsole(project).getOutputStream();
	}

	public ConsoleOutputStream getInfoStream() throws CoreException {
		return fConsoleManager.getConsole(project).getInfoStream();
	}

	public ConsoleOutputStream getErrorStream() throws CoreException {
		return fConsoleManager.getConsole(project).getErrorStream();
	}
}

Back to the top