Search in sources :

Example 11 with ToolInformationData

use of net.sourceforge.usbdm.constants.ToolInformationData in project usbdm-eclipse-plugins by podonoghue.

the class PrefixedCommandLineGenerator method getToolPrefix.

/**
 * @param tool       The tool to look in for options
 * @return           The tool prefix e.g.arm-none-eabi-
 */
private String getToolPrefix(ITool tool) {
    if (buildToolOptionId == null) {
        // System.err.println("PrefixedCmdLineGenerator.getToolPrefix() buildToolOptionId null");
        return "";
    }
    IToolChain toolChain = getToolChain(tool);
    if (toolChain == null) {
        // System.err.println("PrefixedCmdLineGenerator.getToolPrefix() Toolchain null");
        return "";
    }
    // System.err.println("PrefixedCmdLineGenerator.getToolPrefix() buildToolOptionId = " +buildToolOptionId);
    // System.err.println("PrefixedCmdLineGenerator.getToolPrefix() Checking toolchain: " + toolChain.getId());
    // Find selected build tool
    IOption buildToolOption = toolChain.getOptionBySuperClassId(buildToolOptionId);
    // }
    if (buildToolOption == null) {
        return "";
    }
    // Get build path variable
    ToolInformationData toolData = ToolInformationData.getToolInformationTable().get(buildToolOption.getValue().toString());
    if (toolData == null) {
        return null;
    }
    String toolPrefixVariableId = toolData.getPrefixVariableName();
    if (toolPrefixVariableId == null) {
        return "";
    }
    UsbdmSharedSettings settings = UsbdmSharedSettings.getSharedSettings();
    String toolPrefix = null;
    if (settings != null) {
        toolPrefix = settings.get(toolPrefixVariableId);
    }
    if (toolPrefix == null) {
        toolPrefix = "Tool Prefix not set";
    }
    // }
    return toolPrefix;
}
Also used : UsbdmSharedSettings(net.sourceforge.usbdm.constants.UsbdmSharedSettings) ToolInformationData(net.sourceforge.usbdm.constants.ToolInformationData) IToolChain(org.eclipse.cdt.managedbuilder.core.IToolChain) IOption(org.eclipse.cdt.managedbuilder.core.IOption)

Example 12 with ToolInformationData

use of net.sourceforge.usbdm.constants.ToolInformationData in project usbdm-eclipse-plugins by podonoghue.

the class UsbdmDebuggerPanel method buildToolSelectionChanged.

private void buildToolSelectionChanged() {
    ToolInformationData toolInfo = ToolInformationData.getToolInformationTable().get(getBuildToolId());
    if (toolInfo != null) {
        fTextGdbCommand.setText("${" + toolInfo.getPrefixVariableName() + "}" + UsbdmSharedConstants.GDB_NAME);
        fTextGdbBinPath.setText("${" + toolInfo.getPathVariableName() + "}");
    }
    fTextGdbCommand.setEnabled(toolInfo == null);
    fButtonGdbCommandVariables.setEnabled(toolInfo == null);
    fTextGdbBinPath.setEnabled(toolInfo == null);
    fButtonGdbBinPathBrowse.setEnabled(toolInfo == null);
    fButtonGdbBinPathVariables.setEnabled(toolInfo == null);
}
Also used : ToolInformationData(net.sourceforge.usbdm.constants.ToolInformationData)

Aggregations

ToolInformationData (net.sourceforge.usbdm.constants.ToolInformationData)12 IOption (org.eclipse.cdt.managedbuilder.core.IOption)5 IToolChain (org.eclipse.cdt.managedbuilder.core.IToolChain)5 UsbdmSharedSettings (net.sourceforge.usbdm.constants.UsbdmSharedSettings)4 IConfiguration (org.eclipse.cdt.managedbuilder.core.IConfiguration)3 IManagedBuildInfo (org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo)2 CoreException (org.eclipse.core.runtime.CoreException)2 File (java.io.File)1 InterfaceType (net.sourceforge.usbdm.constants.UsbdmSharedConstants.InterfaceType)1 Device (net.sourceforge.usbdm.deviceDatabase.Device)1 ICProject (org.eclipse.cdt.core.model.ICProject)1