Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on May 4, 2019. It is now read-only.

Version 2.0.0 Release #33

Merged
merged 62 commits into from
Dec 14, 2017
Merged

Version 2.0.0 Release #33

merged 62 commits into from
Dec 14, 2017

Conversation

MrPointer
Copy link
Member

Ah, such a great moment for this project!
It is finally time to integrate all our work into master, after finishing the release :)

@JonasProgrammer @fraillt I've added a Change-Log file, would like you to review it and suggest anything else to write there before completing the PR.

Thank you all for participating in our great adventure!

First run also occurs when resetting cache and reloading CMake.
Solution was to add a check for the existence of a dedicated variable, and set it immediately afterwards so the next check will always fail.
The script has been extracted into separate files under the 'Initialization' directory, with the main file named 'Initializer'.
The original 'Arduino.cmake' file now includes the 'Initializer.cmake' file using CMake's 'include' command, making the script run as if no changes have been made at all.
…ndard.

'VAR_NAME' has been renamed to 'OUTPUT_VAR_NAME'.
Instead of calling functions located in dedicated files, those files became script parts themselves, allowing to simply include them in the script using CMake's 'include' command.
Also extracted the 'register_hardware_platform' function to a script named 'RegisterHardwarePlatform.cmake', which sets the platform path explicitly, causing less modular code yet simpler in that there's no other use of this function through the entire project.
Further extracted the script to separate files, leading to a super-small initialization script - just as a clean, modular system should be.
It made the '${CMAKE_CURRENT_LIST_DIR}' prefix unnecessary in various 'include' commands. Note that their '.cmake' suffixes has also been removed.
Until now the function wrote an entire CMake script as a hardcoded string to a cached file, in order to calculate a target's firmware size.
This commit changes it by extracting the hardcoded string into a valid, readable and easily editable CMake script, named 'CalculateFirmwareSize.cmake', located under the 'Extras' directory.
Added another initializing script to completely replace the need for the function, including a script part instead, named 'SetupFirmwareSizeScript.cmake'.
…functions.

It sticks with the script-driven approach, providing consistency.
Moved the 'find_file' command used to find SDK's version file to the 'DetectVersion' script. This results in an 'Initializer' script that only includes other script parts.
This is the last part that still was in the 'Arduino' script, now extracted to a script named 'LoadArduinoPlatformSettings' under the 'Initialization' directory.
The script is named 'SetupExampleCategories', located under the 'Initialization' directory.
Also renamed the cached variable 'ARDUINO_EXAMPLES_CATEGORIES' to 'ARDUINO_EXAMPLE_CATEGORIES'.
… parts.

They are still functions, not actual script parts as the initialization system is, yet each has its own file - Following SRP's design principle.
… 'Extras' directory.

All 'Print' functions are located in the 'Printer' script, while the 'Debug' functions are located in the 'DebugOptions' script.
Updated project's authors and home page on GitHub.
All scripts are located under the 'Core/Libraries' directory, named as factories since they serve as a kind of factory methods. Renamed the functions to 'make_xxx' as a result.
…directory.

Renamed all of the functions to 'create_xxx' since it's a better suited name, except for the 'Arguments' classes, which were renamed to 'build_xxx' since they are similar to a builder (Will be refactored to a one in the future).
Sketch setup is located under the 'Sketch' directory, along with 'ArduinoSketchToCppConverter' which has been moved as well.
Example setup is located under the 'Examples' directory.
Renamed all functions to 'make_xxx' since they are kind of factories.
Removed 'find_prototypes' function since it SEEMS it's no longer needed.
Will return if I'm wrong...
…driven

Refactoring: Prefer script-driven approach over function-driven approach
The script, named 'Macros', is located under the 'Extras' directory and currently contains all existing macros.
Also extracted the 'load_generator_settings' function to a script file named 'GeneratorSettingLoader', also located under the 'Extras' directory.
Bug was in generated makefiles - They had misplaced colons (:).
Solution was to retain the previous state (before refactoring) where the hardcoded string setting the compiler flags was a single line. During the refactor process it has been line-broken for convenience.
First bug has yet again been at 'CompilerFlagsSetter', as the 'set_compiler_flags' function didn't accept a 'defined_version' as a parameter - crucial to a successful build. Solution was to get it from the 'is_sdk_version_valid' function, since it's defined there.
Second bug has been in the definition of 'Recurse' libraries. During the refactoring process all 'library_RECURSE' definitions have been moved to the 'SetDefaults' script, but since they're not set as cache variables, they are redefined on each CMake reload, causing their value to become undefined.
Current solution was to just move them back to the main 'Arduino' script.
This is done by checking whether a variable is defined at the beginning, setting it to 'True' at the end.
This may have improved CMake's reset time by a few hundred milliseconds!
Scripts are located under the 'Generation directory'.
It seems to solve some issues arising in Unix-git systems.
…ements.

There seems to be lack of support for late-including of this module on lower versions of CMake, such as the one used in this project.
MrPointer and others added 16 commits December 1, 2017 00:46
…c versions.

The '_get_normalized_sdk_version' function of the `FlagsSetter` has been improved to return different results, depending on the current SDK version, as the '-DARDUINO' flag intended to use it has different accepted formats over the versions.
Also renamed '_get_board_property_if_exists' function to '_try_get_board_property' as a convention.
Integrated various fixes and improvements to comply with refactored version
It now thoroughly describes how bug-fixes should be addressed, how new features should be added and what is the release strategy of the project.
…tandard

Feature/16 define a style standard
Adding Arduino 1.8.5 SDK path ("Arduino.app/Contents/Java")
Updated documentation to comply with the new script-driven approach towards registering custom hardware platforms.
fraillt
fraillt previously approved these changes Dec 12, 2017
@fraillt
Copy link

fraillt commented Dec 12, 2017

What a great news!
I'm glad that I could participate in this adventure :)

Regarding CHANGELOG I think it's ok for this release, it was too many changes and too long time passed to recall all the bits that has been changed :)

Copy link

@JonasProgrammer JonasProgrammer left a comment

Choose a reason for hiding this comment

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

LGTM

Can't say anything other than a huge 'thank you' for this incredible large revamp again.

I won't merge it, the honour of clicking this button shall be thine @MrPointer.

Summarized most of the changes from version 1.0.0 to version 2.0.0.
@MrPointer
Copy link
Member Author

Fuck. I just wanted to update the release date to match the actual date (Has been Dec 11th, today is Dec 13th) so I changed the CHANGELOG file and force-pushed. If anyone had told me earlier that it will dismiss the reviews...
@fraillt @JonasProgrammer Please approve the PR again so I could merge it, sorry :(

Copy link

@JonasProgrammer JonasProgrammer left a comment

Choose a reason for hiding this comment

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

+50 date correctness

LEBTM ;)

@MrPointer MrPointer merged commit 9937311 into master Dec 14, 2017
@MrPointer MrPointer deleted the release/2.0.0 branch December 14, 2017 10:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants