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
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 1 addition & 2 deletions src/arduino.cc/builder/add_additional_entries_to_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ func (s *AddAdditionalEntriesToContext) Run(ctx *types.Context) error {
ctx.WarningsLevel = DEFAULT_WARNINGS_LEVEL
}

ctx.CollectedSourceFiles = &types.UniqueStringQueue{}
ctx.FoldersWithSourceFiles = &types.UniqueSourceFolderQueue{}
ctx.CollectedSourceFiles = &types.UniqueSourceFileQueue{}

ctx.LibrariesResolutionResults = make(map[string]types.LibraryResolutionResult)
ctx.HardwareRewriteResults = make(map[*types.Platform][]types.PlatforKeyRewrite)
Expand Down

This file was deleted.

2 changes: 2 additions & 0 deletions src/arduino.cc/builder/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ const FILE_PLATFORM_KEYS_REWRITE_TXT = "platform.keys.rewrite.txt"
const FILE_PLATFORM_LOCAL_TXT = "platform.local.txt"
const FILE_PLATFORM_TXT = "platform.txt"
const FILE_PROGRAMMERS_TXT = "programmers.txt"
const FILE_INCLUDES_CACHE = "includes.cache"
const FOLDER_BOOTLOADERS = "bootloaders"
const FOLDER_CORE = "core"
const FOLDER_CORES = "cores"
Expand Down Expand Up @@ -180,6 +181,7 @@ const MSG_USING_LIBRARY = "Using library {0} in folder: {1} {2}"
const MSG_USING_BOARD = "Using board '{0}' from platform in folder: {1}"
const MSG_USING_CORE = "Using core '{0}' from platform in folder: {1}"
const MSG_USING_PREVIOUS_COMPILED_FILE = "Using previously compiled file: {0}"
const MSG_USING_CACHED_INCLUDES = "Using cached library dependencies for file: {0}"
const MSG_WARNING_LIB_INVALID_CATEGORY = "WARNING: Category '{0}' in library {1} is not valid. Setting to '{2}'"
const MSG_WARNING_PLATFORM_MISSING_VALUE = "Warning: platform.txt from core '{0}' misses property '{1}', using default value '{2}'. Consider upgrading this core."
const MSG_WARNING_PLATFORM_OLD_VALUES = "Warning: platform.txt from core '{0}' contains deprecated {1}, automatically converted to {2}. Consider upgrading this core."
Expand Down
5 changes: 4 additions & 1 deletion src/arduino.cc/builder/container_add_prototypes.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
package builder

import (
"path/filepath"

"arduino.cc/builder/constants"
"arduino.cc/builder/ctags"
"arduino.cc/builder/i18n"
Expand All @@ -39,8 +41,9 @@ import (
type ContainerAddPrototypes struct{}

func (s *ContainerAddPrototypes) Run(ctx *types.Context) error {
sourceFile := filepath.Join(ctx.SketchBuildPath, filepath.Base(ctx.Sketch.MainFile.Name)+".cpp")
commands := []types.Command{
&GCCPreprocRunner{TargetFileName: constants.FILE_CTAGS_TARGET_FOR_GCC_MINUS_E},
&GCCPreprocRunner{SourceFilePath: sourceFile, TargetFileName: constants.FILE_CTAGS_TARGET_FOR_GCC_MINUS_E, Includes: ctx.IncludeFolders},
&ReadFileAndStoreInContext{Target: &ctx.SourceGccMinusE},
&FilterSketchSource{Source: &ctx.SourceGccMinusE},
&CTagsTargetFileSaver{Source: &ctx.SourceGccMinusE, TargetFileName: constants.FILE_CTAGS_TARGET_FOR_GCC_MINUS_E},
Expand Down
Loading