mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 22:52:11 +02:00
Fix for [Bug 187092] [Internal Builder] Build output directory not created when pre-build step is run
This commit is contained in:
parent
b13f9ba593
commit
0209a3ac9b
4 changed files with 26 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2006 Intel Corporation and others.
|
||||
* Copyright (c) 2006, 2007 Intel Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -81,4 +81,6 @@ public interface IBuildDescription {
|
|||
* @return IPath
|
||||
*/
|
||||
IPath getDefaultBuildDirLocation();
|
||||
|
||||
IPath getDefaultBuildDirFullPath();
|
||||
}
|
||||
|
|
|
@ -2106,7 +2106,11 @@ public class BuildDescription implements IBuildDescription {
|
|||
public IPath getDefaultBuildDirLocation() {
|
||||
return getTopBuildDirLocation();
|
||||
}
|
||||
|
||||
|
||||
public IPath getDefaultBuildDirFullPath() {
|
||||
return getTopBuildDirFullPath();
|
||||
}
|
||||
|
||||
protected void resourceAddedToType(BuildIOType type, BuildResource rc){
|
||||
if(!type.isInput()){
|
||||
String var = type.getLinkId();
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2006 Intel Corporation and others.
|
||||
* Copyright (c) 2006, 2007 Intel Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -50,7 +50,12 @@ public class GenDirInfo {
|
|||
createDir(path, monitor);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void createIfProjectDir(IPath fullPath, IProgressMonitor monitor){
|
||||
if(fullPath.segmentCount() > fProjPath.segmentCount() && fProjPath.isPrefixOf(fullPath))
|
||||
createDir(fullPath.removeFirstSegments(fProjPath.segmentCount()), monitor);
|
||||
}
|
||||
|
||||
protected void createDir(IPath path, IProgressMonitor monitor){
|
||||
if(path.segmentCount() > 0 && fDirPathSet.add(path)){
|
||||
IFolder folder = fProject.getFolder(path);
|
||||
|
|
|
@ -14,9 +14,12 @@ import java.io.OutputStream;
|
|||
|
||||
import org.eclipse.cdt.managedbuilder.buildmodel.BuildDescriptionManager;
|
||||
import org.eclipse.cdt.managedbuilder.buildmodel.IBuildCommand;
|
||||
import org.eclipse.cdt.managedbuilder.buildmodel.IBuildDescription;
|
||||
import org.eclipse.cdt.managedbuilder.buildmodel.IBuildResource;
|
||||
import org.eclipse.cdt.managedbuilder.buildmodel.IBuildStep;
|
||||
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.resources.IResource;
|
||||
import org.eclipse.core.resources.IWorkspaceRoot;
|
||||
import org.eclipse.core.resources.ResourcesPlugin;
|
||||
|
@ -188,6 +191,14 @@ public class StepBuilder implements IBuildModelBuilder {
|
|||
}
|
||||
|
||||
protected void createOutDirs(IProgressMonitor monitor){
|
||||
IBuildDescription des = fStep.getBuildDescription();
|
||||
if(des != null && des.getInputStep() == fStep){
|
||||
IPath path = des.getDefaultBuildDirFullPath();
|
||||
if(path != null){
|
||||
fDirs.createIfProjectDir(path, monitor);
|
||||
}
|
||||
}
|
||||
|
||||
IBuildResource rcs[] = fStep.getOutputResources();
|
||||
|
||||
for(int i = 0; i < rcs.length; i++){
|
||||
|
|
Loading…
Add table
Reference in a new issue