1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-07 01:36:01 +02:00

Fixes for 41590, 44159, 51640, and 51646

This commit is contained in:
Sean Evoy 2004-02-17 14:20:11 +00:00
parent 8cf9302004
commit aba55c1109
17 changed files with 2526 additions and 2014 deletions

View file

@ -1,3 +1,39 @@
2004-02-17 Sean Evoy
Fix for critical bug 44163.
The managed build info would become confused when the project it was associated
with was renamed. The project still stored the build information in its session
data, but the internal reference to the owner project was not updated in the
build info. Now, when the build info is retrieved from a project, the manager
asks the info to do a sanity test to check the identity of the true owner against
the owner the it thinks it has. If they differ, the build information updates its
owner and the owner of all the targets it maintains for the project.
* src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java
* src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java
* src/org/eclipse/cdt/managedbuilder/core/ITarget.java
* src/org/eclipse/cdt/managedbuilder/internal/core/Target.java
Fixes for 51646
Moved the makefile comment character out of the hard-coded strings and into
the makefile generator.
* src/org/eclipse/cdt/managedbuilder/internal/core/PluginResources.properties
* src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java
Fixes for bug 49590:
The target maintains the default extension and the overridden extension. There
is an interface to get and set the extension, but the method to get the default
extension is deprecated.
* src/org/eclipse/cdt/managedbuilder/core/ITarget.java
* src/org/eclipse/cdt/managedbuilder/internal/core/Target.java
The build information now has a method to get at the extension
* src/org/eclipse/cdt/managedbuilder/core/IManagedBuildInfo.java
* src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java
The makefile generator now asks for both the name and the extension when
generating targets and dependencies.
* src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java
2003-10-23 Bogdan Gheorghe 2003-10-23 Bogdan Gheorghe
Updated the indexManager.perfomConcurrentJob call in MakefileGenerator Updated the indexManager.perfomConcurrentJob call in MakefileGenerator

View file

@ -1,9 +1,7 @@
package org.eclipse.cdt.managedbuilder.core; package org.eclipse.cdt.managedbuilder.core;
import java.util.List;
/********************************************************************** /**********************************************************************
* Copyright (c) 2002,2003 Rational Software Corporation and others. * Copyright (c) 2003,2004 Rational Software Corporation and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v0.5 * are made available under the terms of the Common Public License v0.5
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -11,7 +9,9 @@ import java.util.List;
* *
* Contributors: * Contributors:
* IBM Rational Software - Initial API and implementation * IBM Rational Software - Initial API and implementation
***********************************************************************/ ***********************************************************************/
import java.util.List;
public interface IManagedBuildInfo { public interface IManagedBuildInfo {
@ -31,6 +31,14 @@ public interface IManagedBuildInfo {
*/ */
public boolean buildsFileType(String srcExt); public boolean buildsFileType(String srcExt);
/**
* Answers the file extension for the receivers build goal.
*
* @return
*/
public String getBuildArtifactExtension();
/** /**
* Returns the name of the artifact to build for the receiver. * Returns the name of the artifact to build for the receiver.
* *

View file

@ -1,5 +1,5 @@
/********************************************************************** /**********************************************************************
* Copyright (c) 2003 IBM Corporation and others. * Copyright (c) 2003,2004 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0 * are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -22,6 +22,7 @@ public interface ITarget extends IBuildObject {
public static final String BINARY_PARSER = "binaryParser"; //$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 CLEAN_COMMAND = "cleanCommand"; //$NON-NLS-1$
public static final String DEFAULT_EXTENSION = "defaultExtension"; //$NON-NLS-1$ public static final String DEFAULT_EXTENSION = "defaultExtension"; //$NON-NLS-1$
public static final String EXTENSION = "extension"; //$NON-NLS-1$
public static final String IS_ABSTRACT = "isAbstract"; //$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 IS_TEST = "isTest"; //$NON-NLS-1$
public static final String MAKE_COMMAND = "makeCommand"; //$NON-NLS-1$ public static final String MAKE_COMMAND = "makeCommand"; //$NON-NLS-1$
@ -49,6 +50,14 @@ public interface ITarget extends IBuildObject {
*/ */
public IConfiguration createConfiguration(String id); public IConfiguration createConfiguration(String id);
/**
* Answers the extension that should be applied to build artifacts created by
* this target.
*
* @return String
*/
public String getArtifactExtension();
/** /**
* Get the name of the final build artifact. * Get the name of the final build artifact.
* *
@ -82,6 +91,7 @@ public interface ITarget extends IBuildObject {
* created by this target. * created by this target.
* *
* @return String * @return String
* @deprecated
*/ */
public String getDefaultExtension(); public String getDefaultExtension();
@ -166,6 +176,14 @@ public interface ITarget extends IBuildObject {
* *
*/ */
public void resetMakeCommand(); public void resetMakeCommand();
/**
* Set (override) the extension that should be appended to the build artifact
* for the receiver.
*
* @param extension
*/
public void setArtifactExtension(String extension);
/** /**
* Set the name of the artifact that will be produced when the receiver * Set the name of the artifact that will be produced when the receiver
@ -173,7 +191,7 @@ public interface ITarget extends IBuildObject {
* *
* @param name * @param name
*/ */
public void setBuildArtifact(String name); public void setArtifactName(String name);
/** /**
* Sets the make command for the receiver to the value in the argument. * Sets the make command for the receiver to the value in the argument.
@ -182,4 +200,11 @@ public interface ITarget extends IBuildObject {
*/ */
public void setMakeCommand(String command); public void setMakeCommand(String command);
/**
* Sets the resource that owns the receiver.
*
* @param resource
*/
public void updateOwner(IResource resource);
} }

View file

@ -29,7 +29,9 @@ import org.apache.xml.serialize.OutputFormat;
import org.apache.xml.serialize.Serializer; import org.apache.xml.serialize.Serializer;
import org.apache.xml.serialize.SerializerFactory; import org.apache.xml.serialize.SerializerFactory;
import org.eclipse.cdt.core.AbstractCExtension; import org.eclipse.cdt.core.AbstractCExtension;
import org.eclipse.cdt.core.parser.*; import org.eclipse.cdt.core.parser.IScannerInfo;
import org.eclipse.cdt.core.parser.IScannerInfoChangeListener;
import org.eclipse.cdt.core.parser.IScannerInfoProvider;
import org.eclipse.cdt.managedbuilder.internal.core.Configuration; import org.eclipse.cdt.managedbuilder.internal.core.Configuration;
import org.eclipse.cdt.managedbuilder.internal.core.ManagedBuildInfo; import org.eclipse.cdt.managedbuilder.internal.core.ManagedBuildInfo;
import org.eclipse.cdt.managedbuilder.internal.core.Target; import org.eclipse.cdt.managedbuilder.internal.core.Target;
@ -64,8 +66,8 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
private static Map extensionTargetMap; private static Map extensionTargetMap;
// Listeners interested in build model changes // Listeners interested in build model changes
private static Map buildModelListeners; private static Map buildModelListeners;
/** /**
* Returns the list of targets that are defined by this project, * Returns the list of targets that are defined by this project,
* projects referenced by this project, and by the extensions. * projects referenced by this project, and by the extensions.
@ -99,10 +101,10 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
return targets; return targets;
} }
/** /* (non-Javadoc)
* @return * @return
*/ */
public static Map getExtensionTargetMap() { protected static Map getExtensionTargetMap() {
if (extensionTargetMap == null) { if (extensionTargetMap == null) {
extensionTargetMap = new HashMap(); extensionTargetMap = new HashMap();
} }
@ -202,7 +204,8 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
} }
} }
/** /* (non-Javadoc)
*
* @param config * @param config
* @param option * @param option
*/ */
@ -368,8 +371,10 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
} }
} }
// Private stuff
/**
* @param target
*/
public static void addExtensionTarget(Target target) { public static void addExtensionTarget(Target target) {
if (extensionTargets == null) { if (extensionTargets == null) {
extensionTargets = new ArrayList(); extensionTargets = new ArrayList();
@ -379,6 +384,7 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
getExtensionTargetMap().put(target.getId(), target); getExtensionTargetMap().put(target.getId(), target);
} }
// Private stuff
private static ManagedBuildInfo loadBuildInfo(IProject project) { private static ManagedBuildInfo loadBuildInfo(IProject project) {
ManagedBuildInfo buildInfo = null; ManagedBuildInfo buildInfo = null;
IFile file = project.getFile(FILE_NAME); IFile file = project.getFile(FILE_NAME);
@ -401,6 +407,10 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
return buildInfo; return buildInfo;
} }
/* (non-Javadoc)
* Since the class does not have a constructor, but all public methods
* call this method first, it is effectively a startup method
*/
private static void loadExtensions() { private static void loadExtensions() {
if (extensionTargetsLoaded) if (extensionTargetsLoaded)
return; return;
@ -459,6 +469,10 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
ManagedBuildInfo buildInfo = null; ManagedBuildInfo buildInfo = null;
try { try {
buildInfo = (ManagedBuildInfo)resource.getSessionProperty(buildInfoProperty); buildInfo = (ManagedBuildInfo)resource.getSessionProperty(buildInfoProperty);
// Make sure that if a project has build info, that the info is not corrupted
if (buildInfo != null) {
buildInfo.updateOwner(resource);
}
} catch (CoreException e) { } catch (CoreException e) {
return buildInfo; return buildInfo;
} }
@ -479,10 +493,27 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
return buildInfo; return buildInfo;
} }
/**
* Answers the build information for the <code>IResource</code> in the
* argument. If the <code>create</code> is true, then a new build information
* repository will be created for the resource.
*
* @param resource
* @param create
* @return IManagedBuildInfo
*/
public static IManagedBuildInfo getBuildInfo(IResource resource, boolean create) { public static IManagedBuildInfo getBuildInfo(IResource resource, boolean create) {
return (IManagedBuildInfo) findBuildInfo(resource, create); return (IManagedBuildInfo) findBuildInfo(resource, create);
} }
/**
* Answers, but does not create, the managed build information for the
* argument.
*
* @see ManagedBuildManager#getBuildInfo(IResource, boolean)
* @param resource
* @return IManagedBuildInfo
*/
public static IManagedBuildInfo getBuildInfo(IResource resource) { public static IManagedBuildInfo getBuildInfo(IResource resource) {
return (IManagedBuildInfo) findBuildInfo(resource, false); return (IManagedBuildInfo) findBuildInfo(resource, false);
} }
@ -551,5 +582,4 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
map.put(project, list); map.put(project, list);
} }
} }
} }

View file

