Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 273636
Collapse All | Expand All

(-)tests/org/eclipse/cdt/managedbuilder/core/tests/BuildDescriptionModelTests.java (-23 / +25 lines)
Lines 60-65 Link Here
60
import org.eclipse.core.runtime.NullProgressMonitor;
60
import org.eclipse.core.runtime.NullProgressMonitor;
61
import org.eclipse.core.runtime.Path;
61
import org.eclipse.core.runtime.Path;
62
62
63
@SuppressWarnings("restriction")
63
public class BuildDescriptionModelTests extends TestCase {
64
public class BuildDescriptionModelTests extends TestCase {
64
	private static final String PREFIX = "BuildDescription_";
65
	private static final String PREFIX = "BuildDescription_";
65
	private static final String PROJ_PATH = "testBuildDescriptionProjects";
66
	private static final String PROJ_PATH = "testBuildDescriptionProjects";
Lines 68-82 Link Here
68
	private Runnable fCleaner = fCompositeCleaner;
69
	private Runnable fCleaner = fCompositeCleaner;
69
	
70
	
70
	private class CompositeCleaner implements Runnable{
71
	private class CompositeCleaner implements Runnable{
71
		private List fRunnables = new ArrayList();
72
		private List<Runnable> fRunnables = new ArrayList<Runnable>();
72
73
73
		public void addRunnable(Runnable r){
74
		public void addRunnable(Runnable r){
74
			fRunnables.add(r);
75
			fRunnables.add(r);
75
		}
76
		}
76
77
77
		public void run() {
78
		public void run() {
78
			for(Iterator iter = fRunnables.iterator(); iter.hasNext();){
79
			for(Iterator<Runnable> iter = fRunnables.iterator(); iter.hasNext();){
79
				Runnable r = (Runnable)iter.next();
80
				Runnable r = iter.next();
80
				r.run();
81
				r.run();
81
			}
82
			}
82
			fRunnables.clear();
83
			fRunnables.clear();
Lines 84-90 Link Here
84
		
85
		
85
	}
86
	}
86
	private class ProjectCleaner implements Runnable{
87
	private class ProjectCleaner implements Runnable{
87
		List fProjList = new ArrayList();
88
		List<String> fProjList = new ArrayList<String>();
88
		
89
		
89
		public ProjectCleaner(){
90
		public ProjectCleaner(){
90
		}
91
		}
Lines 106-113 Link Here
106
		}
107
		}
107
108
108
		public void run() {
109
		public void run() {
109
			for(Iterator iter = fProjList.iterator(); iter.hasNext();){
110
			for(Iterator<String> iter = fProjList.iterator(); iter.hasNext();){
110
				String name = (String)iter.next();
111
				String name = iter.next();
111
				ManagedBuildTestHelper.removeProject(name);
112
				ManagedBuildTestHelper.removeProject(name);
112
			}
113
			}
113
			fProjList.clear();
114
			fProjList.clear();
Lines 143-149 Link Here
143
		if(aAsmRc != des.createResource("a.asm"))
144
		if(aAsmRc != des.createResource("a.asm"))
144
			fail("new build resource created for the same resource");
145
			fail("new build resource created for the same resource");
145
146
146
		if(aAsmRc != des.createResource(aAsm.getLocation(), aAsm.getFullPath()))
147
		if(aAsmRc != des.createResource(aAsm.getLocation(), aAsm.getLocationURI()))
147
			fail("new build resource created for the same resource");
148
			fail("new build resource created for the same resource");
148
149
149
		assertEquals(aAsmRc.getProducerIOType(), null);
150
		assertEquals(aAsmRc.getProducerIOType(), null);
Lines 157-162 Link Here
157
		if(type == null)
158
		if(type == null)
158
			fail("failed to create output type");
159
			fail("failed to create output type");
159
		
160
		
161
		assertNotNull(type);
160
		assertEquals(type.getStep(), inStep);
162
		assertEquals(type.getStep(), inStep);
161
		
163
		
162
		type.addResource(aAsmRc);
164
		type.addResource(aAsmRc);
Lines 558-578 Link Here
558
	}
560
	}
559
*/
561
*/
560
	private void doTestStep(IBuildStep step, IBuildStep oStep, boolean up){
562
	private void doTestStep(IBuildStep step, IBuildStep oStep, boolean up){
561
		Map inMap = new HashMap();
563
		Map<IBuildIOType, IBuildIOType> inMap = new HashMap<IBuildIOType, IBuildIOType>();
562
		Map outMap = new HashMap();
564
		Map<IBuildIOType, IBuildIOType> outMap = new HashMap<IBuildIOType, IBuildIOType>();
563
		
565
		
564
		stepsMatch(step, oStep, inMap, outMap, true);
566
		stepsMatch(step, oStep, inMap, outMap, true);
565
		
567
		
566
		Map map = up ? outMap : inMap;
568
		Map<IBuildIOType, IBuildIOType> map = up ? outMap : inMap;
567
		
569
		
568
		for(Iterator iter = map.entrySet().iterator();iter.hasNext();){
570
		for(Iterator<?> iter = map.entrySet().iterator();iter.hasNext();){
569
			Map.Entry entry = (Map.Entry)iter.next();
571
			Map.Entry entry = (Map.Entry)iter.next();
570
			doTestType((IBuildIOType)entry.getKey(), (IBuildIOType)entry.getValue());
572
			doTestType((IBuildIOType)entry.getKey(), (IBuildIOType)entry.getValue());
571
		}
573
		}
572
	}
574
	}
573
	
575
	
574
	private void doTestType(IBuildIOType type, IBuildIOType oType){
576
	private void doTestType(IBuildIOType type, IBuildIOType oType){
575
		Map map = new HashMap();
577
		Map<IBuildResource, IBuildResource> map = new HashMap<IBuildResource, IBuildResource>();
576
		
578
		
577
		typesMatch(type, oType, map, true);
579
		typesMatch(type, oType, map, true);
578
		
580
		
Lines 583-589 Link Here
583
	}
585
	}
584
	
586
	
585
	private void doTestResource(IBuildResource rc, IBuildResource oRc, boolean up){
587
	private void doTestResource(IBuildResource rc, IBuildResource oRc, boolean up){
586
		Map outMap = new HashMap();
588
		Map<IBuildIOType, IBuildIOType> outMap = new HashMap<IBuildIOType, IBuildIOType>();
587
		
589
		
588
		doTestResourceMatch(rc, oRc, outMap);
590
		doTestResourceMatch(rc, oRc, outMap);
589
		
591
		
Lines 591-597 Link Here
591
			typesMatch(rc.getProducerIOType(), oRc.getProducerIOType(), null, true);
593
			typesMatch(rc.getProducerIOType(), oRc.getProducerIOType(), null, true);
592
			doTestStep(rc.getProducerIOType().getStep(), oRc.getProducerIOType().getStep(), up);
594
			doTestStep(rc.getProducerIOType().getStep(), oRc.getProducerIOType().getStep(), up);
593
		} else {
595
		} else {
594
			Set stepSet = new HashSet();
596
			Set<IBuildStep> stepSet = new HashSet<IBuildStep>();
595
			
597
			
596
			for(Iterator iter = outMap.entrySet().iterator(); iter.hasNext();){
598
			for(Iterator iter = outMap.entrySet().iterator(); iter.hasNext();){
597
				Map.Entry entry = (Map.Entry)iter.next();
599
				Map.Entry entry = (Map.Entry)iter.next();
Lines 607-613 Link Here
607
		}
609
		}
608
	}
610
	}
609
	
611
	
610
	private void doTestResourceMatch(IBuildResource rc, IBuildResource oRc, Map outTypeMap){
612
	private void doTestResourceMatch(IBuildResource rc, IBuildResource oRc, Map<IBuildIOType, IBuildIOType> outTypeMap){
611
		
613
		
612
		doTrace("matching resource " + DbgUtil.resourceName(rc));
614
		doTrace("matching resource " + DbgUtil.resourceName(rc));
613
		
615
		
Lines 642-652 Link Here
642
	}
644
	}
643
645
644
646
645
	private boolean stepsMatch(IBuildStep step, IBuildStep oStep, Map inTypeMap, Map outTypeMap, boolean failOnErr){
647
	private boolean stepsMatch(IBuildStep step, IBuildStep oStep, Map<IBuildIOType, IBuildIOType> inTypeMap, Map<IBuildIOType, IBuildIOType> outTypeMap, boolean failOnErr){
646
		return stepsMatch(step, oStep, inTypeMap, outTypeMap, true, failOnErr);
648
		return stepsMatch(step, oStep, inTypeMap, outTypeMap, true, failOnErr);
647
	}
649
	}
648
650
649
	private boolean stepsMatch(IBuildStep step, IBuildStep oStep, Map inTypeMap, Map outTypeMap, boolean checkSteps, boolean failOnErr){
651
	private boolean stepsMatch(IBuildStep step, IBuildStep oStep, Map<IBuildIOType, IBuildIOType> inTypeMap, Map<IBuildIOType, IBuildIOType> outTypeMap, boolean checkSteps, boolean failOnErr){
650
		IBuildIOType inTypes[] = step.getInputIOTypes();
652
		IBuildIOType inTypes[] = step.getInputIOTypes();
651
		IBuildIOType oInTypes[] = oStep.getInputIOTypes();
653
		IBuildIOType oInTypes[] = oStep.getInputIOTypes();
652
		
654
		
Lines 709-715 Link Here
709
		return getCorType(type, oTypes, null, true);
711
		return getCorType(type, oTypes, null, true);
710
	}
712
	}
711
713
712
	private IBuildIOType getCorType(IBuildIOType type, IBuildIOType oTypes[], Map rcMap, boolean checkSteps){
714
	private IBuildIOType getCorType(IBuildIOType type, IBuildIOType oTypes[], Map<IBuildResource, IBuildResource> rcMap, boolean checkSteps){
713
		for(int i = 0; i < oTypes.length; i++){
715
		for(int i = 0; i < oTypes.length; i++){
714
			if(typesMatch(type, oTypes[i], rcMap, checkSteps, false))
716
			if(typesMatch(type, oTypes[i], rcMap, checkSteps, false))
715
				return oTypes[i];
717
				return oTypes[i];
Lines 746-756 Link Here
746
*/
748
*/
747
	}
749
	}
748
750
749
	private boolean typesMatch(IBuildIOType type, IBuildIOType oType, Map rcMap, boolean failOnError){
751
	private boolean typesMatch(IBuildIOType type, IBuildIOType oType, Map<IBuildResource, IBuildResource> rcMap, boolean failOnError){
750
		return typesMatch(type, oType, rcMap, true, failOnError);
752
		return typesMatch(type, oType, rcMap, true, failOnError);
751
	}
753
	}
752
754
753
	private boolean typesMatch(IBuildIOType type, IBuildIOType oType, Map rcMap, boolean checkStep, boolean failOnError){
755
	private boolean typesMatch(IBuildIOType type, IBuildIOType oType, Map<IBuildResource, IBuildResource> rcMap, boolean checkStep, boolean failOnError){
754
		
756
		
755
//		doTrace("matching io type");
757
//		doTrace("matching io type");
756
		if(type.isInput() != oType.isInput()){
758
		if(type.isInput() != oType.isInput()){
Lines 766-773 Link Here
766
			return false;
768
			return false;
767
		
769
		
768
		if(resourcesMatch(rcs, oRcs, rcMap)){
770
		if(resourcesMatch(rcs, oRcs, rcMap)){
769
			Map inMap = new HashMap();
771
			Map<IBuildIOType, IBuildIOType> inMap = new HashMap<IBuildIOType, IBuildIOType>();
770
			Map outMap = new HashMap();
772
			Map<IBuildIOType, IBuildIOType> outMap = new HashMap<IBuildIOType, IBuildIOType>();
771
			if(!checkStep)
773
			if(!checkStep)
772
				return true;
774
				return true;
773
			return stepsMatch(type.getStep(), oType.getStep(), inMap, outMap, false, failOnError);
775
			return stepsMatch(type.getStep(), oType.getStep(), inMap, outMap, false, failOnError);
Lines 779-785 Link Here
779
		return false;
781
		return false;
780
	}
782
	}
781
	
783
	
782
	private boolean resourcesMatch(IBuildResource rcs[], IBuildResource oRcs[], Map rcMap){
784
	private boolean resourcesMatch(IBuildResource rcs[], IBuildResource oRcs[], Map<IBuildResource, IBuildResource> rcMap){
783
		if(rcs.length != oRcs.length)
785
		if(rcs.length != oRcs.length)
784
			return false;
786
			return false;
785
		
787
		
(-).project (+6 lines)
Lines 20-28 Link Here
20
			<arguments>
20
			<arguments>
21
			</arguments>
21
			</arguments>
22
		</buildCommand>
22
		</buildCommand>
23
		<buildCommand>
24
			<name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
25
			<arguments>
26
			</arguments>
27
		</buildCommand>
23
	</buildSpec>
28
	</buildSpec>
24
	<natures>
29
	<natures>
25
		<nature>org.eclipse.pde.PluginNature</nature>
30
		<nature>org.eclipse.pde.PluginNature</nature>
26
		<nature>org.eclipse.jdt.core.javanature</nature>
31
		<nature>org.eclipse.jdt.core.javanature</nature>
32
		<nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
27
	</natures>
33
	</natures>
28
</projectDescription>
34
</projectDescription>
(-)META-INF/MANIFEST.MF (-1 / +1 lines)
Lines 9-15 Link Here
9
Export-Package: org.eclipse.cdt.managedbuilder.gnu.cygwin,
9
Export-Package: org.eclipse.cdt.managedbuilder.gnu.cygwin,
10
 org.eclipse.cdt.managedbuilder.gnu.ui
10
 org.eclipse.cdt.managedbuilder.gnu.ui
11
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
11
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
12
 org.eclipse.cdt.managedbuilder.core;bundle-version="[5.0.0,6.0.0)",
12
 org.eclipse.cdt.managedbuilder.core;bundle-version="[5.1.0,6.0.0)",
13
 org.eclipse.cdt.core;bundle-version="[5.0.0,6.0.0)",
13
 org.eclipse.cdt.core;bundle-version="[5.0.0,6.0.0)",
14
 org.eclipse.core.resources
14
 org.eclipse.core.resources
15
Bundle-ActivationPolicy: lazy
15
Bundle-ActivationPolicy: lazy
(-)META-INF/MANIFEST.MF (-1 / +2 lines)
Lines 8-13 Link Here
8
Bundle-Localization: plugin
8
Bundle-Localization: plugin
9
Export-Package: org.eclipse.cdt.managedbuilder.internal.ui.workingsets,
9
Export-Package: org.eclipse.cdt.managedbuilder.internal.ui.workingsets,
10
 org.eclipse.cdt.managedbuilder.ui.actions,
10
 org.eclipse.cdt.managedbuilder.ui.actions,
11
 org.eclipse.cdt.managedbuilder.ui.preferences,
11
 org.eclipse.cdt.managedbuilder.ui.properties,
12
 org.eclipse.cdt.managedbuilder.ui.properties,
12
 org.eclipse.cdt.managedbuilder.ui.wizards
13
 org.eclipse.cdt.managedbuilder.ui.wizards
13
Require-Bundle: org.eclipse.ui.ide;bundle-version="[3.2.0,4.0.0)",
14
Require-Bundle: org.eclipse.ui.ide;bundle-version="[3.2.0,4.0.0)",
Lines 15-21 Link Here
15
 org.eclipse.ui;bundle-version="[3.2.0,4.0.0)",
16
 org.eclipse.ui;bundle-version="[3.2.0,4.0.0)",
16
 org.eclipse.cdt.core;bundle-version="[5.0.0,6.0.0)",
17
 org.eclipse.cdt.core;bundle-version="[5.0.0,6.0.0)",
17
 org.eclipse.cdt.ui;bundle-version="[5.0.0,6.0.0)",
18
 org.eclipse.cdt.ui;bundle-version="[5.0.0,6.0.0)",
18
 org.eclipse.cdt.managedbuilder.core;bundle-version="[5.0.0,6.0.0)",
19
 org.eclipse.cdt.managedbuilder.core;bundle-version="[5.1.0,6.0.0)",
19
 org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
20
 org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
20
 org.eclipse.core.variables;bundle-version="[3.1.100,4.0.0)",
21
 org.eclipse.core.variables;bundle-version="[3.1.100,4.0.0)",
21
 org.eclipse.ui.navigator;bundle-version="[3.2.0,4.0.0)";resolution:=optional,
22
 org.eclipse.ui.navigator;bundle-version="[3.2.0,4.0.0)";resolution:=optional,
(-)src/org/eclipse/cdt/managedbuilder/ui/properties/AbstractToolSettingUI.java (+3 lines)
Lines 30-35 Link Here
30
		this(info, GRID);
30
		this(info, GRID);
31
	}
31
	}
32
	
32
	
33
	/**
34
	 * @since 5.0
35
	 */
33
	protected AbstractToolSettingUI(IResourceInfo info, int style) {
36
	protected AbstractToolSettingUI(IResourceInfo info, int style) {
34
 		super(style);
37
 		super(style);
35
 		noDefaultAndApplyButton();
38
 		noDefaultAndApplyButton();
(-)src/org/eclipse/cdt/managedbuilder/ui/properties/ToolSettingsTab.java (+7 lines)
Lines 449-458 Link Here
449
			}
449
			}
450
		}
450
		}
451
		
451
		
452
		/**
453
		 * @since 5.0
454
		 */
452
		protected void addFilter(ViewerFilter filter) {
455
		protected void addFilter(ViewerFilter filter) {
453
			optionList.addFilter(filter);
456
			optionList.addFilter(filter);
454
		}
457
		}
455
		
458
		
459
		/**
460
		 * @since 5.0
461
		 */
456
		@SuppressWarnings("unchecked")
462
		@SuppressWarnings("unchecked")
457
		protected void setOption(IOption op1, IOption op2, IHoldsOptions dst, IResourceInfo res){
463
		protected void setOption(IOption op1, IOption op2, IHoldsOptions dst, IResourceInfo res){
458
			try {
464
			try {
Lines 601-606 Link Here
601
		 * Unlike the default provider, that provider also contains
607
		 * Unlike the default provider, that provider also contains
602
		 * the user-modified macros that are not applied yet
608
		 * the user-modified macros that are not applied yet
603
		 * If the "Build Macros" tab is not available, returns the default BuildMacroProvider
609
		 * If the "Build Macros" tab is not available, returns the default BuildMacroProvider
610
		 * @noreference This method is not intended to be referenced by clients.
604
		 */
611
		 */
605
		public BuildMacroProvider obtainMacroProvider(){
612
		public BuildMacroProvider obtainMacroProvider(){
606
			return (BuildMacroProvider)ManagedBuildManager.getBuildMacroProvider();
613
			return (BuildMacroProvider)ManagedBuildManager.getBuildMacroProvider();
(-).project (+6 lines)
Lines 20-28 Link Here
20
			<arguments>
20
			<arguments>
21
			</arguments>
21
			</arguments>
22
		</buildCommand>
22
		</buildCommand>
23
		<buildCommand>
24
			<name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
25
			<arguments>
26
			</arguments>
27
		</buildCommand>
23
	</buildSpec>
28
	</buildSpec>
24
	<natures>
29
	<natures>
25
		<nature>org.eclipse.jdt.core.javanature</nature>
30
		<nature>org.eclipse.jdt.core.javanature</nature>
26
		<nature>org.eclipse.pde.PluginNature</nature>
31
		<nature>org.eclipse.pde.PluginNature</nature>
32
		<nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
27
	</natures>
33
	</natures>
28
</projectDescription>
34
</projectDescription>
(-)src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuMakefileGenerator.java (-7 / +40 lines)
Lines 13-18 Link Here
13
package org.eclipse.cdt.managedbuilder.makegen.gnu;
13
package org.eclipse.cdt.managedbuilder.makegen.gnu;
14
14
15
import java.io.ByteArrayInputStream;
15
import java.io.ByteArrayInputStream;
16
import java.io.File;
16
import java.io.IOException;
17
import java.io.IOException;
17
import java.io.InputStream;
18
import java.io.InputStream;
18
import java.io.InputStreamReader;
19
import java.io.InputStreamReader;
Lines 70-75 Link Here
70
import org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyGeneratorType;
71
import org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyGeneratorType;
71
import org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyInfo;
72
import org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyInfo;
72
import org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyPreBuild;
73
import org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyPreBuild;
74
import org.eclipse.core.filesystem.EFS;
75
import org.eclipse.core.filesystem.IFileStore;
73
import org.eclipse.core.resources.IContainer;
76
import org.eclipse.core.resources.IContainer;
74
import org.eclipse.core.resources.IFile;
77
import org.eclipse.core.resources.IFile;
75
import org.eclipse.core.resources.IFolder;
78
import org.eclipse.core.resources.IFolder;
Lines 2012-2018 Link Here
2012
//				if( (rcInfo.isExcluded()) )
2015
//				if( (rcInfo.isExcluded()) )
2013
//					continue;
2016
//					continue;
2014
				addFragmentMakefileEntriesForSource(buildVarToRuleStringMap, ruleBuffer, 
2017
				addFragmentMakefileEntriesForSource(buildVarToRuleStringMap, ruleBuffer, 
2015
						folder, relativePath, resource, resource.getLocation(), rcInfo, null, false);
2018
						folder, relativePath, resource, getPathForResource(resource), rcInfo, null, false);
2016
			}
2019
			}
2017
		}
2020
		}
2018
							
2021
							
Lines 2159-2165 Link Here
2159
						//  because the file is not under the project.  We use this resource in the calls to the dependency generator
2162
						//  because the file is not under the project.  We use this resource in the calls to the dependency generator
2160
						generateOutputResource = project.getFile(generatedOutput);
2163
						generateOutputResource = project.getFile(generatedOutput);
2161
					} else {
2164
					} else {
2162
						generatedOutput = project.getLocation().append(getBuildWorkingDir()).append((IPath)generatedOutputs.get(k));
2165
						generatedOutput = getPathForResource(project).append(getBuildWorkingDir()).append((IPath)generatedOutputs.get(k));
2163
						generateOutputResource = project.getFile(getBuildWorkingDir().append((IPath)generatedOutputs.get(k)));
2166
						generateOutputResource = project.getFile(getBuildWorkingDir().append((IPath)generatedOutputs.get(k)));
2164
					}
2167
					}
2165
					IResourceInfo nextRcInfo;
2168
					IResourceInfo nextRcInfo;
Lines 2194-2199 Link Here
2194
		}
2197
		}
2195
	}
2198
	}
2196
2199
2200
2201
	/**
2202
	 * Gets a path for a resource by extracting the Path field from its
2203
	 * location URI.
2204
	 * @return IPath
2205
	 * @since 5.1
2206
	 */
2207
	protected IPath getPathForResource(IResource resource) {
2208
		return new Path(resource.getLocationURI().getPath());
2209
	}
2210
2197
	/* (non-Javadoc)
2211
	/* (non-Javadoc)
2198
	 * Adds the source file to the appropriate build variable
2212
	 * Adds the source file to the appropriate build variable
2199
	 * 
2213
	 * 
Lines 2415-2426 Link Here
2415
		 * then we must get the actual location of the resource, rather
2429
		 * then we must get the actual location of the resource, rather
2416
		 * than the relative path.
2430
		 * than the relative path.
2417
		 */
2431
		 */
2418
		String projectLocation = project.getLocation().toString();
2432
		String projectLocation = null;
2433
		
2434
		// is the project local?  if so we might have to convert the paths to local format
2435
		try {
2436
			IFileStore fileStore = EFS.getStore(project.getLocationURI());
2437
			File localFile = fileStore.toLocalFile(EFS.NONE, null);
2438
			
2439
			if(localFile != null) {
2440
				// it's a local file... use project location for proper path formatting
2441
				projectLocation = project.getLocation().addTrailingSeparator().toOSString();
2442
			}
2443
			else {
2444
				// remote... get the path from the URI
2445
				projectLocation = project.getLocationURI().getPath().toString();
2446
				
2447
			}
2448
		} catch (CoreException e1) {
2449
			// TODO Auto-generated catch block
2450
			e1.printStackTrace();
2451
		}
2419
2452
2420
		// Output file location needed for the file-specific build macros
2453
		// Output file location needed for the file-specific build macros
2421
		IPath outputLocation = Path.fromOSString(primaryOutputName);
2454
		IPath outputLocation = Path.fromOSString(primaryOutputName);
2422
		if (!outputLocation.isAbsolute()) {
2455
		if (!outputLocation.isAbsolute()) {
2423
			outputLocation = project.getLocation().append(getBuildWorkingDir()).append(primaryOutputName);
2456
			outputLocation = getPathForResource(project).append(getBuildWorkingDir()).append(primaryOutputName);
2424
		}
2457
		}
2425
		
2458
		
2426
		// A separate rule is needed for the resource in the case where explicit file-specific macros
2459
		// A separate rule is needed for the resource in the case where explicit file-specific macros
Lines 2644-2650 Link Here
2644
				IPath addlPath = addlInputPaths[i];
2677
				IPath addlPath = addlInputPaths[i];
2645
				if (!(addlPath.toString().startsWith("$("))) {		//$NON-NLS-1$
2678
				if (!(addlPath.toString().startsWith("$("))) {		//$NON-NLS-1$
2646
					if (!addlPath.isAbsolute()) {
2679
					if (!addlPath.isAbsolute()) {
2647
						IPath tempPath = project.getLocation().append(addlPath);
2680
						IPath tempPath = getPathForResource(project).append(addlPath);
2648
						if (tempPath != null) {
2681
						if (tempPath != null) {
2649
							addlPath = ManagedBuildManager.calculateRelativePath(getTopBuildDir(), tempPath);
2682
							addlPath = ManagedBuildManager.calculateRelativePath(getTopBuildDir(), tempPath);
2650
						}
2683
						}
Lines 3854-3860 Link Here
3854
			String relativePath, IPath sourceLocation, boolean generatedSource) {
3887
			String relativePath, IPath sourceLocation, boolean generatedSource) {
3855
		//  Add the source file path to the makefile line that adds source files to the build variable
3888
		//  Add the source file path to the makefile line that adds source files to the build variable
3856
		String srcName;
3889
		String srcName;
3857
		IPath projectLocation = project.getLocation();
3890
		IPath projectLocation = getPathForResource(project);
3858
		IPath dirLocation = projectLocation;
3891
		IPath dirLocation = projectLocation;
3859
		if (generatedSource) {
3892
		if (generatedSource) {
3860
			dirLocation = dirLocation.append(getBuildWorkingDir());
3893
			dirLocation = dirLocation.append(getBuildWorkingDir());
Lines 4618-4624 Link Here
4618
	 * Return the configuration's top build directory as an absolute path
4651
	 * Return the configuration's top build directory as an absolute path
4619
	 */
4652
	 */
4620
	public IPath getTopBuildDir() {
4653
	public IPath getTopBuildDir() {
4621
		return project.getLocation().append(getBuildWorkingDir());
4654
		return getPathForResource(project).append(getBuildWorkingDir());
4622
	}
4655
	}
4623
4656
4624
	/**
4657
	/**
(-)src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildResource.java (-15 / +29 lines)
Lines 10-15 Link Here
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.cdt.managedbuilder.internal.buildmodel;
11
package org.eclipse.cdt.managedbuilder.internal.buildmodel;
12
12
13
import java.net.URI;
13
import java.util.ArrayList;
14
import java.util.ArrayList;
14
import java.util.HashSet;
15
import java.util.HashSet;
15
import java.util.Iterator;
16
import java.util.Iterator;
Lines 22-53 Link Here
22
import org.eclipse.cdt.managedbuilder.buildmodel.IBuildStep;
23
import org.eclipse.cdt.managedbuilder.buildmodel.IBuildStep;
23
import org.eclipse.core.resources.IResource;
24
import org.eclipse.core.resources.IResource;
24
import org.eclipse.core.runtime.IPath;
25
import org.eclipse.core.runtime.IPath;
26
import org.eclipse.core.runtime.Path;
25
27
26
public class BuildResource implements IBuildResource {
28
public class BuildResource implements IBuildResource {
27
	private List fDepArgs = new ArrayList();
29
	private List<BuildIOType> fDepArgs = new ArrayList<BuildIOType>();
28
	private BuildIOType fProducerArg;
30
	private BuildIOType fProducerArg;
29
	private boolean fNeedsRebuild;
31
	private boolean fNeedsRebuild;
30
	private boolean fIsRemoved;
32
	private boolean fIsRemoved;
31
	private IPath fLocation; 
33
	private IPath fLocation; 
32
	private IPath fFullPath; 
33
	private boolean fIsProjectRc;
34
	private boolean fIsProjectRc;
34
	private BuildDescription fInfo;
35
	private BuildDescription fInfo;
36
	private URI fLocationURI;
35
37
36
	protected BuildResource(BuildDescription info, IResource rc){
38
	protected BuildResource(BuildDescription info, IResource rc){
37
		this(info, info.calcResourceLocation(rc), rc.getFullPath());
39
		this(info, info.calcResourceLocation(rc), rc.getLocationURI());
38
	}
40
	}
39
41
40
	protected BuildResource(BuildDescription info, IPath location, IPath fullPath){
42
	protected BuildResource(BuildDescription info, IPath projectPath, URI locationURI){
41
		fLocation = location;
43
		
44
		if(locationURI == null)
45
			throw new IllegalArgumentException(); // must point to somewhere!
46
		
47
		fLocationURI = locationURI;
48
		
49
		fLocation = projectPath;
42
		fInfo = info;
50
		fInfo = info;
43
		fFullPath = fullPath;
51
		
44
		if(fFullPath != null)
52
		fIsProjectRc = (projectPath != null);
45
			fIsProjectRc = fFullPath.segment(0).equals(info.getProject().getName());
46
53
47
		info.resourceCreated(this);
54
		info.resourceCreated(this);
48
		
55
		
49
		if(DbgUtil.DEBUG)
56
		if(DbgUtil.DEBUG)
50
			DbgUtil.trace("resource " + location + " created");	//$NON-NLS-1$	//$NON-NLS-2$
57
			DbgUtil.trace("resource " + projectPath + " created");	//$NON-NLS-1$	//$NON-NLS-2$
51
	}
58
	}
52
	/* (non-Javadoc)
59
	/* (non-Javadoc)
53
	 * @see org.eclipse.cdt.managedbuilder.builddescription.IBuildResource#getLocation()
60
	 * @see org.eclipse.cdt.managedbuilder.builddescription.IBuildResource#getLocation()
Lines 60-66 Link Here
60
	 * @see org.eclipse.cdt.managedbuilder.builddescription.IBuildResource#getFullPath()
67
	 * @see org.eclipse.cdt.managedbuilder.builddescription.IBuildResource#getFullPath()
61
	 */
68
	 */
62
	public IPath getFullPath() {
69
	public IPath getFullPath() {
63
		return fFullPath;
70
		return new Path(fLocationURI.getPath());
64
	}
71
	}
65
72
66
	/* (non-Javadoc)
73
	/* (non-Javadoc)
Lines 74-80 Link Here
74
	 * @see org.eclipse.cdt.managedbuilder.builddescription.IBuildResource#getDependentIOTypes()
81
	 * @see org.eclipse.cdt.managedbuilder.builddescription.IBuildResource#getDependentIOTypes()
75
	 */
82
	 */
76
	public IBuildIOType[] getDependentIOTypes() {
83
	public IBuildIOType[] getDependentIOTypes() {
77
		return (BuildIOType[])fDepArgs.toArray(new BuildIOType[fDepArgs.size()]);
84
		return fDepArgs.toArray(new BuildIOType[fDepArgs.size()]);
78
	}
85
	}
79
86
80
	/* (non-Javadoc)
87
	/* (non-Javadoc)
Lines 183-193 Link Here
183
	}
190
	}
184
191
185
	public IBuildStep[] getDependentSteps() {
192
	public IBuildStep[] getDependentSteps() {
186
		Set set = new HashSet();
193
		Set<IBuildStep> set = new HashSet<IBuildStep>();
187
		for(Iterator iter = fDepArgs.iterator(); iter.hasNext();){
194
		for(Iterator<BuildIOType> iter = fDepArgs.iterator(); iter.hasNext();){
188
			set.add(((BuildIOType)iter.next()).getStep());
195
			set.add(iter.next().getStep());
189
		}
196
		}
190
		return (BuildStep[])set.toArray(new BuildStep[set.size()]);
197
		return set.toArray(new BuildStep[set.size()]);
191
	}
198
	}
192
199
193
	public IBuildStep getProducerStep() {
200
	public IBuildStep getProducerStep() {
Lines 208-211 Link Here
208
		return buf.toString();
215
		return buf.toString();
209
	}
216
	}
210
217
218
	/* (non-Javadoc)
219
	 * @see org.eclipse.cdt.managedbuilder.buildmodel.IBuildResource#getLocationURI()
220
	 */
221
	public URI getLocationURI() {
222
		return fLocationURI;
223
	}
224
211
}
225
}
(-)src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildDescription.java (-23 / +65 lines)
Lines 11-16 Link Here
11
 *******************************************************************************/
11
 *******************************************************************************/
12
package org.eclipse.cdt.managedbuilder.internal.buildmodel;
12
package org.eclipse.cdt.managedbuilder.internal.buildmodel;
13
13
14
import java.net.URI;
15
import java.net.URISyntaxException;
14
import java.util.ArrayList;
16
import java.util.ArrayList;
15
import java.util.Arrays;
17
import java.util.Arrays;
16
import java.util.Collection;
18
import java.util.Collection;
Lines 67-72 Link Here
67
import org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyGeneratorType;
69
import org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyGeneratorType;
68
import org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyInfo;
70
import org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyInfo;
69
import org.eclipse.cdt.managedbuilder.pdomdepgen.PDOMDependencyGenerator;
71
import org.eclipse.cdt.managedbuilder.pdomdepgen.PDOMDependencyGenerator;
72
import org.eclipse.core.filesystem.EFS;
73
import org.eclipse.core.filesystem.IFileStore;
70
import org.eclipse.core.resources.IFile;
74
import org.eclipse.core.resources.IFile;
71
import org.eclipse.core.resources.IProject;
75
import org.eclipse.core.resources.IProject;
72
import org.eclipse.core.resources.IResource;
76
import org.eclipse.core.resources.IResource;
Lines 1003-1011 Link Here
1003
	}
1007
	}
1004
	
1008
	
1005
	private IPath getTopBuildDirLocation(){
1009
	private IPath getTopBuildDirLocation(){
1006
		return fProject.getLocation().append(getTopBuildDirFullPath().removeFirstSegments(1));
1010
		IPath projLocation = getProjectLocation();
1011
		return projLocation.append(getTopBuildDirFullPath().removeFirstSegments(1));
1007
	}
1012
	}
1008
	
1013
	
1014
	private IPath getProjectLocation() {
1015
		return new Path(fProject.getLocationURI().getPath());
1016
	}
1017
1009
	private BuildResource[] addOutputs(IPath paths[], BuildIOType buildArg, IPath outDirPath){
1018
	private BuildResource[] addOutputs(IPath paths[], BuildIOType buildArg, IPath outDirPath){
1010
		if(paths != null){
1019
		if(paths != null){
1011
			List list = new ArrayList();
1020
			List list = new ArrayList();
Lines 1016-1036 Link Here
1016
				
1025
				
1017
				if(outFullPath.isAbsolute()){
1026
				if(outFullPath.isAbsolute()){
1018
					outLocation = outFullPath;
1027
					outLocation = outFullPath;
1019
					if(fProject.getLocation().isPrefixOf(outLocation))
1028
					
1020
						outFullPath = fProject.getFullPath().append(outLocation.removeFirstSegments(fProject.getLocation().segmentCount()));
1029
					IPath projLocation = new Path(fProject.getLocationURI().getPath());
1030
					
1031
					if(projLocation.isPrefixOf(outLocation))
1032
						outFullPath = projLocation.append(outLocation.removeFirstSegments(projLocation.segmentCount()));
1021
					else
1033
					else
1022
						outFullPath = null;
1034
						outFullPath = null;
1023
				} else {
1035
				} else {
1024
					if (outFullPath.segmentCount() == 1) {
1036
					if (outFullPath.segmentCount() == 1) {
1025
						outFullPath = outDirPath.append(outFullPath); 
1037
						outFullPath = outDirPath.append(outFullPath); 
1026
						outLocation = fProject.getLocation().append(outFullPath.removeFirstSegments(1));
1038
						outLocation = getProjectLocation().append(outFullPath.removeFirstSegments(1));
1027
					} else {
1039
					} else {
1028
						outLocation = getTopBuildDirLocation().append(outFullPath);
1040
						outLocation = getTopBuildDirLocation().append(outFullPath);
1029
						outFullPath = getTopBuildDirFullPath().append(outFullPath);
1041
						outFullPath = getTopBuildDirFullPath().append(outFullPath);
1030
					}
1042
					}
1031
				}
1043
				}
1032
1044
				
1033
				BuildResource outRc = createResource(outLocation, outFullPath);
1045
				BuildResource outRc = createResource(outLocation, getURIForFullPath(outFullPath));
1034
				list.add(outRc);
1046
				list.add(outRc);
1035
				buildArg.addResource(outRc);
1047
				buildArg.addResource(outRc);
1036
				
1048
				
Lines 1040-1045 Link Here
1040
		return null;
1052
		return null;
1041
	}
1053
	}
1042
1054
1055
	private URI getURIForFullPath(IPath fullPath) {
1056
		// Basically, assume that we use the same type of URI that the project uses.
1057
		// Create one using the same info, except point the path at the path provided.
1058
		URI projURI = fProject.getLocationURI();
1059
		try {
1060
			URI newURI = new URI(projURI.getScheme(), projURI.getUserInfo(),
1061
					projURI.getHost(), projURI.getPort(), fullPath
1062
							.toPortableString(), projURI.getQuery(), projURI
1063
							.getFragment());
1064
			return newURI;
1065
		} catch (URISyntaxException e) {
1066
			// TODO Auto-generated catch block
1067
			e.printStackTrace();
1068
		}
1069
		
1070
		return null;
1071
	}
1072
1043
	private void calculateOutputs(BuildStep action, BuildIOType arg, BuildResource buildRc) throws CoreException {
1073
	private void calculateOutputs(BuildStep action, BuildIOType arg, BuildResource buildRc) throws CoreException {
1044
		BuildResource rcs[] = null;
1074
		BuildResource rcs[] = null;
1045
		ITool tool = action.getTool();
1075
		ITool tool = action.getTool();
Lines 1344-1354 Link Here
1344
				String outExt = tool.getOutputExtension(inExt);
1374
				String outExt = tool.getOutputExtension(inExt);
1345
				outFullPath = resolvePercent(outFullPath.addFileExtension(outExt), buildRc.getLocation());
1375
				outFullPath = resolvePercent(outFullPath.addFileExtension(outExt), buildRc.getLocation());
1346
				
1376
				
1347
				outLocation = fProject.getLocation().append(outFullPath.removeFirstSegments(1));
1377
				outLocation = getProjectLocation().append(outFullPath.removeFirstSegments(1));
1348
				
1378
				
1349
				BuildIOType buildArg = action.createIOType(false, true, null);
1379
				BuildIOType buildArg = action.createIOType(false, true, null);
1350
1380
1351
				BuildResource outRc = createResource(outLocation, outFullPath);
1381
				BuildResource outRc = createResource(outLocation, getURIForFullPath(outFullPath));
1352
				buildArg.addResource(outRc);
1382
				buildArg.addResource(outRc);
1353
		}
1383
		}
1354
		
1384
		
Lines 1432-1439 Link Here
1432
	
1462
	
1433
	
1463
	
1434
	private IPath locationToRel(IPath location){
1464
	private IPath locationToRel(IPath location){
1435
		if(fProject.getLocation().isPrefixOf(location))
1465
		if(getProjectLocation().isPrefixOf(location))
1436
			return location.removeFirstSegments(fProject.getLocation().segmentCount()).setDevice(null);
1466
			return location.removeFirstSegments(getProjectLocation().segmentCount()).setDevice(null);
1437
		//TODO
1467
		//TODO
1438
		return location;
1468
		return location;
1439
	}
1469
	}
Lines 1897-1904 Link Here
1897
				}
1927
				}
1898
				if(inFullPath == null && files.length > 0)
1928
				if(inFullPath == null && files.length > 0)
1899
					inFullPath = files[0].getFullPath();
1929
					inFullPath = files[0].getFullPath();
1900
				if(inFullPath == null && fProject.getLocation().isPrefixOf(inLocation)){
1930
				if(inFullPath == null && getProjectLocation().isPrefixOf(inLocation)){
1901
					inFullPath = fProject.getFullPath().append(inLocation.removeFirstSegments(fProject.getLocation().segmentCount())); 
1931
					inFullPath = fProject.getFullPath().append(inLocation.removeFirstSegments(getProjectLocation().segmentCount())); 
1902
				}
1932
				}
1903
			} else {
1933
			} else {
1904
				IPath projPath = inFullPath;
1934
				IPath projPath = inFullPath;
Lines 1906-1919 Link Here
1906
1936
1907
				IResource res = ResourcesPlugin.getWorkspace().getRoot().getFile(inFullPath);//.findMember(inFullPath);
1937
				IResource res = ResourcesPlugin.getWorkspace().getRoot().getFile(inFullPath);//.findMember(inFullPath);
1908
				inLocation = calcResourceLocation(res);
1938
				inLocation = calcResourceLocation(res);
1909
/*				if(res != null)
1910
					inLocation = res.getLocation();
1911
				else 
1912
					inLocation = fProject.getLocation().append(projPath);
1913
*/
1914
			}
1939
			}
1915
			
1940
			
1916
			BuildResource rc = createResource(inLocation, inFullPath);
1941
			BuildResource rc = createResource(inLocation, getURIForFullPath(inFullPath));
1917
			buildArg.addResource(rc);
1942
			buildArg.addResource(rc);
1918
			
1943
			
1919
			return rc;
1944
			return rc;
Lines 1929-1947 Link Here
1929
	}
1954
	}
1930
1955
1931
	public BuildResource createResource(IPath projPath){
1956
	public BuildResource createResource(IPath projPath){
1932
		return createResource(fProject.getLocation().append(projPath),fProject.getFullPath().append(projPath));
1957
		return createResource(projPath, createProjectRelativeURI(projPath));
1933
	}
1958
	}
1934
	
1959
	
1960
	private URI createProjectRelativeURI(IPath projPath) {
1961
		URI projURI = fProject.getLocationURI();
1962
		IFileStore projStore = null;
1963
		try {
1964
			projStore = EFS.getStore(projURI);
1965
		} catch (CoreException e) {
1966
			// TODO Auto-generated catch block
1967
			e.printStackTrace();
1968
		}
1969
		
1970
		if(projStore == null)
1971
			return null;
1972
		
1973
		IFileStore childStore = projStore.getFileStore(projPath);
1974
		return childStore.toURI();
1975
	}
1976
1935
	public BuildResource createResource(IResource rc){
1977
	public BuildResource createResource(IResource rc){
1936
		return createResource(calcResourceLocation(rc), rc.getFullPath());
1978
		return createResource(calcResourceLocation(rc), rc.getLocationURI());
1937
	}
1979
	}
1938
1980
1939
	public BuildResource createResource(IPath location, IPath fullPath){
1981
	public BuildResource createResource(IPath projPath, URI locationURI){
1940
		
1982
		
1941
		BuildResource rc = (BuildResource)getBuildResource(location);
1983
		BuildResource rc = (BuildResource)getBuildResource(projPath);
1942
		
1984
		
1943
		if(rc == null)
1985
		if(rc == null)
1944
			rc = new BuildResource(this, location, fullPath);
1986
			rc = new BuildResource(this, projPath, locationURI);
1945
1987
1946
		return rc;
1988
		return rc;
1947
	}
1989
	}
(-)src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java (-1 / +5 lines)
Lines 4094-4100 Link Here
4094
				buildDirectory = res.getLocation();
4094
				buildDirectory = res.getLocation();
4095
			}
4095
			}
