@@ -280,7 +280,7 @@ public boolean visit(IResourceProxy proxy) throws CoreException {
280
280
// dependency files
281
281
/** Collection of Containers which contribute source files to the build */
282
282
private Collection <IContainer > subdirList ;
283
- private IPath topBuildDir ;
283
+ private IFile topBuildDir ;
284
284
final HashMap <String , List <IPath >> buildSrcVars = new HashMap <>();
285
285
final HashMap <String , List <IPath >> buildOutVars = new HashMap <>();
286
286
final HashMap <String , ArduinoGnuDependencyGroupInfo > buildDepVars = new HashMap <>();
@@ -348,7 +348,7 @@ public void initialize(IProject project, IManagedBuildInfo info, IProgressMonito
348
348
builder = config .getEditableBuilder ();
349
349
initToolInfos ();
350
350
// set the top build dir path
351
- topBuildDir = project .getFolder (info .getConfigurationName ()). getFullPath ( );
351
+ topBuildDir = project .getFile (info .getConfigurationName ());
352
352
}
353
353
354
354
/**
@@ -364,11 +364,12 @@ private void callDependencyPostProcessors(IResourceInfo rcInfo, ToolInfoHolder h
364
364
IPath absolutePath = new Path (
365
365
EFSExtensionManager .getDefault ().getPathFromURI (depFile .getLocationURI ()));
366
366
// Convert to build directory relative
367
- IPath depPath = ManagedBuildManager .calculateRelativePath (getTopBuildDir (), absolutePath );
367
+ IPath depPath = ManagedBuildManager .calculateRelativePath (getTopBuildDir (). getFullPath () , absolutePath );
368
368
for (int i = 0 ; i < postProcessors .length ; i ++) {
369
369
IManagedDependencyGenerator2 depGen = postProcessors [i ];
370
370
if (depGen != null ) {
371
- depGen .postProcessDependencyFile (depPath , config , h .buildTools [i ], getTopBuildDir ());
371
+ depGen .postProcessDependencyFile (depPath , config , h .buildTools [i ],
372
+ getTopBuildDir ().getFullPath ());
372
373
}
373
374
}
374
375
}
@@ -475,7 +476,7 @@ public boolean visit(PathSettingsContainer container) {
475
476
continue ;
476
477
DepInfo di = (DepInfo ) cr .getValue ();
477
478
ToolInfoHolder h = ToolInfoHolder .getToolInfo (this , projectRelativePath );
478
- IPath buildRelativePath = topBuildDir .append (projectRelativePath );
479
+ IPath buildRelativePath = topBuildDir .getFullPath (). append (projectRelativePath );
479
480
IFolder buildFolder = root .getFolder (buildRelativePath );
480
481
if (buildFolder == null )
481
482
continue ;
@@ -544,11 +545,12 @@ public MultiStatus generateMakefiles(IResourceDelta delta) throws CoreException
544
545
return status ;
545
546
}
546
547
// Make sure the build directory is available
547
- topBuildDir = createDirectory (project , config .getName ());
548
+ topBuildDir = project .getFile (config .getName ());
549
+ createDirectory (project , config .getName ());
548
550
checkCancel ();
549
551
// Make sure that there is a makefile containing all the folders
550
552
// participating
551
- IPath srcsFilePath = topBuildDir .append (SRCSFILE_NAME );
553
+ IPath srcsFilePath = topBuildDir .getFullPath (). append (SRCSFILE_NAME );
552
554
IFile srcsFileHandle = createFile (srcsFilePath );
553
555
buildSrcVars .clear ();
554
556
buildOutVars .clear ();
@@ -616,7 +618,7 @@ public MultiStatus generateMakefiles(IResourceDelta delta) throws CoreException
616
618
calculateToolInputsOutputs ();
617
619
checkCancel ();
618
620
// Re-create the top-level makefile
619
- IPath makefilePath = topBuildDir .append (MAKEFILE_NAME );
621
+ IPath makefilePath = topBuildDir .getFullPath (). append (MAKEFILE_NAME );
620
622
IFile makefileHandle = createFile (makefilePath );
621
623
myTopMakeFileGenerator .populateTopMakefile (makefileHandle , false );
622
624
checkCancel ();
@@ -651,7 +653,7 @@ public MultiStatus generateMakefiles(IResourceDelta delta) throws CoreException
651
653
@ Override
652
654
public IPath getBuildWorkingDir () {
653
655
if (topBuildDir != null ) {
654
- return topBuildDir .removeFirstSegments (1 );
656
+ return topBuildDir .getFullPath (). removeFirstSegments (1 );
655
657
}
656
658
return null ;
657
659
}
@@ -720,7 +722,7 @@ public boolean visit(PathSettingsContainer container) {
720
722
IResourceInfo rcInfo = config .getResourceInfo (container .getPath (), false );
721
723
for (IPath path : getDependencyMakefiles (h )) {
722
724
// The path to search for the dependency makefile
723
- IPath relDepFilePath = topBuildDir .append (path );
725
+ IPath relDepFilePath = topBuildDir .getFullPath (). append (path );
724
726
IFile depFile = root .getFile (relDepFilePath );
725
727
if (depFile == null || !depFile .isAccessible ())
726
728
continue ;
@@ -765,10 +767,11 @@ public MultiStatus regenerateMakefiles() throws CoreException {
765
767
return status ;
766
768
}
767
769
// Create the top-level directory for the build output
768
- topBuildDir = createDirectory (project , config .getName ());
770
+ topBuildDir = project .getFile (config .getName ());
771
+ createDirectory (project , config .getName ());
769
772
checkCancel ();
770
773
// Get the list of subdirectories
771
- IPath srcsFilePath = topBuildDir .append (SRCSFILE_NAME );
774
+ IPath srcsFilePath = topBuildDir .getFullPath (). append (SRCSFILE_NAME );
772
775
IFile srcsFileHandle = createFile (srcsFilePath );
773
776
buildSrcVars .clear ();
774
777
buildOutVars .clear ();
@@ -793,13 +796,13 @@ public MultiStatus regenerateMakefiles() throws CoreException {
793
796
calculateToolInputsOutputs ();
794
797
checkCancel ();
795
798
// Create the top-level makefile
796
- IPath makefilePath = topBuildDir .append (MAKEFILE_NAME );
799
+ IPath makefilePath = topBuildDir .getFullPath (). append (MAKEFILE_NAME );
797
800
IFile makefileHandle = createFile (makefilePath );
798
801
myTopMakeFileGenerator .populateTopMakefile (makefileHandle , true );
799
802
// JABA SLOEBER create the size.awk file
800
803
ICConfigurationDescription confDesc = ManagedBuildManager .getDescriptionForConfiguration (config );
801
804
IWorkspaceRoot root = CCorePlugin .getWorkspace ().getRoot ();
802
- IFile sizeAwkFile1 = root .getFile (topBuildDir .append ("size.awk" ));
805
+ IFile sizeAwkFile1 = root .getFile (topBuildDir .getFullPath (). append ("size.awk" ));
803
806
File sizeAwkFile = sizeAwkFile1 .getLocation ().toFile ();
804
807
String regex = Common .getBuildEnvironmentVariable (confDesc , "recipe.size.regex" , EMPTY );
805
808
String awkContent = "/" + regex + "/ {arduino_size += $2 }\n " ;
@@ -825,7 +828,7 @@ public MultiStatus regenerateMakefiles() throws CoreException {
825
828
// END JABA SLOEBER create the size.awk file
826
829
checkCancel ();
827
830
// Now finish up by adding all the object files
828
- IPath objFilePath = topBuildDir .append (OBJECTS_MAKFILE );
831
+ IPath objFilePath = topBuildDir .getLocation (). append (OBJECTS_MAKFILE );
829
832
IFile objsFileHandle = createFile (objFilePath );
830
833
populateObjectsMakefile (objsFileHandle );
831
834
checkCancel ();
@@ -1290,8 +1293,9 @@ private void deleteBuildTarget(IResource deletedFile) {
1290
1293
1291
1294
private IPath inFullPathFromOutFullPath (IPath path ) {
1292
1295
IPath inPath = null ;
1293
- if (topBuildDir .isPrefixOf (path )) {
1294
- inPath = path .removeFirstSegments (topBuildDir .segmentCount ());
1296
+ IPath topBuildPath = topBuildDir .getFullPath ();
1297
+ if (topBuildPath .isPrefixOf (path )) {
1298
+ inPath = path .removeFirstSegments (topBuildPath .segmentCount ());
1295
1299
inPath = project .getFullPath ().append (path );
1296
1300
}
1297
1301
return inPath ;
@@ -1323,7 +1327,8 @@ private void deleteDepFile(IResource deletedFile) {
1323
1327
if (calcType == IManagedDependencyGeneratorType .TYPE_COMMAND ) {
1324
1328
depFilePaths = new IPath [1 ];
1325
1329
IPath absolutePath = deletedFile .getLocation ();
1326
- depFilePaths [0 ] = ManagedBuildManager .calculateRelativePath (getTopBuildDir (), absolutePath );
1330
+ depFilePaths [0 ] = ManagedBuildManager .calculateRelativePath (getTopBuildDir ().getFullPath (),
1331
+ absolutePath );
1327
1332
depFilePaths [0 ] = depFilePaths [0 ].removeFileExtension ().addFileExtension (DEP_EXT );
1328
1333
} else if (calcType == IManagedDependencyGeneratorType .TYPE_BUILD_COMMANDS
1329
1334
|| calcType == IManagedDependencyGeneratorType .TYPE_PREBUILD_COMMANDS ) {
@@ -1497,8 +1502,8 @@ protected void updateMonitor(String msg) {
1497
1502
/**
1498
1503
* Return the configuration's top build directory as an absolute path
1499
1504
*/
1500
- public IPath getTopBuildDir () {
1501
- return getPathForResource ( project ). append ( getBuildWorkingDir ()) ;
1505
+ public IFile getTopBuildDir () {
1506
+ return topBuildDir ;
1502
1507
}
1503
1508
1504
1509
@ Override
@@ -1551,7 +1556,7 @@ public void initialize(int buildKind, IConfiguration cfg, IBuilder builder, IPro
1551
1556
this .builder = builder ;
1552
1557
initToolInfos ();
1553
1558
// set the top build dir path
1554
- topBuildDir = project .getFolder (cfg .getName ()). getFullPath ( );
1559
+ topBuildDir = project .getFile (cfg .getName ());
1555
1560
srcEntries = config .getSourceEntries ();
1556
1561
if (srcEntries .length == 0 ) {
1557
1562
srcEntries = new ICSourceEntry [] {
0 commit comments