Lines 7-21
Link Here
|
7 |
* |
7 |
* |
8 |
* Contributors: |
8 |
* Contributors: |
9 |
* QNX Software Systems - Initial API and implementation |
9 |
* QNX Software Systems - Initial API and implementation |
|
|
10 |
* Tianchao Li (tianchao.li@gmail.com) - EFS support |
10 |
*******************************************************************************/ |
11 |
*******************************************************************************/ |
11 |
package org.eclipse.cdt.make.internal.core.makefile.gnu; |
12 |
package org.eclipse.cdt.make.internal.core.makefile.gnu; |
12 |
|
13 |
|
13 |
import java.io.IOException; |
14 |
import java.io.IOException; |
|
|
15 |
import java.net.URI; |
16 |
import java.net.URISyntaxException; |
14 |
|
17 |
|
15 |
import org.eclipse.cdt.make.core.makefile.IDirective; |
18 |
import org.eclipse.cdt.make.core.makefile.IDirective; |
16 |
import org.eclipse.cdt.make.core.makefile.gnu.IInclude; |
19 |
import org.eclipse.cdt.make.core.makefile.gnu.IInclude; |
17 |
import org.eclipse.cdt.make.internal.core.makefile.Directive; |
20 |
import org.eclipse.cdt.make.internal.core.makefile.Directive; |
18 |
import org.eclipse.cdt.make.internal.core.makefile.Parent; |
21 |
import org.eclipse.cdt.make.internal.core.makefile.Parent; |
|
|
22 |
import org.eclipse.core.filesystem.EFS; |
23 |
import org.eclipse.core.filesystem.URIUtil; |
24 |
import org.eclipse.core.runtime.CoreException; |
19 |
|
25 |
|
20 |
public class Include extends Parent implements IInclude { |
26 |
public class Include extends Parent implements IInclude { |
21 |
|
27 |
|
Lines 43-65
Link Here
|
43 |
public IDirective[] getDirectives() { |
49 |
public IDirective[] getDirectives() { |
44 |
clearDirectives(); |
50 |
clearDirectives(); |
45 |
for (int i = 0; i < filenames.length; i++) { |
51 |
for (int i = 0; i < filenames.length; i++) { |
46 |
// Try the current directory. |
|
|
47 |
GNUMakefile gnu = new GNUMakefile(); |
52 |
GNUMakefile gnu = new GNUMakefile(); |
48 |
try { |
53 |
// // Try the current directory. |
49 |
gnu.parse(filenames[i]); |
54 |
// try { |
50 |
addDirective(gnu); |
55 |
// gnu.parse(filenames[i]); |
51 |
continue; |
56 |
// addDirective(gnu); |
52 |
} catch (IOException e) { |
57 |
// continue; |
53 |
} |
58 |
// } catch (IOException e) { |
|
|
59 |
// } |
54 |
if (!filenames[i].startsWith(GNUMakefile.FILE_SEPARATOR) && dirs != null) { |
60 |
if (!filenames[i].startsWith(GNUMakefile.FILE_SEPARATOR) && dirs != null) { |
55 |
for (int j = 0; j < dirs.length; j++) { |
61 |
for (int j = 0; j < dirs.length; j++) { |
56 |
try { |
62 |
try { |
57 |
String filename = dirs[j] + GNUMakefile.FILE_SEPARATOR + filenames[i]; |
|
|
58 |
gnu = new GNUMakefile(); |
63 |
gnu = new GNUMakefile(); |
59 |
gnu.parse(filename); |
64 |
|
|
|
65 |
// EFS |
66 |
URI uri = new URI(dirs[j]); |
67 |
// START ================================================= |
68 |
// Temporary hack to provide UI support for EFS |
69 |
// without modifying the filesystemSupport extension point |
70 |
// Real solution has to be based on bug fix to 134270 |
71 |
if (uri != null) |
72 |
{ |
73 |
if ((uri.getScheme() == null) |
74 |
|| (uri.getScheme() != null && uri.getScheme().length() == 1)) // This is a hack for Windows paths like c:\...! |
75 |
{ |
76 |
uri = URIUtil.toURI(dirs[j]); |
77 |
} |
78 |
} |
79 |
// =================================================== END |
80 |
|
81 |
URI fileURI = EFS.getStore(uri).getChild(filenames[i]).toURI(); |
82 |
gnu.parse(fileURI); |
60 |
addDirective(gnu); |
83 |
addDirective(gnu); |
61 |
break; |
84 |
break; |
62 |
} catch (IOException e) { |
85 |
} catch (IOException e) { |
|
|
86 |
e.printStackTrace(); |
87 |
} catch (URISyntaxException e) { |
88 |
e.printStackTrace(); |
89 |
} catch (CoreException e) { |
90 |
e.printStackTrace(); |
63 |
} |
91 |
} |
64 |
} |
92 |
} |
65 |
} |
93 |
} |