mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 14:42:11 +02:00
Yet Another Build Model.
- Defines most of the interfaces - Some simple implementation behind the interfaces to at least get information from the extension point.
This commit is contained in:
parent
44aad85270
commit
ec7c947a6f
15 changed files with 1097 additions and 24 deletions
|
@ -0,0 +1,46 @@
|
|||
/**********************************************************************
|
||||
* Copyright (c) 2003 IBM Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Common Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/cpl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* IBM - Initial API and implementation
|
||||
**********************************************************************/
|
||||
package org.eclipse.cdt.core.build.managed;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public interface IConfiguration {
|
||||
|
||||
/**
|
||||
* Returns the name of this configuration
|
||||
* @return
|
||||
*/
|
||||
public String getName();
|
||||
|
||||
/**
|
||||
* Returns the platform for this configuration.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public ITarget getTarget();
|
||||
|
||||
/**
|
||||
* Returns the configuration from which this configuration inherits
|
||||
* properties.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public IConfiguration getParent();
|
||||
|
||||
/**
|
||||
* Returns the tools that are used in this configuration.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public ITool[] getTools();
|
||||
|
||||
}
|
|
@ -0,0 +1,65 @@
|
|||
/**********************************************************************
|
||||
* Copyright (c) 2003 IBM Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Common Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/cpl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* IBM - Initial API and implementation
|
||||
**********************************************************************/
|
||||
package org.eclipse.cdt.core.build.managed;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public interface IOption {
|
||||
|
||||
// Type for the value of the option
|
||||
public static final int STRING = 0;
|
||||
public static final int STRING_LIST = 1;
|
||||
|
||||
/**
|
||||
* Returns the category for this option.
|
||||
* @return
|
||||
*/
|
||||
public IOptionCategory getCategory();
|
||||
|
||||
/**
|
||||
* Returns the name of this option.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getName();
|
||||
|
||||
/**
|
||||
* Get the type for the value of the option.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public int getValueType();
|
||||
|
||||
/**
|
||||
* If this option is defined as an enumeration, this function returns
|
||||
* the list of possible values for that enum.
|
||||
*
|
||||
* If this option is not defined as an enumeration, it returns null.
|
||||
* @return
|
||||
*/
|
||||
public String [] getApplicableValues();
|
||||
|
||||
/**
|
||||
* Returns the current value for this option if it is a String
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getStringValue();
|
||||
|
||||
/**
|
||||
* Returns the current value for this option if it is a List of Strings.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String [] getStringListValue();
|
||||
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
/**********************************************************************
|
||||
* Copyright (c) 2003 IBM Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Common Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/cpl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* IBM - Initial API and implementation
|
||||
**********************************************************************/
|
||||
package org.eclipse.cdt.core.build.managed;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public interface IOptionCategory {
|
||||
|
||||
/**
|
||||
* Returns the options that have been assigned to this category.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public IOption[] getOptions();
|
||||
|
||||
/**
|
||||
* Returns the list of children of this node in the option category tree
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public IOptionCategory[] getChildCategories();
|
||||
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
/**********************************************************************
|
||||
* Copyright (c) 2003 IBM Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Common Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/cpl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* IBM - Initial API and implementation
|
||||
**********************************************************************/
|
||||
package org.eclipse.cdt.core.build.managed;
|
||||
|
||||
/**
|
||||
* This class represents targets for the managed build process. A target
|
||||
* is some type of resource built using a given collection of tools.
|
||||
*/
|
||||
public interface ITarget {
|
||||
|
||||
/**
|
||||
* Gets the name for the target.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getName();
|
||||
|
||||
/**
|
||||
* Gets the parent for the target.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public ITarget getParent();
|
||||
|
||||
/**
|
||||
* Returns the list of platform specific tools associated with this
|
||||
* platform.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public ITool[] getTools();
|
||||
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
/**********************************************************************
|
||||
* Copyright (c) 2003 IBM Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Common Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/cpl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* IBM - Initial API and implementation
|
||||
**********************************************************************/
|
||||
package org.eclipse.cdt.core.build.managed;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public interface ITool {
|
||||
|
||||
/**
|
||||
* Returns the name of the tool.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getName();
|
||||
|
||||
/**
|
||||
* Return the target that defines this tool, if applicable
|
||||
* @return
|
||||
*/
|
||||
public ITarget getTarget();
|
||||
|
||||
/**
|
||||
* Returns the tool that this tool inherits properties from.
|
||||
* @return
|
||||
*/
|
||||
public ITool getParent();
|
||||
|
||||
/**
|
||||
* Returns the options that may be customized for this tool.
|
||||
*/
|
||||
public IOption[] getOptions();
|
||||
|
||||
/**
|
||||
* Options are organized into categories for UI purposes.
|
||||
* These categories are organized into a tree. This is the root
|
||||
* of that tree.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public IOptionCategory getTopOptionCategory();
|
||||
}
|
|
@ -0,0 +1,165 @@
|
|||
/**********************************************************************
|
||||
* Copyright (c) 2003 IBM Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Common Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/cpl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* IBM - Initial API and implementation
|
||||
**********************************************************************/
|
||||
package org.eclipse.cdt.core.build.managed;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.cdt.core.CCorePlugin;
|
||||
import org.eclipse.cdt.internal.core.build.managed.Target;
|
||||
import org.eclipse.cdt.internal.core.build.managed.Tool;
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.runtime.IConfigurationElement;
|
||||
import org.eclipse.core.runtime.IExtension;
|
||||
import org.eclipse.core.runtime.IExtensionPoint;
|
||||
|
||||
/**
|
||||
* This is the main entry point for getting at the build information
|
||||
* for the managed build system.
|
||||
*/
|
||||
public class ManagedBuildManager {
|
||||
|
||||
/**
|
||||
* Returns the list of platforms that are available to be used in
|
||||
* conjunction with the given resource. Generally this will include
|
||||
* platforms defined by extensions as well as platforms defined by
|
||||
* the project and all projects this project reference.
|
||||
*
|
||||
* @param project
|
||||
* @return
|
||||
*/
|
||||
public static ITarget[] getAvailableTargets(IProject project) {
|
||||
// Make sure the extensions are loaded
|
||||
loadExtensions();
|
||||
|
||||
// Get the platforms for this project and all referenced projects
|
||||
|
||||
// Create the array and copy the elements over
|
||||
ITarget[] targets = new ITarget[extensionTargets.size()];
|
||||
|
||||
for (int i = 0; i < extensionTargets.size(); ++i)
|
||||
targets[i] = (ITarget)extensionTargets.get(i);
|
||||
|
||||
return targets;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the list of configurations belonging to the given platform
|
||||
* that can be applied to the given project. This does not include
|
||||
* the configurations already applied to the project.
|
||||
*
|
||||
* @param resource
|
||||
* @param platform
|
||||
* @return
|
||||
*/
|
||||
public static IConfiguration [] getAvailableConfigurations(IProject project, ITarget platform) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the list of configurations associated with the given project.
|
||||
*
|
||||
* @param project
|
||||
* @return
|
||||
*/
|
||||
public static IConfiguration [] getConfigurations(IProject project) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the list of configurations associated with a given file.
|
||||
*
|
||||
* @param file
|
||||
* @return
|
||||
*/
|
||||
public static IConfiguration[] getConfigurations(IFile file) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a configuration containing the tools defined by the target.
|
||||
*
|
||||
* @param target
|
||||
* @param project
|
||||
* @return
|
||||
*/
|
||||
public static IConfiguration createConfiguration(IProject project, ITarget target) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a configuration that inherits from the parent configuration.
|
||||
*
|
||||
* @param origConfig
|
||||
* @param resource
|
||||
* @return
|
||||
*/
|
||||
public static IConfiguration createConfiguration(IProject project, IConfiguration parentConfig) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the String value for an option.
|
||||
*
|
||||
* @param project
|
||||
* @param config
|
||||
* @param option
|
||||
* @param value
|
||||
*/
|
||||
public static void setOptionValue(IProject project, IConfiguration config, IOption option, String value) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the String List value for an option.
|
||||
*
|
||||
* @param project
|
||||
* @param config
|
||||
* @param option
|
||||
* @param value
|
||||
*/
|
||||
public static void setOptionValue(IProject project, IConfiguration config, IOption option, String[] value) {
|
||||
}
|
||||
|
||||
// Private stuff
|
||||
|
||||
private static List extensionTargets;
|
||||
|
||||
private static void loadExtensions() {
|
||||
if (extensionTargets != null)
|
||||
return;
|
||||
|
||||
extensionTargets = new ArrayList();
|
||||
|
||||
IExtensionPoint extensionPoint
|
||||
= CCorePlugin.getDefault().getDescriptor().getExtensionPoint("ManagedBuildInfo");
|
||||
IExtension[] extensions = extensionPoint.getExtensions();
|
||||
for (int i = 0; i < extensions.length; ++i) {
|
||||
IExtension extension = extensions[i];
|
||||
IConfigurationElement[] elements = extension.getConfigurationElements();
|
||||
for (int j = 0; j < elements.length; ++j) {
|
||||
IConfigurationElement element = elements[j];
|
||||
if (element.getName().equals("target")) {
|
||||
Target target = new Target(element.getAttribute("name"));
|
||||
extensionTargets.add(target);
|
||||
|
||||
IConfigurationElement[] targetElements = element.getChildren();
|
||||
for (int k = 0; k < targetElements.length; ++k) {
|
||||
IConfigurationElement platformElement = targetElements[k];
|
||||
if (platformElement.getName().equals("tool")) {
|
||||
Tool tool = new Tool(platformElement.getAttribute("name"), target);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,74 @@
|
|||
/**********************************************************************
|
||||
* Copyright (c) 2003 IBM Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Common Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/cpl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* IBM - Initial API and implementation
|
||||
**********************************************************************/
|
||||
package org.eclipse.cdt.internal.core.build.managed;
|
||||
|
||||
import org.eclipse.cdt.core.build.managed.IConfiguration;
|
||||
import org.eclipse.cdt.core.build.managed.ITarget;
|
||||
import org.eclipse.cdt.core.build.managed.ITool;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class Configuration implements IConfiguration {
|
||||
|
||||
private String name;
|
||||
private ITarget platform;
|
||||
|
||||
public Configuration(ITarget platform) {
|
||||
this.platform = platform;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.IConfiguration#getName()
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.IConfiguration#setName(java.lang.String)
|
||||
*/
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.IConfiguration#getPlatform()
|
||||
*/
|
||||
public ITarget getPlatform() {
|
||||
return platform;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.IConfiguration#getTools()
|
||||
*/
|
||||
public ITool[] getTools() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.IConfiguration#getParent()
|
||||
*/
|
||||
public IConfiguration getParent() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.IConfiguration#getTarget()
|
||||
*/
|
||||
public ITarget getTarget() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,80 @@
|
|||
/**********************************************************************
|
||||
* Copyright (c) 2003 IBM Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Common Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/cpl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* IBM - Initial API and implementation
|
||||
**********************************************************************/
|
||||
package org.eclipse.cdt.internal.core.build.managed;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.cdt.core.build.managed.ITarget;
|
||||
import org.eclipse.cdt.core.build.managed.ITool;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class Target implements ITarget {
|
||||
|
||||
private String name;
|
||||
private Target parent;
|
||||
private List tools;
|
||||
|
||||
public Target(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Target(String name, Target parent) {
|
||||
this(name);
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public ITarget getParent() {
|
||||
return parent;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
private int getNumTools() {
|
||||
int n = (tools == null) ? 0 : tools.size();
|
||||
if (parent != null)
|
||||
n += parent.getNumTools();
|
||||
return n;
|
||||
}
|
||||
|
||||
private int addToolsToArray(ITool[] toolArray, int start) {
|
||||
int n = start;
|
||||
if (parent != null)
|
||||
n = parent.addToolsToArray(toolArray, start);
|
||||
|
||||
if (tools != null) {
|
||||
for (int i = 0; i < tools.size(); ++i)
|
||||
toolArray[n++] = (ITool)tools.get(i);
|
||||
}
|
||||
|
||||
return n;
|
||||
}
|
||||
public ITool[] getTools() {
|
||||
ITool[] toolArray = new ITool[getNumTools()];
|
||||
addToolsToArray(toolArray, 0);
|
||||
return toolArray;
|
||||
}
|
||||
|
||||
public void addTool(Tool tool) {
|
||||
if (tools == null)
|
||||
tools = new ArrayList();
|
||||
tools.add(tool);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,60 @@
|
|||
/**********************************************************************
|
||||
* Copyright (c) 2003 IBM Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Common Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/cpl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* IBM - Initial API and implementation
|
||||
**********************************************************************/
|
||||
package org.eclipse.cdt.internal.core.build.managed;
|
||||
|
||||
import org.eclipse.cdt.core.build.managed.IOption;
|
||||
import org.eclipse.cdt.core.build.managed.IOptionCategory;
|
||||
import org.eclipse.cdt.core.build.managed.ITarget;
|
||||
import org.eclipse.cdt.core.build.managed.ITool;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class Tool implements ITool {
|
||||
|
||||
private String name;
|
||||
private ITarget target;
|
||||
|
||||
public Tool(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Tool(String name, Target target) {
|
||||
this(name);
|
||||
this.target = target;
|
||||
target.addTool(this);
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public ITarget getTarget() {
|
||||
return target;
|
||||
}
|
||||
|
||||
public IOption[] getOptions() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public IOptionCategory getTopOptionCategory() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.ITool#getParent()
|
||||
*/
|
||||
public ITool getParent() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
|
@ -11,9 +11,6 @@
|
|||
<export name="*"/>
|
||||
</library>
|
||||
</runtime>
|
||||
<!-- ======================================================================= -->
|
||||
<!-- The C Plugin -->
|
||||
<!-- ======================================================================= -->
|
||||
<requires>
|
||||
<import plugin="org.eclipse.core.resources"/>
|
||||
<import plugin="org.eclipse.core.runtime"/>
|
||||
|
@ -30,12 +27,12 @@
|
|||
<extension-point id="CBuildModel" name="%CBuilder.name"/>
|
||||
<extension-point id="ProcessList" name="%ProcessList.name" schema="schema/ProcessList.exsd"/>
|
||||
<extension-point id="BinaryParser" name="BinaryParser"/>
|
||||
|
||||
<extension-point id="CToolchain" name="C/C++ Toolchain Provider" schema="schema/CToolchain.exsd"/>
|
||||
<extension-point id="CBuildConfiguration" name="C/C++ Build Configuration" schema="schema/CBuildConfiguration.exsd"/>
|
||||
<extension-point id="CTool" name="C/C++ Tool" schema="schema/CTool.exsd"/>
|
||||
<extension-point id="CBuildVariable" name="C/C++ Build Variable" schema="schema/CBuildVariable.exsd"/>
|
||||
<extension-point id="CToolType" name="C/C++ Tool Type" schema="schema/CToolType.exsd"/>
|
||||
<extension-point id="ManagedBuildInfo" name="Managed Build Tools" schema="schema/ManagedBuildTools.exsd"/>
|
||||
|
||||
<extension
|
||||
point="org.eclipse.cdt.core.CToolType">
|
||||
|
@ -76,20 +73,27 @@
|
|||
id="org.eclipse.cdt.core.tool.strip">
|
||||
</type>
|
||||
</extension>
|
||||
|
||||
<!-- Define the list of the Binary Parser provided by the CDT -->
|
||||
<extension id="ELF" name="Elf Parser" point="org.eclipse.cdt.core.BinaryParser">
|
||||
<cextension>
|
||||
<run class="org.eclipse.cdt.internal.core.model.parser.ElfParser"/>
|
||||
</cextension>
|
||||
</extension>
|
||||
|
||||
<extension id="PE" name="PE Windows Parser" point="org.eclipse.cdt.core.BinaryParser">
|
||||
<cextension>
|
||||
<run class="org.eclipse.cdt.internal.core.model.parser.PEParser"> </run>
|
||||
</cextension>
|
||||
</extension>
|
||||
|
||||
<!-- Define the list of the Binary Parser provided by the CDT -->
|
||||
<extension
|
||||
id="ELF"
|
||||
name="Elf Parser"
|
||||
point="org.eclipse.cdt.core.BinaryParser">
|
||||
<cextension>
|
||||
<run
|
||||
class="org.eclipse.cdt.internal.core.model.parser.ElfParser">
|
||||
</run>
|
||||
</cextension>
|
||||
</extension>
|
||||
<extension
|
||||
id="PE"
|
||||
name="PE Windows Parser"
|
||||
point="org.eclipse.cdt.core.BinaryParser">
|
||||
<cextension>
|
||||
<run
|
||||
class="org.eclipse.cdt.internal.core.model.parser.PEParser">
|
||||
</run>
|
||||
</cextension>
|
||||
</extension>
|
||||
<extension
|
||||
id="cbuilder"
|
||||
name="C Builder"
|
||||
|
|
329
core/org.eclipse.cdt.core/schema/ManagedBuildTools.exsd
Normal file
329
core/org.eclipse.cdt.core/schema/ManagedBuildTools.exsd
Normal file
|
@ -0,0 +1,329 @@
|
|||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<!-- Schema file written by PDE -->
|
||||
<schema targetNamespace="org.eclipse.cdt.core">
|
||||
<annotation>
|
||||
<appInfo>
|
||||
<meta.schema plugin="org.eclipse.cdt.core" id="ManagedBuildTools" name="Managed Build Tools"/>
|
||||
</appInfo>
|
||||
<documentation>
|
||||
[Enter description of this extension point.]
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
<element name="extension">
|
||||
<complexType>
|
||||
<sequence>
|
||||
<element ref="target"/>
|
||||
<element ref="tool"/>
|
||||
<element ref="configuration"/>
|
||||
</sequence>
|
||||
<attribute name="point" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="id" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="name" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<element name="tool">
|
||||
<complexType>
|
||||
<sequence>
|
||||
<element ref="option"/>
|
||||
<element ref="optionCategory"/>
|
||||
</sequence>
|
||||
<attribute name="id" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="name" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="sources" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="outputs" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="dependencyCalculator" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
<appInfo>
|
||||
<meta.attribute kind="java"/>
|
||||
</appInfo>
|
||||
</annotation>
|
||||
</attribute>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<element name="option">
|
||||
<complexType>
|
||||
<sequence>
|
||||
<element ref="optionEnum"/>
|
||||
</sequence>
|
||||
<attribute name="id" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="name" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="type" use="default" value="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
</annotation>
|
||||
<simpleType>
|
||||
<restriction base="string">
|
||||
<enumeration value="string">
|
||||
</enumeration>
|
||||
<enumeration value="enumeration">
|
||||
</enumeration>
|
||||
</restriction>
|
||||
</simpleType>
|
||||
</attribute>
|
||||
<attribute name="default" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="category" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
This is the id of the option category for this option. The id can be the id of the tool which is also a category.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<element name="optionEnum">
|
||||
<complexType>
|
||||
<attribute name="id" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="name" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<element name="configuration">
|
||||
<complexType>
|
||||
<sequence>
|
||||
<element ref="toolRef"/>
|
||||
</sequence>
|
||||
<attribute name="id" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="name" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="platform" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<element name="toolRef">
|
||||
<complexType>
|
||||
<sequence>
|
||||
<element ref="optionRef"/>
|
||||
</sequence>
|
||||
<attribute name="id" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<element name="optionRef">
|
||||
<complexType>
|
||||
<attribute name="id" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="value" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<element name="target">
|
||||
<annotation>
|
||||
<documentation>
|
||||
Represents a type of resource that is the target of the build process, for example, a Linux Library. A target contains a sequence of tool definitions. Targets are arranged in an inheritance hierarchy where a target inherits the list of tools from it's parent and can add to or override tools in this list.
|
||||
</documentation>
|
||||
</annotation>
|
||||
<complexType>
|
||||
<sequence>
|
||||
<element ref="tool"/>
|
||||
</sequence>
|
||||
<attribute name="id" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="name" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="isAbstract" type="boolean" use="default" value="false">
|
||||
<annotation>
|
||||
<documentation>
|
||||
This is a UI property. If set to true, users should not be able to create project configurations targeted at this target.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="parent" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
The id of a target that this tool inherits from.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<element name="optionCategory">
|
||||
<complexType>
|
||||
<attribute name="id" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="name" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<annotation>
|
||||
<appInfo>
|
||||
<meta.section type="since"/>
|
||||
</appInfo>
|
||||
<documentation>
|
||||
[Enter the first release in which this extension point appears.]
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
<annotation>
|
||||
<appInfo>
|
||||
<meta.section type="examples"/>
|
||||
</appInfo>
|
||||
<documentation>
|
||||
[Enter extension point usage example here.]
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
<annotation>
|
||||
<appInfo>
|
||||
<meta.section type="apiInfo"/>
|
||||
</appInfo>
|
||||
<documentation>
|
||||
[Enter API information here.]
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
<annotation>
|
||||
<appInfo>
|
||||
<meta.section type="implementation"/>
|
||||
</appInfo>
|
||||
<documentation>
|
||||
[Enter information about supplied implementation of this extension point.]
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
<annotation>
|
||||
<appInfo>
|
||||
<meta.section type="copyright"/>
|
||||
</appInfo>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
</schema>
|
|
@ -1,19 +1,24 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src/"/>
|
||||
<classpathentry kind="src" path="ui"/>
|
||||
<classpathentry kind="src" path="core"/>
|
||||
<classpathentry kind="src" path="model"/>
|
||||
<classpathentry kind="src" path="parser"/>
|
||||
<classpathentry kind="src" path="ui/"/>
|
||||
<classpathentry kind="src" path="core/"/>
|
||||
<classpathentry kind="src" path="model/"/>
|
||||
<classpathentry kind="src" path="build"/>
|
||||
<classpathentry kind="src" path="/org.apache.xerces"/>
|
||||
<classpathentry kind="src" path="/org.eclipse.core.boot"/>
|
||||
<classpathentry kind="src" path="/org.eclipse.core.resources"/>
|
||||
<classpathentry kind="src" path="/org.eclipse.core.runtime"/>
|
||||
<classpathentry kind="src" path="/org.eclipse.cdt.core"/>
|
||||
<classpathentry kind="src" path="/org.eclipse.cdt.core.linux"/>
|
||||
<classpathentry kind="src" path="/org.eclipse.cdt.core.qnx"/>
|
||||
<classpathentry kind="src" path="/org.eclipse.cdt.core.solaris"/>
|
||||
<classpathentry kind="src" path="/org.eclipse.cdt.core.win32"/>
|
||||
<classpathentry kind="src" path="/org.eclipse.cdt.ui"/>
|
||||
<classpathentry kind="src" path="/org.eclipse.swt"/>
|
||||
<classpathentry kind="src" path="/org.eclipse.ui"/>
|
||||
<classpathentry kind="src" path="/org.junit"/>
|
||||
<classpathentry kind="var" path="JRE_LIB" rootpath="JRE_SRCROOT" sourcepath="JRE_SRC"/>
|
||||
<classpathentry kind="src" path="/org.apache.xerces"/>
|
||||
<classpathentry kind="src" path="/org.eclipse.update.core"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
|
|
|
@ -5,12 +5,17 @@
|
|||
<projects>
|
||||
<project>org.apache.xerces</project>
|
||||
<project>org.eclipse.cdt.core</project>
|
||||
<project>org.eclipse.cdt.core.linux</project>
|
||||
<project>org.eclipse.cdt.core.qnx</project>
|
||||
<project>org.eclipse.cdt.core.solaris</project>
|
||||
<project>org.eclipse.cdt.core.win32</project>
|
||||
<project>org.eclipse.cdt.ui</project>
|
||||
<project>org.eclipse.core.boot</project>
|
||||
<project>org.eclipse.core.resources</project>
|
||||
<project>org.eclipse.core.runtime</project>
|
||||
<project>org.eclipse.swt</project>
|
||||
<project>org.eclipse.ui</project>
|
||||
<project>org.eclipse.update.core</project>
|
||||
<project>org.junit</project>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
|
|
|
@ -0,0 +1,56 @@
|
|||
/**********************************************************************
|
||||
* Copyright (c) 2003 IBM Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Common Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/cpl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* IBM - Initial API and implementation
|
||||
**********************************************************************/
|
||||
package org.eclipse.cdt.core.build.managed.tests;
|
||||
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestCase;
|
||||
import junit.framework.TestSuite;
|
||||
|
||||
import org.eclipse.cdt.core.build.managed.ITarget;
|
||||
import org.eclipse.cdt.core.build.managed.ITool;
|
||||
import org.eclipse.cdt.core.build.managed.ManagedBuildManager;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class AllBuildTests extends TestCase {
|
||||
|
||||
public AllBuildTests(String name) {
|
||||
super(name);
|
||||
}
|
||||
|
||||
public static Test suite() {
|
||||
TestSuite suite = new TestSuite();
|
||||
|
||||
suite.addTest(new AllBuildTests("testExtensions"));
|
||||
|
||||
return suite;
|
||||
}
|
||||
|
||||
public void testThatAlwaysFails() {
|
||||
assertTrue(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Navigates through the build info as defined in the extensions
|
||||
* defined in this plugin
|
||||
*/
|
||||
public void testExtensions() {
|
||||
// Note secret null parameter which means just extensions
|
||||
ITarget[] targets = ManagedBuildManager.getAvailableTargets(null);
|
||||
|
||||
ITarget target = targets[0];
|
||||
assertEquals(target.getName(), "Linux");
|
||||
ITool[] tools = target.getTools();
|
||||
ITool tool = tools[0];
|
||||
assertEquals(tool.getName(), "Compiler");
|
||||
}
|
||||
}
|
|
@ -24,4 +24,65 @@
|
|||
</requires>
|
||||
|
||||
|
||||
<extension
|
||||
id="buildTest"
|
||||
name="Tools for Build Test"
|
||||
point="org.eclipse.cdt.core.ManagedBuildInfo">
|
||||
<target
|
||||
name="Linux"
|
||||
isAbstract="true"
|
||||
id="linux">
|
||||
<tool
|
||||
name="Compiler"
|
||||
id="linux.compiler">
|
||||
<optionCategory
|
||||
name="Optimization Options"
|
||||
id="linux.compiler.optimization">
|
||||
</optionCategory>
|
||||
<option
|
||||
name="Compiler Flags"
|
||||
type="string"
|
||||
id="linux.compiler.flags">
|
||||
</option>
|
||||
<option
|
||||
default="-O"
|
||||
name="Optimization Flags"
|
||||
type="string"
|
||||
category="linux.compiler.optimization"
|
||||
id="linux.compiler.optimizationFlags">
|
||||
</option>
|
||||
</tool>
|
||||
</target>
|
||||
<target
|
||||
name="Linux Executable"
|
||||
parent="linux"
|
||||
isAbstract="false"
|
||||
id="linux.exec">
|
||||
<tool
|
||||
name="Linker"
|
||||
id="org.eclipse.cdt.ui.tests.tool.linux.link">
|
||||
</tool>
|
||||
</target>
|
||||
<target
|
||||
name="Linux Shared Library"
|
||||
parent="linux"
|
||||
isAbstract="false"
|
||||
id="linux.so">
|
||||
<tool
|
||||
name="Linker"
|
||||
id="org.eclipse.cdt.ui.tests.tool.linux.solink">
|
||||
</tool>
|
||||
</target>
|
||||
<target
|
||||
name="Linux Static Library"
|
||||
parent="linux"
|
||||
isAbstract="false"
|
||||
id="linux.lib">
|
||||
<tool
|
||||
name="Archiver"
|
||||
id="org.eclipse.cdt.ui.tests.tool.linux.ar">
|
||||
</tool>
|
||||
</target>
|
||||
</extension>
|
||||
|
||||
</plugin>
|
||||
|
|
Loading…
Add table
Reference in a new issue