37
37
import org .eclipse .core .resources .IFile ;
38
38
import org .eclipse .core .resources .IFolder ;
39
39
import org .eclipse .core .resources .IProject ;
40
- import org .eclipse .core .resources .IProjectDescription ;
41
40
import org .eclipse .core .resources .IResource ;
42
41
import org .eclipse .core .resources .ResourcesPlugin ;
43
42
import org .eclipse .core .runtime .CoreException ;
@@ -103,8 +102,10 @@ public class Helpers extends Common {
103
102
* @param configurationDescription
104
103
* @param IncludePath
105
104
*/
106
- public static void addIncludeFolder (ICConfigurationDescription configurationDescription , IPath IncludePath ) {
107
- addIncludeFolder (configurationDescription , IncludePath , true );
105
+
106
+ public static void addIncludeFolder (ICFolderDescription folderDescription , IPath IncludePath )
107
+ {
108
+ addIncludeFolder ( folderDescription , IncludePath ,true ) ;
108
109
}
109
110
110
111
/**
@@ -116,10 +117,7 @@ public static void addIncludeFolder(ICConfigurationDescription configurationDesc
116
117
* @param IncludePath The path to add to the include folders
117
118
* @see addLibraryDependency {@link #addLibraryDependency(IProject, IProject)}
118
119
*/
119
- public static void addIncludeFolder (ICConfigurationDescription configurationDescription , IPath IncludePath ,
120
- boolean isWorkspacePath ) {
121
- // find all languages
122
- ICFolderDescription folderDescription = configurationDescription .getRootFolderDescription ();
120
+ public static void addIncludeFolder (ICFolderDescription folderDescription , IPath IncludePath ,boolean isWorkspacePath ) {
123
121
ICLanguageSetting [] languageSettings = folderDescription .getLanguageSettings ();
124
122
int pathSetting = ICSettingEntry .VALUE_WORKSPACE_PATH ;
125
123
if (!isWorkspacePath ) {
@@ -247,6 +245,7 @@ public static void LinkFolderToFolder(IProject project, IPath source, IPath targ
247
245
public static void addCodeFolder (IProject project , IPath toLinkFolder , String LinkName ,
248
246
ICConfigurationDescription configurationDescription , boolean forceRoot ) throws CoreException {
249
247
IFolder link = project .getFolder (LinkName );
248
+ ICFolderDescription folderDescription = configurationDescription .getRootFolderDescription ();
250
249
251
250
LinkFolderToFolder (project , toLinkFolder , new Path (LinkName ));
252
251
@@ -256,27 +255,27 @@ public static void addCodeFolder(IProject project, IPath toLinkFolder, String Li
256
255
String possibleIncludeFolder = "utility" ;
257
256
File file = toLinkFolder .append (possibleIncludeFolder ).toFile ();
258
257
if (file .exists ()) {
259
- addIncludeFolder (configurationDescription , link .getFullPath ().append (possibleIncludeFolder ));
258
+ addIncludeFolder (folderDescription , link .getFullPath ().append (possibleIncludeFolder ));
260
259
}
261
260
262
261
if (forceRoot ) {
263
- addIncludeFolder (configurationDescription , link .getFullPath ());
262
+ addIncludeFolder (folderDescription , link .getFullPath ());
264
263
} else {
265
264
// add src or root give priority to src
266
265
possibleIncludeFolder = Library .LIBRARY_SOURCE_FODER ;
267
266
file = toLinkFolder .append (possibleIncludeFolder ).toFile ();
268
267
if (file .exists ()) {
269
- addIncludeFolder (configurationDescription , link .getFullPath ().append (possibleIncludeFolder ));
268
+ addIncludeFolder (folderDescription , link .getFullPath ().append (possibleIncludeFolder ));
270
269
} else {
271
- addIncludeFolder (configurationDescription , link .getFullPath ());
270
+ addIncludeFolder (folderDescription , link .getFullPath ());
272
271
}
273
272
}
274
273
275
274
possibleIncludeFolder = "arch" ;
276
275
file = toLinkFolder .append (possibleIncludeFolder ).toFile ();
277
276
if (file .exists ()) {
278
277
InternalBoardDescriptor boardDescriptor = new InternalBoardDescriptor (configurationDescription );
279
- addIncludeFolder (configurationDescription ,
278
+ addIncludeFolder (folderDescription ,
280
279
link .getFullPath ().append (possibleIncludeFolder ).append (boardDescriptor .getArchitecture ()));
281
280
}
282
281
}
@@ -316,24 +315,6 @@ public static void addCodeFolder(IProject project, Path Path, ICConfigurationDes
316
315
addCodeFolder (project , Path , NiceName , configurationDescription , forceRoot );
317
316
}
318
317
319
- /**
320
- * addTheNatures replaces all existing natures by the natures needed for a
321
- * arduino project
322
- *
323
- * @param project The project where the natures need to be added to
324
- * @throws CoreException
325
- */
326
- public static void addTheNatures (IProjectDescription description ) throws CoreException {
327
-
328
- String [] newnatures = new String [5 ];
329
- newnatures [0 ] = "org.eclipse.cdt.core.cnature" ;
330
- newnatures [1 ] = "org.eclipse.cdt.core.ccnature" ;
331
- newnatures [2 ] = "org.eclipse.cdt.managedbuilder.core.managedBuildNature" ;
332
- newnatures [3 ] = "org.eclipse.cdt.managedbuilder.core.ScannerConfigNature" ;
333
- newnatures [4 ] = Const .ARDUINO_NATURE_ID ;
334
- description .setNatureIds (newnatures );
335
-
336
- }
337
318
338
319
/**
339
320
* This method adds the content of a content stream to a file If the file
0 commit comments