diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/plugin.xml b/build/org.eclipse.cdt.managedbuilder.core.tests/plugin.xml index fb518e66748..56f51c673fe 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/plugin.xml +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/plugin.xml @@ -4934,6 +4934,70 @@ owner="cdt.test.assignToOption.exeLinker"/> + + + + + + + + + + + + + + + + + + Optional class which can be used to override the default command-generation logic for an option. This class must impelment the IOptionCommandGenerator interface. If no generator is specified then the 'comand' attribute is used to generate the option's command. + + + + + + diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOption.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOption.java index 98605b465ae..49e60826091 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOption.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOption.java @@ -10,6 +10,7 @@ * ARM Ltd. - basic tooltip support * James Blackburn (Broadcom Corp.) * Petri Tuononen - [321040] Get Library Search Paths + * Baltasar Belyavsky (Texas Instruments) - [279633] Custom command-generator support *******************************************************************************/ package org.eclipse.cdt.managedbuilder.core; @@ -85,6 +86,8 @@ public interface IOption extends IBuildObject { public static final String CATEGORY = "category"; //$NON-NLS-1$ public static final String COMMAND = "command"; //$NON-NLS-1$ public static final String COMMAND_FALSE = "commandFalse"; //$NON-NLS-1$ + /** @since 8.0 */ + public static final String COMMAND_GENERATOR = "commandGenerator"; //$NON-NLS-1$ public static final String TOOL_TIP = "tip"; //$NON-NLS-1$ public static final String CONTEXT_ID = "contextId"; //$NON-NLS-1$ public static final String DEFAULT_VALUE = "defaultValue"; //$NON-NLS-1$ @@ -246,6 +249,12 @@ public interface IOption extends IBuildObject { */ public String getCommand(); + /** + * @return an instance of the class that overrides the default command generation for the option + * @since 8.0 + */ + public IOptionCommandGenerator getCommandGenerator(); + /** * Sets a String containing the actual command line * option associated with the option diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOptionCommandGenerator.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOptionCommandGenerator.java new file mode 100644 index 00000000000..da2d6f993bd --- /dev/null +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IOptionCommandGenerator.java @@ -0,0 +1,38 @@ +/***************************************************************** + * Copyright (c) 2010, 2011 Texas Instruments 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: + * Texas Instruments - Initial API and implementation + *****************************************************************/ + +package org.eclipse.cdt.managedbuilder.core; + +import org.eclipse.cdt.utils.cdtvariables.IVariableSubstitutor; + + +/** + * This interface can be implemented by clients to contribute custom command-generator + * for a build-option. + * + * The custom command-generator class should be referenced in the