Skip to content

Include detection caching #175

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 21 commits into from
Aug 26, 2016
Merged
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
33a565a
Remove error return value from resolveLibraries
matthijskooijman May 6, 2016
3ff8ebb
Let IncludesFinderWithRegExp return at most 1 include
matthijskooijman Jul 21, 2016
e6bb6fd
Let the IncludesFinder tests also check ctx.IncludeJustFound
matthijskooijman Jul 21, 2016
6b29889
Do not rebuild the include folder list repeatedely
matthijskooijman May 6, 2016
c788448
Simplify IncludesToIncludeFolders
matthijskooijman Jul 21, 2016
85de69a
Remove unneeded code from ContainerFindIncludes
matthijskooijman Aug 1, 2016
3a08c41
Call findIncludesUntilDone from only one place
matthijskooijman Aug 1, 2016
0298939
Remove Context.FoldersWithSourceFiles
matthijskooijman Aug 1, 2016
adc8cf9
Remove done variable from findIncludesUntilDone
matthijskooijman Aug 1, 2016
de46825
Remove IncludesToIncludeFolders.Run
matthijskooijman Aug 1, 2016
f1b0834
Move QueueSourceFilesFromFolder into container_find_includes.go
matthijskooijman Aug 2, 2016
c4cd959
Rename includes_to_include_folders.go to resolve_library.go
matthijskooijman Aug 2, 2016
c062430
Add SourceFile struct
matthijskooijman Aug 2, 2016
87f3397
Add UniqueSourceFileQueue
matthijskooijman Aug 2, 2016
0c64d15
Add appendIncludeFolder helper function
matthijskooijman Aug 2, 2016
c1c9b1b
Store SourceFiles in Context.CollectedSourceFiles
matthijskooijman Aug 2, 2016
8b70ca7
Document the include detection process
matthijskooijman Aug 2, 2016
874b3b6
Cache the results of include detection
matthijskooijman Aug 2, 2016
b7d8f28
Show errors during include detection properly
matthijskooijman Aug 3, 2016
7dd4e1c
Add Library.UtilityFolder
matthijskooijman Aug 3, 2016
6f5e242
Put utility folders in the include path during include detection
matthijskooijman Aug 3, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add appendIncludeFolder helper function
This helper does not do much, but it will be expanded in a later commit.

Signed-off-by: Matthijs Kooijman <matthijs@stdin.nl>
  • Loading branch information
matthijskooijman committed Aug 2, 2016
commit 0c64d158c7ff9b20aeff0691fab281d19ad78a07
11 changes: 8 additions & 3 deletions src/arduino.cc/builder/container_find_includes.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ import (
type ContainerFindIncludes struct{}

func (s *ContainerFindIncludes) Run(ctx *types.Context) error {
ctx.IncludeFolders = append(ctx.IncludeFolders, ctx.BuildProperties[constants.BUILD_PROPERTIES_BUILD_CORE_PATH])
appendIncludeFolder(ctx, ctx.BuildProperties[constants.BUILD_PROPERTIES_BUILD_CORE_PATH])
if ctx.BuildProperties[constants.BUILD_PROPERTIES_BUILD_VARIANT_PATH] != constants.EMPTY_STRING {
ctx.IncludeFolders = append(ctx.IncludeFolders, ctx.BuildProperties[constants.BUILD_PROPERTIES_BUILD_VARIANT_PATH])
appendIncludeFolder(ctx, ctx.BuildProperties[constants.BUILD_PROPERTIES_BUILD_VARIANT_PATH])
}

sketchBuildPath := ctx.SketchBuildPath
Expand Down Expand Up @@ -73,6 +73,11 @@ func (s *ContainerFindIncludes) Run(ctx *types.Context) error {
return nil
}

// Append the given folder to the include path.
func appendIncludeFolder(ctx *types.Context, folder string) {
ctx.IncludeFolders = append(ctx.IncludeFolders, folder)
}

func runCommand(ctx *types.Context, command types.Command) error {
PrintRingNameIfDebug(ctx, command)
err := command.Run(ctx)
Expand Down Expand Up @@ -111,7 +116,7 @@ func findIncludesUntilDone(ctx *types.Context, sourceFilePath string) error {
// include path and queue its source files for further
// include scanning
ctx.ImportedLibraries = append(ctx.ImportedLibraries, library)
ctx.IncludeFolders = append(ctx.IncludeFolders, library.SrcFolder)
appendIncludeFolder(ctx, library.SrcFolder)
sourceFolders := types.LibraryToSourceFolder(library)
for _, sourceFolder := range sourceFolders {
queueSourceFilesFromFolder(ctx.CollectedSourceFiles, sourceFolder.Folder, sourceFolder.Recurse)
Expand Down