@ -1,7 +1,7 @@
package org.eclipse.cdt.managedbuilder.internal.core; package org.eclipse.cdt.managedbuilder.internal.core;
/********************************************************************** /**********************************************************************
* Copyright (c) 2002,2003 Rational Software Corporation and others. * Copyright (c) 2003,2004 Rational Software Corporation and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v0.5 * are made available under the terms of the Common Public License v0.5
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -61,18 +61,19 @@ public class MakefileGenerator {
private static final String AUTO_DEP = COMMENT + ".autodeps"; //$NON-NLS-1$ private static final String AUTO_DEP = COMMENT + ".autodeps"; //$NON-NLS-1$
// String constants for makefile contents // String constants for makefile contents
protected static final String COLON = ":"; protected static final String COLON = ":"; //$NON-NLS-1$
protected static final String DEPFILE_NAME = "subdir.dep"; //$NON-NLS-1$ protected static final String DEPFILE_NAME = "subdir.dep"; //$NON-NLS-1$
protected static final String DOT = "."; protected static final String DOT = "."; //$NON-NLS-1$
protected static final String MAKEFILE_NAME = "makefile"; //$NON-NLS-1$ protected static final String MAKEFILE_NAME = "makefile"; //$NON-NLS-1$
protected static final String MODFILE_NAME = "subdir.mk"; //$NON-NLS-1$ protected static final String MODFILE_NAME = "subdir.mk"; //$NON-NLS-1$
protected static final String LINEBREAK = "\\"; protected static final String LINEBREAK = "\\"; //$NON-NLS-1$
protected static final String NEWLINE = System.getProperty("line.separator"); protected static final String NEWLINE = System.getProperty("line.separator"); //$NON-NLS-1$
protected static final String LOGICAL_AND = "&&"; protected static final String LOGICAL_AND = "&&"; //$NON-NLS-1$
protected static final String SEPARATOR = "/"; protected static final String SEPARATOR = "/"; //$NON-NLS-1$
protected static final String TAB = "\t"; protected static final String TAB = "\t"; //$NON-NLS-1$
protected static final String WHITESPACE = " "; protected static final String WHITESPACE = " "; //$NON-NLS-1$
protected static final String WILDCARD = "%"; protected static final String WILDCARD = "%"; //$NON-NLS-1$
protected static final String COMMENT_SYMBOL = "#"; //$NON-NLS-1$
// Local variables needed by generator // Local variables needed by generator
protected IManagedBuildInfo info; protected IManagedBuildInfo info;
@ -294,7 +295,7 @@ public class MakefileGenerator {
// Get the name of the build target // Get the name of the build target
target = info.getBuildArtifactName(); target = info.getBuildArtifactName();
// Get its extension // Get its extension
extension = (new Path(target)).getFileExtension(); extension = info.getBuildArtifactExtension();
if (extension == null) { if (extension == null) {
extension = new String(); extension = new String();
} }
@ -316,7 +317,7 @@ public class MakefileGenerator {
// Create the buffer to hold the output for the module and a dep calculator // Create the buffer to hold the output for the module and a dep calculator
StringBuffer buffer = new StringBuffer(); StringBuffer buffer = new StringBuffer();
buffer.append(ManagedBuilderCorePlugin.getResourceString(AUTO_DEP) + NEWLINE); buffer.append(COMMENT_SYMBOL + WHITESPACE + ManagedBuilderCorePlugin.getResourceString(AUTO_DEP) + NEWLINE);
IndexManager indexManager = CCorePlugin.getDefault().getCoreModel().getIndexManager(); IndexManager indexManager = CCorePlugin.getDefault().getCoreModel().getIndexManager();
/* /*
@ -374,7 +375,7 @@ public class MakefileGenerator {
buffer.append("RM := "); buffer.append("RM := ");
buffer.append(info.getCleanCommand() + NEWLINE + NEWLINE); buffer.append(info.getCleanCommand() + NEWLINE + NEWLINE);
buffer.append(ManagedBuilderCorePlugin.getResourceString(SRC_LISTS) + NEWLINE); buffer.append(COMMENT_SYMBOL + WHITESPACE + ManagedBuilderCorePlugin.getResourceString(SRC_LISTS) + NEWLINE);
buffer.append("C_SRCS := " + NEWLINE); buffer.append("C_SRCS := " + NEWLINE);
buffer.append("CC_SRCS := " + NEWLINE); buffer.append("CC_SRCS := " + NEWLINE);
buffer.append("CXX_SRCS := " + NEWLINE); buffer.append("CXX_SRCS := " + NEWLINE);
@ -409,7 +410,7 @@ public class MakefileGenerator {
protected StringBuffer addSubdirectories() { protected StringBuffer addSubdirectories() {
StringBuffer buffer = new StringBuffer(); StringBuffer buffer = new StringBuffer();
// Add the comment // Add the comment
buffer.append(ManagedBuilderCorePlugin.getResourceString(MOD_LIST) + NEWLINE); buffer.append(COMMENT_SYMBOL + WHITESPACE + ManagedBuilderCorePlugin.getResourceString(MOD_LIST) + NEWLINE);
buffer.append("SUBDIRS := " + LINEBREAK + NEWLINE); buffer.append("SUBDIRS := " + LINEBREAK + NEWLINE);
// Get all the module names // Get all the module names
@ -427,7 +428,7 @@ public class MakefileGenerator {
// Now add the makefile instruction to include all the subdirectory makefile fragments // Now add the makefile instruction to include all the subdirectory makefile fragments
buffer.append(NEWLINE); buffer.append(NEWLINE);
buffer.append(ManagedBuilderCorePlugin.getResourceString(MOD_INCL) + NEWLINE); buffer.append(COMMENT_SYMBOL +WHITESPACE + ManagedBuilderCorePlugin.getResourceString(MOD_INCL) + NEWLINE);
buffer.append("-include ${patsubst %, %/subdir.mk, $(SUBDIRS)}" + NEWLINE); buffer.append("-include ${patsubst %, %/subdir.mk, $(SUBDIRS)}" + NEWLINE);
buffer.append(NEWLINE + NEWLINE); buffer.append(NEWLINE + NEWLINE);
@ -460,10 +461,10 @@ public class MakefileGenerator {
capcBuffer.append("${addprefix $(ROOT)/" + relativePath + "," + LINEBREAK + NEWLINE); capcBuffer.append("${addprefix $(ROOT)/" + relativePath + "," + LINEBREAK + NEWLINE);
StringBuffer cppBuffer = new StringBuffer("CPP_SRCS += \\" + NEWLINE); StringBuffer cppBuffer = new StringBuffer("CPP_SRCS += \\" + NEWLINE);
cppBuffer.append("${addprefix $(ROOT)/" + relativePath + "," + LINEBREAK + NEWLINE); cppBuffer.append("${addprefix $(ROOT)/" + relativePath + "," + LINEBREAK + NEWLINE);
StringBuffer ruleBuffer = new StringBuffer(ManagedBuilderCorePlugin.getResourceString(MOD_RULES) + NEWLINE); StringBuffer ruleBuffer = new StringBuffer(COMMENT_SYMBOL + WHITESPACE + ManagedBuilderCorePlugin.getResourceString(MOD_RULES) + NEWLINE);
// Put the comment in // Put the comment in
buffer.append(ManagedBuilderCorePlugin.getResourceString(SRC_LISTS) + NEWLINE); buffer.append(COMMENT_SYMBOL + WHITESPACE + ManagedBuilderCorePlugin.getResourceString(SRC_LISTS) + NEWLINE);
// Visit the resources in this folder // Visit the resources in this folder
IResource[] resources = module.members(); IResource[] resources = module.members();
@ -531,8 +532,11 @@ public class MakefileGenerator {
if (deps.length > 0) { if (deps.length > 0) {
defaultTarget += WHITESPACE + "deps"; defaultTarget += WHITESPACE + "deps";
} }
buffer.append(defaultTarget + WHITESPACE + outputPrefix + target + NEWLINE); buffer.append(defaultTarget + WHITESPACE + outputPrefix + target);
buffer.append(NEWLINE); if (extension.length() > 0) {
buffer.append(DOT + extension);
}
buffer.append(NEWLINE + NEWLINE);
/* /*
* The build target may depend on other projects in the workspace. These are * The build target may depend on other projects in the workspace. These are
@ -555,12 +559,16 @@ public class MakefileGenerator {
// Extract the build artifact to add to the dependency list // Extract the build artifact to add to the dependency list
String depTarget = depInfo.getBuildArtifactName(); String depTarget = depInfo.getBuildArtifactName();
String depExt = (new Path(depTarget)).getFileExtension(); String depExt = depInfo.getBuildArtifactExtension();
String depPrefix = depInfo.getOutputPrefix(depExt); String depPrefix = depInfo.getOutputPrefix(depExt);
if (depInfo.isDirty()) { if (depInfo.isDirty()) {
depTargets = "clean all"; depTargets = "clean all";
} }
managedProjectOutputs.add(buildDir + SEPARATOR + depPrefix + depTarget); String dependency = buildDir + SEPARATOR + depPrefix + depTarget;
if (depExt.length() > 0) {
dependency += DOT + depExt;
}
managedProjectOutputs.add(dependency);
} }
buffer.append(TAB + "-cd" + WHITESPACE + buildDir + WHITESPACE + LOGICAL_AND + WHITESPACE + "$(MAKE) " + depTargets + NEWLINE); buffer.append(TAB + "-cd" + WHITESPACE + buildDir + WHITESPACE + LOGICAL_AND + WHITESPACE + "$(MAKE) " + depTargets + NEWLINE);
} }
@ -573,7 +581,11 @@ public class MakefileGenerator {
* targ_<prefix><target>.<extension>: $(OBJS) [<dep_proj_1_output> ... <dep_proj_n_output>] * targ_<prefix><target>.<extension>: $(OBJS) [<dep_proj_1_output> ... <dep_proj_n_output>]
* $(BUILD_TOOL) $(FLAGS) $(OUTPUT_FLAG) $@ $(OBJS) $(USER_OBJS) $(LIB_DEPS) * $(BUILD_TOOL) $(FLAGS) $(OUTPUT_FLAG) $@ $(OBJS) $(USER_OBJS) $(LIB_DEPS)
*/ */
buffer.append(outputPrefix + target + COLON + WHITESPACE + "$(OBJS)"); buffer.append(outputPrefix + target);
if (extension.length() > 0) {
buffer.append(DOT + extension);
}
buffer.append(COLON + WHITESPACE + "$(OBJS)");
Iterator iter = managedProjectOutputs.listIterator(); Iterator iter = managedProjectOutputs.listIterator();
while (iter.hasNext()) { while (iter.hasNext()) {
buffer.append(WHITESPACE + (String)iter.next()); buffer.append(WHITESPACE + (String)iter.next());
@ -588,7 +600,7 @@ public class MakefileGenerator {
buffer.append(".PHONY: all clean deps" + NEWLINE + NEWLINE); buffer.append(".PHONY: all clean deps" + NEWLINE + NEWLINE);
buffer.append(ManagedBuilderCorePlugin.getResourceString(DEP_INCL) + NEWLINE); buffer.append(COMMENT_SYMBOL + WHITESPACE + ManagedBuilderCorePlugin.getResourceString(DEP_INCL) + NEWLINE);
buffer.append("-include ${patsubst %, %/subdir.dep, $(SUBDIRS)}" + NEWLINE); buffer.append("-include ${patsubst %, %/subdir.dep, $(SUBDIRS)}" + NEWLINE);
return buffer; return buffer;
} }

View file

@ -1,7 +1,7 @@
package org.eclipse.cdt.managedbuilder.internal.core; package org.eclipse.cdt.managedbuilder.internal.core;
/********************************************************************** /**********************************************************************
* Copyright (c) 2002,2003 Rational Software Corporation and others. * Copyright (c) 2002,2004 Rational Software Corporation and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v0.5 * are made available under the terms of the Common Public License v0.5
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -74,7 +74,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
} }
// All the available targets have been read in // All the available targets have been read in
defaultTarget = (ITarget) targetMap.get(defaultTargetId); defaultTarget = (ITarget) targetMap.get(defaultTargetId);
// Now we have a misserable O(N^2) operation (oh well, the data sets are small) // Now we have a miserable O(N^2) operation (oh well, the data sets are small)
ListIterator stringIter = configIds.listIterator(); ListIterator stringIter = configIds.listIterator();
while (stringIter.hasNext()){ while (stringIter.hasNext()){
String confId = (String) stringIter.next(); String confId = (String) stringIter.next();
@ -133,13 +133,29 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
return false; return false;
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo#getBuildArtifactExtension()
*/
public String getBuildArtifactExtension() {
String ext = new String();
ITarget target = getDefaultTarget();
if (target != null) {
ext = target.getArtifactExtension();
}
return ext;
}
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getBuildArtifactName() * @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getBuildArtifactName()
*/ */
public String getBuildArtifactName() { public String getBuildArtifactName() {
// Get the default target and use its value // Get the default target and use its value
String name = getDefaultTarget().getArtifactName(); String name = new String();
return name == null ? new String() : name; ITarget target = getDefaultTarget();
if (target != null) {
name = target.getArtifactName();
}
return name;
} }
/* (non-Javadoc) /* (non-Javadoc)
@ -149,7 +165,9 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
// Get from the model // Get from the model
String command = new String(); String command = new String();
ITarget target = getDefaultTarget(); ITarget target = getDefaultTarget();
command = target.getCleanCommand(); if (target != null) {
command = target.getCleanCommand();
}
return command; return command;
} }
@ -359,7 +377,12 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
// Return the include paths for the default configuration // Return the include paths for the default configuration
ArrayList paths = new ArrayList(); ArrayList paths = new ArrayList();
IConfiguration config = getDefaultConfiguration(getDefaultTarget()); IConfiguration config = getDefaultConfiguration(getDefaultTarget());
IPath root = owner.getLocation().addTrailingSeparator().append(config.getName()); IPath location = owner.getLocation();
// If the build info is out of date this might be null
if (location == null) {
location = new Path(".");
}
IPath root = location.addTrailingSeparator().append(config.getName());
ITool[] tools = config.getTools(); ITool[] tools = config.getTools();
for (int i = 0; i < tools.length; i++) { for (int i = 0; i < tools.length; i++) {
ITool tool = tools[i]; ITool tool = tools[i];
@ -867,4 +890,22 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
this.isDirty = isDirty; this.isDirty = isDirty;
} }
/**
* @param resource
*/
public void updateOwner(IResource resource) {
// Check to see if the owner is the same as the argument
if (resource != null) {
if (!owner.equals(resource)) {
owner = resource;
// Do the same for the targets
Iterator iter = targets.listIterator();
while(iter.hasNext()) {
ITarget target = (ITarget) iter.next();
target.updateOwner(resource);
}
}
}
}
} }

