Skip to content
This repository was archived by the owner on Apr 17, 2023. It is now read-only.

Commit 7e70e6d

Browse files
committed
Added some files from Arduino CMake 2 for easy setup
1 parent 23f27a1 commit 7e70e6d

File tree

10 files changed

+495
-20
lines changed

10 files changed

+495
-20
lines changed

.editorconfig

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
6+
end_of_line = lf
7+
insert_final_newline = true
8+
9+
indent_style = space
10+
indent_size = 4
11+
# Editor support is limited. Make your you align multiline statements accordingly, should your editor not honour this attribute
12+
continuation_indent_size = 8
13+
14+
trim_trailing_whitespace = true
15+
16+
[*.{md,rst}]
17+
trim_trailing_whitespace = false

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text eol=lf

.gitignore

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
### CMake template
2+
CMakeCache.txt
3+
CMakeFiles
4+
CMakeScripts
5+
Testing
6+
Makefile
7+
cmake_install.cmake
8+
install_manifest.txt
9+
compile_commands.json
10+
CTestTestfile.cmake
11+
12+
### C++ template
13+
# Prerequisites
14+
*.d
15+
16+
# Compiled Object files
17+
*.slo
18+
*.lo
19+
*.o
20+
*.obj
21+
22+
# Precompiled Headers
23+
*.gch
24+
*.pch
25+
26+
# Compiled Dynamic libraries
27+
*.so
28+
*.dylib
29+
*.dll
30+
31+
# Fortran module files
32+
*.mod
33+
*.smod
34+
35+
# Compiled Static libraries
36+
*.lai
37+
*.la
38+
*.a
39+
*.lib
40+
41+
# Executables
42+
*.exe
43+
*.out
44+
*.app
45+
46+
### C template
47+
# Prerequisites
48+
49+
# Object files
50+
*.ko
51+
*.elf
52+
53+
# Linker output
54+
*.ilk
55+
*.map
56+
*.exp
57+
58+
# Precompiled Headers
59+
60+
# Libraries
61+
62+
# Shared objects (inc. Windows DLLs)
63+
*.so.*
64+
65+
# Executables
66+
*.i*86
67+
*.x86_64
68+
*.hex
69+
70+
# Debug files
71+
*.dSYM/
72+
*.su
73+
*.idb
74+
*.pdb
75+
76+
# Kernel Module Compile Results
77+
*.mod*
78+
*.cmd
79+
.tmp_versions/
80+
modules.order
81+
Module.symvers
82+
Mkfile.old
83+
dkms.conf
84+
85+
### JetBrains (modified)
86+
.idea/*
87+
!.idea/codeStyleSettings.xml
88+
!.idea/codeStyles/
89+
90+
# CMake
91+
cmake-build-debug/
92+
93+
# Mongo Explorer plugin:
94+
.idea/**/mongoSettings.xml
95+
96+
## File-based project format:
97+
*.iws
98+
99+
## Plugin-specific files:
100+
101+
# IntelliJ
102+
out/
103+
104+
# mpeltonen/sbt-idea plugin
105+
.idea_modules/
106+
107+
# JIRA plugin
108+
atlassian-ide-plugin.xml
109+
110+
# Cursive Clojure plugin
111+
.idea/replstate.xml
112+
113+
# Crashlytics plugin (for Android Studio and IntelliJ)
114+
com_crashlytics_export_strings.xml
115+
crashlytics.properties
116+
crashlytics-build.properties
117+
fabric.properties
118+
119+
### User-Defined
120+
[Aa]ssets/*

.travis.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
language: c
2+
os:
3+
- linux
4+
- osx
5+
env:
6+
matrix:
7+
- ARDUINO_SDK_VERSION=1.6.13
8+
- ARDUINO_SDK_VERSION=1.8.5
9+
addons:
10+
apt:
11+
packages:
12+
- gcc-avr
13+
- binutils-avr
14+
- avr-libc
15+
- avrdude
16+
before_install:
17+
- |
18+
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
19+
export ARDUINO_SDK_FILE="arduino-$ARDUINO_SDK_VERSION-linux32.tar.xz"
20+
else
21+
export ARDUINO_SDK_FILE="arduino-$ARDUINO_SDK_VERSION-macosx.zip"
22+
fi
23+
- wget "https://downloads.arduino.cc/$ARDUINO_SDK_FILE" -O "$ARDUINO_SDK_FILE"
24+
- mkdir arduino-sdk
25+
- |
26+
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
27+
tar xf "$ARDUINO_SDK_FILE" -C arduino-sdk --strip-components 1
28+
export ARDUINO_SDK_PATH="$(pwd)/arduino-sdk"
29+
else
30+
unzip "$ARDUINO_SDK_FILE" "Arduino.app/Contents/Java/*" -d arduino-sdk
31+
export ARDUINO_SDK_PATH="$(pwd)/arduino-sdk/Arduino.app/Contents/Java"
32+
fi
33+
install:
34+
- mkdir build
35+
- rm -rf build/*
36+
- cd build/
37+
script:
38+
- cmake -D ARDUINO_SDK_PATH="$ARDUINO_SDK_PATH" ..
39+
- make
40+
after_script:
41+
- cat CMakeFiles/CMakeOutput.log

AUTHORS.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Authors
2+
3+
This files lists all the authors of this project, which helped its growing by adding code, fixing bugs, etc.
4+
5+
- mean00 ([mean00](https://github.com/mean00))
6+
- Ariel ([aog2000a](https://github.com/aog2000a))
7+
- Konstantin Gredeskoul ([kigster](https://github.com/kigster))
8+
- Juan José Herrero Barbosa ([Souler](https://github.com/Souler))
9+
- Bei Chen Liu ([Baycken](https://github.com/Baycken))
10+
- Marc Plano-Lesay ([Kernald](https://github.com/Kernald))
11+
- James Goppert ([jgoppert](https://github.com/jgoppert))
12+
- Matt Tyler ([matt-tyler](https://github.com/matt-tyler))
13+
- Andrew Stromme ([astromme](https://github.com/astromme))
14+
- [johnyb](https://github.com/johnyb)
15+
- [arunh](https://github.com/arunh)
16+
- Sebastian Herp ([sebastianherp](https://github.com/sebastianherp))
17+
- Michael Daffin ([james147](https://github.com/james147))
18+
- Pavel Ilin ([PIlin](https://github.com/PIlin))
19+
- Igor Mikolic-Torreira ([igormiktor](https://github.com/igormiktor))
20+
- Claudio Henrique Fortes Felix ([chffelix](https://github.com/chffelix))
21+
- Alexandre Tuleu ([atuleu](https://github.com/atuleu))
22+
- [getSurreal](https://github.com/getSurreal)
23+
- Sebastian Zaffarano ([szaffarano](https://github.com/szaffarano))
24+
- [cheshirekow](https://github.com/cheshirekow)
25+
- Logan Engstrom ([meadowstream](https://github.com/meadowstream))
26+
- Francisco Ramírez ([franramirez688](https://github.com/franramirez688))
27+
- Brendan Shillingford ([bshillingford](https://github.com/bshillingford))
28+
- Mike Purvis ([mikepurvis](https://github.com/mikepurvis))
29+
- Steffen Hanikel ([hanikesn](https://github.com/hanikesn))
30+
- Mindaugas Vinkelis ([fraillt - Contributor)
31+
- noseglasses ([noseglasses - Contributor)
32+
- Tomasz Bogdal ([queezythegreat - Original author of arduino-cmake)
33+
- Jonas ([JonasProgrammer](https://github.com/JonasProgrammer) - Maintainer)
34+
- Timor Gruber ([MrPointer](https://github.com/MrPointer) - Maintainer)

CHANGELOG.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Change Log
2+
3+
# Version [2.0.1](https://github.com/arduino-cmake/arduino-cmake/compare/v2.0.0...v2.0.1) (Dec 19th 2017)
4+
5+
### Bug fixes
6+
7+
* fixed `-DARDUINO` define for Arduino SDK versions between 1.0.0 and 1.5.8. This bug caused to included `WProgram.h` instead of `Arduino.h` for aforementioned versions.
8+
9+
# Version 2.0.0 (Dec 13th 2017)
10+
11+
An epic version which integrates too many changes to be listed and recorded since the latest stable version, which was **1.0.0**. It has been released almost <u>4 years ago</u>!
12+
13+
However, here are some of the most noticeable changes in this version:
14+
15+
* Code has been completely refactored:
16+
* Previously the project has consisted from generally 2 files:
17+
1. `ArduinoToolchain.cmake`
18+
2. `Platform/Arduino.cmake`
19+
* All functions and scripts in the `Arduino.cmake` file, which took nearly 3,500 lines of code, have been separated into matching script files, located under matching directories.
20+
* A script-driven approach has been taken, allowing developers to substitute a functionality simply by referencing a different CMake script file.
21+
* Arduino SDK version 1.5 and higher is supported:
22+
* Several changes were introduced in the SDK itself causing the previous version to fail building.
23+
* Custom hardware platforms and architectures can be defined:
24+
* Though it has already existed in the previous version, this feature was in a form of a function.
25+
Now it's a script that can either be replaced or use customized parameters.
26+
* Ability to define architecture is new.
27+
* Example generation:
28+
* Users can generate firmware using one of Arduino's built-in examples, such as the classic **Blink**.
29+
* Support for example *categories* has also been added, complying with Arduino current example-nesting strategy. For example, the **Blink** example is located under the `01.Basic` directory, which is also considered as its category.

CONTRIBUTING.md

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
# Contribution #
2+
3+
Contribution means helping the project get bigger and better, by any manner.
4+
If this is what your'e truly looking for, than you've come to the right place!
5+
6+
## Short Brief ##
7+
8+
### What is this file? ###
9+
It is a set of guidence rules for developers who'd like to contribute to this repo.
10+
API changes, versions go forward but sometimes documentation is not, unfortunately.
11+
To address those issues and allow developers to contribute good, quality code - This file must exist and always be up to date.
12+
13+
### Dear Contributors ###
14+
First of all, thank you for taking your time even considering contributing to this repo.
15+
It is extremely improtant to us that you, simple users or continous collaborators,
16+
contribute to this project in a combined effort to make it greater, stable than ever before.
17+
18+
## Submitting Issues ##
19+
Requests for new features and bug reports keep the project moving forward.
20+
21+
### Before you submit an issue ###
22+
* Please make sure your'e using the latest version of Arduino CMake.
23+
Currently it's the one in the [master](https://github.com/arduino-cmake/arduino-cmake) branch,
24+
but this will be updated once a version-release standard will be applied.
25+
* Search the [issue list](https://github.com/arduino-cmake/arduino-cmake/issues?utf8=%E2%9C%93&q=is%3Aissue)
26+
(including closed ones) to make sure it hasn't already been reported.
27+
28+
### Submitting a good issue ###
29+
Issues can be submitted with a very short description, but that would make the life of the developers addressing it very hard, leading to unresolved issues due to lack of information.
30+
31+
Here is a set of rules you should apply to **every** issue you submit:
32+
33+
* Give the issue a short, clear title that describes the bug or feature request
34+
* Include your Arduino SDK version
35+
* Include your Operating System (No need to specify exact Linux version (Ubuntu, Fedora, etc.) - Linux is just enough)
36+
* Include steps to reproduce the issue
37+
* If the issue regards a special behavior, maybe related to a specific board - Please tell us all you know about it
38+
and put some links to external sources if those exist. Not all of the developers are Arduino experts, and in fact there
39+
are so many types of boards and platforms that there being an "Arduino Expert" isn't even real.
40+
* Use markdown formatting as appropriate to make the issue and code more readable.
41+
42+
## Code Contribution
43+
44+
### Code Style
45+
Like pretty much every project, ArduinoCMake uses it'ws own coding style which ensures that everybody can easily read and change files without the hassle of reading 3 different indention styles paired 4 ways of brace spacing.
46+
47+
While we believe, that the coding style you are using benefits you, please try and stick to the current style as close at possible. It is far from perfect (and we ourselves don't like every part that has grown from the project's
48+
past) but it is sufficient to be a common set of rules we can agree on.
49+
50+
For the most basic part, make sure your editor supports `.editorconfig`.
51+
It will
52+
take care of the greatest hassle like indention, new lines and linebreaks at the end of a file. As for spacing, naming conventions etc. look at the existing code to get an idea of the style. If you use an `IDEA` based IDE (for example `CLion`), chances are that the auto formatting functionality will take care of things due to the project's `codeStyleSettings.xml` residing in the repository.
53+
54+
### Versioning
55+
While in the past the project barely had a proper versioning scheme, we're now trying to incorporate [semantic versioning](http://semver.org/spec/v2.0.0.html). That benefits both developers and users, as there are clear rules about when to bump versions and which versions can be considered compatible.
56+
57+
This versioning scheme also allows easy integration with Git's classic [Workflow Model](http://nvie.com/posts/a-successful-git-branching-model), which is described next.
58+
59+
### Project Workflow
60+
61+
This project follows Git's classic [Workflow Model](http://nvie.com/posts/a-successful-git-branching-model), allowing developers to work on multiple features simultaneously without clashing. This model is a bit different than suggested by **GitHub**, intended mostly for offline Git repositories. However, both models can be easily integrated together to form a single model.
62+
63+
The parts that consist the model are thoroughly described in the following sections.
64+
65+
#### Bug Fixes
66+
Bug fixes can be found in the *stable* release or in a *developed* feature.
67+
The way we treat them is different, described in the next sections.
68+
69+
**Note:** Before claiming to find a bug, make sure you are on the latest commit of that branch.
70+
71+
##### Release Bugs/Critical Bugs
72+
73+
Those are the ones with the highest priority to fix. If you encounter such a bug you should immediately submit a new issue. Before you submit, see [Submitting Issues](#Submitting-Issues). If you'd also like to fix the bug yourself, please state that in the issue.
74+
75+
Fixes to such bugs should be made on a separate branch named `hotfix/B` where `B` is a short description of the bug being solved, separated with a hyphen (`-`) between every word.
76+
Do note that even though it should describe the bug, it's just a name, thus it shouldn't be too long.
77+
For example the name `hotfix/cmake-not-reloading-when-custom-libraries-are-set` is a bad name, because even though it fits the naming standard and describes the bug, it is way too long for a name.
78+
A better name would be `hotfix/custom-libraries-reloading`.
79+
80+
According to our [Workflow model](#Project-Workflow), once the hotfix is finished you should:
81+
82+
* Merge directly to **master**.
83+
* Add a tag to the *merge-commit* named after the patched version.
84+
e.g If the current stable version is v2.1.0, the hotfix should make it v2.1.1 (Bump the patch number).
85+
* Merge directly to **develop**.
86+
* Use the `--no-ff` flag when merging.
87+
88+
However, **GitHub**'s model support *Pull-Request*s instead of simple *merges*, at least for non-Administrator users (Though should apply for them as well). To comply with the steps listed above, 2 PRs should be made: One to the **master** branch and another to the **develop** branch.
89+
Instead, we accept a single PR to the **master** branch, and will manually merge the rest once the hotfix is finished. Converting that to a list would look like this:
90+
91+
* Pull-Request directly to **master**.
92+
* Once accepted, the merging administrator will add a tag to the *merge-commit* and bump the patch version (Further described in the previous list).
93+
* An administrator will merge to **develop** or **current release** (Note on that below).
94+
* The `--no-ff` flag will be used when merging.
95+
96+
**Note to Administrators/Collaborators:** If an active **release** branch exists when the hotfix is integrated, meaning there's a planned on-going release, the hotfix should be merged directly to the **release** branch instead of the **develop** branch, unless the hotfix fixes a truly critical bug that affects development as well.
97+
98+
##### Development Bugs
99+
100+
Those are easier to find and fix since they exist only in **feature** branches, planned for future releases and considered in development. If you encounter such a bug you can submit a new issue, however it is not necessary if you'd like to fix the bug yourself.
101+
102+
Fixes to such bugs should be made on a separate branch, preferably in a forked version, named after the bug. Once finished, you should PR it to the appropriate **feature** branch. If the **feature** branch has already been merged to **develop**, the merging administrator will take care of merging the branch to develop again.
103+
104+
#### Feature Additions
105+
To ensure your contribution makes it into the mainline codebase, always check the **develop** branch for the next targeted release. Make sure your contribution is on par with that branch and PR features back into **develop**. This strategy should be the right one for most users. If you want to make further additions to a feature currently under development, you can also PR into the corresponding **feature** branch.
106+
107+
##### Feature Branch Naming
108+
109+
**Feature** branch names should be short and descriptive, each word separated by a single hyphen (`-`).
110+
e.g A branch named `feature/blacklisting-libraries-to-avoid-automatic-inclusion-when-reloading-cmake` is a bad branch name because it's too long, even though it's very descriptive. A better name would be `feature/library-blacklist` because it's short and generally descriptive. Any further description would be written in commit messages or the final PR to the **develop** branch.
111+
112+
#### Releases
113+
114+
When a handful of features is complete, the developed product is ready for release.
115+
According to our [Workflow model](#Project-Workflow), every release should start with a branch named after the about-to-be-released version. e.g `release/2.0.0`.
116+
117+
There are some strict rules we apply to our releases:
118+
119+
* At any given moment there should be a <u>single</u> release or no release at all. We're not working Agile on this project, thus there's no need for multiple simultaneous releases.
120+
* Once existing, any hotfix should be merged to the **release** branch instead of the **develop** branch (See [Release Bugs](#Release-Bugs/Critical-Bugs)).
121+
* Any last-minute bug-fixes should be made directly on the **release** branch. They will be merged later to the **develop** branch once the release is completed.
122+
* New features developed after the release has been started are intended for the <u>next</u> release.
123+
* Before completing the release the `CHANGELOG.md` file should be updated accordingly.
124+
125+
Once the release is complete it is merged to the **master** branch and to the **develop** branch.
126+
A tag with the final release version is also added to the *merge-commit* on **master**.
127+
128+
### Pull Requests
129+
130+
As this is GitHub, we support merging by Pull-Requesting. It helps us document code better, as well as discussing and reviewing a change before it gets into the mainline codebase.
131+
So please - Make a Pull Request for every change you'd like to make, yes, even if your'e an administrator or a collaborator.
132+
133+
Also note that we do have a strict rule about the branch your'e PRing from - Once it gets merged, it will be deleted. This is done to avoid unnecessary cluttering of the project. If you need to keep the branch for some reason, please state it in **bold** in the PR's description, so that the merging user will notice it.
134+
135+
### Breaking Changes
136+
Breaking changes require the release of a new major version according to *semver* rules.
137+
So if you are going to make changes to the **public** interface that are not backwards-compatible, make sure it is **absolutely** necessary.
138+
139+
### Changelog
140+
From v2.0.0 on, we are going to take note of changes in a proper `CHANGELOG.md`.
141+
For any contribution, please add a corresponding changelog entry.
142+
Bump the patch version for bug fixes and the minor version for feature additions.
143+
Don't **ever** bump the major version on your behaf - It should be done only by the owners of the project.

0 commit comments

Comments
 (0)