@@ -92,18 +92,6 @@ public class Helpers extends Common {
92
92
93
93
private static boolean myHasBeenLogged = false ;
94
94
95
- /**
96
- * conveniance method because java does not know default values as parameters
97
- * default is isWorkSpace=true
98
- *
99
- * @param configurationDescription
100
- * @param IncludePath
101
- */
102
-
103
- public static void addIncludeFolder (ICFolderDescription folderDescription , IPath IncludePath )
104
- {
105
- addIncludeFolder ( folderDescription , IncludePath ,true ) ;
106
- }
107
95
108
96
/**
109
97
* This method is the internal working class that adds the provided include path
@@ -114,8 +102,10 @@ public static void addIncludeFolder(ICFolderDescription folderDescription, IPat
114
102
* @param IncludePath The path to add to the include folders
115
103
* @see addLibraryDependency {@link #addLibraryDependency(IProject, IProject)}
116
104
*/
117
- public static void addIncludeFolder (ICFolderDescription folderDescription , IPath IncludePath ,boolean isWorkspacePath ) {
118
- ICLanguageSetting [] languageSettings = folderDescription .getLanguageSettings ();
105
+ public static void addIncludeFolder (ICConfigurationDescription configurationDescription , IPath IncludePath ,
106
+ boolean isWorkspacePath ) {
107
+ ICLanguageSetting [] languageSettings = configurationDescription .getRootFolderDescription ()
108
+ .getLanguageSettings ();
119
109
int pathSetting = ICSettingEntry .VALUE_WORKSPACE_PATH ;
120
110
if (!isWorkspacePath ) {
121
111
pathSetting = 0 ;
@@ -241,8 +231,7 @@ public static void LinkFolderToFolder(IProject project, IPath source, IPath targ
241
231
*/
242
232
public static void addCodeFolder (IProject project , IPath toLinkFolder , String LinkName ,
243
233
ICConfigurationDescription configurationDescription , boolean forceRoot ) throws CoreException {
244
- IFolder link = project .getFolder (LinkName );
245
- ICFolderDescription folderDescription = configurationDescription .getRootFolderDescription ();
234
+ IFolder link = project .getFolder (LinkName );
246
235
247
236
LinkFolderToFolder (project , toLinkFolder , new Path (LinkName ));
248
237
@@ -252,29 +241,35 @@ public static void addCodeFolder(IProject project, IPath toLinkFolder, String Li
252
241
String possibleIncludeFolder = "utility" ; //$NON-NLS-1$
253
242
File file = toLinkFolder .append (possibleIncludeFolder ).toFile ();
254
243
if (file .exists ()) {
255
- addIncludeFolder (folderDescription , link .getFullPath ().append (possibleIncludeFolder ));
244
+ addIncludeFolder (configurationDescription , link .getFullPath ().append (possibleIncludeFolder ), true );
256
245
}
257
246
258
247
if (forceRoot ) {
259
- addIncludeFolder (folderDescription , link .getFullPath ());
248
+ addIncludeFolder (configurationDescription , link .getFullPath (), true );
260
249
} else {
261
250
// add src or root give priority to src
262
251
possibleIncludeFolder = Library .LIBRARY_SOURCE_FODER ;
263
252
file = toLinkFolder .append (possibleIncludeFolder ).toFile ();
264
253
if (file .exists ()) {
265
- addIncludeFolder (folderDescription , link .getFullPath ().append (possibleIncludeFolder ));
254
+ addIncludeFolder (configurationDescription , link .getFullPath ().append (possibleIncludeFolder ), true );
266
255
} else {
267
- addIncludeFolder (folderDescription , link .getFullPath ());
256
+ addIncludeFolder (configurationDescription , link .getFullPath (), true );
268
257
}
269
258
}
270
-
271
- possibleIncludeFolder = "arch" ; //$NON-NLS-1$
272
- file = toLinkFolder .append (possibleIncludeFolder ).toFile ();
273
- if (file .exists ()) {
274
- InternalBoardDescriptor boardDescriptor = new InternalBoardDescriptor (configurationDescription );
275
- addIncludeFolder (folderDescription ,
276
- link .getFullPath ().append (possibleIncludeFolder ).append (boardDescriptor .getArchitecture ()));
277
- }
259
+ // TOFIX removed this code as part of libraries not included in project after
260
+ // creation,
261
+ // Should run a lib test to see how this works without this code
262
+ // if this is needed I should create a include with a environment var so I do
263
+ // not need to get the boardDescriptor
264
+
265
+ // possibleIncludeFolder = "arch"; //$NON-NLS-1$
266
+ // file = toLinkFolder.append(possibleIncludeFolder).toFile();
267
+ // if (file.exists()) {
268
+ // InternalBoardDescriptor boardDescriptor = new
269
+ // InternalBoardDescriptor(configurationDescription);
270
+ // addIncludeFolder(rootFolderDescr,
271
+ // link.getFullPath().append(possibleIncludeFolder).append(boardDescriptor.getArchitecture()));
272
+ // }
278
273
}
279
274
280
275
public static void removeCodeFolder (IProject project , String LinkName ) throws CoreException {
@@ -285,30 +280,30 @@ public static void removeCodeFolder(IProject project, String LinkName) throws Co
285
280
}
286
281
287
282
/**
288
- * This method creates a link folder in the project and adds the folder as a
289
- * source path to the project it also adds the path to the include folder if the
290
- * include path parameter points to a path that contains a subfolder named
291
- * "utility" this subfolder will be added to the include path as well <br/>
292
- * <br/>
293
- *
294
- * note Arduino has these subfolders in the libraries that need to be
295
- * include.<br/>
296
- * <br/>
297
- *
298
- * note that in the current eclipse version, there is no need to add the
299
- * subfolder as a code folder. This may change in the future as it looks like a
300
- * bug to me.<br/>
301
- *
302
- * @param project
303
- * @param Path
304
- * @throws CoreException
305
- *
306
- * @see addLibraryDependency {@link #addLibraryDependency(IProject, IProject)}
307
- */
283
+ * This method creates a link folder in the project descriptor and adds the
284
+ * folder as a source path to the projectdescriptor it also adds the path to the
285
+ * include folder if the include path parameter points to a path that contains a
286
+ * subfolder named "utility" this subfolder will be added to the include path as
287
+ * well <br/>
288
+ * <br/>
289
+ *
290
+ * note Arduino has these subfolders in the libraries that need to be
291
+ * include.<br/>
292
+ * <br/>
293
+ *
294
+ * note that in the current eclipse version, there is no need to add the
295
+ * subfolder as a code folder. This may change in the future as it looks like a
296
+ * bug to me.<br/>
297
+ *
298
+ * @param project
299
+ * @param Path
300
+ * @throws CoreException
301
+ *
302
+ * @see addLibraryDependency {@link #addLibraryDependency(IProject, IProject)}
303
+ */
308
304
public static void addCodeFolder (IProject project , Path Path , ICConfigurationDescription configurationDescription ,
309
305
boolean forceRoot ) throws CoreException {
310
-
311
- String NiceName = Path .lastSegment ();
306
+ String NiceName = Path .lastSegment ();
312
307
addCodeFolder (project , Path , NiceName , configurationDescription , forceRoot );
313
308
}
314
309
0 commit comments