View file

@ -19,9 +19,9 @@ ManagedMakeBuilder.message.creating.markers = Generating markers...
ManagedMakeBuilder.message.error = Build error ManagedMakeBuilder.message.error = Build error
ManagedMakeBuilder.message.error.refresh = Error refreshing project. ManagedMakeBuilder.message.error.refresh = Error refreshing project.
ManagedMakeBuilder.message.finished = Build complete for project {0} ManagedMakeBuilder.message.finished = Build complete for project {0}
ManagedMakeBuilder.comment.module.list = # Every subdirectory with source files must be described here ManagedMakeBuilder.comment.module.list = Every subdirectory with source files must be described here
ManagedMakeBuilder.comment.source.list = # Each subdirectory must contribute its source files here ManagedMakeBuilder.comment.source.list = Each subdirectory must contribute its source files here
ManagedMakeBuilder.comment.build.rule = # Each subdirectory must supply rules for building sources it contributes ManagedMakeBuilder.comment.build.rule = Each subdirectory must supply rules for building sources it contributes
ManagedMakeBuilder.comment.module.make.includes = # Include the makefiles for each source subdirectory ManagedMakeBuilder.comment.module.make.includes = Include the makefiles for each source subdirectory
ManagedMakeBuilder.comment.module.dep.includes = # Include automatically-generated dependency list: ManagedMakeBuilder.comment.module.dep.includes = Include automatically-generated dependency list:
ManagedMakeBuilder.comment.autodeps = # Automatically-generated dependency list: ManagedMakeBuilder.comment.autodeps = Automatically-generated dependency list:

View file

@ -1,7 +1,7 @@
package org.eclipse.cdt.managedbuilder.internal.core; package org.eclipse.cdt.managedbuilder.internal.core;
/********************************************************************** /**********************************************************************
* Copyright (c) 2003 IBM Corporation and others. * Copyright (c) 2003,2004 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0 * are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -39,6 +39,7 @@ public class Target extends BuildObject implements ITarget {
private Map configMap; private Map configMap;
private List configurations; private List configurations;
private String defaultExtension; private String defaultExtension;
private String extension;
private boolean isAbstract = false; private boolean isAbstract = false;
private boolean isTest = false; private boolean isTest = false;
private String makeCommand; private String makeCommand;
@ -77,7 +78,7 @@ public class Target extends BuildObject implements ITarget {
setName(parent.getName()); setName(parent.getName());
this.artifactName = parent.getArtifactName(); this.artifactName = parent.getArtifactName();
this.binaryParserId = parent.getBinaryParserId(); this.binaryParserId = parent.getBinaryParserId();
this.defaultExtension = parent.getDefaultExtension(); this.defaultExtension = parent.getArtifactExtension();
this.isTest = parent.isTestTarget(); this.isTest = parent.isTestTarget();
this.cleanCommand = parent.getCleanCommand(); this.cleanCommand = parent.getCleanCommand();
@ -193,8 +194,10 @@ public class Target extends BuildObject implements ITarget {
// contain what the user entered in the UI). // contain what the user entered in the UI).
artifactName = element.getAttribute(ARTIFACT_NAME); artifactName = element.getAttribute(ARTIFACT_NAME);
// Get the default extension // Get the overridden extension
defaultExtension = element.getAttribute(DEFAULT_EXTENSION); if (element.hasAttribute(EXTENSION)) {
extension = element.getAttribute(EXTENSION);
}
// parent // parent
String parentId = element.getAttribute(PARENT); String parentId = element.getAttribute(PARENT);
@ -261,7 +264,9 @@ public class Target extends BuildObject implements ITarget {
element.setAttribute(PARENT, parent.getId()); element.setAttribute(PARENT, parent.getId());
element.setAttribute(IS_ABSTRACT, isAbstract ? "true" : "false"); element.setAttribute(IS_ABSTRACT, isAbstract ? "true" : "false");
element.setAttribute(ARTIFACT_NAME, getArtifactName()); element.setAttribute(ARTIFACT_NAME, getArtifactName());
element.setAttribute(DEFAULT_EXTENSION, getDefaultExtension()); if (extension != null) {
element.setAttribute(EXTENSION, extension);
}
element.setAttribute(IS_TEST, isTest ? "true" : "false"); element.setAttribute(IS_TEST, isTest ? "true" : "false");
element.setAttribute(CLEAN_COMMAND, getCleanCommand()); element.setAttribute(CLEAN_COMMAND, getCleanCommand());
if (makeCommand != null) { if (makeCommand != null) {
@ -410,8 +415,9 @@ public class Target extends BuildObject implements ITarget {
return emptyConfigs; return emptyConfigs;
} }
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.ITarget#getDefaultExtension() * @see org.eclipse.cdt.managedbuilder.core.ITarget#getDefaultExtension()
*/ */
public String getDefaultExtension() { public String getDefaultExtension() {
return defaultExtension == null ? EMPTY_STRING : defaultExtension; return defaultExtension == null ? EMPTY_STRING : defaultExtension;
@ -442,6 +448,28 @@ public class Target extends BuildObject implements ITarget {
} }
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.ITarget#getArtifactExtension()
*/
public String getArtifactExtension() {
// Has the user changed the extension for this target
if (extension != null) {
return extension;
}
// If not, then go through the default extension lookup
if (defaultExtension == null) {
// Ask my parent first
if (parent != null) {
return parent.getArtifactExtension();
} else {
return EMPTY_STRING;
}
} else {
return defaultExtension;
}
}
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.ITarget#getBinaryParserId() * @see org.eclipse.cdt.managedbuilder.core.ITarget#getBinaryParserId()
*/ */
@ -476,7 +504,7 @@ public class Target extends BuildObject implements ITarget {
configurations.add(configuration); configurations.add(configuration);
configMap.put(configuration.getId(), configuration); configMap.put(configuration.getId(), configuration);
} }
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.ITarget#isAbstract() * @see org.eclipse.cdt.core.build.managed.ITarget#isAbstract()
*/ */
@ -506,9 +534,18 @@ public class Target extends BuildObject implements ITarget {
} }
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.ITarget#setBuildArtifact(java.lang.String) * @see org.eclipse.cdt.managedbuilder.core.ITarget#setArtifactExtension(java.lang.String)
*/ */
public void setBuildArtifact(String name) { public void setArtifactExtension(String extension) {
if (extension != null) {
this.extension = extension;
}
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.ITarget#setArtifactName(java.lang.String)
*/
public void setArtifactName(String name) {
if (name != null) { if (name != null) {
artifactName = name; artifactName = name;
} }
@ -523,4 +560,14 @@ public class Target extends BuildObject implements ITarget {
} }
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.ITarget#updateOwner(org.eclipse.core.resources.IResource)
*/
public void updateOwner(IResource resource) {
if (!resource.equals(owner)) {
// Set the owner correctly
owner = resource;
}
}
} }

View file

