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

Bug 418114 - Build artifact name can be set to an empty string, causing

a cluster of build errors

Change-Id: Ief7eca369edf60aa1a064495a7da98089cb88d5d
Signed-off-by: Serge Beauchamp <sergebeauchamp@mac.com>
Reviewed-on: https://git.eclipse.org/r/16805
Tested-by: Hudson CI
Reviewed-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
IP-Clean: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Tested-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
This commit is contained in:
Serge Beauchamp 2013-09-26 16:03:54 +01:00 committed by Marc-Andre Laperle
parent 4918f94f20
commit 612cecbc3c

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2007, 2010 Intel Corporation and others. * Copyright (c) 2007, 2013 Intel 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 Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -8,6 +8,7 @@
* Contributors: * Contributors:
* Intel Corporation - Initial API and implementation * Intel Corporation - Initial API and implementation
* James Blackburn (Broadcom Corp.) * James Blackburn (Broadcom Corp.)
* Serge Beauchamp (Freescale Semiconductor) - Bug 418114
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.managedbuilder.ui.properties; package org.eclipse.cdt.managedbuilder.ui.properties;
@ -83,8 +84,15 @@ public class ArtifactTab extends AbstractCBuildPropertyTab {
t2.addModifyListener(new ModifyListener() { t2.addModifyListener(new ModifyListener() {
@Override @Override
public void modifyText(ModifyEvent e) { public void modifyText(ModifyEvent e) {
if (canModify) if (canModify) {
String artifactName = t2.getText();
// The artifact Name cannot be empty
if (! page.isMultiCfg() && (artifactName.trim().length() == 0)) {
artifactName = fCfg.getManagedProject().getDefaultArtifactName();
t2.setText(artifactName);
}
fCfg.setArtifactName(t2.getText()); fCfg.setArtifactName(t2.getText());
}
}} ); }} );
Label l3 = new Label(usercomp, SWT.NONE); Label l3 = new Label(usercomp, SWT.NONE);
@ -167,7 +175,7 @@ public class ArtifactTab extends AbstractCBuildPropertyTab {
String s = fCfg.getArtifactName(); String s = fCfg.getArtifactName();
if (! page.isMultiCfg() && (s == null || s.trim().length() == 0)) { if (! page.isMultiCfg() && (s == null || s.trim().length() == 0)) {
s = getResDesc().getConfiguration().getProjectDescription().getName(); s = fCfg.getManagedProject().getDefaultArtifactName();
getCfg().setArtifactName(s); getCfg().setArtifactName(s);
} }
@ -206,7 +214,12 @@ public class ArtifactTab extends AbstractCBuildPropertyTab {
protected void performApply(ICResourceDescription src, ICResourceDescription dst) { protected void performApply(ICResourceDescription src, ICResourceDescription dst) {
IConfiguration cfg1 = getCfg(src.getConfiguration()); IConfiguration cfg1 = getCfg(src.getConfiguration());
IConfiguration cfg2 = getCfg(dst.getConfiguration()); IConfiguration cfg2 = getCfg(dst.getConfiguration());
cfg2.setArtifactName(cfg1.getArtifactName());
String artifactName = cfg1.getArtifactName();
if (! page.isMultiCfg() && (artifactName == null || artifactName.trim().length() == 0))
artifactName = cfg1.getManagedProject().getDefaultArtifactName();
cfg2.setArtifactName(artifactName);
cfg2.setArtifactExtension(cfg1.getArtifactExtension()); cfg2.setArtifactExtension(cfg1.getArtifactExtension());
ITool t1 = cfg1.calculateTargetTool(); ITool t1 = cfg1.calculateTargetTool();