Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 133173 Details for
Bug 273636
changes to enable MBS on EFS projects
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
proposed patch
EFS_managed_build_patch.txt (text/plain), 41.08 KB, created by
Chris Recoskie
on 2009-04-24 15:36:23 EDT
(
hide
)
Description:
proposed patch
Filename:
MIME Type:
Creator:
Chris Recoskie
Created:
2009-04-24 15:36:23 EDT
Size:
41.08 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.cdt.managedbuilder.core.tests >Index: tests/org/eclipse/cdt/managedbuilder/core/tests/BuildDescriptionModelTests.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/BuildDescriptionModelTests.java,v >retrieving revision 1.10 >diff -u -r1.10 BuildDescriptionModelTests.java >--- tests/org/eclipse/cdt/managedbuilder/core/tests/BuildDescriptionModelTests.java 15 Jun 2007 10:49:52 -0000 1.10 >+++ tests/org/eclipse/cdt/managedbuilder/core/tests/BuildDescriptionModelTests.java 24 Apr 2009 19:31:20 -0000 >@@ -60,6 +60,7 @@ > import org.eclipse.core.runtime.NullProgressMonitor; > import org.eclipse.core.runtime.Path; > >+@SuppressWarnings("restriction") > public class BuildDescriptionModelTests extends TestCase { > private static final String PREFIX = "BuildDescription_"; > private static final String PROJ_PATH = "testBuildDescriptionProjects"; >@@ -68,15 +69,15 @@ > private Runnable fCleaner = fCompositeCleaner; > > private class CompositeCleaner implements Runnable{ >- private List fRunnables = new ArrayList(); >+ private List<Runnable> fRunnables = new ArrayList<Runnable>(); > > public void addRunnable(Runnable r){ > fRunnables.add(r); > } > > public void run() { >- for(Iterator iter = fRunnables.iterator(); iter.hasNext();){ >- Runnable r = (Runnable)iter.next(); >+ for(Iterator<Runnable> iter = fRunnables.iterator(); iter.hasNext();){ >+ Runnable r = iter.next(); > r.run(); > } > fRunnables.clear(); >@@ -84,7 +85,7 @@ > > } > private class ProjectCleaner implements Runnable{ >- List fProjList = new ArrayList(); >+ List<String> fProjList = new ArrayList<String>(); > > public ProjectCleaner(){ > } >@@ -106,8 +107,8 @@ > } > > public void run() { >- for(Iterator iter = fProjList.iterator(); iter.hasNext();){ >- String name = (String)iter.next(); >+ for(Iterator<String> iter = fProjList.iterator(); iter.hasNext();){ >+ String name = iter.next(); > ManagedBuildTestHelper.removeProject(name); > } > fProjList.clear(); >@@ -143,7 +144,7 @@ > if(aAsmRc != des.createResource("a.asm")) > fail("new build resource created for the same resource"); > >- if(aAsmRc != des.createResource(aAsm.getLocation(), aAsm.getFullPath())) >+ if(aAsmRc != des.createResource(aAsm.getLocation(), aAsm.getLocationURI())) > fail("new build resource created for the same resource"); > > assertEquals(aAsmRc.getProducerIOType(), null); >@@ -157,6 +158,7 @@ > if(type == null) > fail("failed to create output type"); > >+ assertNotNull(type); > assertEquals(type.getStep(), inStep); > > type.addResource(aAsmRc); >@@ -558,21 +560,21 @@ > } > */ > private void doTestStep(IBuildStep step, IBuildStep oStep, boolean up){ >- Map inMap = new HashMap(); >- Map outMap = new HashMap(); >+ Map<IBuildIOType, IBuildIOType> inMap = new HashMap<IBuildIOType, IBuildIOType>(); >+ Map<IBuildIOType, IBuildIOType> outMap = new HashMap<IBuildIOType, IBuildIOType>(); > > stepsMatch(step, oStep, inMap, outMap, true); > >- Map map = up ? outMap : inMap; >+ Map<IBuildIOType, IBuildIOType> map = up ? outMap : inMap; > >- for(Iterator iter = map.entrySet().iterator();iter.hasNext();){ >+ for(Iterator<?> iter = map.entrySet().iterator();iter.hasNext();){ > Map.Entry entry = (Map.Entry)iter.next(); > doTestType((IBuildIOType)entry.getKey(), (IBuildIOType)entry.getValue()); > } > } > > private void doTestType(IBuildIOType type, IBuildIOType oType){ >- Map map = new HashMap(); >+ Map<IBuildResource, IBuildResource> map = new HashMap<IBuildResource, IBuildResource>(); > > typesMatch(type, oType, map, true); > >@@ -583,7 +585,7 @@ > } > > private void doTestResource(IBuildResource rc, IBuildResource oRc, boolean up){ >- Map outMap = new HashMap(); >+ Map<IBuildIOType, IBuildIOType> outMap = new HashMap<IBuildIOType, IBuildIOType>(); > > doTestResourceMatch(rc, oRc, outMap); > >@@ -591,7 +593,7 @@ > typesMatch(rc.getProducerIOType(), oRc.getProducerIOType(), null, true); > doTestStep(rc.getProducerIOType().getStep(), oRc.getProducerIOType().getStep(), up); > } else { >- Set stepSet = new HashSet(); >+ Set<IBuildStep> stepSet = new HashSet<IBuildStep>(); > > for(Iterator iter = outMap.entrySet().iterator(); iter.hasNext();){ > Map.Entry entry = (Map.Entry)iter.next(); >@@ -607,7 +609,7 @@ > } > } > >- private void doTestResourceMatch(IBuildResource rc, IBuildResource oRc, Map outTypeMap){ >+ private void doTestResourceMatch(IBuildResource rc, IBuildResource oRc, Map<IBuildIOType, IBuildIOType> outTypeMap){ > > doTrace("matching resource " + DbgUtil.resourceName(rc)); > >@@ -642,11 +644,11 @@ > } > > >- private boolean stepsMatch(IBuildStep step, IBuildStep oStep, Map inTypeMap, Map outTypeMap, boolean failOnErr){ >+ private boolean stepsMatch(IBuildStep step, IBuildStep oStep, Map<IBuildIOType, IBuildIOType> inTypeMap, Map<IBuildIOType, IBuildIOType> outTypeMap, boolean failOnErr){ > return stepsMatch(step, oStep, inTypeMap, outTypeMap, true, failOnErr); > } > >- private boolean stepsMatch(IBuildStep step, IBuildStep oStep, Map inTypeMap, Map outTypeMap, boolean checkSteps, boolean failOnErr){ >+ private boolean stepsMatch(IBuildStep step, IBuildStep oStep, Map<IBuildIOType, IBuildIOType> inTypeMap, Map<IBuildIOType, IBuildIOType> outTypeMap, boolean checkSteps, boolean failOnErr){ > IBuildIOType inTypes[] = step.getInputIOTypes(); > IBuildIOType oInTypes[] = oStep.getInputIOTypes(); > >@@ -709,7 +711,7 @@ > return getCorType(type, oTypes, null, true); > } > >- private IBuildIOType getCorType(IBuildIOType type, IBuildIOType oTypes[], Map rcMap, boolean checkSteps){ >+ private IBuildIOType getCorType(IBuildIOType type, IBuildIOType oTypes[], Map<IBuildResource, IBuildResource> rcMap, boolean checkSteps){ > for(int i = 0; i < oTypes.length; i++){ > if(typesMatch(type, oTypes[i], rcMap, checkSteps, false)) > return oTypes[i]; >@@ -746,11 +748,11 @@ > */ > } > >- private boolean typesMatch(IBuildIOType type, IBuildIOType oType, Map rcMap, boolean failOnError){ >+ private boolean typesMatch(IBuildIOType type, IBuildIOType oType, Map<IBuildResource, IBuildResource> rcMap, boolean failOnError){ > return typesMatch(type, oType, rcMap, true, failOnError); > } > >- private boolean typesMatch(IBuildIOType type, IBuildIOType oType, Map rcMap, boolean checkStep, boolean failOnError){ >+ private boolean typesMatch(IBuildIOType type, IBuildIOType oType, Map<IBuildResource, IBuildResource> rcMap, boolean checkStep, boolean failOnError){ > > // doTrace("matching io type"); > if(type.isInput() != oType.isInput()){ >@@ -766,8 +768,8 @@ > return false; > > if(resourcesMatch(rcs, oRcs, rcMap)){ >- Map inMap = new HashMap(); >- Map outMap = new HashMap(); >+ Map<IBuildIOType, IBuildIOType> inMap = new HashMap<IBuildIOType, IBuildIOType>(); >+ Map<IBuildIOType, IBuildIOType> outMap = new HashMap<IBuildIOType, IBuildIOType>(); > if(!checkStep) > return true; > return stepsMatch(type.getStep(), oType.getStep(), inMap, outMap, false, failOnError); >@@ -779,7 +781,7 @@ > return false; > } > >- private boolean resourcesMatch(IBuildResource rcs[], IBuildResource oRcs[], Map rcMap){ >+ private boolean resourcesMatch(IBuildResource rcs[], IBuildResource oRcs[], Map<IBuildResource, IBuildResource> rcMap){ > if(rcs.length != oRcs.length) > return false; > >#P org.eclipse.cdt.managedbuilder.gnu.ui >Index: .project >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.managedbuilder.gnu.ui/.project,v >retrieving revision 1.1 >diff -u -r1.1 .project >--- .project 16 May 2005 20:48:15 -0000 1.1 >+++ .project 24 Apr 2009 19:31:20 -0000 >@@ -20,9 +20,15 @@ > <arguments> > </arguments> > </buildCommand> >+ <buildCommand> >+ <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name> >+ <arguments> >+ </arguments> >+ </buildCommand> > </buildSpec> > <natures> > <nature>org.eclipse.pde.PluginNature</nature> > <nature>org.eclipse.jdt.core.javanature</nature> >+ <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature> > </natures> > </projectDescription> >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.managedbuilder.gnu.ui/META-INF/MANIFEST.MF,v >retrieving revision 1.8 >diff -u -r1.8 MANIFEST.MF >--- META-INF/MANIFEST.MF 9 Jan 2009 10:05:52 -0000 1.8 >+++ META-INF/MANIFEST.MF 24 Apr 2009 19:31:20 -0000 >@@ -9,7 +9,7 @@ > Export-Package: org.eclipse.cdt.managedbuilder.gnu.cygwin, > org.eclipse.cdt.managedbuilder.gnu.ui > Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)", >- org.eclipse.cdt.managedbuilder.core;bundle-version="[5.0.0,6.0.0)", >+ org.eclipse.cdt.managedbuilder.core;bundle-version="[5.1.0,6.0.0)", > org.eclipse.cdt.core;bundle-version="[5.0.0,6.0.0)", > org.eclipse.core.resources > Bundle-ActivationPolicy: lazy >#P org.eclipse.cdt.managedbuilder.ui >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.managedbuilder.ui/META-INF/MANIFEST.MF,v >retrieving revision 1.15 >diff -u -r1.15 MANIFEST.MF >--- META-INF/MANIFEST.MF 23 Apr 2009 14:57:17 -0000 1.15 >+++ META-INF/MANIFEST.MF 24 Apr 2009 19:31:21 -0000 >@@ -8,6 +8,7 @@ > Bundle-Localization: plugin > Export-Package: org.eclipse.cdt.managedbuilder.internal.ui.workingsets, > org.eclipse.cdt.managedbuilder.ui.actions, >+ org.eclipse.cdt.managedbuilder.ui.preferences, > org.eclipse.cdt.managedbuilder.ui.properties, > org.eclipse.cdt.managedbuilder.ui.wizards > Require-Bundle: org.eclipse.ui.ide;bundle-version="[3.2.0,4.0.0)", >@@ -15,7 +16,7 @@ > org.eclipse.ui;bundle-version="[3.2.0,4.0.0)", > org.eclipse.cdt.core;bundle-version="[5.0.0,6.0.0)", > org.eclipse.cdt.ui;bundle-version="[5.0.0,6.0.0)", >- org.eclipse.cdt.managedbuilder.core;bundle-version="[5.0.0,6.0.0)", >+ org.eclipse.cdt.managedbuilder.core;bundle-version="[5.1.0,6.0.0)", > org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)", > org.eclipse.core.variables;bundle-version="[3.1.100,4.0.0)", > org.eclipse.ui.navigator;bundle-version="[3.2.0,4.0.0)";resolution:=optional, >Index: src/org/eclipse/cdt/managedbuilder/ui/properties/AbstractToolSettingUI.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/AbstractToolSettingUI.java,v >retrieving revision 1.2 >diff -u -r1.2 AbstractToolSettingUI.java >--- src/org/eclipse/cdt/managedbuilder/ui/properties/AbstractToolSettingUI.java 22 Jan 2009 18:16:17 -0000 1.2 >+++ src/org/eclipse/cdt/managedbuilder/ui/properties/AbstractToolSettingUI.java 24 Apr 2009 19:31:21 -0000 >@@ -30,6 +30,9 @@ > this(info, GRID); > } > >+ /** >+ * @since 5.0 >+ */ > protected AbstractToolSettingUI(IResourceInfo info, int style) { > super(style); > noDefaultAndApplyButton(); >Index: src/org/eclipse/cdt/managedbuilder/ui/properties/ToolSettingsTab.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ToolSettingsTab.java,v >retrieving revision 1.17 >diff -u -r1.17 ToolSettingsTab.java >--- src/org/eclipse/cdt/managedbuilder/ui/properties/ToolSettingsTab.java 6 Apr 2009 19:04:15 -0000 1.17 >+++ src/org/eclipse/cdt/managedbuilder/ui/properties/ToolSettingsTab.java 24 Apr 2009 19:31:21 -0000 >@@ -449,10 +449,16 @@ > } > } > >+ /** >+ * @since 5.0 >+ */ > protected void addFilter(ViewerFilter filter) { > optionList.addFilter(filter); > } > >+ /** >+ * @since 5.0 >+ */ > @SuppressWarnings("unchecked") > protected void setOption(IOption op1, IOption op2, IHoldsOptions dst, IResourceInfo res){ > try { >@@ -601,6 +607,7 @@ > * Unlike the default provider, that provider also contains > * the user-modified macros that are not applied yet > * If the "Build Macros" tab is not available, returns the default BuildMacroProvider >+ * @noreference This method is not intended to be referenced by clients. > */ > public BuildMacroProvider obtainMacroProvider(){ > return (BuildMacroProvider)ManagedBuildManager.getBuildMacroProvider(); >Index: .project >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.managedbuilder.ui/.project,v >retrieving revision 1.4 >diff -u -r1.4 .project >--- .project 2 Dec 2005 20:43:10 -0000 1.4 >+++ .project 24 Apr 2009 19:31:21 -0000 >@@ -20,9 +20,15 @@ > <arguments> > </arguments> > </buildCommand> >+ <buildCommand> >+ <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name> >+ <arguments> >+ </arguments> >+ </buildCommand> > </buildSpec> > <natures> > <nature>org.eclipse.jdt.core.javanature</nature> > <nature>org.eclipse.pde.PluginNature</nature> >+ <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature> > </natures> > </projectDescription> >#P org.eclipse.cdt.managedbuilder.core >Index: src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuMakefileGenerator.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuMakefileGenerator.java,v >retrieving revision 1.81 >diff -u -r1.81 GnuMakefileGenerator.java >--- src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuMakefileGenerator.java 11 Jun 2008 15:48:35 -0000 1.81 >+++ src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuMakefileGenerator.java 24 Apr 2009 19:31:21 -0000 >@@ -13,6 +13,7 @@ > package org.eclipse.cdt.managedbuilder.makegen.gnu; > > import java.io.ByteArrayInputStream; >+import java.io.File; > import java.io.IOException; > import java.io.InputStream; > import java.io.InputStreamReader; >@@ -70,6 +71,8 @@ > import org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyGeneratorType; > import org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyInfo; > import org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyPreBuild; >+import org.eclipse.core.filesystem.EFS; >+import org.eclipse.core.filesystem.IFileStore; > import org.eclipse.core.resources.IContainer; > import org.eclipse.core.resources.IFile; > import org.eclipse.core.resources.IFolder; >@@ -2012,7 +2015,7 @@ > // if( (rcInfo.isExcluded()) ) > // continue; > addFragmentMakefileEntriesForSource(buildVarToRuleStringMap, ruleBuffer, >- folder, relativePath, resource, resource.getLocation(), rcInfo, null, false); >+ folder, relativePath, resource, getPathForResource(resource), rcInfo, null, false); > } > } > >@@ -2159,7 +2162,7 @@ > // because the file is not under the project. We use this resource in the calls to the dependency generator > generateOutputResource = project.getFile(generatedOutput); > } else { >- generatedOutput = project.getLocation().append(getBuildWorkingDir()).append((IPath)generatedOutputs.get(k)); >+ generatedOutput = getPathForResource(project).append(getBuildWorkingDir()).append((IPath)generatedOutputs.get(k)); > generateOutputResource = project.getFile(getBuildWorkingDir().append((IPath)generatedOutputs.get(k))); > } > IResourceInfo nextRcInfo; >@@ -2194,6 +2197,17 @@ > } > } > >+ >+ /** >+ * Gets a path for a resource by extracting the Path field from its >+ * location URI. >+ * @return IPath >+ * @since 5.1 >+ */ >+ protected IPath getPathForResource(IResource resource) { >+ return new Path(resource.getLocationURI().getPath()); >+ } >+ > /* (non-Javadoc) > * Adds the source file to the appropriate build variable > * >@@ -2415,12 +2429,31 @@ > * then we must get the actual location of the resource, rather > * than the relative path. > */ >- String projectLocation = project.getLocation().toString(); >+ String projectLocation = null; >+ >+ // is the project local? if so we might have to convert the paths to local format >+ try { >+ IFileStore fileStore = EFS.getStore(project.getLocationURI()); >+ File localFile = fileStore.toLocalFile(EFS.NONE, null); >+ >+ if(localFile != null) { >+ // it's a local file... use project location for proper path formatting >+ projectLocation = project.getLocation().addTrailingSeparator().toOSString(); >+ } >+ else { >+ // remote... get the path from the URI >+ projectLocation = project.getLocationURI().getPath().toString(); >+ >+ } >+ } catch (CoreException e1) { >+ // TODO Auto-generated catch block >+ e1.printStackTrace(); >+ } > > // Output file location needed for the file-specific build macros > IPath outputLocation = Path.fromOSString(primaryOutputName); > if (!outputLocation.isAbsolute()) { >- outputLocation = project.getLocation().append(getBuildWorkingDir()).append(primaryOutputName); >+ outputLocation = getPathForResource(project).append(getBuildWorkingDir()).append(primaryOutputName); > } > > // A separate rule is needed for the resource in the case where explicit file-specific macros >@@ -2644,7 +2677,7 @@ > IPath addlPath = addlInputPaths[i]; > if (!(addlPath.toString().startsWith("$("))) { //$NON-NLS-1$ > if (!addlPath.isAbsolute()) { >- IPath tempPath = project.getLocation().append(addlPath); >+ IPath tempPath = getPathForResource(project).append(addlPath); > if (tempPath != null) { > addlPath = ManagedBuildManager.calculateRelativePath(getTopBuildDir(), tempPath); > } >@@ -3854,7 +3887,7 @@ > String relativePath, IPath sourceLocation, boolean generatedSource) { > // Add the source file path to the makefile line that adds source files to the build variable > String srcName; >- IPath projectLocation = project.getLocation(); >+ IPath projectLocation = getPathForResource(project); > IPath dirLocation = projectLocation; > if (generatedSource) { > dirLocation = dirLocation.append(getBuildWorkingDir()); >@@ -4618,7 +4651,7 @@ > * Return the configuration's top build directory as an absolute path > */ > public IPath getTopBuildDir() { >- return project.getLocation().append(getBuildWorkingDir()); >+ return getPathForResource(project).append(getBuildWorkingDir()); > } > > /** >Index: src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildResource.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildResource.java,v >retrieving revision 1.10 >diff -u -r1.10 BuildResource.java >--- src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildResource.java 12 Sep 2007 08:48:34 -0000 1.10 >+++ src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildResource.java 24 Apr 2009 19:31:21 -0000 >@@ -10,6 +10,7 @@ > *******************************************************************************/ > package org.eclipse.cdt.managedbuilder.internal.buildmodel; > >+import java.net.URI; > import java.util.ArrayList; > import java.util.HashSet; > import java.util.Iterator; >@@ -22,32 +23,38 @@ > import org.eclipse.cdt.managedbuilder.buildmodel.IBuildStep; > import org.eclipse.core.resources.IResource; > import org.eclipse.core.runtime.IPath; >+import org.eclipse.core.runtime.Path; > > public class BuildResource implements IBuildResource { >- private List fDepArgs = new ArrayList(); >+ private List<BuildIOType> fDepArgs = new ArrayList<BuildIOType>(); > private BuildIOType fProducerArg; > private boolean fNeedsRebuild; > private boolean fIsRemoved; > private IPath fLocation; >- private IPath fFullPath; > private boolean fIsProjectRc; > private BuildDescription fInfo; >+ private URI fLocationURI; > > protected BuildResource(BuildDescription info, IResource rc){ >- this(info, info.calcResourceLocation(rc), rc.getFullPath()); >+ this(info, info.calcResourceLocation(rc), rc.getLocationURI()); > } > >- protected BuildResource(BuildDescription info, IPath location, IPath fullPath){ >- fLocation = location; >+ protected BuildResource(BuildDescription info, IPath projectPath, URI locationURI){ >+ >+ if(locationURI == null) >+ throw new IllegalArgumentException(); // must point to somewhere! >+ >+ fLocationURI = locationURI; >+ >+ fLocation = projectPath; > fInfo = info; >- fFullPath = fullPath; >- if(fFullPath != null) >- fIsProjectRc = fFullPath.segment(0).equals(info.getProject().getName()); >+ >+ fIsProjectRc = (projectPath != null); > > info.resourceCreated(this); > > if(DbgUtil.DEBUG) >- DbgUtil.trace("resource " + location + " created"); //$NON-NLS-1$ //$NON-NLS-2$ >+ DbgUtil.trace("resource " + projectPath + " created"); //$NON-NLS-1$ //$NON-NLS-2$ > } > /* (non-Javadoc) > * @see org.eclipse.cdt.managedbuilder.builddescription.IBuildResource#getLocation() >@@ -60,7 +67,7 @@ > * @see org.eclipse.cdt.managedbuilder.builddescription.IBuildResource#getFullPath() > */ > public IPath getFullPath() { >- return fFullPath; >+ return new Path(fLocationURI.getPath()); > } > > /* (non-Javadoc) >@@ -74,7 +81,7 @@ > * @see org.eclipse.cdt.managedbuilder.builddescription.IBuildResource#getDependentIOTypes() > */ > public IBuildIOType[] getDependentIOTypes() { >- return (BuildIOType[])fDepArgs.toArray(new BuildIOType[fDepArgs.size()]); >+ return fDepArgs.toArray(new BuildIOType[fDepArgs.size()]); > } > > /* (non-Javadoc) >@@ -183,11 +190,11 @@ > } > > public IBuildStep[] getDependentSteps() { >- Set set = new HashSet(); >- for(Iterator iter = fDepArgs.iterator(); iter.hasNext();){ >- set.add(((BuildIOType)iter.next()).getStep()); >+ Set<IBuildStep> set = new HashSet<IBuildStep>(); >+ for(Iterator<BuildIOType> iter = fDepArgs.iterator(); iter.hasNext();){ >+ set.add(iter.next().getStep()); > } >- return (BuildStep[])set.toArray(new BuildStep[set.size()]); >+ return set.toArray(new BuildStep[set.size()]); > } > > public IBuildStep getProducerStep() { >@@ -208,4 +215,11 @@ > return buf.toString(); > } > >+ /* (non-Javadoc) >+ * @see org.eclipse.cdt.managedbuilder.buildmodel.IBuildResource#getLocationURI() >+ */ >+ public URI getLocationURI() { >+ return fLocationURI; >+ } >+ > } >Index: src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildDescription.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildDescription.java,v >retrieving revision 1.24 >diff -u -r1.24 BuildDescription.java >--- src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildDescription.java 3 May 2008 09:26:45 -0000 1.24 >+++ src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildDescription.java 24 Apr 2009 19:31:21 -0000 >@@ -11,6 +11,8 @@ > *******************************************************************************/ > package org.eclipse.cdt.managedbuilder.internal.buildmodel; > >+import java.net.URI; >+import java.net.URISyntaxException; > import java.util.ArrayList; > import java.util.Arrays; > import java.util.Collection; >@@ -67,6 +69,8 @@ > import org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyGeneratorType; > import org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyInfo; > import org.eclipse.cdt.managedbuilder.pdomdepgen.PDOMDependencyGenerator; >+import org.eclipse.core.filesystem.EFS; >+import org.eclipse.core.filesystem.IFileStore; > import org.eclipse.core.resources.IFile; > import org.eclipse.core.resources.IProject; > import org.eclipse.core.resources.IResource; >@@ -1003,9 +1007,14 @@ > } > > private IPath getTopBuildDirLocation(){ >- return fProject.getLocation().append(getTopBuildDirFullPath().removeFirstSegments(1)); >+ IPath projLocation = getProjectLocation(); >+ return projLocation.append(getTopBuildDirFullPath().removeFirstSegments(1)); > } > >+ private IPath getProjectLocation() { >+ return new Path(fProject.getLocationURI().getPath()); >+ } >+ > private BuildResource[] addOutputs(IPath paths[], BuildIOType buildArg, IPath outDirPath){ > if(paths != null){ > List list = new ArrayList(); >@@ -1016,21 +1025,24 @@ > > if(outFullPath.isAbsolute()){ > outLocation = outFullPath; >- if(fProject.getLocation().isPrefixOf(outLocation)) >- outFullPath = fProject.getFullPath().append(outLocation.removeFirstSegments(fProject.getLocation().segmentCount())); >+ >+ IPath projLocation = new Path(fProject.getLocationURI().getPath()); >+ >+ if(projLocation.isPrefixOf(outLocation)) >+ outFullPath = projLocation.append(outLocation.removeFirstSegments(projLocation.segmentCount())); > else > outFullPath = null; > } else { > if (outFullPath.segmentCount() == 1) { > outFullPath = outDirPath.append(outFullPath); >- outLocation = fProject.getLocation().append(outFullPath.removeFirstSegments(1)); >+ outLocation = getProjectLocation().append(outFullPath.removeFirstSegments(1)); > } else { > outLocation = getTopBuildDirLocation().append(outFullPath); > outFullPath = getTopBuildDirFullPath().append(outFullPath); > } > } >- >- BuildResource outRc = createResource(outLocation, outFullPath); >+ >+ BuildResource outRc = createResource(outLocation, getURIForFullPath(outFullPath)); > list.add(outRc); > buildArg.addResource(outRc); > >@@ -1040,6 +1052,24 @@ > return null; > } > >+ private URI getURIForFullPath(IPath fullPath) { >+ // Basically, assume that we use the same type of URI that the project uses. >+ // Create one using the same info, except point the path at the path provided. >+ URI projURI = fProject.getLocationURI(); >+ try { >+ URI newURI = new URI(projURI.getScheme(), projURI.getUserInfo(), >+ projURI.getHost(), projURI.getPort(), fullPath >+ .toPortableString(), projURI.getQuery(), projURI >+ .getFragment()); >+ return newURI; >+ } catch (URISyntaxException e) { >+ // TODO Auto-generated catch block >+ e.printStackTrace(); >+ } >+ >+ return null; >+ } >+ > private void calculateOutputs(BuildStep action, BuildIOType arg, BuildResource buildRc) throws CoreException { > BuildResource rcs[] = null; > ITool tool = action.getTool(); >@@ -1344,11 +1374,11 @@ > String outExt = tool.getOutputExtension(inExt); > outFullPath = resolvePercent(outFullPath.addFileExtension(outExt), buildRc.getLocation()); > >- outLocation = fProject.getLocation().append(outFullPath.removeFirstSegments(1)); >+ outLocation = getProjectLocation().append(outFullPath.removeFirstSegments(1)); > > BuildIOType buildArg = action.createIOType(false, true, null); > >- BuildResource outRc = createResource(outLocation, outFullPath); >+ BuildResource outRc = createResource(outLocation, getURIForFullPath(outFullPath)); > buildArg.addResource(outRc); > } > >@@ -1432,8 +1462,8 @@ > > > private IPath locationToRel(IPath location){ >- if(fProject.getLocation().isPrefixOf(location)) >- return location.removeFirstSegments(fProject.getLocation().segmentCount()).setDevice(null); >+ if(getProjectLocation().isPrefixOf(location)) >+ return location.removeFirstSegments(getProjectLocation().segmentCount()).setDevice(null); > //TODO > return location; > } >@@ -1897,8 +1927,8 @@ > } > if(inFullPath == null && files.length > 0) > inFullPath = files[0].getFullPath(); >- if(inFullPath == null && fProject.getLocation().isPrefixOf(inLocation)){ >- inFullPath = fProject.getFullPath().append(inLocation.removeFirstSegments(fProject.getLocation().segmentCount())); >+ if(inFullPath == null && getProjectLocation().isPrefixOf(inLocation)){ >+ inFullPath = fProject.getFullPath().append(inLocation.removeFirstSegments(getProjectLocation().segmentCount())); > } > } else { > IPath projPath = inFullPath; >@@ -1906,14 +1936,9 @@ > > IResource res = ResourcesPlugin.getWorkspace().getRoot().getFile(inFullPath);//.findMember(inFullPath); > inLocation = calcResourceLocation(res); >-/* if(res != null) >- inLocation = res.getLocation(); >- else >- inLocation = fProject.getLocation().append(projPath); >-*/ > } > >- BuildResource rc = createResource(inLocation, inFullPath); >+ BuildResource rc = createResource(inLocation, getURIForFullPath(inFullPath)); > buildArg.addResource(rc); > > return rc; >@@ -1929,19 +1954,36 @@ > } > > public BuildResource createResource(IPath projPath){ >- return createResource(fProject.getLocation().append(projPath),fProject.getFullPath().append(projPath)); >+ return createResource(projPath, createProjectRelativeURI(projPath)); > } > >+ private URI createProjectRelativeURI(IPath projPath) { >+ URI projURI = fProject.getLocationURI(); >+ IFileStore projStore = null; >+ try { >+ projStore = EFS.getStore(projURI); >+ } catch (CoreException e) { >+ // TODO Auto-generated catch block >+ e.printStackTrace(); >+ } >+ >+ if(projStore == null) >+ return null; >+ >+ IFileStore childStore = projStore.getFileStore(projPath); >+ return childStore.toURI(); >+ } >+ > public BuildResource createResource(IResource rc){ >- return createResource(calcResourceLocation(rc), rc.getFullPath()); >+ return createResource(calcResourceLocation(rc), rc.getLocationURI()); > } > >- public BuildResource createResource(IPath location, IPath fullPath){ >+ public BuildResource createResource(IPath projPath, URI locationURI){ > >- BuildResource rc = (BuildResource)getBuildResource(location); >+ BuildResource rc = (BuildResource)getBuildResource(projPath); > > if(rc == null) >- rc = new BuildResource(this, location, fullPath); >+ rc = new BuildResource(this, projPath, locationURI); > > return rc; > } >Index: src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java,v >retrieving revision 1.120 >diff -u -r1.120 ManagedBuildManager.java >--- src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java 20 Feb 2009 21:08:12 -0000 1.120 >+++ src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java 24 Apr 2009 19:31:21 -0000 >@@ -4094,7 +4094,7 @@ > buildDirectory = res.getLocation(); > } > } else { >- buildDirectory = project.getLocation(); >+ buildDirectory = getPathForResource(project); > > if (buildDirectory != null) { > if (builder.isManagedBuildOn()) >@@ -4104,6 +4104,10 @@ > return buildDirectory; > } > >+ private static IPath getPathForResource(IResource resource) { >+ return new Path(resource.getLocationURI().getPath()); >+ } >+ > public static IBuilder[] createBuilders(IProject project, Map args){ > return ManagedBuilderCorePlugin.createBuilders(project, args); > } >Index: src/org/eclipse/cdt/managedbuilder/core/IBuilder.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IBuilder.java,v >retrieving revision 1.11 >diff -u -r1.11 IBuilder.java >--- src/org/eclipse/cdt/managedbuilder/core/IBuilder.java 16 Mar 2009 14:36:23 -0000 1.11 >+++ src/org/eclipse/cdt/managedbuilder/core/IBuilder.java 24 Apr 2009 19:31:21 -0000 >@@ -89,6 +89,9 @@ > static final String DEFAULT_TARGET_CLEAN = "clean"; //$NON-NLS-1$ > static final String DEFAULT_TARGET_AUTO = "all"; //$NON-NLS-1$ > >+ /** >+ * @since 5.1 >+ */ > static final String ATTRIBUTE_COMMAND_LAUNCHER = "commandLauncher"; //$NON-NLS-1$ > > /** >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.managedbuilder.core/META-INF/MANIFEST.MF,v >retrieving revision 1.18 >diff -u -r1.18 MANIFEST.MF >--- META-INF/MANIFEST.MF 13 Mar 2009 13:47:45 -0000 1.18 >+++ META-INF/MANIFEST.MF 24 Apr 2009 19:31:21 -0000 >@@ -2,25 +2,25 @@ > Bundle-ManifestVersion: 2 > Bundle-Name: %pluginName > Bundle-SymbolicName: org.eclipse.cdt.managedbuilder.core; singleton:=true >-Bundle-Version: 5.0.100.qualifier >+Bundle-Version: 5.1.0.qualifier > Bundle-Activator: org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin > Bundle-Vendor: %providerName > Bundle-Localization: plugin > Export-Package: org.eclipse.cdt.build.core.scannerconfig, >- org.eclipse.cdt.build.internal.core.scannerconfig, >- org.eclipse.cdt.build.internal.core.scannerconfig2, >+ org.eclipse.cdt.build.internal.core.scannerconfig;x-internal:=true;x-friends:="org.eclipse.cdt.ui,org.eclipse.cdt.managedbuilder.ui,org.eclipse.cdt.managedbuilder.core.tests", >+ org.eclipse.cdt.build.internal.core.scannerconfig2;x-internal:=true;x-friends:="org.eclipse.cdt.ui,org.eclipse.cdt.managedbuilder.ui,org.eclipse.cdt.managedbuilder.core.tests", > org.eclipse.cdt.managedbuilder.buildmodel, > org.eclipse.cdt.managedbuilder.buildproperties, > org.eclipse.cdt.managedbuilder.core, > org.eclipse.cdt.managedbuilder.envvar, >- org.eclipse.cdt.managedbuilder.internal.buildmodel, >- org.eclipse.cdt.managedbuilder.internal.core, >- org.eclipse.cdt.managedbuilder.internal.envvar, >- org.eclipse.cdt.managedbuilder.internal.macros, >+ org.eclipse.cdt.managedbuilder.internal.buildmodel;x-internal:=true;x-friends:="org.eclipse.cdt.ui,org.eclipse.cdt.managedbuilder.ui,org.eclipse.cdt.managedbuilder.core.tests", >+ org.eclipse.cdt.managedbuilder.internal.core;x-internal:=true;x-friends:="org.eclipse.cdt.ui,org.eclipse.cdt.managedbuilder.ui,org.eclipse.cdt.managedbuilder.core.tests", >+ org.eclipse.cdt.managedbuilder.internal.envvar;x-internal:=true;x-friends:="org.eclipse.cdt.ui,org.eclipse.cdt.managedbuilder.ui,org.eclipse.cdt.managedbuilder.core.tests", >+ org.eclipse.cdt.managedbuilder.internal.macros;x-internal:=true;x-friends:="org.eclipse.cdt.ui,org.eclipse.cdt.managedbuilder.ui,org.eclipse.cdt.managedbuilder.core.tests", > org.eclipse.cdt.managedbuilder.macros, > org.eclipse.cdt.managedbuilder.makegen, > org.eclipse.cdt.managedbuilder.makegen.gnu, >- org.eclipse.cdt.managedbuilder.makegen.internal, >+ org.eclipse.cdt.managedbuilder.makegen.internal;x-internal:=true;x-friends:="org.eclipse.cdt.ui,org.eclipse.cdt.managedbuilder.ui,org.eclipse.cdt.managedbuilder.core.tests", > org.eclipse.cdt.managedbuilder.pdomdepgen, > org.eclipse.cdt.managedbuilder.projectconverter, > org.eclipse.cdt.managedbuilder.scannerconfig, >@@ -33,7 +33,8 @@ > org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)", > org.eclipse.ui;bundle-version="[3.2.0,4.0.0)", > org.eclipse.core.variables;bundle-version="[3.1.100,4.0.0)", >- org.eclipse.cdt.make.core;visibility:=reexport >+ org.eclipse.cdt.make.core;visibility:=reexport, >+ org.eclipse.core.filesystem;bundle-version="1.2.0" > Bundle-ActivationPolicy: lazy > Bundle-RequiredExecutionEnvironment: J2SE-1.5 > Import-Package: com.ibm.icu.text >Index: .project >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.managedbuilder.core/.project,v >retrieving revision 1.3 >diff -u -r1.3 .project >--- .project 2 Dec 2005 20:43:13 -0000 1.3 >+++ .project 24 Apr 2009 19:31:21 -0000 >@@ -20,9 +20,15 @@ > <arguments> > </arguments> > </buildCommand> >+ <buildCommand> >+ <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name> >+ <arguments> >+ </arguments> >+ </buildCommand> > </buildSpec> > <natures> > <nature>org.eclipse.jdt.core.javanature</nature> > <nature>org.eclipse.pde.PluginNature</nature> >+ <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature> > </natures> > </projectDescription> >Index: src/org/eclipse/cdt/managedbuilder/buildmodel/BuildDescriptionManager.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/BuildDescriptionManager.java,v >retrieving revision 1.8 >diff -u -r1.8 BuildDescriptionManager.java >--- src/org/eclipse/cdt/managedbuilder/buildmodel/BuildDescriptionManager.java 11 May 2007 12:15:42 -0000 1.8 >+++ src/org/eclipse/cdt/managedbuilder/buildmodel/BuildDescriptionManager.java 24 Apr 2009 19:31:21 -0000 >@@ -59,7 +59,7 @@ > */ > public static final int DEPFILES = 1 << 3; > >- private Set fVisitedSteps = new HashSet(); >+ private Set<IBuildStep> fVisitedSteps = new HashSet<IBuildStep>(); > private boolean fUp; > private IBuildDescription fInfo; > >@@ -94,6 +94,9 @@ > return DefaultBuildDescriptionFactory.getInstance().createBuildDescription(cfg, delta, flags); > } > >+ /** >+ * @noreference This method is not intended to be referenced by clients. >+ */ > static public IBuildDescription createBuildDescription(IConfiguration cfg, > IConfigurationBuildState bs, > IResourceDelta delta, >@@ -162,7 +165,7 @@ > } > > public static IBuildStep[] getSteps(IBuildStep step, boolean input){ >- Set set = new HashSet(); >+ Set<IBuildStep> set = new HashSet<IBuildStep>(); > > IBuildIOType args[] = input ? > step.getInputIOTypes() : >@@ -186,17 +189,17 @@ > } > } > >- return (IBuildStep[])set.toArray(new IBuildStep[set.size()]); >+ return set.toArray(new IBuildStep[set.size()]); > } > > public static IBuildResource[] filterGeneratedBuildResources(IBuildResource rc[], int rcState){ >- List list = new ArrayList(); >+ List<IBuildResource> list = new ArrayList<IBuildResource>(); > > addBuildResources(rc, list, rcState); >- return (IBuildResource[])list.toArray(new IBuildResource[list.size()]); >+ return list.toArray(new IBuildResource[list.size()]); > } > >- private static void addBuildResources(IBuildResource rcs[], List list, int rcState){ >+ private static void addBuildResources(IBuildResource rcs[], List<IBuildResource> list, int rcState){ > if(rcs.length == 0) > return; > IBuildStep inputAction = rcs[0].getBuildDescription().getInputStep(); >@@ -254,7 +257,7 @@ > */ > public static void cleanGeneratedRebuildResources(IBuildDescription des) throws CoreException{ > IBuildResource bRcs[] = filterGeneratedBuildResources(des.getResources(), REMOVED | REBUILD); >- List failList = new ArrayList(); >+ List<Object[]> failList = new ArrayList<Object[]>(); > > for(int i = 0; i < bRcs.length; i++){ > if(!bRcs[i].isProjectResource()) >@@ -272,8 +275,8 @@ > > if(failList.size() != 0){ > BuildMultiStatus status = new BuildMultiStatus("failed to remove resources", null); //$NON-NLS-1$ >- for(Iterator iter = failList.iterator(); iter.hasNext();){ >- Object[] err = (Object[])iter.next(); >+ for(Iterator<Object[]> iter = failList.iterator(); iter.hasNext();){ >+ Object[] err = iter.next(); > IResource rc = (IResource)err[0]; > CoreException e = (CoreException)err[1]; > status.add(new BuildStatus(rc.getFullPath().toString(), e)); >Index: src/org/eclipse/cdt/managedbuilder/buildmodel/IBuildResource.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/IBuildResource.java,v >retrieving revision 1.2 >diff -u -r1.2 IBuildResource.java >--- src/org/eclipse/cdt/managedbuilder/buildmodel/IBuildResource.java 27 Apr 2006 15:16:06 -0000 1.2 >+++ src/org/eclipse/cdt/managedbuilder/buildmodel/IBuildResource.java 24 Apr 2009 19:31:21 -0000 >@@ -10,6 +10,8 @@ > *******************************************************************************/ > package org.eclipse.cdt.managedbuilder.buildmodel; > >+import java.net.URI; >+ > import org.eclipse.core.runtime.IPath; > > /** >@@ -26,15 +28,21 @@ > IPath getLocation(); > > /** >- * In case the resource is a workspace resource, >- * returns the full workspace path for the resource >- * otherwise returns null >+ * Returns the full path to the build resource as seen on the target machine. > * > * @return IPath > */ > IPath getFullPath(); > > /** >+ * Returns a URI that can be used by EFS to access the build resource. >+ * >+ * @return URI >+ * @since 5.1 >+ */ >+ URI getLocationURI(); >+ >+ /** > * Returns the output io type of the step > * that generates this resource. > * In case the resource is the project source, >#P org.eclipse.cdt.ui >Index: src/org/eclipse/cdt/ui/wizards/CDTCommonProjectWizard.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/CDTCommonProjectWizard.java,v >retrieving revision 1.26 >diff -u -r1.26 CDTCommonProjectWizard.java >--- src/org/eclipse/cdt/ui/wizards/CDTCommonProjectWizard.java 18 Nov 2008 08:54:07 -0000 1.26 >+++ src/org/eclipse/cdt/ui/wizards/CDTCommonProjectWizard.java 24 Apr 2009 19:31:22 -0000 >@@ -208,6 +208,11 @@ > ICProjectDescriptionManager mngr = CoreModel.getDefault().getProjectDescriptionManager(); > > ICProjectDescription des = mngr.getProjectDescription(newProject, false); >+ >+ if(des == null ) { >+ return false; >+ } >+ > if(des.isCdtProjectCreating()){ > des = mngr.getProjectDescription(newProject, true); > des.setCdtProjectCreated();
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 273636
: 133173