@ -1,164 +1,189 @@
2003-11-10 Tanya Wolff 2004-2-17 Sean Evoy
Fixes for 51640
I18N-Externalized strings from plugin.xml. Externalized strings for the target names.
I18N-Added keys & strings to plugin.properties. * plugin.properties
Fixed an id error in linux c compiler debugger options. * plugin.xml
* plugin.xml
* plugin.properties Fixes for bug 49590:
The system now makes a distinction between the name of the output and its extension.
2003-11-11 Sean Evoy The UI for managing the name of the build output now has a field for entering the
Work to implement bugzilla 44841: extension. The new project wizard does not automatically append the extension to the
Added a scrollbar to the list control inside the custom list field editor. name of the build output.
Also added an Edit button to the field editor to make it easier for keyboard-only * src/org/eclipse/cdt/managedbuilder/ui/properties/BuildPropertyPage.java
accessibility. * src/org/eclipse/cdt/managedbuilder/ui/properties/ManageConfigDialog.java
* src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectWizard.java
Work for bugzilla 44451:
Changed the method that prompts user for information so that if the user cancels Some ground work for C11:
with an empty input dialog, the method always returns an empty string. The responsibility Added a browse button and an area for selecting a path variable to the browse
now rests with the caller to test the return value for length > 0 to decide whether or dialog. However, this is still turned off since it is not fully functional.
not to add string to the list. * src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties
* src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionListFieldEditor.java * src/org/eclipse/cdt/managedbuilder/ui/properties/BrowseEntryDialog.java
* src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionListFieldEditor.java
Moved string constants from core UI plugin to build UI plugin. These values are duplicated
in the standadrd make UI plugin anyway, so the argument for keeping them in a common Changed the order of the configurations in the manifest so that debug configurations are the default for every project.
plugin seems pretty weak. This removes another dependency between the builder UI and * plugin.xml
common UI plugin. I did have to change the string resource lookup method in a few of
the UI implementation classes that use the constants. 2003-11-10 Tanya Wolff
* src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties
* src/org/eclipse/cdt/managedbuilder/ui/properties/BrowseEntryDialog.java I18N-Externalized strings from plugin.xml.
* src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolSettingsPage.java I18N-Added keys & strings to plugin.properties.
* src/org/eclipse/cdt/managedbuilder/ui/properties/ManageConfigDialog.java Fixed an id error in linux c compiler debugger options.
* plugin.xml
2003-10-17 Tom Tromey * plugin.properties
Changed -werror to -Werror 2003-11-11 Sean Evoy
* plugin.xml Work to implement bugzilla 44841:
Added a scrollbar to the list control inside the custom list field editor.
2003-10-14 Alain Magloire Also added an Edit button to the field editor to make it easier for keyboard-only
accessibility.
ICOptionPage was added a new method
Preferences getPreferences(); Work for bugzilla 44451:
This is needed to get the preference store when saving Changed the method that prompts user for information so that if the user cancels
On the plugin. We had the equivalent for project with an empty input dialog, the method always returns an empty string. The responsibility
IProject getProject(); now rests with the caller to test the return value for length > 0 to decide whether or
not to add string to the list.
* src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectOptionPage * src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionListFieldEditor.java
2003-10-01 Sean Evoy Moved string constants from core UI plugin to build UI plugin. These values are duplicated
Fix for bugs 43490 (trivial), 44020, and 43980. in the standadrd make UI plugin anyway, so the argument for keeping them in a common
A massive change has occurred in the plugin file. I added new C tools that apply plugin seems pretty weak. This removes another dependency between the builder UI and
only to projects with C natures. I also added option overrides in the default common UI plugin. I did have to change the string resource lookup method in a few of
configurations for these new tools. The trivial fix for the new C project wizard the UI implementation classes that use the constants.
involved changing the icon entry in the plugin file. * src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties
* plugin.xml * src/org/eclipse/cdt/managedbuilder/ui/properties/BrowseEntryDialog.java
* src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolSettingsPage.java
In preparation for 44020, each new configuration created is assigned a truly * src/org/eclipse/cdt/managedbuilder/ui/properties/ManageConfigDialog.java
random ID.
* src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectWizard.java 2003-10-17 Tom Tromey
* src/org/eclipse/cdt/managedbuilder/ui/properties/BuildPropertyPage.java
Changed -werror to -Werror
Removed a tooltip that was not being populated properly. * plugin.xml
* src/org/eclipse/cdt/managedbuilder/ui/wizards/CProjectPlatformPage.java
2003-10-14 Alain Magloire
2003-09-30 Sean Evoy
Fix for bug 41826. ICOptionPage was added a new method
Preferences getPreferences();
Updated the tool specifications for Win32, Linux, and Solaris so that header This is needed to get the preference store when saving
file extension info is available. On the plugin. We had the equivalent for project
* plugin.xml IProject getProject();
2003-09-25 Sean Evoy * src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectOptionPage
For bug (really an enhancement request)43756, I added the word default to a
widget label to try and make it clear that a new configuration will be based 2003-10-01 Sean Evoy
on default values, not user-overridden stuff. It remains to be seen if this Fix for bugs 43490 (trivial), 44020, and 43980.
actually helps, but it seems reasonable. A massive change has occurred in the plugin file. I added new C tools that apply
* src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties only to projects with C natures. I also added option overrides in the default
configurations for these new tools. The trivial fix for the new C project wizard
For bug 43220 I now display a widget just for user objects. involved changing the icon entry in the plugin file.
* src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolSettingsPage.java * plugin.xml
* src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolsSettingsStore.java
In preparation for 44020, each new configuration created is assigned a truly
I also reordered the plugin definition for the linker tools, and moved some of random ID.
the option labels to the plugin property file. I also added a user object option * src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectWizard.java
to each linker tool definition. * src/org/eclipse/cdt/managedbuilder/ui/properties/BuildPropertyPage.java
* plugin.properties
* plugin.xml Removed a tooltip that was not being populated properly.
* src/org/eclipse/cdt/managedbuilder/ui/wizards/CProjectPlatformPage.java
2003-09-25 Sean Evoy
This patch contains a lot of changes needed to implement fixes for 42648 and 2003-09-30 Sean Evoy
43122. Fix for bug 41826.
The properties file has been updated to externalize some of the option labels Updated the tool specifications for Win32, Linux, and Solaris so that header
to try and address some of the concern about continuity between UIs on file extension info is available.
different platforms. * plugin.xml
* plugin.properties
2003-09-25 Sean Evoy
There are changes in the plugin XML file to accomodate showing the targets For bug (really an enhancement request)43756, I added the word default to a
only on the correct host platform. Option names have bee replaced with widget label to try and make it clear that a new configuration will be based
externalized equivalents where possible. The release and debug configurations on default values, not user-overridden stuff. It remains to be seen if this
for each configuration now apply "reasonable" defaults for debug and optimization actually helps, but it seems reasonable.
option. Finally, the Cygwinb tool specification has been brought closer to those * src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties
for *nix.
* plugin.xml For bug 43220 I now display a widget just for user objects.
* src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolSettingsPage.java
Only targets that correspond to the host platforms are shown in the drop-down * src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolsSettingsStore.java
list.
* src/org/eclipse/cdt/managedbuilder/ui/wizards/CProjectPlatformPage.java I also reordered the plugin definition for the linker tools, and moved some of
the option labels to the plugin property file. I also added a user object option
2003-09-23 Sean Evoy to each linker tool definition.
I added a fix for critical bug 43439. The new project wizard is ready to be hooked * plugin.properties
up to the help system content on F1. There is a new file with the string constant * plugin.xml
the doc project will use to map the widget to a help file.
* src/org/eclipse/cdt/managedbuilder/ui/wizards/CProjectPlatformPage.java 2003-09-25 Sean Evoy
* src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuilderHelpContextIds.java This patch contains a lot of changes needed to implement fixes for 42648 and
43122.
In support of the fix for critical bug 43292, I added a new set of widgets to
the ManageConfigDialog implementation. I added new string literals in the properties The properties file has been updated to externalize some of the option labels
file for the plugin. There are obviously new event handlers for the Manage dialog. to try and address some of the concern about continuity between UIs on
It displays the make command for the target, the name of the build artifact, and different platforms.
a list of current and deleted configurations. There is no way to add new targets. * plugin.properties
Users can restore deleted configurations up until they click OK. The client of this
dialog has been changed to properly respond to the changes. The NewConfigurationDialog There are changes in the plugin XML file to accomodate showing the targets
now displays an externalized string in the title bar. only on the correct host platform. Option names have bee replaced with
* plugin.xml externalized equivalents where possible. The release and debug configurations
* plugin.properties for each configuration now apply "reasonable" defaults for debug and optimization
* src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties option. Finally, the Cygwinb tool specification has been brought closer to those
* src/org/eclipse/cdt/managedbuilder/ui/properties/BuildPropertyPage.java for *nix.
* src/org/eclipse/cdt/managedbuilder/ui/properties/ManageConfigDialog.java * plugin.xml
* src/org/eclipse/cdt/managedbuilder/ui/properties/NewConfigurationDialog.java
Only targets that correspond to the host platforms are shown in the drop-down
2003-09-19 Sean Evoy list.
Removed the binary parser selection tab from the new class wizard. Updated the * src/org/eclipse/cdt/managedbuilder/ui/wizards/CProjectPlatformPage.java
page description externalized string.
* src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties 2003-09-23 Sean Evoy
* src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectOptionPage.java I added a fix for critical bug 43439. The new project wizard is ready to be hooked
up to the help system content on F1. There is a new file with the string constant
Added the hard-coded binary parser info to the defined targets. the doc project will use to map the widget to a help file.
* plugin.xml * src/org/eclipse/cdt/managedbuilder/ui/wizards/CProjectPlatformPage.java
* src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuilderHelpContextIds.java
Fixed the event handling for add/remove in the list widget for build settings pages.
* src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionListFieldEditor.java In support of the fix for critical bug 43292, I added a new set of widgets to
the ManageConfigDialog implementation. I added new string literals in the properties
2003-09-16 Sean Evoy file for the plugin. There are obviously new event handlers for the Manage dialog.
Changed the initialization and button status logic so the list buttons are It displays the make command for the target, the name of the build artifact, and
enabled correctly on start-up and that the fist item in the list (if a list of current and deleted configurations. There is no way to add new targets.
any) is selected. Also changed the "Add" event handler to properly enable Users can restore deleted configurations up until they click OK. The client of this
the buttons and set the list selection. dialog has been changed to properly respond to the changes. The NewConfigurationDialog
now displays an externalized string in the title bar.
* src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionListFieldEditor.java * plugin.xml
* plugin.properties
2003-09-15 Sean Evoy * src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties
First submission of code to new project. Moved all the managed * src/org/eclipse/cdt/managedbuilder/ui/properties/BuildPropertyPage.java
builder-specific UI elements out of the cdt.ui project. This * src/org/eclipse/cdt/managedbuilder/ui/properties/ManageConfigDialog.java
includes the icons, and externalized strings. * src/org/eclipse/cdt/managedbuilder/ui/properties/NewConfigurationDialog.java
There are 2 new classes to handle the externalized strings and image 2003-09-19 Sean Evoy
files: Removed the binary parser selection tab from the new class wizard. Updated the
* src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties page description externalized string.
* src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuilderUIPlugin.java * src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties
* src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuilderUIImages.java * src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectOptionPage.java
The property pages have been modified to use a mix of externalized Added the hard-coded binary parser info to the defined targets.
strings from the CUIPlugin and ManagedBuilderUIPlugin. The new project * plugin.xml
wizard has been reimplemented using the new C project classes added by
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
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
any) is selected. Also changed the "Add" event handler to properly enable
the buttons and set the list selection.
* src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionListFieldEditor.java
2003-09-15 Sean Evoy
First submission of code to new project. Moved all the managed
builder-specific UI elements out of the cdt.ui project. This
includes the icons, and externalized strings.
There are 2 new classes to handle the externalized strings and image
files:
* src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties
* src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuilderUIPlugin.java
* src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuilderUIImages.java
The property pages have been modified to use a mix of externalized
strings from the CUIPlugin and ManagedBuilderUIPlugin. The new project
wizard has been reimplemented using the new C project classes added by
QNX September 12, 2003. The UI itself has not changed. QNX September 12, 2003. The UI itself has not changed.