4096
		} else {
4096
		} else {
4097
			buildDirectory = project.getLocation();
4097
			buildDirectory = getPathForResource(project);
4098
			
4098
			
4099
			if (buildDirectory != null) {
4099
			if (buildDirectory != null) {
4100
				if (builder.isManagedBuildOn())
4100
				if (builder.isManagedBuildOn())
Lines 4104-4109 Link Here
4104
		return buildDirectory;
4104
		return buildDirectory;
4105
	}
4105
	}
4106
	
4106
	
4107
	private static IPath getPathForResource(IResource resource) {
4108
		return new Path(resource.getLocationURI().getPath());
4109
	}
4110
4107
	public static IBuilder[] createBuilders(IProject project, Map args){
4111
	public static IBuilder[] createBuilders(IProject project, Map args){
4108
		return ManagedBuilderCorePlugin.createBuilders(project, args);
4112
		return ManagedBuilderCorePlugin.createBuilders(project, args);
4109
	}
4113
	}
(-)src/org/eclipse/cdt/managedbuilder/core/IBuilder.java (+3 lines)
Lines 89-94 Link Here
89
	static final String DEFAULT_TARGET_CLEAN = "clean";  //$NON-NLS-1$
89
	static final String DEFAULT_TARGET_CLEAN = "clean";  //$NON-NLS-1$
90
	static final String DEFAULT_TARGET_AUTO = "all"; //$NON-NLS-1$
90
	static final String DEFAULT_TARGET_AUTO = "all"; //$NON-NLS-1$
91
	
91
	
92
	/**
93
	 * @since 5.1
94
	 */
92
	static final String ATTRIBUTE_COMMAND_LAUNCHER = "commandLauncher"; //$NON-NLS-1$
95
	static final String ATTRIBUTE_COMMAND_LAUNCHER = "commandLauncher"; //$NON-NLS-1$
93
	
96
	
94
	/**
97
	/**
(-)META-INF/MANIFEST.MF (-9 / +10 lines)
Lines 2-26 Link Here
2
Bundle-ManifestVersion: 2
2
Bundle-ManifestVersion: 2
3
Bundle-Name: %pluginName
3
Bundle-Name: %pluginName
4
Bundle-SymbolicName: org.eclipse.cdt.managedbuilder.core; singleton:=true
4
Bundle-SymbolicName: org.eclipse.cdt.managedbuilder.core; singleton:=true
5
Bundle-Version: 5.0.100.qualifier
5
Bundle-Version: 5.1.0.qualifier
6
Bundle-Activator: org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin
6
Bundle-Activator: org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin
7
Bundle-Vendor: %providerName
7
Bundle-Vendor: %providerName
8
Bundle-Localization: plugin
8
Bundle-Localization: plugin
9
Export-Package: org.eclipse.cdt.build.core.scannerconfig,
9
Export-Package: org.eclipse.cdt.build.core.scannerconfig,
10
 org.eclipse.cdt.build.internal.core.scannerconfig,
10
 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",
11
 org.eclipse.cdt.build.internal.core.scannerconfig2,
11
 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",
12
 org.eclipse.cdt.managedbuilder.buildmodel,
12
 org.eclipse.cdt.managedbuilder.buildmodel,
13
 org.eclipse.cdt.managedbuilder.buildproperties,
13
 org.eclipse.cdt.managedbuilder.buildproperties,
14
 org.eclipse.cdt.managedbuilder.core,
14
 org.eclipse.cdt.managedbuilder.core,
15
 org.eclipse.cdt.managedbuilder.envvar,
15
 org.eclipse.cdt.managedbuilder.envvar,
16
 org.eclipse.cdt.managedbuilder.internal.buildmodel,
16
 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",
17
 org.eclipse.cdt.managedbuilder.internal.core,
17
 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",
18
 org.eclipse.cdt.managedbuilder.internal.envvar,
18
 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",
19
 org.eclipse.cdt.managedbuilder.internal.macros,
19
 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",
20
 org.eclipse.cdt.managedbuilder.macros,
20
 org.eclipse.cdt.managedbuilder.macros,
21
 org.eclipse.cdt.managedbuilder.makegen,
21
 org.eclipse.cdt.managedbuilder.makegen,
22
 org.eclipse.cdt.managedbuilder.makegen.gnu,
22
 org.eclipse.cdt.managedbuilder.makegen.gnu,
23
 org.eclipse.cdt.managedbuilder.makegen.internal,
23
 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",
24
 org.eclipse.cdt.managedbuilder.pdomdepgen,
24
 org.eclipse.cdt.managedbuilder.pdomdepgen,
25
 org.eclipse.cdt.managedbuilder.projectconverter,
25
 org.eclipse.cdt.managedbuilder.projectconverter,
26
 org.eclipse.cdt.managedbuilder.scannerconfig,
26
 org.eclipse.cdt.managedbuilder.scannerconfig,
Lines 33-39 Link Here
33
 org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
33
 org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
34
 org.eclipse.ui;bundle-version="[3.2.0,4.0.0)",
34
 org.eclipse.ui;bundle-version="[3.2.0,4.0.0)",
35
 org.eclipse.core.variables;bundle-version="[3.1.100,4.0.0)",
35
 org.eclipse.core.variables;bundle-version="[3.1.100,4.0.0)",
36
 org.eclipse.cdt.make.core;visibility:=reexport
36
 org.eclipse.cdt.make.core;visibility:=reexport,
37
 org.eclipse.core.filesystem;bundle-version="1.2.0"
37
Bundle-ActivationPolicy: lazy
38
Bundle-ActivationPolicy: lazy
38
Bundle-RequiredExecutionEnvironment: J2SE-1.5
39
Bundle-RequiredExecutionEnvironment: J2SE-1.5
39
Import-Package: com.ibm.icu.text
40
Import-Package: com.ibm.icu.text
(-).project (+6 lines)
Lines 20-28 Link Here
20
			<arguments>
20
			<arguments>
21
			</arguments>
21
			</arguments>
22
		</buildCommand>
22
		</buildCommand>
23
		<buildCommand>
24
			<name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
25
			<arguments>
26
			</arguments>
27
		</buildCommand>
23
	</buildSpec>
28
	</buildSpec>
24
	<natures>
29
	<natures>
25
		<nature>org.eclipse.jdt.core.javanature</nature>
30
		<nature>org.eclipse.jdt.core.javanature</nature>
26
		<nature>org.eclipse.pde.PluginNature</nature>
31
		<nature>org.eclipse.pde.PluginNature</nature>
32
		<nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
27
	</natures>
33
	</natures>
28
</projectDescription>
34
</projectDescription>
(-)src/org/eclipse/cdt/managedbuilder/buildmodel/BuildDescriptionManager.java (-9 / +12 lines)
Lines 59-65 Link Here
59
	 */
59
	 */
60
	public static final int DEPFILES = 1 << 3;
60
	public static final int DEPFILES = 1 << 3;
61
	
61
	
62
	private Set fVisitedSteps = new HashSet();
62
	private Set<IBuildStep> fVisitedSteps = new HashSet<IBuildStep>();
63
	private boolean fUp;
63
	private boolean fUp;
64
	private IBuildDescription fInfo;
64
	private IBuildDescription fInfo;
65
65
Lines 94-99 Link Here
94
		return DefaultBuildDescriptionFactory.getInstance().createBuildDescription(cfg, delta, flags);
94
		return DefaultBuildDescriptionFactory.getInstance().createBuildDescription(cfg, delta, flags);
95
	}
