|
| 1 | +## Development: Testing your changes |
| 2 | + |
| 3 | +### Local install (simpler) |
| 4 | + |
| 5 | +- Close Arduino IDE. |
| 6 | +- Copy your **macchina** folder from this repository into your Arduino directory. |
| 7 | + - This can be either your _sketchbook_ directory (usually <Documents>/Arduino), or the directory of the Arduino application itself, the choice is up to you. |
| 8 | +- Launch Arduino IDE and you should find the **Macchina M2** board file installed. |
| 9 | + |
| 10 | +### Board Manager Install |
| 11 | + |
| 12 | +- Reference the steps in see `before_deploy` in [**.travis.yml**](./.travis.yml) to create an archive from your **macchina** folder and get the size and hash. |
| 13 | +- Grab a copy of [`package_macchina_index.json`](https://macchina.github.io/package_macchina_index.json) and edit one of the `packages.platforms` entries to match your created archive. |
| 14 | + - You can use either a `file://` url or [serve the files over HTTP locally](https://gist.github.com/willurd/5720255). |
| 15 | +- Add your modified `package_macchina_index.json` under Preferences and download your board with the Board Manager. |
| 16 | + |
| 17 | + |
| 18 | +## Upstream: ArduinoCore-sam |
| 19 | +This variant started as a fork of the `arduino_due_x` variant in [**ArduinoCore-sam**](https://github.com/arduino/ArduinoCore-sam). This was done in a way that preserves the ability to merge most upstream changes from the variant. |
| 20 | + |
| 21 | +### Variant folder (`m2`) |
| 22 | +Running the following command from a branch in **ArduinoCore-sam** prepares that branch so it can be merged with the contents in [**macchina/sam/variants/m2**](https://github.com/adamvoss/Macchina_Arduino_Boards/tree/master/macchina/sam/variants/m2) folder. This should probably be done with some regularity, unless the variant has diverged sufficiently so merging is no longer useful. |
| 23 | + |
| 24 | +```bash |
| 25 | +git filter-branch --prune-empty --subdirectory-filter variants/arduino_due_x/ -f |
| 26 | +``` |
| 27 | + |
| 28 | +### Platforms.txt / Boards.txt |
| 29 | +Summary: it will be best to update these files manually if upstream changes happen that would be relevant/beneficial. |
| 30 | + |
| 31 | +These files change less frequently, are shorter, and would be a greater source of merge conflicts. To increase tidyness of the repository, they were included in such a way that it would not be easy to use git to merge changes from upstream (it remains possible, but would require `git replace`). Since the files change infrequently, checking for changes from time to time and integrating them should be feasible. |
| 32 | + |
| 33 | +For completeness, here is the command to prepare an **ArduinoCore-sam** branch to match the structure needed for merging with this repository. |
| 34 | + |
| 35 | +```bash |
| 36 | +git filter-branch \ |
| 37 | + --force \ |
| 38 | + --prune-empty \ |
| 39 | + --index-filter ' |
| 40 | + git ls-tree -z -r --name-only --full-tree $GIT_COMMIT \ |
| 41 | + | grep -z -v "^boards.txt" \ |
| 42 | + | grep -z -v "^platform.txt" \ |
| 43 | + | grep -z -v "^programmers.txt" \ |
| 44 | + | xargs -0 -r git rm -q --cached -r |
| 45 | + ' |
| 46 | + |
| 47 | +# Eliminate merge commits |
| 48 | +git rebase |
| 49 | +``` |
0 commit comments