View file

@ -7,15 +7,34 @@ MngCWizard.description=Create a new C project and let Eclipse create and manage
MngCCWizard.name=Managed Make C++ Project MngCCWizard.name=Managed Make C++ Project
MngCCWizard.description=Create a new C++ project and let Eclipse create and manage the makefile MngCCWizard.description=Create a new C++ project and let Eclipse create and manage the makefile
#The property pages
MngBuildProp.name=C/C++ Build
# Build Model Names # Build Model Names
TargetName.cygw=Cygwin
TargetName.cygw.exe=Cygwin Executable
TargetName.cygw.so=Cygwin Shared Library
TargetName.cygw.lib=Cygwin Static Library
TargetName.cygw.dll=Cygwin Export Library (DLL)
TargetName.linux=Linux
TargetName.linux.exe=Linux Executable
TargetName.linux.so=Linux Shared Library
TargetName.linux.lib=Linux Static Library
TargetName.solaris=Solaris
TargetName.solaris.exe=Solaris Executable
TargetName.solaris.so=Solaris Shared Library
TargetName.solaris.lib=Solaris Static Library
ConfigName.Rel=Release ConfigName.Rel=Release
ConfigName.Dbg=Debug ConfigName.Dbg=Debug
ToolName.preprocessor = Preprocessor ToolName.preprocessor = Preprocessor
ToolName.compiler.c = C Compiler ToolName.compiler.c = C Compiler
ToolName.compiler.cpp = C++ Compiler ToolName.compiler.cpp = C++ Compiler
ToolName.archiver = Archiver ToolName.archiver = Archiver
ToolName.linker.c = C Linker ToolName.linker.c = C Linker
ToolName.linker.cpp = C++ Linker ToolName.linker.cpp = C++ Linker
OptionCategory.Symbols = Symbols OptionCategory.Symbols = Symbols
OptionCategory.Preproc = Preprocessor OptionCategory.Preproc = Preprocessor
OptionCategory.Dirs = Directories OptionCategory.Dirs = Directories

File diff suppressed because it is too large Load diff

View file

@ -59,7 +59,8 @@ NewConfiguration.error.duplicateName=A configuration named "{0}" already exists.
ManageConfig.label.makecmdgroup=Make command ManageConfig.label.makecmdgroup=Make command
ManageConfig.label.makecmddef=Use default command ManageConfig.label.makecmddef=Use default command
ManageConfig.label.output.group=Build output ManageConfig.label.output.group=Build output
ManageConfig.label.output.label=Artifact name: ManageConfig.label.output.name=Artifact name:
ManageConfig.label.output.extension=Artifact extension:
ManageConfig.label.configs=Manage configurations ManageConfig.label.configs=Manage configurations
ManageConfig.label.restore=Restore ManageConfig.label.restore=Restore
ManageConfig.label.configs.current=Current: ManageConfig.label.configs.current=Current:

View file

@ -1,73 +1,102 @@
package org.eclipse.cdt.managedbuilder.ui.properties; package org.eclipse.cdt.managedbuilder.ui.properties;
/********************************************************************** /*******************************************************************************
* Copyright (c) 2002,2003 Rational Software Corporation and others. * Copyright (c) 2002,2004 IBM Corporation and others. All rights reserved.
* All rights reserved. This program and the accompanying materials * This program and the accompanying materials are made available under the
* are made available under the terms of the Common Public License v0.5 * terms of the Common Public License v0.5 which accompanies this distribution,
* which accompanies this distribution, and is available at * and is available at http://www.eclipse.org/legal/cpl-v05.html
* http://www.eclipse.org/legal/cpl-v05.html
* *
* Contributors: * Contributors: IBM Rational Software - Initial API and implementation
* IBM Rational Software - Initial API and implementation ******************************************************************************/
* **********************************************************************/
import org.eclipse.cdt.internal.ui.dialogs.SelectionStatusDialog;
import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin;
import org.eclipse.cdt.managedbuilder.internal.ui.ManagedBuilderUIPlugin; import org.eclipse.cdt.managedbuilder.internal.ui.ManagedBuilderUIPlugin;
import org.eclipse.cdt.utils.ui.controls.ControlFactory; import org.eclipse.cdt.utils.ui.controls.ControlFactory;
import org.eclipse.jface.dialogs.Dialog; import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.swt.SWT; import org.eclipse.swt.SWT;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.events.ModifyEvent; import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener; import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.DirectoryDialog;
import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text; import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.internal.ide.IDEWorkbenchMessages;
public class BrowseEntryDialog extends Dialog { /**
* The BrowseEntryDialog allows clients to prompt the user for a path location.
* The dialog will contain a browse button to make it easy to lcate absolute
* locations onthe target file system. The user will also be able to specify a
* location using defined variables. The client must be able to deal with these
* variables.
*/
public class BrowseEntryDialog extends SelectionStatusDialog {
// String constants // String constants
private static final String PREFIX = "BuildPropertyCommon"; //$NON-NLS-1$ private static final String PREFIX = "BuildPropertyCommon"; //$NON-NLS-1$
private static final String LABEL = PREFIX + ".label"; //$NON-NLS-1$ private static final String LABEL = PREFIX + ".label"; //$NON-NLS-1$
private static final String BROWSE = LABEL + ".browse"; //$NON-NLS-1$ private static final String BROWSE = LABEL + ".browse"; //$NON-NLS-1$
private static final String HIDE = "hideAdvanced"; //$NON-NLS-1$
/** private static final String SHOW = "showAdvanced"; //$NON-NLS-1$
private static final String EMPTY = "NewFolderDialog.folderNameEmpty"; //$NON-NLS-1$
/* (non-Javadoc)
* The title of the dialog. * The title of the dialog.
*/ */
private String title = ""; private String title = "";
/** /* (non-Javadoc)
* The message to display, or <code>null</code> if none. * The message to display, or <code>null</code> if none.
*/ */
private String message = ""; private String message = "";
/** /* (non-Javadoc)
* The input value; the empty string by default. * The input value; the empty string by default.
*/ */
private String value = ""; private String folderName = "";
/** /* (non-Javadoc)
* Error message label widget. *
*/ */
private Label errorMessageLabel; private int basicShellHeight;
/* (non-Javadoc)
*
*/
// private CreateLinkedResourceGroup linkedResourceGroup;
// Widgets // Widgets
private Button btnBrowse = null; private Button advancedButton = null;
private Button btnOK = null; private Button browseButton = null;
private Label errorMessageLabel;
private Composite macroComposite;
private Text text = null; private Text text = null;
/** /**
* Creates an input dialog with OK, Cancel, and a Browse button. * Creates an input dialog with OK, Cancel, a Browse button and a button to
* reveal path macros.
* *
* @param shell the parent shell * @param shell
* @param dialogTitle the title of the dialog or <code>null</code> if none * the parent shell
* @param dialogMessage the dialog message, or <code>null</code> if none * @param dialogTitle
* @param initialValue the initial input value, or <code>null</code> if none * the title of the dialog or <code>null</code> if none
* (equivalent to the empty string) * @param dialogMessage
* the dialog message, or <code>null</code> if none
* @param initialValue
* the initial input value, or <code>null</code> if none
* (equivalent to the empty string)
*/ */
public BrowseEntryDialog(Shell shell, String dialogTitle, String dialogMessage, String initialValue) { public BrowseEntryDialog(Shell shell, String dialogTitle, String dialogMessage, String initialValue) {
super(shell); super(shell);
@ -81,105 +110,228 @@ public class BrowseEntryDialog extends Dialog {
} }
// Value for the text widget // Value for the text widget
if (initialValue != null) { if (initialValue != null) {
value = initialValue; folderName = initialValue;
} }
setStatusLineAboveButtons(true);
} }
/* (non-Javadoc) /* (non-Javadoc)
* Method declared on Dialog. * @see org.eclipse.cdt.internal.ui.dialogs.SelectionStatusDialog#computeResult()
*/ */
protected void buttonPressed(int buttonId) { protected void computeResult() {
if (buttonId == IDialogConstants.OK_ID) { // TODO Auto-generated method stub
value = text.getText().trim();
} else {
value = null;
}
super.buttonPressed(buttonId);
} }
/* (non-Javadoc) /* (non-Javadoc)
* Method declared in Window. * @see org.eclipse.cdt.internal.ui.dialogs.SelectionStatusDialog#configureShell(org.eclipse.swt.widgets.Shell)
*/ */
protected void configureShell(Shell shell) { protected void configureShell(Shell shell) {
super.configureShell(shell); super.configureShell(shell);
if (title != null) // Set the display title the user has specified
if (title != null) {
shell.setText(title); shell.setText(title);
}
protected Control createDialogArea(Composite parent) {
Composite composite = ControlFactory.createComposite(parent, 4);
// Create the label
if (message != null) {
Label label = new Label(composite, SWT.WRAP);
label.setText(message);
GridData gd = new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_CENTER);
gd.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);
gd.horizontalSpan = 4;
label.setLayoutData(gd);
label.setFont(parent.getFont());
} }
}
text = new Text(composite, SWT.SINGLE | SWT.BORDER);
GridData gd = new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL); /* (non-Javadoc)
gd.horizontalSpan = 3; * @see org.eclipse.cdt.internal.ui.dialogs.SelectionStatusDialog#create()
text.setLayoutData(gd); */
text.addModifyListener(new ModifyListener() { public void create() {
public void modifyText(ModifyEvent e) { // Disable the OK button to start
updateButtonState(); super.create();
getButton(IDialogConstants.OK_ID).setEnabled(false);
}
/* (non-Javadoc)
*
* @param parent
*/
private void createAdvancedBrowseArea(Composite parent) {
// Instantiate the macros button
advancedButton = new Button(parent, SWT.PUSH);
applyDialogFont(advancedButton);
advancedButton.setText(IDEWorkbenchMessages.getString(SHOW));
setButtonLayoutData(advancedButton);
GridData data = (GridData) advancedButton.getLayoutData();
data.horizontalAlignment = GridData.BEGINNING;
advancedButton.setLayoutData(data);
advancedButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
handleAdvancedPressed();
}
});
advancedButton.addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent e) {
advancedButton = null;
} }
}); });
// Instantiate the browse button // linkedResourceGroup = new CreateLinkedResourceGroup(
btnBrowse = ControlFactory.createPushButton(composite, ManagedBuilderUIPlugin.getResourceString(BROWSE)); // IResource.FOLDER,
setButtonLayoutData(btnBrowse); // new Listener(){
btnBrowse.addSelectionListener(new SelectionAdapter () { // public void handleEvent(Event event) {
// // TODO Auto-generated method stub
//
// }
// });
}
/* (non-Javadoc)
*
* @param parent
*/
private void createBasicBrowseArea(Composite parent) {
Composite basicGroup = new Composite(parent, SWT.NONE);
basicGroup.setLayout(new GridLayout(2, false));
basicGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
GridData data;
// Create the label
if (message != null) {
Label label = new Label(basicGroup, SWT.WRAP);
label.setText(message);
data = new GridData(
GridData.FILL_HORIZONTAL |
GridData.GRAB_VERTICAL |
GridData.VERTICAL_ALIGN_BEGINNING);
data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);
data.horizontalSpan = 2;
label.setLayoutData(data);
applyDialogFont(label);
}
// Entry widget next
text = new Text(basicGroup, SWT.SINGLE | SWT.BORDER);
data = new GridData(GridData.FILL_BOTH);
data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH;
text.setLayoutData(data);
text.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
validateLocation();
}
});
applyDialogFont(text);
// Finally make the browse button
browseButton = new Button(basicGroup, SWT.PUSH);
applyDialogFont(browseButton);
browseButton.setText(ManagedBuilderUIPlugin.getResourceString(BROWSE));
setButtonLayoutData(browseButton);
data = (GridData) browseButton.getLayoutData();
data.horizontalAlignment = GridData.BEGINNING;
browseButton.setLayoutData(data);
browseButton.addSelectionListener(new SelectionAdapter () {
public void widgetSelected(SelectionEvent e) { public void widgetSelected(SelectionEvent e) {
handleBrowsePressed(); handleBrowsePressed();
} }
}); });
browseButton.addDisposeListener(new DisposeListener () {
public void widgetDisposed(DisposeEvent e) {
browseButton = null;
}
});
}
protected Control createDialogArea(Composite parent) {
Composite composite = (Composite) super.createDialogArea(parent);
composite.setLayout(new GridLayout());
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
createBasicBrowseArea(composite);
createAdvancedBrowseArea(composite);
return composite; return composite;
} }
protected void createButtonsForButtonBar(Composite parent) { /**
// create OK and Cancel buttons by default * Answers the value the user has entered in the selection dialog.
btnOK = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); *
createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false); * <p>The selection will be a folder location specified in the format appropriate
* for the platform that Eclipse is running on, i.e. <code>C:\foo\mydir</code>
* for Windows platforms and <code>/foo/mydir</code> on POSIX platforms.
*
* <p>The answer may also contain a path variable as a component of the location. It
* is the responsibility of the client to properly handle this situation.
*
* @return String
*/
public String getValue() {
return folderName;
}
text.setFocus(); /* (non-Javadoc)
if (value != null) { * Shows/hides the path macro widgets.
text.setText(value); */
protected void handleAdvancedPressed() {
Shell shell = getShell();
Point shellSize = shell.getSize();
if (macroComposite == null) {
basicShellHeight = shell.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).y;
Composite composite = (Composite) getDialogArea();
// macroComposite = linkedResourceGroup.createContents(composite);
macroComposite = ControlFactory.createComposite(composite, 1);
shellSize = shell.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
shell.setSize(shellSize);
advancedButton.setText(IDEWorkbenchMessages.getString(HIDE));
} else if (macroComposite.getVisible()) {
macroComposite.setVisible(false);
shell.setSize(shellSize.x, basicShellHeight);
advancedButton.setText(IDEWorkbenchMessages.getString(SHOW));
} else {
macroComposite.setVisible(true);
shellSize = shell.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
shell.setSize(shellSize);
advancedButton.setText(IDEWorkbenchMessages.getString(HIDE));
} }
updateButtonState();
} }
protected String getValue() { /* (non-Javadoc)
return value; *
} */
protected void handleBrowsePressed() { protected void handleBrowsePressed() {
// Popup a file browser widget // TODO Auto-generated method stub
DirectoryDialog dialog = new DirectoryDialog(getShell());
// Create a hint if text widget contains value
String widgetText;
if ((widgetText = text.getText().trim()).length() > 0) {
dialog.setFilterPath(widgetText);
}
// Open the selection dialog and populate the widget
String directory;
if ((directory = dialog.open()) != null) {
/*
* TODO: Convert the dialog to the proper format for platform (i.e.
* if platform.pathStyle == Platform.POSIX then swap \\ to / )
*/
text.setText(directory.trim());
updateButtonState();
}
} }
protected void updateButtonState() { /* (non-Javadoc)
if (btnOK != null) * Utility method to send a status message to the status line of the dialog.
btnOK.setEnabled(text.getText().trim().length() > 0); *
* @param severity
* @param message
*/
private void updateStatus(int severity, String message) {
updateStatus(new Status(severity, ManagedBuilderCorePlugin.getUniqueIdentifier(), severity, message, null));
}
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.ui.dialogs.SelectionStatusDialog#updateStatus(org.eclipse.core.runtime.IStatus)
*/
protected void updateStatus(IStatus status) {
// TODO Auto-generated method stub
super.updateStatus(status);
}
/**
*
*/
protected void validateLocation() {
folderName = text.getText();
// Empty or null string is invalid
if (folderName == null || folderName.equals("")) {
updateStatus(IStatus.ERROR, IDEWorkbenchMessages.getString(EMPTY));
return;
} else {
// Make sure that the specified location exists
IPath path = new Path(folderName);
if (!path.isValidPath(folderName)) {
updateStatus(IStatus.ERROR, "Folder name invalid");
return;
}
}
updateStatus(IStatus.OK, ""); //$NON-NLS-1$
getButton(IDialogConstants.OK_ID).setEnabled(true);
} }
} }

