mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 22:52:11 +02:00
Patch for Sean Evoy:
- I have removed the binary parser selection from the new managed project wizard and hard-coded the proper parser ID in the plugin spec for the build model. There is an updated JUnit test that verifies this change to the build model. - There is also a fix for the library problem on *nix. The makefile pattern was also changed slightly to better capture the dependencies between the build target and the outputs of other managed projects.
This commit is contained in:
parent
e1ef9ffd9f
commit
0abb42e093
15 changed files with 251 additions and 118 deletions
|
@ -1,3 +1,20 @@
|
||||||
|
2003-09-19 Sean Evoy
|
||||||
|
Added a new field to the target specification in the build model to
|
||||||
|
hard-code the binary parser for project creation. There is a new getter
|
||||||
|
method in the interface and the implementor contains additional code to
|
||||||
|
extract the information from a project file or plugin manifest. The
|
||||||
|
interface also contains new strings to make changing the specification
|
||||||
|
easier in the future.
|
||||||
|
* schema/ManagedBuildTools.exsd
|
||||||
|
* src/org/eclipse/cdt/managedbuilder/core/ITarget.java
|
||||||
|
* src/org/eclipse/cdt/managedbuilder/internal/core/Target.java
|
||||||
|
|
||||||
|
Fix for bug 41720: libraries are now found for Solaris and Linux
|
||||||
|
executables. The problem was the executable had no extension and
|
||||||
|
the client of the build model passed null instead of the empty string.
|
||||||
|
* src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java
|
||||||
|
* src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java
|
||||||
|
|
||||||
2003-09-16 Sean Evoy
|
2003-09-16 Sean Evoy
|
||||||
Patch contains a fix for bug 43017. Renamed the "addDeps" method to a
|
Patch contains a fix for bug 43017. Renamed the "addDeps" method to a
|
||||||
more descriptive "addSourceDependencies". Added a flag when the
|
more descriptive "addSourceDependencies". Added a flag when the
|
||||||
|
|
|
@ -387,6 +387,13 @@ Two additional types exist to flag options of special relevance to the build mod
|
||||||
</documentation>
|
</documentation>
|
||||||
</annotation>
|
</annotation>
|
||||||
</attribute>
|
</attribute>
|
||||||
|
<attribute name="binaryParser" type="string" use="required">
|
||||||
|
<annotation>
|
||||||
|
<documentation>
|
||||||
|
Set this to the ID of the binary parser for the output format of your target. Currently there are only 2 choices: org.eclipse.cdt.core.ELF for *nix targets, and "org.eclipse.cdt.core.PE" for targets that build for Windows, like Cygwin.
|
||||||
|
</documentation>
|
||||||
|
</annotation>
|
||||||
|
</attribute>
|
||||||
</complexType>
|
</complexType>
|
||||||
</element>
|
</element>
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,15 @@ import org.eclipse.core.resources.IResource;
|
||||||
*/
|
*/
|
||||||
public interface ITarget extends IBuildObject {
|
public interface ITarget extends IBuildObject {
|
||||||
public static final String TARGET_ELEMENT_NAME = "target"; //$NON-NLS-1$
|
public static final String TARGET_ELEMENT_NAME = "target"; //$NON-NLS-1$
|
||||||
|
public static final String ARTIFACT_NAME = "artifactName"; //$NON-NLS-1$
|
||||||
|
public static final String BINARY_PARSER = "binaryParser"; //$NON-NLS-1$
|
||||||
|
public static final String CLEAN_COMMAND = "cleanCommand"; //$NON-NLS-1$
|
||||||
|
public static final String DEFAULT_EXTENSION = "defaultExtension"; //$NON-NLS-1$
|
||||||
|
public static final String IS_ABSTRACT = "isAbstract"; //$NON-NLS-1$
|
||||||
|
public static final String IS_TEST = "isTest"; //$NON-NLS-1$
|
||||||
|
public static final String MAKE_COMMAND = "makeCommand"; //$NON-NLS-1$
|
||||||
|
public static final String PARENT = "parent"; //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a configuration for the target populated with the tools and
|
* Creates a configuration for the target populated with the tools and
|
||||||
* options settings from the parent configuration. As options and tools
|
* options settings from the parent configuration. As options and tools
|
||||||
|
@ -47,6 +55,13 @@ public interface ITarget extends IBuildObject {
|
||||||
*/
|
*/
|
||||||
public String getArtifactName();
|
public String getArtifactName();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Answers the unique ID of the binary parser associated with the target.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String getBinaryParserId();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Answers the OS-specific command to remove files created by the build
|
* Answers the OS-specific command to remove files created by the build
|
||||||
*
|
*
|
||||||
|
|
|
@ -18,19 +18,17 @@ import java.util.Enumeration;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
import java.util.StringTokenizer;
|
|
||||||
|
|
||||||
import org.eclipse.cdt.core.CCorePlugin;
|
import org.eclipse.cdt.core.CCorePlugin;
|
||||||
import org.eclipse.cdt.core.CommandLauncher;
|
import org.eclipse.cdt.core.CommandLauncher;
|
||||||
import org.eclipse.cdt.core.ConsoleOutputStream;
|
import org.eclipse.cdt.core.ConsoleOutputStream;
|
||||||
import org.eclipse.cdt.core.ErrorParserManager;
|
import org.eclipse.cdt.core.ErrorParserManager;
|
||||||
import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo;
|
|
||||||
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
|
|
||||||
import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin;
|
|
||||||
import org.eclipse.cdt.core.model.ICModelMarker;
|
import org.eclipse.cdt.core.model.ICModelMarker;
|
||||||
import org.eclipse.cdt.core.resources.ACBuilder;
|
import org.eclipse.cdt.core.resources.ACBuilder;
|
||||||
import org.eclipse.cdt.core.resources.IConsole;
|
import org.eclipse.cdt.core.resources.IConsole;
|
||||||
import org.eclipse.cdt.core.resources.MakeUtil;
|
import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo;
|
||||||
|
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
|
||||||
|
import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin;
|
||||||
import org.eclipse.core.resources.IMarker;
|
import org.eclipse.core.resources.IMarker;
|
||||||
import org.eclipse.core.resources.IProject;
|
import org.eclipse.core.resources.IProject;
|
||||||
import org.eclipse.core.resources.IResource;
|
import org.eclipse.core.resources.IResource;
|
||||||
|
@ -208,18 +206,7 @@ public class GeneratedMakefileBuilder extends ACBuilder {
|
||||||
if (fullBuild) {
|
if (fullBuild) {
|
||||||
args.add("clean");
|
args.add("clean");
|
||||||
}
|
}
|
||||||
// Add each target
|
args.add("all");
|
||||||
String sessionTarget = MakeUtil.getSessionTarget(getProject());
|
|
||||||
StringTokenizer tokens = new StringTokenizer(sessionTarget);
|
|
||||||
while (tokens.hasMoreTokens()) {
|
|
||||||
String target = tokens.nextToken().trim();
|
|
||||||
if (!args.contains(target)) {
|
|
||||||
args.add(target);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (args.isEmpty() || !args.contains("all")) {
|
|
||||||
args.add("all");
|
|
||||||
}
|
|
||||||
return (String[])args.toArray(new String[args.size()]);
|
return (String[])args.toArray(new String[args.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -233,7 +220,10 @@ public class GeneratedMakefileBuilder extends ACBuilder {
|
||||||
return resourcesToBuild;
|
return resourcesToBuild;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* (non-javadoc)
|
||||||
|
* Answers the list of build rules that have been assembled. If there are none,
|
||||||
|
* answers an empty list, never <code>null</code>
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
protected List getRuleList() {
|
protected List getRuleList() {
|
||||||
|
@ -248,9 +238,7 @@ public class GeneratedMakefileBuilder extends ACBuilder {
|
||||||
*/
|
*/
|
||||||
public IPath getWorkingDirectory() {
|
public IPath getWorkingDirectory() {
|
||||||
IProject currProject = getProject();
|
IProject currProject = getProject();
|
||||||
IPath workingDirectory = new Path(MakeUtil.getSessionBuildDir((IResource) currProject));
|
IPath workingDirectory = currProject.getLocation();
|
||||||
if (workingDirectory.isEmpty())
|
|
||||||
workingDirectory = currProject.getLocation();
|
|
||||||
return workingDirectory;
|
return workingDirectory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -80,6 +80,9 @@ public class MakefileGenerator {
|
||||||
protected IPath topBuildDir;
|
protected IPath topBuildDir;
|
||||||
protected boolean shouldRunBuild;
|
protected boolean shouldRunBuild;
|
||||||
|
|
||||||
|
private String target;
|
||||||
|
|
||||||
|
private String extension;
|
||||||
/**
|
/**
|
||||||
* This class is used to recursively walk the project and determine which
|
* This class is used to recursively walk the project and determine which
|
||||||
* modules contribute buildable source files.
|
* modules contribute buildable source files.
|
||||||
|
@ -211,6 +214,13 @@ public class MakefileGenerator {
|
||||||
this.info = info;
|
this.info = info;
|
||||||
// By default a build never runs
|
// By default a build never runs
|
||||||
shouldRunBuild = false;
|
shouldRunBuild = false;
|
||||||
|
// Get the name of the build target
|
||||||
|
target = info.getBuildArtifactName();
|
||||||
|
// Get its extension
|
||||||
|
extension = (new Path(target)).getFileExtension();
|
||||||
|
if (extension == null) {
|
||||||
|
extension = new String();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-javadoc)
|
/* (non-javadoc)
|
||||||
|
@ -289,12 +299,22 @@ public class MakefileGenerator {
|
||||||
|
|
||||||
buffer.append(ManagedBuilderCorePlugin.getResourceString(SRC_LISTS) + NEWLINE);
|
buffer.append(ManagedBuilderCorePlugin.getResourceString(SRC_LISTS) + NEWLINE);
|
||||||
buffer.append("C_SRCS := " + NEWLINE);
|
buffer.append("C_SRCS := " + NEWLINE);
|
||||||
buffer.append("CC_SRCS := " + NEWLINE + NEWLINE);
|
buffer.append("CC_SRCS := " + NEWLINE);
|
||||||
|
buffer.append("CXX_SRCS := " + NEWLINE);
|
||||||
|
buffer.append("CAPC_SRCS := " + NEWLINE);
|
||||||
|
buffer.append("CPP_SRCS := " + NEWLINE + NEWLINE);
|
||||||
|
|
||||||
// Add the libraries this project depends on
|
// Add the libraries this project depends on
|
||||||
buffer.append("LIBS := ");
|
buffer.append("LIBS := ");
|
||||||
|
String[] libs = info.getLibsForTarget(extension);
|
||||||
|
for (int i = 0; i < libs.length; i++) {
|
||||||
|
String string = libs[i];
|
||||||
|
buffer.append(LINEBREAK + NEWLINE + string);
|
||||||
|
}
|
||||||
buffer.append(NEWLINE + NEWLINE);
|
buffer.append(NEWLINE + NEWLINE);
|
||||||
return buffer;
|
|
||||||
|
buffer.append("OBJS = $(C_SRCS:$(ROOT)/%.c=%.o) $(CC_SRCS:$(ROOT)/%.cc=%.o) $(CXX_SRCS:$(ROOT)/%.cxx=%.o) $(CAPC_SRCS:$(ROOT)/%.C=%.o) $(CPP_SRCS:$(ROOT)/%.cpp=%.o)" + NEWLINE);
|
||||||
|
return (buffer.append(NEWLINE));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-javadoc)
|
/* (non-javadoc)
|
||||||
|
@ -347,6 +367,12 @@ public class MakefileGenerator {
|
||||||
cBuffer.append("${addprefix $(ROOT)/" + relativePath + "," + LINEBREAK + NEWLINE);
|
cBuffer.append("${addprefix $(ROOT)/" + relativePath + "," + LINEBREAK + NEWLINE);
|
||||||
StringBuffer ccBuffer = new StringBuffer("CC_SRCS += \\" + NEWLINE);
|
StringBuffer ccBuffer = new StringBuffer("CC_SRCS += \\" + NEWLINE);
|
||||||
ccBuffer.append("${addprefix $(ROOT)/" + relativePath + "," + LINEBREAK + NEWLINE);
|
ccBuffer.append("${addprefix $(ROOT)/" + relativePath + "," + LINEBREAK + NEWLINE);
|
||||||
|
StringBuffer cxxBuffer = new StringBuffer("CXX_SRCS += \\" + NEWLINE);
|
||||||
|
cxxBuffer.append("${addprefix $(ROOT)/" + relativePath + "," + LINEBREAK + NEWLINE);
|
||||||
|
StringBuffer capcBuffer = new StringBuffer("CAPC_SRCS += \\" + NEWLINE);
|
||||||
|
capcBuffer.append("${addprefix $(ROOT)/" + relativePath + "," + LINEBREAK + NEWLINE);
|
||||||
|
StringBuffer cppBuffer = new StringBuffer("CPP_SRCS += \\" + NEWLINE);
|
||||||
|
cppBuffer.append("${addprefix $(ROOT)/" + relativePath + "," + LINEBREAK + NEWLINE);
|
||||||
StringBuffer ruleBuffer = new StringBuffer(ManagedBuilderCorePlugin.getResourceString(MOD_RULES) + NEWLINE);
|
StringBuffer ruleBuffer = new StringBuffer(ManagedBuilderCorePlugin.getResourceString(MOD_RULES) + NEWLINE);
|
||||||
|
|
||||||
// Put the comment in
|
// Put the comment in
|
||||||
|
@ -359,8 +385,18 @@ public class MakefileGenerator {
|
||||||
if (resource.getType() == IResource.FILE) {
|
if (resource.getType() == IResource.FILE) {
|
||||||
String ext = resource.getFileExtension();
|
String ext = resource.getFileExtension();
|
||||||
if (info.buildsFileType(ext)) {
|
if (info.buildsFileType(ext)) {
|
||||||
// TODO use build model to determine what list the file goes in
|
if (new String("c").equals(ext)) {
|
||||||
ccBuffer.append(resource.getName() + WHITESPACE + LINEBREAK + NEWLINE);
|
cBuffer.append(resource.getName() + WHITESPACE + LINEBREAK + NEWLINE);
|
||||||
|
} else if (new String("cc").equalsIgnoreCase(ext)) {
|
||||||
|
ccBuffer.append(resource.getName() + WHITESPACE + LINEBREAK + NEWLINE);
|
||||||
|
} else if (new String("cxx").equalsIgnoreCase(ext)) {
|
||||||
|
cxxBuffer.append(resource.getName() + WHITESPACE + LINEBREAK + NEWLINE);
|
||||||
|
} else if (new String("C").equals(ext)) {
|
||||||
|
capcBuffer.append(resource.getName() + WHITESPACE + LINEBREAK + NEWLINE);
|
||||||
|
} else {
|
||||||
|
cppBuffer.append(resource.getName() + WHITESPACE + LINEBREAK + NEWLINE);
|
||||||
|
}
|
||||||
|
|
||||||
// Try to add the rule for the file
|
// Try to add the rule for the file
|
||||||
addRule(relativePath, ruleBuffer, resource);
|
addRule(relativePath, ruleBuffer, resource);
|
||||||
}
|
}
|
||||||
|
@ -368,12 +404,13 @@ public class MakefileGenerator {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Finish the commands in the buffers
|
// Finish the commands in the buffers
|
||||||
cBuffer.append("}" + NEWLINE + NEWLINE);
|
buffer.append(cBuffer.append("}" + NEWLINE + NEWLINE));
|
||||||
ccBuffer.append("}" + NEWLINE + NEWLINE);
|
buffer.append(ccBuffer.append("}" + NEWLINE + NEWLINE));
|
||||||
|
buffer.append(cxxBuffer.append("}" + NEWLINE + NEWLINE));
|
||||||
|
buffer.append(capcBuffer.append("}" + NEWLINE + NEWLINE));
|
||||||
|
buffer.append(cppBuffer.append("}" + NEWLINE + NEWLINE));
|
||||||
|
|
||||||
// Append them all together
|
return buffer.append(ruleBuffer + NEWLINE);
|
||||||
buffer.append(cBuffer).append(ccBuffer).append(ruleBuffer);
|
|
||||||
return buffer;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-javadoc)
|
/* (non-javadoc)
|
||||||
|
@ -383,65 +420,77 @@ public class MakefileGenerator {
|
||||||
protected StringBuffer addTargets(boolean rebuild) {
|
protected StringBuffer addTargets(boolean rebuild) {
|
||||||
StringBuffer buffer = new StringBuffer();
|
StringBuffer buffer = new StringBuffer();
|
||||||
|
|
||||||
// Get the target and it's extension
|
// Assemble the information needed to generate the targets
|
||||||
String target = info.getBuildArtifactName();
|
|
||||||
IPath temp = new Path(target);
|
|
||||||
String extension = temp.getFileExtension();
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Write out the target rule as:
|
|
||||||
* <prefix><target>.<extension>: $(CC_SRCS:$(ROOT)/%.cpp=%.o) $(C_SRCS:$(ROOT)/%.c=%.o)
|
|
||||||
* <cd <Proj_Dep_1/build_dir>; $(MAKE) all>
|
|
||||||
* <cd <Proj_Dep_.../build_dir>; $(MAKE) all>
|
|
||||||
* <cd <Proj_Dep_n/build_dir>; $(MAKE) all>
|
|
||||||
* $(BUILD_TOOL) $(FLAGS) $(OUTPUT_FLAG) $@ $^ $(LIB_DEPS)
|
|
||||||
*/
|
|
||||||
String cmd = info.getToolForTarget(extension);
|
String cmd = info.getToolForTarget(extension);
|
||||||
String flags = info.getFlagsForTarget(extension);
|
String flags = info.getFlagsForTarget(extension);
|
||||||
String outflag = info.getOutputFlag(extension);
|
String outflag = info.getOutputFlag(extension);
|
||||||
String outputPrefix = info.getOutputPrefix(extension);
|
String outputPrefix = info.getOutputPrefix(extension);
|
||||||
String targets = rebuild ? "clean all" : "all";
|
String targets = rebuild ? "clean all" : "all";
|
||||||
buffer.append(outputPrefix + target + COLON + WHITESPACE + "$(CC_SRCS:$(ROOT)/%.cpp=%.o) $(C_SRCS:$(ROOT)/%.c=%.o)" + NEWLINE);
|
|
||||||
IProject[] deps;
|
// Get all the projects the build target depends on
|
||||||
|
IProject[] deps = null;
|
||||||
try {
|
try {
|
||||||
deps = project.getReferencedProjects();
|
deps = project.getReferencedProjects();
|
||||||
for (int i = 0; i < deps.length; i++) {
|
|
||||||
IProject dep = deps[i];
|
|
||||||
String buildDir = dep.getLocation().toString();
|
|
||||||
if (ManagedBuildManager.manages(dep)) {
|
|
||||||
IManagedBuildInfo depInfo = ManagedBuildManager.getBuildInfo(dep);
|
|
||||||
buildDir += SEPARATOR + depInfo.getConfigurationName();
|
|
||||||
}
|
|
||||||
buffer.append(TAB + "cd" + WHITESPACE + buildDir + SEMI_COLON + WHITESPACE + "$(MAKE) " + targets + NEWLINE);
|
|
||||||
}
|
|
||||||
} catch (CoreException e) {
|
} catch (CoreException e) {
|
||||||
// There are 2 exceptions; the project does not exist or it is not open
|
// There are 2 exceptions; the project does not exist or it is not open
|
||||||
// and neither conditions apply if we are building for it ....
|
// and neither conditions apply if we are building for it ....
|
||||||
}
|
}
|
||||||
|
|
||||||
buffer.append(TAB + cmd + WHITESPACE + flags + WHITESPACE + outflag + WHITESPACE + "$@" + WHITESPACE + "$^");
|
// Write out the all target first in case someone just runs make
|
||||||
String[] libraries = info.getLibsForTarget(extension);
|
buffer.append("all: deps" + WHITESPACE + outputPrefix + target + NEWLINE);
|
||||||
for (int i = 0; i < libraries.length; i++) {
|
|
||||||
String lib = libraries[i];
|
|
||||||
buffer.append(WHITESPACE + lib);
|
|
||||||
}
|
|
||||||
buffer.append(NEWLINE);
|
|
||||||
buffer.append(NEWLINE);
|
buffer.append(NEWLINE);
|
||||||
|
|
||||||
// We only have one target, 'all'
|
/*
|
||||||
buffer.append("all: " + outputPrefix + target + NEWLINE);
|
* The build target may depend on other projects in the workspace. These are
|
||||||
|
* captured in the deps target:
|
||||||
|
* deps:
|
||||||
|
* <cd <Proj_Dep_1/build_dir>; $(MAKE) [clean all | all]>
|
||||||
|
*/
|
||||||
|
List managedProjectOutputs = new ArrayList();
|
||||||
|
buffer.append("deps:" + NEWLINE);
|
||||||
|
if (deps != null) {
|
||||||
|
for (int i = 0; i < deps.length; i++) {
|
||||||
|
IProject dep = deps[i];
|
||||||
|
String buildDir = dep.getLocation().toString();
|
||||||
|
if (ManagedBuildManager.manages(dep)) {
|
||||||
|
// Add the current configuration to the makefile path
|
||||||
|
IManagedBuildInfo depInfo = ManagedBuildManager.getBuildInfo(dep);
|
||||||
|
buildDir += SEPARATOR + depInfo.getConfigurationName();
|
||||||
|
|
||||||
|
// Extract the build artifact to add to the dependency list
|
||||||
|
String depTarget = depInfo.getBuildArtifactName();
|
||||||
|
String depExt = (new Path(depTarget)).getFileExtension();
|
||||||
|
String depPrefix = depInfo.getOutputPrefix(depExt);
|
||||||
|
managedProjectOutputs.add(buildDir + SEPARATOR + depPrefix + depTarget);
|
||||||
|
}
|
||||||
|
buffer.append(TAB + "cd" + WHITESPACE + buildDir + SEMI_COLON + WHITESPACE + "$(MAKE) " + targets + NEWLINE);
|
||||||
|
}
|
||||||
|
}
|
||||||
buffer.append(NEWLINE);
|
buffer.append(NEWLINE);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Write out the target rule as:
|
||||||
|
* <prefix><target>.<extension>: $(OBJS) [<dep_proj_1_output> ... <dep_proj_n_output>]
|
||||||
|
* $(BUILD_TOOL) $(FLAGS) $(OUTPUT_FLAG) $@ $^ $(LIB_DEPS)
|
||||||
|
*/
|
||||||
|
//
|
||||||
|
buffer.append(outputPrefix + target + COLON + WHITESPACE + "$(OBJS)");
|
||||||
|
Iterator iter = managedProjectOutputs.listIterator();
|
||||||
|
while (iter.hasNext()) {
|
||||||
|
buffer.append(WHITESPACE + (String)iter.next());
|
||||||
|
}
|
||||||
|
buffer.append(NEWLINE);
|
||||||
|
buffer.append(TAB + cmd + WHITESPACE + flags + WHITESPACE + outflag + WHITESPACE + "$@" + WHITESPACE + "$(OBJS) $(LIBS)");
|
||||||
|
buffer.append(NEWLINE + NEWLINE);
|
||||||
|
|
||||||
// Always add a clean target
|
// Always add a clean target
|
||||||
buffer.append(".PHONY: clean" + NEWLINE);
|
|
||||||
buffer.append("clean:" + NEWLINE);
|
buffer.append("clean:" + NEWLINE);
|
||||||
buffer.append(TAB + "$(RM)" + WHITESPACE + "${addprefix ., $(CC_SRCS:$(ROOT)%.cpp=%.o)} ${addprefix ., $(C_SRCS:$(ROOT)%.c=%.o)}" + WHITESPACE + outputPrefix + target + NEWLINE);
|
buffer.append(TAB + "$(RM)" + WHITESPACE + "$(OBJS)" + WHITESPACE + outputPrefix + target + NEWLINE + NEWLINE);
|
||||||
buffer.append(NEWLINE);
|
|
||||||
|
|
||||||
buffer.append(NEWLINE + ManagedBuilderCorePlugin.getResourceString(DEP_INCL) + NEWLINE);
|
buffer.append(".PHONY: all clean deps" + NEWLINE + NEWLINE);
|
||||||
|
|
||||||
|
buffer.append(ManagedBuilderCorePlugin.getResourceString(DEP_INCL) + NEWLINE);
|
||||||
buffer.append("include ${patsubst %, %/module.dep, $(MODULES)}" + NEWLINE);
|
buffer.append("include ${patsubst %, %/module.dep, $(MODULES)}" + NEWLINE);
|
||||||
|
|
||||||
buffer.append(NEWLINE);
|
|
||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,7 @@ import org.w3c.dom.Node;
|
||||||
public class Target extends BuildObject implements ITarget {
|
public class Target extends BuildObject implements ITarget {
|
||||||
|
|
||||||
private String artifactName;
|
private String artifactName;
|
||||||
|
private String binaryParserId;
|
||||||
private String cleanCommand;
|
private String cleanCommand;
|
||||||
private Map configMap;
|
private Map configMap;
|
||||||
private List configurations;
|
private List configurations;
|
||||||
|
@ -66,6 +67,7 @@ public class Target extends BuildObject implements ITarget {
|
||||||
setId(parent.getId() + ".1");
|
setId(parent.getId() + ".1");
|
||||||
setName(parent.getName());
|
setName(parent.getName());
|
||||||
this.artifactName = parent.getArtifactName();
|
this.artifactName = parent.getArtifactName();
|
||||||
|
this.binaryParserId = parent.getBinaryParserId();
|
||||||
this.defaultExtension = parent.getDefaultExtension();
|
this.defaultExtension = parent.getDefaultExtension();
|
||||||
this.isTest = parent.isTestTarget();
|
this.isTest = parent.isTestTarget();
|
||||||
this.cleanCommand = parent.getCleanCommand();
|
this.cleanCommand = parent.getCleanCommand();
|
||||||
|
@ -83,23 +85,26 @@ public class Target extends BuildObject implements ITarget {
|
||||||
*/
|
*/
|
||||||
public Target(IConfigurationElement element) {
|
public Target(IConfigurationElement element) {
|
||||||
// id
|
// id
|
||||||
setId(element.getAttribute("id"));
|
setId(element.getAttribute(ID));
|
||||||
|
|
||||||
// hook me up
|
// hook me up
|
||||||
ManagedBuildManager.addExtensionTarget(this);
|
ManagedBuildManager.addExtensionTarget(this);
|
||||||
|
|
||||||
// Get the target name
|
// Get the target name
|
||||||
setName(element.getAttribute("name"));
|
setName(element.getAttribute(NAME));
|
||||||
|
|
||||||
// Get the name of the build artifact associated with target (usually
|
// Get the name of the build artifact associated with target (usually
|
||||||
// in the plugin specification).
|
// in the plugin specification).
|
||||||
artifactName = element.getAttribute("artifactName");
|
artifactName = element.getAttribute(ARTIFACT_NAME);
|
||||||
|
|
||||||
|
// Get the ID of the binary parser
|
||||||
|
binaryParserId = element.getAttribute(BINARY_PARSER);
|
||||||
|
|
||||||
// Get the default extension
|
// Get the default extension
|
||||||
defaultExtension = element.getAttribute("defaultExtension");
|
defaultExtension = element.getAttribute(DEFAULT_EXTENSION);
|
||||||
|
|
||||||
// parent
|
// parent
|
||||||
String parentId = element.getAttribute("parent");
|
String parentId = element.getAttribute(PARENT);
|
||||||
if (parentId != null) {
|
if (parentId != null) {
|
||||||
parent = ManagedBuildManager.getTarget(null, parentId);
|
parent = ManagedBuildManager.getTarget(null, parentId);
|
||||||
// copy over the parents configs
|
// copy over the parents configs
|
||||||
|
@ -109,21 +114,21 @@ public class Target extends BuildObject implements ITarget {
|
||||||
}
|
}
|
||||||
|
|
||||||
// isAbstract
|
// isAbstract
|
||||||
if ("true".equals(element.getAttribute("isAbstract")))
|
if ("true".equals(element.getAttribute(IS_ABSTRACT)))
|
||||||
isAbstract = true;
|
isAbstract = true;
|
||||||
|
|
||||||
// Is this a test target
|
// Is this a test target
|
||||||
isTest = ("true".equals(element.getAttribute("isTest")));
|
isTest = ("true".equals(element.getAttribute(IS_TEST)));
|
||||||
|
|
||||||
// Get the clean command
|
// Get the clean command
|
||||||
cleanCommand = element.getAttribute("cleanCommand");
|
cleanCommand = element.getAttribute(CLEAN_COMMAND);
|
||||||
if (cleanCommand == null) {
|
if (cleanCommand == null) {
|
||||||
// See if it defined in the parent
|
// See if it defined in the parent
|
||||||
cleanCommand = parent.getCleanCommand();
|
cleanCommand = parent.getCleanCommand();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the make command
|
// Get the make command
|
||||||
makeCommand = element.getAttribute("makeCommand");
|
makeCommand = element.getAttribute(MAKE_COMMAND);
|
||||||
if (makeCommand == null) {
|
if (makeCommand == null) {
|
||||||
// See if it defined in the parent
|
// See if it defined in the parent
|
||||||
makeCommand = parent.getMakeCommand();
|
makeCommand = parent.getMakeCommand();
|
||||||
|
@ -151,38 +156,41 @@ public class Target extends BuildObject implements ITarget {
|
||||||
this(buildInfo.getOwner());
|
this(buildInfo.getOwner());
|
||||||
|
|
||||||
// id
|
// id
|
||||||
setId(element.getAttribute("id"));
|
setId(element.getAttribute(ID));
|
||||||
|
|
||||||
// hook me up
|
// hook me up
|
||||||
buildInfo.addTarget(this);
|
buildInfo.addTarget(this);
|
||||||
|
|
||||||
// name
|
// name
|
||||||
setName(element.getAttribute("name"));
|
setName(element.getAttribute(NAME));
|
||||||
|
|
||||||
// Get the name of the build artifact associated with target (should
|
// Get the name of the build artifact associated with target (should
|
||||||
// contain what the user entered in the UI).
|
// contain what the user entered in the UI).
|
||||||
artifactName = element.getAttribute("artifactName");
|
artifactName = element.getAttribute(ARTIFACT_NAME);
|
||||||
|
|
||||||
|
// Get the ID of the binary parser
|
||||||
|
binaryParserId = element.getAttribute(BINARY_PARSER);
|
||||||
|
|
||||||
// Get the default extension
|
// Get the default extension
|
||||||
defaultExtension = element.getAttribute("defaultExtension");
|
defaultExtension = element.getAttribute(DEFAULT_EXTENSION);
|
||||||
|
|
||||||
// parent
|
// parent
|
||||||
String parentId = element.getAttribute("parent");
|
String parentId = element.getAttribute(PARENT);
|
||||||
if (parentId != null)
|
if (parentId != null)
|
||||||
parent = ManagedBuildManager.getTarget(null, parentId);
|
parent = ManagedBuildManager.getTarget(null, parentId);
|
||||||
|
|
||||||
// isAbstract
|
// isAbstract
|
||||||
if ("true".equals(element.getAttribute("isAbstract")))
|
if ("true".equals(element.getAttribute(IS_ABSTRACT)))
|
||||||
isAbstract = true;
|
isAbstract = true;
|
||||||
|
|
||||||
// Is this a test target
|
// Is this a test target
|
||||||
isTest = ("true".equals(element.getAttribute("isTest")));
|
isTest = ("true".equals(element.getAttribute(IS_TEST)));
|
||||||
|
|
||||||
// Get the clean command
|
// Get the clean command
|
||||||
cleanCommand = element.getAttribute("cleanCommand");
|
cleanCommand = element.getAttribute(CLEAN_COMMAND);
|
||||||
|
|
||||||
// Get the make command
|
// Get the make command
|
||||||
makeCommand = element.getAttribute("makeCommand");
|
makeCommand = element.getAttribute(MAKE_COMMAND);
|
||||||
|
|
||||||
Node child = element.getFirstChild();
|
Node child = element.getFirstChild();
|
||||||
while (child != null) {
|
while (child != null) {
|
||||||
|
@ -200,21 +208,22 @@ public class Target extends BuildObject implements ITarget {
|
||||||
* @param element
|
* @param element
|
||||||
*/
|
*/
|
||||||
public void serialize(Document doc, Element element) {
|
public void serialize(Document doc, Element element) {
|
||||||
element.setAttribute("id", getId());
|
element.setAttribute(ID, getId());
|
||||||
element.setAttribute("name", getName());
|
element.setAttribute(NAME, getName());
|
||||||
if (parent != null)
|
if (parent != null)
|
||||||
element.setAttribute("parent", parent.getId());
|
element.setAttribute(PARENT, parent.getId());
|
||||||
element.setAttribute("isAbstract", isAbstract ? "true" : "false");
|
element.setAttribute(IS_ABSTRACT, isAbstract ? "true" : "false");
|
||||||
element.setAttribute("artifactName", getArtifactName());
|
element.setAttribute(ARTIFACT_NAME, getArtifactName());
|
||||||
element.setAttribute("defaultExtension", getDefaultExtension());
|
element.setAttribute(BINARY_PARSER, getBinaryParserId());
|
||||||
element.setAttribute("isTest", isTest ? "true" : "false");
|
element.setAttribute(DEFAULT_EXTENSION, getDefaultExtension());
|
||||||
element.setAttribute("cleanCommand", getCleanCommand());
|
element.setAttribute(IS_TEST, isTest ? "true" : "false");
|
||||||
element.setAttribute("makeCommand", getMakeCommand());
|
element.setAttribute(CLEAN_COMMAND, getCleanCommand());
|
||||||
|
element.setAttribute(MAKE_COMMAND, getMakeCommand());
|
||||||
|
|
||||||
if (configurations != null)
|
if (configurations != null)
|
||||||
for (int i = 0; i < configurations.size(); ++i) {
|
for (int i = 0; i < configurations.size(); ++i) {
|
||||||
Configuration config = (Configuration)configurations.get(i);
|
Configuration config = (Configuration)configurations.get(i);
|
||||||
Element configElement = doc.createElement("configuration");
|
Element configElement = doc.createElement(IConfiguration.CONFIGURATION_ELEMENT_NAME);
|
||||||
element.appendChild(configElement);
|
element.appendChild(configElement);
|
||||||
config.serialize(doc, configElement);
|
config.serialize(doc, configElement);
|
||||||
}
|
}
|
||||||
|
@ -317,6 +326,13 @@ public class Target extends BuildObject implements ITarget {
|
||||||
return artifactName == null ? EMPTY_STRING : artifactName;
|
return artifactName == null ? EMPTY_STRING : artifactName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.cdt.managedbuilder.core.ITarget#getBinaryParserId()
|
||||||
|
*/
|
||||||
|
public String getBinaryParserId() {
|
||||||
|
return binaryParserId == null ? EMPTY_STRING : binaryParserId;
|
||||||
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.core.build.managed.ITarget#getConfiguration()
|
* @see org.eclipse.cdt.core.build.managed.ITarget#getConfiguration()
|
||||||
*/
|
*/
|
||||||
|
@ -368,4 +384,5 @@ public class Target extends BuildObject implements ITarget {
|
||||||
artifactName = name;
|
artifactName = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,15 @@
|
||||||
|
2003-09-19 Sean Evoy
|
||||||
|
Removed the binary parser selection tab from the new class wizard. Updated the
|
||||||
|
page description externalized string.
|
||||||
|
* src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties
|
||||||
|
* src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectOptionPage.java
|
||||||
|
|
||||||
|
Added the hard-coded binary parser info to the defined targets.
|
||||||
|
* plugin.xml
|
||||||
|
|
||||||
|
Fixed the event handling for add/remove in the list widget for build settings pages.
|
||||||
|
* src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionListFieldEditor.java
|
||||||
|
|
||||||
2003-09-16 Sean Evoy
|
2003-09-16 Sean Evoy
|
||||||
Changed the initialization and button status logic so the list buttons are
|
Changed the initialization and button status logic so the list buttons are
|
||||||
enabled correctly on start-up and that the fist item in the list (if
|
enabled correctly on start-up and that the fist item in the list (if
|
||||||
|
|
|
@ -70,6 +70,7 @@
|
||||||
isTest="false"
|
isTest="false"
|
||||||
cleanCommand="rm -rf"
|
cleanCommand="rm -rf"
|
||||||
name="Cygwin"
|
name="Cygwin"
|
||||||
|
binaryParser="org.eclipse.cdt.core.PE"
|
||||||
isAbstract="true"
|
isAbstract="true"
|
||||||
makeCommand="make"
|
makeCommand="make"
|
||||||
id="cygwin">
|
id="cygwin">
|
||||||
|
@ -307,6 +308,7 @@
|
||||||
isTest="false"
|
isTest="false"
|
||||||
name="Cygwin Executable"
|
name="Cygwin Executable"
|
||||||
parent="cygwin"
|
parent="cygwin"
|
||||||
|
binaryParser="org.eclipse.cdt.core.PE"
|
||||||
defaultExtension="exe"
|
defaultExtension="exe"
|
||||||
isAbstract="false"
|
isAbstract="false"
|
||||||
id="cygwin.exec">
|
id="cygwin.exec">
|
||||||
|
@ -335,13 +337,6 @@
|
||||||
valueType="string"
|
valueType="string"
|
||||||
id="cygwin.link.ld.flags">
|
id="cygwin.link.ld.flags">
|
||||||
</option>
|
</option>
|
||||||
<option
|
|
||||||
name="Library Paths"
|
|
||||||
category="cygwin.linker.category.general"
|
|
||||||
command="-L"
|
|
||||||
valueType="stringList"
|
|
||||||
id="cygwin.link.ld.paths">
|
|
||||||
</option>
|
|
||||||
<option
|
<option
|
||||||
name="Libraries"
|
name="Libraries"
|
||||||
category="cygwin.linker.category.general"
|
category="cygwin.linker.category.general"
|
||||||
|
@ -349,12 +344,20 @@
|
||||||
valueType="libs"
|
valueType="libs"
|
||||||
id="cygwin.link.libs">
|
id="cygwin.link.libs">
|
||||||
</option>
|
</option>
|
||||||
|
<option
|
||||||
|
name="Library Paths"
|
||||||
|
category="cygwin.linker.category.general"
|
||||||
|
command="-L"
|
||||||
|
valueType="stringList"
|
||||||
|
id="cygwin.link.ld.paths">
|
||||||
|
</option>
|
||||||
</tool>
|
</tool>
|
||||||
</target>
|
</target>
|
||||||
<target
|
<target
|
||||||
isTest="false"
|
isTest="false"
|
||||||
name="Cygwin Shared Library"
|
name="Cygwin Shared Library"
|
||||||
parent="cygwin"
|
parent="cygwin"
|
||||||
|
binaryParser="org.eclipse.cdt.core.PE"
|
||||||
defaultExtension="dll"
|
defaultExtension="dll"
|
||||||
isAbstract="false"
|
isAbstract="false"
|
||||||
id="cygwin.so">
|
id="cygwin.so">
|
||||||
|
@ -405,6 +408,7 @@
|
||||||
isTest="true"
|
isTest="true"
|
||||||
name="Cygwin Export Library (DLL)"
|
name="Cygwin Export Library (DLL)"
|
||||||
parent="cygwin"
|
parent="cygwin"
|
||||||
|
binaryParser="org.eclipse.cdt.core.PE"
|
||||||
defaultExtension="dll.a"
|
defaultExtension="dll.a"
|
||||||
isAbstract="false"
|
isAbstract="false"
|
||||||
id="cygwin.exp">
|
id="cygwin.exp">
|
||||||
|
@ -455,6 +459,7 @@
|
||||||
isTest="false"
|
isTest="false"
|
||||||
name="Cygwin Static Library"
|
name="Cygwin Static Library"
|
||||||
parent="cygwin"
|
parent="cygwin"
|
||||||
|
binaryParser="org.eclipse.cdt.core.PE"
|
||||||
defaultExtension="a"
|
defaultExtension="a"
|
||||||
isAbstract="false"
|
isAbstract="false"
|
||||||
id="cygwin.lib">
|
id="cygwin.lib">
|
||||||
|
@ -491,6 +496,7 @@
|
||||||
isTest="false"
|
isTest="false"
|
||||||
cleanCommand="rm -rf"
|
cleanCommand="rm -rf"
|
||||||
name="Linux"
|
name="Linux"
|
||||||
|
binaryParser="org.eclipse.cdt.core.ELF"
|
||||||
isAbstract="true"
|
isAbstract="true"
|
||||||
makeCommand="make"
|
makeCommand="make"
|
||||||
id="linux.gnu">
|
id="linux.gnu">
|
||||||
|
@ -781,6 +787,7 @@
|
||||||
isTest="false"
|
isTest="false"
|
||||||
name="Linux Executable"
|
name="Linux Executable"
|
||||||
parent="linux.gnu"
|
parent="linux.gnu"
|
||||||
|
binaryParser="org.eclipse.cdt.core.ELF"
|
||||||
isAbstract="false"
|
isAbstract="false"
|
||||||
id="linux.gnu.exec">
|
id="linux.gnu.exec">
|
||||||
<configuration
|
<configuration
|
||||||
|
@ -874,6 +881,7 @@
|
||||||
isTest="false"
|
isTest="false"
|
||||||
name="Linux Shared Library"
|
name="Linux Shared Library"
|
||||||
parent="linux.gnu"
|
parent="linux.gnu"
|
||||||
|
binaryParser="org.eclipse.cdt.core.ELF"
|
||||||
defaultExtension="so"
|
defaultExtension="so"
|
||||||
isAbstract="false"
|
isAbstract="false"
|
||||||
id="linux.gnu.so">
|
id="linux.gnu.so">
|
||||||
|
@ -978,6 +986,7 @@
|
||||||
isTest="false"
|
isTest="false"
|
||||||
name="Linux Static Library"
|
name="Linux Static Library"
|
||||||
parent="linux.gnu"
|
parent="linux.gnu"
|
||||||
|
binaryParser="org.eclipse.cdt.core.ELF"
|
||||||
defaultExtension="a"
|
defaultExtension="a"
|
||||||
isAbstract="false"
|
isAbstract="false"
|
||||||
id="linux.gnu.lib">
|
id="linux.gnu.lib">
|
||||||
|
@ -1015,6 +1024,7 @@
|
||||||
isTest="false"
|
isTest="false"
|
||||||
cleanCommand="rm -rf"
|
cleanCommand="rm -rf"
|
||||||
name="Solaris"
|
name="Solaris"
|
||||||
|
binaryParser="org.eclipse.cdt.core.ELF"
|
||||||
isAbstract="true"
|
isAbstract="true"
|
||||||
makeCommand="make"
|
makeCommand="make"
|
||||||
id="solaris.gnu">
|
id="solaris.gnu">
|
||||||
|
@ -1297,6 +1307,7 @@
|
||||||
isTest="false"
|
isTest="false"
|
||||||
name="Solaris Executable"
|
name="Solaris Executable"
|
||||||
parent="solaris.gnu"
|
parent="solaris.gnu"
|
||||||
|
binaryParser="org.eclipse.cdt.core.ELF"
|
||||||
isAbstract="false"
|
isAbstract="false"
|
||||||
id="solaris.gnu.exec">
|
id="solaris.gnu.exec">
|
||||||
<configuration
|
<configuration
|
||||||
|
@ -1390,6 +1401,7 @@
|
||||||
isTest="false"
|
isTest="false"
|
||||||
name="Solaris Shared Library"
|
name="Solaris Shared Library"
|
||||||
parent="solaris.gnu"
|
parent="solaris.gnu"
|
||||||
|
binaryParser="org.eclipse.cdt.core.ELF"
|
||||||
defaultExtension="so"
|
defaultExtension="so"
|
||||||
isAbstract="false"
|
isAbstract="false"
|
||||||
id="solaris.gnu.so">
|
id="solaris.gnu.so">
|
||||||
|
@ -1494,6 +1506,7 @@
|
||||||
isTest="false"
|
isTest="false"
|
||||||
name="Solaris Static Library"
|
name="Solaris Static Library"
|
||||||
parent="solaris.gnu"
|
parent="solaris.gnu"
|
||||||
|
binaryParser="org.eclipse.cdt.core.ELF"
|
||||||
defaultExtension="a"
|
defaultExtension="a"
|
||||||
isAbstract="false"
|
isAbstract="false"
|
||||||
id="solaris.gnu.lib">
|
id="solaris.gnu.lib">
|
||||||
|
|
|
@ -33,7 +33,7 @@ PlatformBlock.label.configs=Configurations:
|
||||||
|
|
||||||
# -- Strings for the additional options tab
|
# -- Strings for the additional options tab
|
||||||
MngMakeProjectWizard.options.title=Additional Project Settings
|
MngMakeProjectWizard.options.title=Additional Project Settings
|
||||||
MngMakeProjectWizard.options.desc=Defined the binary parser and inter-project dependencies, if any.
|
MngMakeProjectWizard.options.desc=Defined the inter-project dependencies, if any.
|
||||||
|
|
||||||
# ----------- Configuration Selection Page -----------
|
# ----------- Configuration Selection Page -----------
|
||||||
BuildPropertyPage.label.Platform=Platform:
|
BuildPropertyPage.label.Platform=Platform:
|
||||||
|
|
|
@ -98,6 +98,7 @@ public class BuildOptionListFieldEditor extends FieldEditor {
|
||||||
list.add(input, 0);
|
list.add(input, 0);
|
||||||
list.setSelection(0);
|
list.setSelection(0);
|
||||||
}
|
}
|
||||||
|
selectionChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -374,6 +375,7 @@ public class BuildOptionListFieldEditor extends FieldEditor {
|
||||||
int index = list.getSelectionIndex();
|
int index = list.getSelectionIndex();
|
||||||
if (index >= 0) {
|
if (index >= 0) {
|
||||||
list.remove(index);
|
list.remove(index);
|
||||||
|
list.setSelection(index - 1);
|
||||||
selectionChanged();
|
selectionChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -387,7 +389,7 @@ public class BuildOptionListFieldEditor extends FieldEditor {
|
||||||
int size = list.getItemCount();
|
int size = list.getItemCount();
|
||||||
|
|
||||||
// Enable the remove button if there is at least one item in the list
|
// Enable the remove button if there is at least one item in the list
|
||||||
removeButton.setEnabled(index >= 0);
|
removeButton.setEnabled(size > 0);
|
||||||
// Enable the up button IFF there is more than 1 item and selection index is not first item
|
// Enable the up button IFF there is more than 1 item and selection index is not first item
|
||||||
upButton.setEnabled(size > 1 && index > 0);
|
upButton.setEnabled(size > 1 && index > 0);
|
||||||
// Enable the down button IFF there is more than 1 item and selection index not last item
|
// Enable the down button IFF there is more than 1 item and selection index not last item
|
||||||
|
|
|
@ -11,9 +11,7 @@ package org.eclipse.cdt.managedbuilder.ui.wizards;
|
||||||
* IBM Rational Software - Initial API and implementation
|
* IBM Rational Software - Initial API and implementation
|
||||||
* **********************************************************************/
|
* **********************************************************************/
|
||||||
|
|
||||||
import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin;
|
|
||||||
import org.eclipse.cdt.managedbuilder.internal.ui.ManagedProjectOptionBlock;
|
import org.eclipse.cdt.managedbuilder.internal.ui.ManagedProjectOptionBlock;
|
||||||
import org.eclipse.cdt.ui.dialogs.BinaryParserBlock;
|
|
||||||
import org.eclipse.cdt.ui.dialogs.ICOptionContainer;
|
import org.eclipse.cdt.ui.dialogs.ICOptionContainer;
|
||||||
import org.eclipse.cdt.ui.dialogs.ReferenceBlock;
|
import org.eclipse.cdt.ui.dialogs.ReferenceBlock;
|
||||||
import org.eclipse.cdt.ui.dialogs.TabFolderOptionBlock;
|
import org.eclipse.cdt.ui.dialogs.TabFolderOptionBlock;
|
||||||
|
@ -31,7 +29,6 @@ public class NewManagedProjectOptionPage extends NewCProjectWizardOptionPage {
|
||||||
|
|
||||||
protected void addTabs() {
|
protected void addTabs() {
|
||||||
addTab(new ReferenceBlock());
|
addTab(new ReferenceBlock());
|
||||||
addTab(new BinaryParserBlock(ManagedBuilderCorePlugin.getDefault().getPluginPreferences()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -103,9 +103,10 @@ public class NewManagedProjectWizard extends NewCProjectWizard {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add the target to the project
|
// Add the target to the project
|
||||||
|
ITarget newTarget = null;
|
||||||
try {
|
try {
|
||||||
ITarget parent = targetConfigurationPage.getSelectedTarget();
|
ITarget parent = targetConfigurationPage.getSelectedTarget();
|
||||||
ITarget newTarget = ManagedBuildManager.createTarget(newProject, parent);
|
newTarget = ManagedBuildManager.createTarget(newProject, parent);
|
||||||
if (newTarget != null) {
|
if (newTarget != null) {
|
||||||
// TODO add name entry field to project
|
// TODO add name entry field to project
|
||||||
String artifactName = newProject.getName();
|
String artifactName = newProject.getName();
|
||||||
|
@ -131,6 +132,10 @@ public class NewManagedProjectWizard extends NewCProjectWizard {
|
||||||
ICDescriptor desc = CCorePlugin.getDefault().getCProjectDescription(newProject);
|
ICDescriptor desc = CCorePlugin.getDefault().getCProjectDescription(newProject);
|
||||||
desc.remove(CCorePlugin.BUILD_SCANNER_INFO_UNIQ_ID);
|
desc.remove(CCorePlugin.BUILD_SCANNER_INFO_UNIQ_ID);
|
||||||
desc.create(CCorePlugin.BUILD_SCANNER_INFO_UNIQ_ID, ManagedBuildManager.INTERFACE_IDENTITY);
|
desc.create(CCorePlugin.BUILD_SCANNER_INFO_UNIQ_ID, ManagedBuildManager.INTERFACE_IDENTITY);
|
||||||
|
|
||||||
|
desc.remove(CCorePlugin.BINARY_PARSER_UNIQ_ID);
|
||||||
|
// org.eclipse.cdt.core.ELF or "org.eclipse.cdt.core.PE"
|
||||||
|
desc.create(CCorePlugin.BINARY_PARSER_UNIQ_ID, newTarget.getBinaryParserId());
|
||||||
} catch (CoreException e) {
|
} catch (CoreException e) {
|
||||||
// TODO Flag the error to the user
|
// TODO Flag the error to the user
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
2003-09-19 Sean Evoy
|
||||||
|
Updated the build test to check the binary parser specification in the
|
||||||
|
target specification.
|
||||||
|
* build/org/eclipse/cdt/core/build/managed/tests/ManagedBuildTests.java
|
||||||
|
|
||||||
2003-09-18 Andrew Niefer
|
2003-09-18 Andrew Niefer
|
||||||
- removed testConditionalExpression_Bug43159 from FailedCompleteParseASTExpressionTest
|
- removed testConditionalExpression_Bug43159 from FailedCompleteParseASTExpressionTest
|
||||||
and uncommented it (testConditionalExpression) in CompleteParseASTExpressionTest
|
and uncommented it (testConditionalExpression) in CompleteParseASTExpressionTest
|
||||||
|
|
|
@ -533,10 +533,12 @@ public class ManagedBuildTests extends TestCase {
|
||||||
// Target stuff
|
// Target stuff
|
||||||
String expectedCleanCmd = "del /myworld";
|
String expectedCleanCmd = "del /myworld";
|
||||||
String expectedMakeCommand = "make";
|
String expectedMakeCommand = "make";
|
||||||
|
String expectedParserId = "org.eclipse.cdt.core.PE";
|
||||||
assertTrue(target.isTestTarget());
|
assertTrue(target.isTestTarget());
|
||||||
assertEquals(target.getDefaultExtension(), rootExt);
|
assertEquals(target.getDefaultExtension(), rootExt);
|
||||||
assertEquals(expectedCleanCmd, target.getCleanCommand());
|
assertEquals(expectedCleanCmd, target.getCleanCommand());
|
||||||
assertEquals(expectedMakeCommand, target.getMakeCommand());
|
assertEquals(expectedMakeCommand, target.getMakeCommand());
|
||||||
|
assertEquals(expectedParserId, target.getBinaryParserId());
|
||||||
|
|
||||||
// Tools
|
// Tools
|
||||||
ITool[] tools = target.getTools();
|
ITool[] tools = target.getTools();
|
||||||
|
@ -643,14 +645,14 @@ public class ManagedBuildTests extends TestCase {
|
||||||
assertEquals("doIt", tools[0].getToolCommand());
|
assertEquals("doIt", tools[0].getToolCommand());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/*
|
||||||
* @param testSubSub
|
* @param testSubSub
|
||||||
*/
|
*/
|
||||||
private void checkSubSubTarget(ITarget target) {
|
private void checkSubSubTarget(ITarget target) {
|
||||||
// Check the inherited clean command
|
// Check the inherited clean command
|
||||||
assertEquals("rm -yourworld", target.getCleanCommand());
|
assertEquals("rm -yourworld", target.getCleanCommand());
|
||||||
assertEquals("nmake", target.getMakeCommand());
|
assertEquals("nmake", target.getMakeCommand());
|
||||||
|
assertEquals("org.eclipse.cdt.core.ELF", target.getBinaryParserId());
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -664,6 +666,7 @@ public class ManagedBuildTests extends TestCase {
|
||||||
// Check the overridden clan command
|
// Check the overridden clan command
|
||||||
assertEquals("rm -yourworld", target.getCleanCommand());
|
assertEquals("rm -yourworld", target.getCleanCommand());
|
||||||
assertEquals("gmake", target.getMakeCommand());
|
assertEquals("gmake", target.getMakeCommand());
|
||||||
|
assertEquals("org.eclipse.cdt.core.PE", target.getBinaryParserId());
|
||||||
|
|
||||||
// Make sure this is a test target
|
// Make sure this is a test target
|
||||||
assertTrue(target.isTestTarget());
|
assertTrue(target.isTestTarget());
|
||||||
|
|
|
@ -29,14 +29,15 @@
|
||||||
name="Tools for Build Test"
|
name="Tools for Build Test"
|
||||||
point="org.eclipse.cdt.managedbuilder.core.ManagedBuildInfo">
|
point="org.eclipse.cdt.managedbuilder.core.ManagedBuildInfo">
|
||||||
<target
|
<target
|
||||||
makeFlags="-k"
|
|
||||||
isTest="true"
|
|
||||||
cleanCommand="del /myworld"
|
|
||||||
name="Test Root"
|
name="Test Root"
|
||||||
|
id="test.root"
|
||||||
|
cleanCommand="del /myworld"
|
||||||
|
isTest="true"
|
||||||
defaultExtension="toor"
|
defaultExtension="toor"
|
||||||
isAbstract="false"
|
isAbstract="false"
|
||||||
makeCommand="make"
|
makeCommand="make"
|
||||||
id="test.root">
|
binaryParser="org.eclipse.cdt.core.PE"
|
||||||
|
makeFlags="-k">
|
||||||
<tool
|
<tool
|
||||||
sources="foo,bar"
|
sources="foo,bar"
|
||||||
name="Root Tool"
|
name="Root Tool"
|
||||||
|
@ -126,6 +127,7 @@
|
||||||
defaultExtension="bus"
|
defaultExtension="bus"
|
||||||
isAbstract="false"
|
isAbstract="false"
|
||||||
makeCommand="gmake"
|
makeCommand="gmake"
|
||||||
|
binaryParser="org.eclipse.cdt.core.PE"
|
||||||
makeFlags="-d"
|
makeFlags="-d"
|
||||||
parent="test.root">
|
parent="test.root">
|
||||||
<configuration
|
<configuration
|
||||||
|
@ -180,6 +182,7 @@
|
||||||
isTest="true"
|
isTest="true"
|
||||||
name="Test Sub Sub"
|
name="Test Sub Sub"
|
||||||
parent="test.sub"
|
parent="test.sub"
|
||||||
|
binaryParser="org.eclipse.cdt.core.ELF"
|
||||||
defaultExtension="tss"
|
defaultExtension="tss"
|
||||||
makeCommand="nmake"
|
makeCommand="nmake"
|
||||||
id="test.sub.sub">
|
id="test.sub.sub">
|
||||||
|
|
Loading…
Add table
Reference in a new issue