Skip to content

Archive compiled core and use on subsequent compilations #213

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 12 commits into from
Mar 20, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
Next Next commit
Added FQBN in the buildProperties
Signed-off-by: Cristian Maglie <c.maglie@arduino.cc>
  • Loading branch information
cmaglie committed Mar 1, 2017
commit b3303ce57b3e6f076ebebf2d8e27045816c2481c
6 changes: 6 additions & 0 deletions src/arduino.cc/builder/builder_utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -366,3 +366,9 @@ func ExecRecipeCollectStdErr(buildProperties properties.Map, recipe string, remo
func RemoveHyphenMDDFlagFromGCCCommandLine(buildProperties properties.Map) {
buildProperties[constants.BUILD_PROPERTIES_COMPILER_CPP_FLAGS] = strings.Replace(buildProperties[constants.BUILD_PROPERTIES_COMPILER_CPP_FLAGS], "-MMD", "", -1)
}

func GetCoreArchivePath(fqbn string) string {
fqbnToUnderscore := strings.Replace(fqbn, ":", "_", -1)
fqbnToUnderscore = strings.Replace(fqbnToUnderscore, "=", "_", -1)
return os.TempDir() + "/core_" + fqbnToUnderscore + ".a"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it a good idea to put these files directly in the tempdir? Also, shouldn't these files be cleaned up at some point (e.g. when the IDE exits)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is only a temporary way to store them 😄 A proper db (or folder structure) is surely the way to go

}
1 change: 1 addition & 0 deletions src/arduino.cc/builder/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ const BUILD_PROPERTIES_EXTRA_TIME_DST = "extra.time.dst"
const BUILD_PROPERTIES_EXTRA_TIME_LOCAL = "extra.time.local"
const BUILD_PROPERTIES_EXTRA_TIME_UTC = "extra.time.utc"
const BUILD_PROPERTIES_EXTRA_TIME_ZONE = "extra.time.zone"
const BUILD_PROPERTIES_FQBN = "build.fqbn"
const BUILD_PROPERTIES_INCLUDES = "includes"
const BUILD_PROPERTIES_OBJECT_FILE = "object_file"
const BUILD_PROPERTIES_OBJECT_FILES = "object_files"
Expand Down
1 change: 1 addition & 0 deletions src/arduino.cc/builder/setup_build_properties.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ func (s *SetupBuildProperties) Run(ctx *types.Context) error {
buildProperties[constants.BUILD_PROPERTIES_RUNTIME_PLATFORM_PATH] = targetPlatform.Folder
buildProperties[constants.BUILD_PROPERTIES_RUNTIME_HARDWARE_PATH] = filepath.Join(targetPlatform.Folder, "..")
buildProperties[constants.BUILD_PROPERTIES_RUNTIME_IDE_VERSION] = ctx.ArduinoAPIVersion
buildProperties[constants.BUILD_PROPERTIES_FQBN] = ctx.FQBN
buildProperties[constants.IDE_VERSION] = ctx.ArduinoAPIVersion
buildProperties[constants.BUILD_PROPERTIES_RUNTIME_OS] = utils.PrettyOSName()

Expand Down