95
	}
96
96
97
	/**
98
	 * @noreference This method is not intended to be referenced by clients.
99
	 */
97
	static public IBuildDescription createBuildDescription(IConfiguration cfg,
100
	static public IBuildDescription createBuildDescription(IConfiguration cfg,
98
			IConfigurationBuildState bs,
101
			IConfigurationBuildState bs,
99
			IResourceDelta delta,
102
			IResourceDelta delta,
Lines 162-168 Link Here
162
	}
165
	}
163
166
164
	public static IBuildStep[] getSteps(IBuildStep step, boolean input){
167
	public static IBuildStep[] getSteps(IBuildStep step, boolean input){
165
		Set set = new HashSet();
168
		Set<IBuildStep> set = new HashSet<IBuildStep>();
166
		
169
		
167
		IBuildIOType args[] = input ?
170
		IBuildIOType args[] = input ?
168
				step.getInputIOTypes() :
171
				step.getInputIOTypes() :
Lines 186-202 Link Here
186
			}
189
			}
187
		}
190
		}
188
		
191
		
189
		return (IBuildStep[])set.toArray(new IBuildStep[set.size()]);
192
		return set.toArray(new IBuildStep[set.size()]);
190
	}
193
	}
191
194
192
	public static IBuildResource[] filterGeneratedBuildResources(IBuildResource rc[], int rcState){
195
	public static IBuildResource[] filterGeneratedBuildResources(IBuildResource rc[], int rcState){
193
		List list = new ArrayList();
196
		List<IBuildResource> list = new ArrayList<IBuildResource>();
194
		
197
		
195
		addBuildResources(rc, list, rcState);
198
		addBuildResources(rc, list, rcState);
196
		return (IBuildResource[])list.toArray(new IBuildResource[list.size()]);
199
		return list.toArray(new IBuildResource[list.size()]);
197
	}
200
	}
