mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +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
|
* 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
|
||||||
|
@ -81,4 +81,6 @@ public interface IBuildDescription {
|
||||||
* @return IPath
|
* @return IPath
|
||||||
*/
|
*/
|
||||||
IPath getDefaultBuildDirLocation();
|
IPath getDefaultBuildDirLocation();
|
||||||
|
|
||||||
|
IPath getDefaultBuildDirFullPath();
|
||||||
}
|
}
|
||||||
|
|
|
@ -2106,7 +2106,11 @@ public class BuildDescription implements IBuildDescription {
|
||||||
public IPath getDefaultBuildDirLocation() {
|
public IPath getDefaultBuildDirLocation() {
|
||||||
return getTopBuildDirLocation();
|
return getTopBuildDirLocation();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public IPath getDefaultBuildDirFullPath() {
|
||||||
|
return getTopBuildDirFullPath();
|
||||||
|
}
|
||||||
|
|
||||||
protected void resourceAddedToType(BuildIOType type, BuildResource rc){
|
protected void resourceAddedToType(BuildIOType type, BuildResource rc){
|
||||||
if(!type.isInput()){
|
if(!type.isInput()){
|
||||||
String var = type.getLinkId();
|
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
|
* 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
|
||||||
|
@ -50,7 +50,12 @@ public class GenDirInfo {
|
||||||
createDir(path, monitor);
|
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){
|
protected void createDir(IPath path, IProgressMonitor monitor){
|
||||||
if(path.segmentCount() > 0 && fDirPathSet.add(path)){
|
if(path.segmentCount() > 0 && fDirPathSet.add(path)){
|
||||||
IFolder folder = fProject.getFolder(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.BuildDescriptionManager;
|
||||||
import org.eclipse.cdt.managedbuilder.buildmodel.IBuildCommand;
|
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.IBuildResource;
|
||||||
import org.eclipse.cdt.managedbuilder.buildmodel.IBuildStep;
|
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.IFile;
|
||||||
|
import org.eclipse.core.resources.IProject;
|
||||||
import org.eclipse.core.resources.IResource;
|
import org.eclipse.core.resources.IResource;
|
||||||
import org.eclipse.core.resources.IWorkspaceRoot;
|
import org.eclipse.core.resources.IWorkspaceRoot;
|
||||||
import org.eclipse.core.resources.ResourcesPlugin;
|
import org.eclipse.core.resources.ResourcesPlugin;
|
||||||
|
@ -188,6 +191,14 @@ public class StepBuilder implements IBuildModelBuilder {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void createOutDirs(IProgressMonitor monitor){
|
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();
|
IBuildResource rcs[] = fStep.getOutputResources();
|
||||||
|
|
||||||
for(int i = 0; i < rcs.length; i++){
|
for(int i = 0; i < rcs.length; i++){
|
||||||
|
|
Loading…
Add table
Reference in a new issue