Skip to content

Commit

Permalink
Move built-in examples to dedicated repository
Browse files Browse the repository at this point in the history
A dedicated repository for the examples will make it easier for them to be built in to arbitrary development tools. It will make it easier to use them for compilation testing of boards platforms. It provides a dedicated location for issue reports and pull requests that are specific to the examples. It continues the work done by moving the AVR and SAM boards platforms and built-in libraries towards making the arduino/Arduino repository solely a place to host the GUI code of the Arduino IDE.
  • Loading branch information
per1234 committed Sep 7, 2020
1 parent 5e30bec commit 99d3114
Show file tree
Hide file tree
Showing 238 changed files with 34 additions and 6,692 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ build/linux/*.tar.bz2
build/linux/*.zip
build/linux/libastylej*
build/linux/liblistSerials*
build/shared/arduino-examples*
build/shared/reference*.zip
build/shared/Edison*.zip
build/shared/Galileo*.zip
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Thanks for your interest in contributing to this free open source project! Ardui
| [Language Reference](https://www.arduino.cc/reference) | [Reference repositories](https://github.com/arduino?q=reference-) |
| Arduino Forum | [arduino/forum-issues](https://github.com/arduino/forum-issues/issues) |
| Arduino libraries | [arduino-libraries](https://github.com/arduino-libraries) |
| Built-in examples | [arduino/arduino-examples](https://github.com/arduino/arduino-examples/issues) |
| arduino-builder | [arduino/arduino-builder](https://github.com/arduino/arduino-builder/issues) |
| [Arduino Web Editor](https://create.arduino.cc/editor) | [**Create > Editor** section of the Arduino Forum](http://forum.arduino.cc/index.php?board=101.0) |
| Arduino AVR Boards (Uno, Mega, Leonardo, etc.) | [arduino/ArduinoCore-avr](https://github.com/arduino/ArduinoCore-avr/issues) |
Expand Down Expand Up @@ -60,7 +61,6 @@ Pull requests are an easy and effective way to submit a proposal for a change to
- Search [existing pull requests](https://github.com/arduino/Arduino/pulls?q=) to see if one has already been submitted for this change. Search the [issues](https://github.com/arduino/Arduino/issues?q=is%3Aissue) to see if there has been a discussion on this topic and whether your pull request can close any issues.
- Code formatting should be consistent with the style used in the existing code.
- Don't leave commented out code. A record of this code is already preserved in the commit history.
- Note that the Arduino core libraries support many boards and processors. When fixing or adding functionality for one of them, it's easy to break something on the others. Please test your changes on as many processors as possible. Even if you don't have a particular board, try compiling your patch for it to make sure that you haven't introduced any errors.
- All commits must be atomic. This means that the commit completely accomplishes a single task. Each commit should result in fully functional code. Multiple tasks should not be combined in a single commit, but a single task should not be split over multiple commits (e.g. one commit per file modified is not a good practice). For more information see http://www.freshconsulting.com/atomic-commits.
- Each pull request should address a single bug fix or enhancement. This may consist of multiple commits. If you have multiple, unrelated fixes or enhancements to contribute, submit them as separate pull requests.
- Commit messages:
Expand Down
2 changes: 1 addition & 1 deletion app/test/processing/app/CommandLineTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public Process runArduino(boolean output, boolean success, File wd, String[] ext

@Test
public void testCommandLineBuildWithRelativePath() throws Exception {
File wd = new File(buildPath, "build/shared/examples/01.Basics/Blink/");
File wd = new File(buildPath, "app/testdata/sketches/Blink/");
runArduino(true, true, wd, new String[] {
"--board", "arduino:avr:uno",
"--verify", "Blink.ino",
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions build/arduino-examples-1.9.0.zip.sha
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
22e2a43d7a4eea5f99998a397b0094f505806642
28 changes: 24 additions & 4 deletions build/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@
<property name="AVRDUDE-VERSION" value="6.3.0-arduino17" />
<property name="AVRCORE-VERSION" value="1.8.3" />
<property name="arduinoOTA-VERSION" value="1.3.0" />
<!-- https://github.com/arduino/built-in-examples -->
<property name="BUILT-IN-EXAMPLES-VERSION" value="1.9.0" />

<!-- Libraries required for running arduino -->
<fileset dir=".." id="runtime.jars">
Expand Down Expand Up @@ -209,10 +211,7 @@

<antcall target="assemble-hardware" />

<!-- copy shared examples folder -->
<copy todir="${target.path}/examples">
<fileset dir="shared/examples" />
</copy>
<antcall target="assemble-examples" />

<mkdir dir="${target.path}/reference"/>

Expand All @@ -232,6 +231,27 @@
</antcall>
</target>

<target name="assemble-examples">
<!-- Add the built-in example sketches -->
<property name="BUILT-IN-EXAMPLES-REPOSITORY-OWNER" value="arduino" />
<property name="BUILT-IN-EXAMPLES-REPOSITORY-NAME" value="arduino-examples" />
<property name="BUILT-IN-EXAMPLES-STAGING-PATH" value="shared" />
<property name="BUILT-IN-EXAMPLES-FINAL-PATH" value="${target.path}/examples" />

<!-- Download built-in examples from repository -->
<antcall target="unzip">
<param name="archive_file" value="${BUILT-IN-EXAMPLES-REPOSITORY-NAME}-${BUILT-IN-EXAMPLES-VERSION}.zip" />
<param name="archive_url" value="https://github.com/${BUILT-IN-EXAMPLES-REPOSITORY-OWNER}/${BUILT-IN-EXAMPLES-REPOSITORY-NAME}/archive/${BUILT-IN-EXAMPLES-VERSION}.zip" />
<param name="final_folder" value="${BUILT-IN-EXAMPLES-FINAL-PATH}" />
<param name="dest_folder" value="${BUILT-IN-EXAMPLES-STAGING-PATH}" />
</antcall>

<!-- Copy examples from subfolder of the downloaded repository -->
<copy todir="${BUILT-IN-EXAMPLES-FINAL-PATH}">
<fileset dir="${BUILT-IN-EXAMPLES-STAGING-PATH}/${BUILT-IN-EXAMPLES-REPOSITORY-NAME}-${BUILT-IN-EXAMPLES-VERSION}/examples" />
</copy>
</target>

<target name="assemble-docs" unless="no_docs">
<!-- Unzip documentation -->
<antcall target="unzip">
Expand Down

This file was deleted.

This file was deleted.

Binary file not shown.
Binary file not shown.
9 changes: 0 additions & 9 deletions build/shared/examples/01.Basics/BareMinimum/BareMinimum.ino

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion build/shared/examples/01.Basics/Blink/Blink.txt

This file was deleted.

This file was deleted.

This file was deleted.

Binary file not shown.
Binary file not shown.
40 changes: 0 additions & 40 deletions build/shared/examples/01.Basics/Fade/Fade.ino

This file was deleted.

1 change: 0 additions & 1 deletion build/shared/examples/01.Basics/Fade/Fade.txt

This file was deleted.

Binary file removed build/shared/examples/01.Basics/Fade/layout.png
Binary file not shown.
Binary file removed build/shared/examples/01.Basics/Fade/schematic.png
Binary file not shown.

This file was deleted.

This file was deleted.

Binary file not shown.
Binary file not shown.

This file was deleted.

This file was deleted.

Binary file not shown.
Binary file not shown.
51 changes: 0 additions & 51 deletions build/shared/examples/02.Digital/Button/Button.ino

This file was deleted.

1 change: 0 additions & 1 deletion build/shared/examples/02.Digital/Button/Button.txt

This file was deleted.

Binary file removed build/shared/examples/02.Digital/Button/layout.png
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 99d3114

Please sign in to comment.