198
201
199
	private static void addBuildResources(IBuildResource rcs[], List list, int rcState){
202
	private static void addBuildResources(IBuildResource rcs[], List<IBuildResource> list, int rcState){
200
		if(rcs.length == 0)
203
		if(rcs.length == 0)
201
			return;
204
			return;
202
		IBuildStep inputAction = rcs[0].getBuildDescription().getInputStep();
205
		IBuildStep inputAction = rcs[0].getBuildDescription().getInputStep();
Lines 254-260 Link Here
254
	 */
257
	 */
255
	public static void cleanGeneratedRebuildResources(IBuildDescription des) throws CoreException{
258
	public static void cleanGeneratedRebuildResources(IBuildDescription des) throws CoreException{
256
		IBuildResource bRcs[] = filterGeneratedBuildResources(des.getResources(), REMOVED | REBUILD);
259
		IBuildResource bRcs[] = filterGeneratedBuildResources(des.getResources(), REMOVED | REBUILD);
257
		List failList = new ArrayList();
260
		List<Object[]> failList = new ArrayList<Object[]>();
258
		
261
		
259
		for(int i = 0; i < bRcs.length; i++){
262
		for(int i = 0; i < bRcs.length; i++){
260
			if(!bRcs[i].isProjectResource())
263
			if(!bRcs[i].isProjectResource())
Lines 272-279 Link Here
272
		
275
		
273
		if(failList.size() != 0){
276
		if(failList.size() != 0){
274
			BuildMultiStatus status = new BuildMultiStatus("failed to remove resources", null);	//$NON-NLS-1$
277
			BuildMultiStatus status = new BuildMultiStatus("failed to remove resources", null);	//$NON-NLS-1$
275
			for(Iterator iter = failList.iterator(); iter.hasNext();){
278
			for(Iterator<Object[]> iter = failList.iterator(); iter.hasNext();){
276
				Object[] err = (Object[])iter.next();
279
				Object[] err = iter.next();
277
				IResource rc = (IResource)err[0];
280
				IResource rc = (IResource)err[0];
278
				CoreException e = (CoreException)err[1];
281
				CoreException e = (CoreException)err[1];
279
				status.add(new BuildStatus(rc.getFullPath().toString(), e));
282
				status.add(new BuildStatus(rc.getFullPath().toString(), e));
(-)src/org/eclipse/cdt/managedbuilder/buildmodel/IBuildResource.java (-3 / +11 lines)
Lines 10-15 Link Here
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.cdt.managedbuilder.buildmodel;
11
package org.eclipse.cdt.managedbuilder.buildmodel;
12
12
13
import java.net.URI;
14
13
import org.eclipse.core.runtime.IPath;
15
import org.eclipse.core.runtime.IPath;
14
16
15
/**
17
/**
Lines 26-40 Link Here
26
	IPath getLocation();
28
	IPath getLocation();
27
	
29
	
28
	/**
30
	/**
29
	 * In case the resource is a workspace resource,
31
	 * Returns the full path to the build resource as seen on the target machine.
30
	 * returns the full workspace path for the resource
31
	 * otherwise returns null
32
	 * 
32
	 * 
33
	 * @return IPath
33
	 * @return IPath
34
	 */
34
	 */
35
	IPath getFullPath();
35
	IPath getFullPath();
36
	
36
	
37
	/**
37
	/**
38
	 * Returns a URI that can be used by EFS to access the build resource.
39
	 * 
40
	 * @return URI
41
	 * @since 5.1
42
	 */
43
	URI getLocationURI();
44
	
45
	/**
38
	 * Returns the output io type of the step
46
	 * Returns the output io type of the step
39
	 * that generates this resource.
47
	 * that generates this resource.
40
	 * In case the resource is the project source,
48
	 * In case the resource is the project source,
(-)src/org/eclipse/cdt/ui/wizards/CDTCommonProjectWizard.java (+5 lines)
Lines 208-213 Link Here
208
		ICProjectDescriptionManager mngr = CoreModel.getDefault().getProjectDescriptionManager();
208
		ICProjectDescriptionManager mngr = CoreModel.getDefault().getProjectDescriptionManager();
209
		
209
		
210
		ICProjectDescription des = mngr.getProjectDescription(newProject, false);
210
		ICProjectDescription des = mngr.getProjectDescription(newProject, false);
211
		
212
		if(des == null ) {
213
			return false;
214
		}
215
		
211
		if(des.isCdtProjectCreating()){
216
		if(des.isCdtProjectCreating()){
212
			des = mngr.getProjectDescription(newProject, true);
217
			des = mngr.getProjectDescription(newProject, true);
213
			des.setCdtProjectCreated();
218
			des.setCdtProjectCreated();

Return to bug 273636