View file

@ -1,7 +1,7 @@
package org.eclipse.cdt.managedbuilder.ui.properties; package org.eclipse.cdt.managedbuilder.ui.properties;
/********************************************************************** /**********************************************************************
* Copyright (c) 2002,2003 Rational Software Corporation and others. * Copyright (c) 2002,2004 Rational Software Corporation and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v0.5 * are made available under the terms of the Common Public License v0.5
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -43,13 +43,6 @@ public class BuildOptionListFieldEditor extends FieldEditor {
private static final String DOWN = "BuildPropertyCommon.label.down"; //$NON-NLS-1$ private static final String DOWN = "BuildPropertyCommon.label.down"; //$NON-NLS-1$
private static final String EDIT = "BuildPropertyCommon.label.editVar"; //$NON-NLS-1$ private static final String EDIT = "BuildPropertyCommon.label.editVar"; //$NON-NLS-1$
// UI constants
private static final int VERTICAL_DIALOG_UNITS_PER_CHAR = 8;
private static final int HORIZONTAL_DIALOG_UNITS_PER_CHAR = 4;
private static final int LIST_HEIGHT_IN_CHARS = 10;
private static final int LIST_HEIGHT_IN_DLUS =
LIST_HEIGHT_IN_CHARS * VERTICAL_DIALOG_UNITS_PER_CHAR;
// The top-level control for the field editor. // The top-level control for the field editor.
private Composite top; private Composite top;
// The list of tags. // The list of tags.
@ -171,14 +164,6 @@ public class BuildOptionListFieldEditor extends FieldEditor {
// Make the list // Make the list
list = new List(controlGroup, SWT.SINGLE | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL); list = new List(controlGroup, SWT.SINGLE | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
// Create a grid data that takes up the extra space in the dialog and spans one column.
GridData listData = new GridData(GridData.FILL_HORIZONTAL);
listData.heightHint =
convertVerticalDLUsToPixels(list, LIST_HEIGHT_IN_DLUS);
listData.horizontalSpan = 1;
list.setLayoutData(listData);
list.addSelectionListener(new SelectionAdapter() { list.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) { public void widgetSelected(SelectionEvent e) {
selectionChanged(); selectionChanged();
@ -222,6 +207,12 @@ public class BuildOptionListFieldEditor extends FieldEditor {
// Create the buttons // Create the buttons
createButtons(buttonGroup); createButtons(buttonGroup);
// Create a grid data that takes up the extra space in the dialog and spans one column.
GridData listData = new GridData(GridData.FILL_HORIZONTAL);
listData.heightHint = buttonGroup.computeSize(SWT.DEFAULT, SWT.DEFAULT).y;
listData.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH;
list.setLayoutData(listData);
} }
/* (non-Javadoc) /* (non-Javadoc)
@ -329,9 +320,11 @@ public class BuildOptionListFieldEditor extends FieldEditor {
protected String getNewInputObject() { protected String getNewInputObject() {
// Create a dialog to prompt for a new symbol or path // Create a dialog to prompt for a new symbol or path
InputDialog dialog = new InputDialog(getShell(), ManagedBuilderUIPlugin.getResourceString(TITLE), fieldName, new String(), null); InputDialog dialog = new InputDialog(getShell(), ManagedBuilderUIPlugin.getResourceString(TITLE), fieldName, new String(), null);
// BrowseEntryDialog dialog = new BrowseEntryDialog(getShell(), ManagedBuilderUIPlugin.getResourceString(TITLE), fieldName, new String());
String input = new String(); String input = new String();
if (dialog.open() == InputDialog.OK) { if (dialog.open() == InputDialog.OK) {
input = dialog.getValue(); // if (dialog.open() == BrowseEntryDialog.OK) {
input = dialog.getValue();
} }
return input; return input;
} }

View file

@ -1,7 +1,7 @@
package org.eclipse.cdt.managedbuilder.ui.properties; package org.eclipse.cdt.managedbuilder.ui.properties;
/********************************************************************** /**********************************************************************
* Copyright (c) 2002,2003 Rational Software Corporation and others. * Copyright (c) 2002,2004 Rational Software Corporation and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v0.5 * are made available under the terms of the Common Public License v0.5
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -446,7 +446,11 @@ public class BuildPropertyPage extends PropertyPage implements IWorkbenchPropert
// Get the build output name // Get the build output name
String newBuildOutput = manageDialog.getBuildArtifactName(); String newBuildOutput = manageDialog.getBuildArtifactName();
if (!selectedTarget.getArtifactName().equals(newBuildOutput)) { if (!selectedTarget.getArtifactName().equals(newBuildOutput)) {
selectedTarget.setBuildArtifact(newBuildOutput); selectedTarget.setArtifactName(newBuildOutput);
}
String newBuildExt = manageDialog.getBuildArtifaceExtension();
if (!selectedTarget.getArtifactExtension().equals(newBuildExt)) {
selectedTarget.setArtifactExtension(newBuildExt);
} }
// Get the new make command // Get the new make command

View file

@ -1,7 +1,7 @@
package org.eclipse.cdt.managedbuilder.ui.properties; package org.eclipse.cdt.managedbuilder.ui.properties;
/********************************************************************** /**********************************************************************
* Copyright (c) 2002,2003 Rational Software Corporation and others. * Copyright (c) 2002,2004 Rational Software Corporation and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v0.5 * are made available under the terms of the Common Public License v0.5
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -19,7 +19,6 @@ import org.eclipse.cdt.managedbuilder.core.IConfiguration;
import org.eclipse.cdt.managedbuilder.core.ITarget; import org.eclipse.cdt.managedbuilder.core.ITarget;
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager; import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
import org.eclipse.cdt.managedbuilder.internal.ui.ManagedBuilderUIPlugin; import org.eclipse.cdt.managedbuilder.internal.ui.ManagedBuilderUIPlugin;
import org.eclipse.cdt.utils.ui.controls.ControlFactory;
import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IProject;
import org.eclipse.jface.dialogs.Dialog; import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.dialogs.IDialogConstants;
@ -29,6 +28,7 @@ import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Control;
@ -50,14 +50,16 @@ public class ManageConfigDialog extends Dialog {
private static final String GROUP = LABEL + ".makecmdgroup"; //$NON-NLS-1$ private static final String GROUP = LABEL + ".makecmdgroup"; //$NON-NLS-1$
private static final String DEF_BTN = LABEL + ".makecmddef"; //$NON-NLS-1$ private static final String DEF_BTN = LABEL + ".makecmddef"; //$NON-NLS-1$
private static final String OUTPUT_GROUP = LABEL + ".output.group"; //$NON-NLS-1$ private static final String OUTPUT_GROUP = LABEL + ".output.group"; //$NON-NLS-1$
private static final String OUTPUT_LABEL = LABEL + ".output.label"; //$NON-NLS-1$ private static final String OUTPUT_EXT = LABEL + ".output.extension"; //$NON-NLS-1$
private static final String OUTPUT_NAME = LABEL + ".output.name"; //$NON-NLS-1$
private static final String CONFIGS = LABEL + ".configs"; //$NON-NLS-1$ private static final String CONFIGS = LABEL + ".configs"; //$NON-NLS-1$
private static final String CURRENT_CONFIGS = CONFIGS + ".current"; //$NON-NLS-1$ private static final String CURRENT_CONFIGS = CONFIGS + ".current"; //$NON-NLS-1$
private static final String DELETED_CONFIGS = CONFIGS + ".deleted"; //$NON-NLS-1$ private static final String DELETED_CONFIGS = CONFIGS + ".deleted"; //$NON-NLS-1$
private static final String CONF_DLG = LABEL + ".new.config.dialog"; //$NON-NLS-1$ private static final String CONF_DLG = LABEL + ".new.config.dialog"; //$NON-NLS-1$
// The name of the build artifact // The name of the build artifact
private String buildArtifact; private String artifactExt;
private String artifactName;
// The list of configurations to delete // The list of configurations to delete
private SortedMap deletedConfigs; private SortedMap deletedConfigs;
// Map of configuration names and ids // Map of configuration names and ids
@ -74,7 +76,8 @@ public class ManageConfigDialog extends Dialog {
private boolean useDefaultMake; private boolean useDefaultMake;
// Widgets // Widgets
protected Text buildArtifactEntry; protected Text buildArtifactExt;
protected Text buildArtifactName;
protected List currentConfigList; protected List currentConfigList;
protected List deletedConfigList; protected List deletedConfigList;
protected Button makeCommandDefault; protected Button makeCommandDefault;
@ -96,7 +99,8 @@ public class ManageConfigDialog extends Dialog {
makeCommand = managedTarget.getMakeCommand(); makeCommand = managedTarget.getMakeCommand();
// Get the name of the build artifact // Get the name of the build artifact
buildArtifact = managedTarget.getArtifactName(); artifactExt = managedTarget.getArtifactExtension();
artifactName = managedTarget.getArtifactName();
// Get the defined configurations from the target // Get the defined configurations from the target
getExistingConfigs().clear(); getExistingConfigs().clear();
@ -117,16 +121,17 @@ public class ManageConfigDialog extends Dialog {
if (buttonId == IDialogConstants.OK_ID) { if (buttonId == IDialogConstants.OK_ID) {
useDefaultMake = makeCommandDefault.getSelection(); useDefaultMake = makeCommandDefault.getSelection();
makeCommand = makeCommandEntry.getText().trim(); makeCommand = makeCommandEntry.getText().trim();
buildArtifact = buildArtifactEntry.getText().trim(); artifactName = buildArtifactName.getText().trim();
artifactExt = buildArtifactExt.getText().trim();
} else { } else {
useDefaultMake = true; useDefaultMake = true;
buildArtifact = managedTarget.getArtifactName(); artifactName = managedTarget.getArtifactName();
} }
super.buttonPressed(buttonId); super.buttonPressed(buttonId);
} }
/* (non-Javadoc) /* (non-Javadoc)
* Method declared in Window. * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
*/ */
protected void configureShell(Shell shell) { protected void configureShell(Shell shell) {
super.configureShell(shell); super.configureShell(shell);
@ -134,6 +139,65 @@ public class ManageConfigDialog extends Dialog {
shell.setText(title); shell.setText(title);
} }
/* (non-Javadoc)
* Creates the group that contains the build artifact name controls.
*/
private void createBuildArtifactGroup(Composite parent) {
final Group outputGroup = new Group(parent, SWT.NONE);
outputGroup.setFont(parent.getFont());
outputGroup.setText(ManagedBuilderUIPlugin.getResourceString(OUTPUT_GROUP));
outputGroup.setLayout(new GridLayout(3, false));
outputGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
// Three labels
final Label nameLabel = new Label(outputGroup, SWT.LEFT);
nameLabel.setFont(outputGroup.getFont());
nameLabel.setText(ManagedBuilderUIPlugin.getResourceString(OUTPUT_NAME));
nameLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
final Label placeHolder = new Label(outputGroup, SWT.CENTER);
placeHolder.setText(new String());
placeHolder.setLayoutData(new GridData());
final Label extLabel = new Label(outputGroup, SWT.LEFT);
extLabel.setFont(outputGroup.getFont());
extLabel.setText(ManagedBuilderUIPlugin.getResourceString(OUTPUT_EXT));
extLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
// Now we need two text widgets separated by a label
buildArtifactName = new Text(outputGroup, SWT.SINGLE | SWT.BORDER);
buildArtifactName.setFont(outputGroup.getFont());
buildArtifactName.setText(artifactName);
GridData data = new GridData(GridData.FILL_HORIZONTAL);
data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH;
buildArtifactName.setLayoutData(data);
buildArtifactName.addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent event) {
buildArtifactName = null;
}
});
final Label dotLabel = new Label(outputGroup, SWT.CENTER);
dotLabel.setFont(outputGroup.getFont());
dotLabel.setText(new String("."));
dotLabel.setLayoutData(new GridData());
buildArtifactExt = new Text(outputGroup, SWT.SINGLE | SWT.BORDER);
buildArtifactExt.setFont(outputGroup.getFont());
buildArtifactExt.setText(artifactExt);
data = new GridData(GridData.FILL_HORIZONTAL);
data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH;
buildArtifactExt.setLayoutData(data);
buildArtifactExt.addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent e) {
buildArtifactExt = null;
}
});
}
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite)
*/
protected void createButtonsForButtonBar(Composite parent) { protected void createButtonsForButtonBar(Composite parent) {
// create OK and Cancel buttons by default // create OK and Cancel buttons by default
okBtn = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); okBtn = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
@ -142,71 +206,40 @@ public class ManageConfigDialog extends Dialog {
updateButtons(); updateButtons();
} }
protected Control createDialogArea(Composite parent) { /* (non-Javadoc)
Composite comp = ControlFactory.createComposite(parent, 1); * Create and lays out the group with the configuration edit controls
*/
// Create a group for the build output private void createConfigListGroup(Composite parent) {
Group outputGroup = ControlFactory.createGroup(comp, ManagedBuilderUIPlugin.getResourceString(OUTPUT_GROUP), 1);
outputGroup.setLayoutData(new GridData(GridData.FILL_BOTH));
Label outputLabel = ControlFactory.createLabel(outputGroup, ManagedBuilderUIPlugin.getResourceString(OUTPUT_LABEL));
outputLabel.setLayoutData(new GridData());
buildArtifactEntry = ControlFactory.createTextField(outputGroup);
buildArtifactEntry.setText(buildArtifact);
buildArtifactEntry.addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent event) {
buildArtifactEntry = null;
}
});
// Create the make command group area
Group makeCommandGroup = ControlFactory.createGroup(comp, ManagedBuilderUIPlugin.getResourceString(GROUP), 1);
GridData gd = new GridData(GridData.FILL_BOTH);
makeCommandGroup.setLayoutData(gd);
makeCommandDefault = ControlFactory.createCheckBox(makeCommandGroup, ManagedBuilderUIPlugin.getResourceString(DEF_BTN));
setButtonLayoutData(makeCommandDefault);
makeCommandDefault.setSelection(!managedTarget.hasOverridenMakeCommand());
makeCommandDefault.addSelectionListener(new SelectionAdapter () {
public void widgetSelected(SelectionEvent e) {
handleUseDefaultPressed();
}
});
makeCommandDefault.addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent event) {
makeCommandDefault = null;
}
});
makeCommandEntry = ControlFactory.createTextField(makeCommandGroup);
makeCommandEntry.setEditable(!makeCommandDefault.getSelection());
makeCommandEntry.setText(makeCommand);
makeCommandEntry.addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent event) {
makeCommandEntry = null;
}
});
// Create the config list group area // Create the config list group area
Group configListGroup = ControlFactory.createGroup(comp, ManagedBuilderUIPlugin.getResourceString(CONFIGS), 3); final Group configListGroup = new Group(parent, SWT.NONE);
gd = new GridData(GridData.FILL_BOTH); configListGroup.setFont(parent.getFont());
configListGroup.setLayoutData(gd); configListGroup.setText(ManagedBuilderUIPlugin.getResourceString(CONFIGS));
configListGroup.setLayout(new GridLayout(3, false));
configListGroup.setLayoutData(new GridData(GridData.FILL_BOTH));
// Create the 2 labels first to align the buttons and list controls // Create the 2 labels first to align the buttons and list controls
Label currentConfigLabel = ControlFactory.createLabel(configListGroup, ManagedBuilderUIPlugin.getResourceString(CURRENT_CONFIGS)); final Label currentConfigLabel = new Label(configListGroup, SWT.LEFT);
gd = new GridData(GridData.FILL_HORIZONTAL); currentConfigLabel.setFont(configListGroup.getFont());
gd.horizontalSpan = 2; currentConfigLabel.setText(ManagedBuilderUIPlugin.getResourceString(CURRENT_CONFIGS));
currentConfigLabel.setLayoutData(gd); GridData data = new GridData(GridData.FILL_HORIZONTAL);
Label deletedConfigLabel = ControlFactory.createLabel(configListGroup, ManagedBuilderUIPlugin.getResourceString(DELETED_CONFIGS)); data.horizontalSpan = 2;
currentConfigLabel.setLayoutData(data);
final Label deletedConfigLabel = new Label(configListGroup, SWT.LEFT);
deletedConfigLabel.setFont(configListGroup.getFont());
deletedConfigLabel.setText(ManagedBuilderUIPlugin.getResourceString(DELETED_CONFIGS));
deletedConfigLabel.setLayoutData(new GridData()); deletedConfigLabel.setLayoutData(new GridData());
// Create the current config list // Create the current config list
Composite currentComp = ControlFactory.createComposite(configListGroup, 1); final Composite currentComp = new Composite(configListGroup, SWT.NULL);
gd = new GridData(GridData.FILL_BOTH); currentComp.setFont(configListGroup.getFont());
gd.horizontalSpan = 1; currentComp.setLayout(new GridLayout(1, true));
currentComp.setLayoutData(gd); currentComp.setLayoutData(new GridData(GridData.FILL_BOTH));
currentConfigList = new List(currentComp, SWT.SINGLE|SWT.V_SCROLL|SWT.H_SCROLL|SWT.BORDER); currentConfigList = new List(currentComp, SWT.SINGLE|SWT.V_SCROLL|SWT.H_SCROLL|SWT.BORDER);
gd = new GridData(GridData.FILL_BOTH); currentConfigList.setFont(currentComp.getFont());
gd.widthHint = 100; data = new GridData(GridData.FILL_BOTH);
currentConfigList.setLayoutData(gd); data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH;
currentConfigList.setLayoutData(data);
currentConfigList.addDisposeListener(new DisposeListener() { currentConfigList.addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent event) { public void widgetDisposed(DisposeEvent event) {
currentConfigList = null; currentConfigList = null;
@ -214,10 +247,14 @@ public class ManageConfigDialog extends Dialog {
}); });
// Create a composite for the buttons // Create a composite for the buttons
Composite buttonBar = ControlFactory.createComposite(configListGroup, 1); final Composite buttonBar = new Composite(configListGroup, SWT.NULL);
buttonBar.setLayoutData(new GridData()); buttonBar.setFont(configListGroup.getFont());
buttonBar.setLayout(new GridLayout(1, true));
buttonBar.setLayoutData(new GridData(GridData.FILL_VERTICAL));
newBtn = ControlFactory.createPushButton(buttonBar, ManagedBuilderUIPlugin.getResourceString(NEW)); newBtn = new Button(buttonBar, SWT.PUSH);
newBtn.setFont(buttonBar.getFont());
newBtn.setText(ManagedBuilderUIPlugin.getResourceString(NEW));
setButtonLayoutData(newBtn); setButtonLayoutData(newBtn);
newBtn.addSelectionListener(new SelectionAdapter () { newBtn.addSelectionListener(new SelectionAdapter () {
public void widgetSelected(SelectionEvent e) { public void widgetSelected(SelectionEvent e) {
@ -229,7 +266,10 @@ public class ManageConfigDialog extends Dialog {
newBtn = null; newBtn = null;
} }
}); });
removeBtn = ControlFactory.createPushButton(buttonBar, ManagedBuilderUIPlugin.getResourceString(REMOVE));
removeBtn = new Button(buttonBar, SWT.PUSH);
removeBtn.setFont(buttonBar.getFont());
removeBtn.setText(ManagedBuilderUIPlugin.getResourceString(REMOVE));
setButtonLayoutData(removeBtn); setButtonLayoutData(removeBtn);
removeBtn.addSelectionListener(new SelectionAdapter () { removeBtn.addSelectionListener(new SelectionAdapter () {
public void widgetSelected(SelectionEvent e) { public void widgetSelected(SelectionEvent e) {
@ -241,7 +281,10 @@ public class ManageConfigDialog extends Dialog {
removeBtn = null; removeBtn = null;
} }
}); });
restoreBtn = ControlFactory.createPushButton(buttonBar, ManagedBuilderUIPlugin.getResourceString(RESTORE));
restoreBtn = new Button(buttonBar, SWT.PUSH);
restoreBtn.setFont(buttonBar.getFont());
restoreBtn.setText(ManagedBuilderUIPlugin.getResourceString(RESTORE));
setButtonLayoutData(restoreBtn); setButtonLayoutData(restoreBtn);
restoreBtn.addSelectionListener(new SelectionAdapter () { restoreBtn.addSelectionListener(new SelectionAdapter () {
public void widgetSelected(SelectionEvent e) { public void widgetSelected(SelectionEvent e) {
@ -255,42 +298,104 @@ public class ManageConfigDialog extends Dialog {
}); });
// Create the deleted config list // Create the deleted config list
Composite deletedComp = ControlFactory.createComposite(configListGroup, 1); final Composite deletedComp = new Composite(configListGroup, SWT.NULL);
gd = new GridData(GridData.FILL_BOTH); deletedComp.setFont(configListGroup.getFont());
gd.horizontalSpan = 1; deletedComp.setLayout(new GridLayout(1, true));
deletedComp.setLayoutData(gd); deletedComp.setLayoutData(new GridData(GridData.FILL_BOTH));
deletedConfigList = new List(deletedComp, SWT.SINGLE|SWT.V_SCROLL|SWT.H_SCROLL|SWT.BORDER); deletedConfigList = new List(deletedComp, SWT.SINGLE|SWT.V_SCROLL|SWT.H_SCROLL|SWT.BORDER);
gd = new GridData(GridData.FILL_BOTH); deletedConfigList.setFont(deletedComp.getFont());
gd.widthHint = 100; data = new GridData(GridData.FILL_BOTH);
deletedConfigList.setLayoutData(gd); data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH;
deletedConfigList.setLayoutData(data);
deletedConfigList.addDisposeListener(new DisposeListener() { deletedConfigList.addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent event) { public void widgetDisposed(DisposeEvent event) {
deletedConfigList = null; deletedConfigList = null;
} }
}); });
}
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
*/
protected Control createDialogArea(Composite parent) {
Composite comp = new Composite(parent, SWT.NULL);
comp.setFont(parent.getFont());
comp.setLayout(new GridLayout(1, true));
comp.setLayoutData(new GridData(GridData.FILL_BOTH));
// Create a group for the build output
createBuildArtifactGroup(comp);
// Create the make command group area
createMakeCommandGroup(comp);
// Make the configuration management area
createConfigListGroup(comp);
// Do the final widget prep // Do the final widget prep
currentConfigList.setItems(getConfigurationNames()); currentConfigList.setItems(getConfigurationNames());
currentConfigList.select(0); currentConfigList.select(0);
newBtn.setFocus(); newBtn.setFocus();
return comp; return comp;
} }
/* (non-Javadoc)
* Creates the group control for the make command
* @param parent
*/
private void createMakeCommandGroup(Composite parent) {
final Group makeCommandGroup = new Group(parent, SWT.NONE);
makeCommandGroup.setFont(parent.getFont());
makeCommandGroup.setText(ManagedBuilderUIPlugin.getResourceString(GROUP));
makeCommandGroup.setLayout(new GridLayout(1, true));
makeCommandGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
makeCommandDefault = new Button(makeCommandGroup, SWT.CHECK | SWT.LEFT);
makeCommandDefault.setFont(makeCommandGroup.getFont());
makeCommandDefault.setText(ManagedBuilderUIPlugin.getResourceString(DEF_BTN));
setButtonLayoutData(makeCommandDefault);
makeCommandDefault.setBackground(makeCommandGroup.getBackground());
makeCommandDefault.setForeground(makeCommandGroup.getForeground());
makeCommandDefault.setSelection(!managedTarget.hasOverridenMakeCommand());
makeCommandDefault.addSelectionListener(new SelectionAdapter () {
public void widgetSelected(SelectionEvent e) {
handleUseDefaultPressed();
}
});
makeCommandDefault.addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent event) {
makeCommandDefault = null;
}
});
makeCommandEntry = new Text(makeCommandGroup, SWT.SINGLE | SWT.BORDER);
makeCommandEntry.setFont(makeCommandGroup.getFont());
makeCommandEntry.setEditable(!makeCommandDefault.getSelection());
makeCommandEntry.setText(makeCommand);
makeCommandEntry.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
makeCommandEntry.addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent event) {
makeCommandEntry = null;
}
});
}
/** /**
* * Answers the extension for the build artifact.
* @return
*/ */
protected void handleUseDefaultPressed() { public String getBuildArtifaceExtension() {
// If the state of the button is unchecked, then we want to enable the edit widget return artifactExt;
makeCommandEntry.setEditable(!makeCommandDefault.getSelection());
} }
/** /**
* Answers the value in the build artifact entry widget. * Answers the value in the build artifact entry widget.
* *
* @return * @return
*/ */
public String getBuildArtifactName() { public String getBuildArtifactName() {
return buildArtifact; return artifactName;
} }
private String [] getConfigurationNames() { private String [] getConfigurationNames() {
@ -453,6 +558,14 @@ public class ManageConfigDialog extends Dialog {
} }
} }
/* (non-Javadoc)
* Event handler for the use default check box in the make command group
*/
protected void handleUseDefaultPressed() {
// If the state of the button is unchecked, then we want to enable the edit widget
makeCommandEntry.setEditable(!makeCommandDefault.getSelection());
}
private void updateButtons() { private void updateButtons() {
// Disable the remove button if there is only 1 configuration // Disable the remove button if there is only 1 configuration
removeBtn.setEnabled(currentConfigList.getItemCount() > 1); removeBtn.setEnabled(currentConfigList.getItemCount() > 1);
@ -460,6 +573,10 @@ public class ManageConfigDialog extends Dialog {
restoreBtn.setEnabled(deletedConfigList.getItemCount() > 0); restoreBtn.setEnabled(deletedConfigList.getItemCount() > 0);
} }
/**
* Answers <code>true</code> if the user has left the use default check box selected.
* @return
*/
public boolean useDefaultMakeCommand () { public boolean useDefaultMakeCommand () {
return useDefaultMake; return useDefaultMake;
} }

View file

@ -1,7 +1,7 @@
package org.eclipse.cdt.managedbuilder.ui.wizards; package org.eclipse.cdt.managedbuilder.ui.wizards;
/********************************************************************** /**********************************************************************
* Copyright (c) 2002,2003 Rational Software Corporation and others. * Copyright (c) 2002,2004 Rational Software Corporation and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v0.5 * are made available under the terms of the Common Public License v0.5
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -111,8 +111,7 @@ public class NewManagedProjectWizard extends NewCProjectWizard {
newTarget = ManagedBuildManager.createTarget(newProject, parent); newTarget = ManagedBuildManager.createTarget(newProject, parent);
if (newTarget != null) { if (newTarget != null) {
String artifactName = newProject.getName(); String artifactName = newProject.getName();
artifactName += parent.getDefaultExtension().length() == 0 ? "" : "." + parent.getDefaultExtension(); newTarget.setArtifactName(artifactName);
newTarget.setBuildArtifact(artifactName);
IConfiguration [] selectedConfigs = targetConfigurationPage.getSelectedConfigurations(); IConfiguration [] selectedConfigs = targetConfigurationPage.getSelectedConfigurations();
Random r = new Random(); Random r = new Random();
r.setSeed(System.currentTimeMillis()); r.setSeed(System.currentTimeMillis());