1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-08 10:16:03 +02:00

Bug 458370: NPE trying to build an existing project

Change-Id: I99cdc7d535a98633ae9d2ea8cca1d49dab1eca3d
Signed-off-by: Andrew Gvozdev <angvoz.dev@gmail.com>
This commit is contained in:
Andrew Gvozdev 2015-03-12 11:09:13 -04:00 committed by Gerrit Code Review @ Eclipse.org
parent 50775fe2fb
commit fe8b5e806d
2 changed files with 38 additions and 32 deletions

View file

@ -1103,6 +1103,7 @@ public class BuildDescription implements IBuildDescription {
// use artifact name & extension // use artifact name & extension
if (fTargetStep == action){ if (fTargetStep == action){
String artifactName = fCfg.getArtifactName(); String artifactName = fCfg.getArtifactName();
if (artifactName != null && ! artifactName.trim().isEmpty()) {
try { try {
String tmp = ManagedBuildManager.getBuildMacroProvider().resolveValue(artifactName, "", " ", IBuildMacroProvider.CONTEXT_CONFIGURATION, fCfg); //$NON-NLS-1$ //$NON-NLS-2$ String tmp = ManagedBuildManager.getBuildMacroProvider().resolveValue(artifactName, "", " ", IBuildMacroProvider.CONTEXT_CONFIGURATION, fCfg); //$NON-NLS-1$ //$NON-NLS-2$
if((tmp = tmp.trim()).length() > 0) if((tmp = tmp.trim()).length() > 0)
@ -1139,6 +1140,10 @@ public class BuildDescription implements IBuildDescription {
if(ioType == null) if(ioType == null)
ioType = action.createIOType(false, true, type); ioType = action.createIOType(false, true, type);
addOutputs(new IPath[]{path}, ioType, outDirPath); addOutputs(new IPath[]{path}, ioType, outDirPath);
} else {
String msg = BuildModelMessages.getFormattedString("BuildDescription.MissingArtifact", new String[] {fProject.getName(), fCfg.getName()}); //$NON-NLS-1$
ManagedBuilderCorePlugin.log(new Status(IStatus.WARNING, ManagedBuilderCorePlugin.PLUGIN_ID, msg));
}
} else if (outTypes != null && outTypes.length > 0) { } else if (outTypes != null && outTypes.length > 0) {
for (IOutputType type : outTypes) { for (IOutputType type : outTypes) {
boolean primaryOutput = (type == tool.getPrimaryOutputType()); boolean primaryOutput = (type == tool.getPrimaryOutputType());

View file

@ -1,5 +1,5 @@
############################################################################### ###############################################################################
# Copyright (c) 2007 Intel Corporation and others. # Copyright (c) 2015 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
@ -10,3 +10,4 @@
############################################################################### ###############################################################################
BuildResource.0=Generated resource conflict: \ntwo resources of the same name: {0} \ngenerated by different tools \ntool1: {1} \ntool2: {2}\n BuildResource.0=Generated resource conflict: \ntwo resources of the same name: {0} \ngenerated by different tools \ntool1: {1} \ntool2: {2}\n
BuildDescription.MissingArtifact=Build Artifact is missing in project ''{0}'' configuration ''{1}''