Skip to content

Commit 99d3114

Browse files
committed
Move built-in examples to dedicated repository
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.
1 parent 5e30bec commit 99d3114

File tree

238 files changed

+34
-6692
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

238 files changed

+34
-6692
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ build/linux/*.tar.bz2
4848
build/linux/*.zip
4949
build/linux/libastylej*
5050
build/linux/liblistSerials*
51+
build/shared/arduino-examples*
5152
build/shared/reference*.zip
5253
build/shared/Edison*.zip
5354
build/shared/Galileo*.zip

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Thanks for your interest in contributing to this free open source project! Ardui
2222
| [Language Reference](https://www.arduino.cc/reference) | [Reference repositories](https://github.com/arduino?q=reference-) |
2323
| Arduino Forum | [arduino/forum-issues](https://github.com/arduino/forum-issues/issues) |
2424
| Arduino libraries | [arduino-libraries](https://github.com/arduino-libraries) |
25+
| Built-in examples | [arduino/arduino-examples](https://github.com/arduino/arduino-examples/issues) |
2526
| arduino-builder | [arduino/arduino-builder](https://github.com/arduino/arduino-builder/issues) |
2627
| [Arduino Web Editor](https://create.arduino.cc/editor) | [**Create > Editor** section of the Arduino Forum](http://forum.arduino.cc/index.php?board=101.0) |
2728
| Arduino AVR Boards (Uno, Mega, Leonardo, etc.) | [arduino/ArduinoCore-avr](https://github.com/arduino/ArduinoCore-avr/issues) |
@@ -60,7 +61,6 @@ Pull requests are an easy and effective way to submit a proposal for a change to
6061
- 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.
6162
- Code formatting should be consistent with the style used in the existing code.
6263
- Don't leave commented out code. A record of this code is already preserved in the commit history.
63-
- 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.
6464
- 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.
6565
- 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.
6666
- Commit messages:

app/test/processing/app/CommandLineTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public Process runArduino(boolean output, boolean success, File wd, String[] ext
105105

106106
@Test
107107
public void testCommandLineBuildWithRelativePath() throws Exception {
108-
File wd = new File(buildPath, "build/shared/examples/01.Basics/Blink/");
108+
File wd = new File(buildPath, "app/testdata/sketches/Blink/");
109109
runArduino(true, true, wd, new String[] {
110110
"--board", "arduino:avr:uno",
111111
"--verify", "Blink.ino",

build/arduino-examples-1.9.0.zip.sha

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
22e2a43d7a4eea5f99998a397b0094f505806642

build/build.xml

+24-4
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@
105105
<property name="AVRDUDE-VERSION" value="6.3.0-arduino17" />
106106
<property name="AVRCORE-VERSION" value="1.8.3" />
107107
<property name="arduinoOTA-VERSION" value="1.3.0" />
108+
<!-- https://github.com/arduino/built-in-examples -->
109+
<property name="BUILT-IN-EXAMPLES-VERSION" value="1.9.0" />
108110

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

210212
<antcall target="assemble-hardware" />
211213

212-
<!-- copy shared examples folder -->
213-
<copy todir="${target.path}/examples">
214-
<fileset dir="shared/examples" />
215-
</copy>
214+
<antcall target="assemble-examples" />
216215

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

@@ -232,6 +231,27 @@
232231
</antcall>
233232
</target>
234233

234+
<target name="assemble-examples">
235+
<!-- Add the built-in example sketches -->
236+
<property name="BUILT-IN-EXAMPLES-REPOSITORY-OWNER" value="arduino" />
237+
<property name="BUILT-IN-EXAMPLES-REPOSITORY-NAME" value="arduino-examples" />
238+
<property name="BUILT-IN-EXAMPLES-STAGING-PATH" value="shared" />
239+
<property name="BUILT-IN-EXAMPLES-FINAL-PATH" value="${target.path}/examples" />
240+
241+
<!-- Download built-in examples from repository -->
242+
<antcall target="unzip">
243+
<param name="archive_file" value="${BUILT-IN-EXAMPLES-REPOSITORY-NAME}-${BUILT-IN-EXAMPLES-VERSION}.zip" />
244+
<param name="archive_url" value="https://github.com/${BUILT-IN-EXAMPLES-REPOSITORY-OWNER}/${BUILT-IN-EXAMPLES-REPOSITORY-NAME}/archive/${BUILT-IN-EXAMPLES-VERSION}.zip" />
245+
<param name="final_folder" value="${BUILT-IN-EXAMPLES-FINAL-PATH}" />
246+
<param name="dest_folder" value="${BUILT-IN-EXAMPLES-STAGING-PATH}" />
247+
</antcall>
248+
249+
<!-- Copy examples from subfolder of the downloaded repository -->
250+
<copy todir="${BUILT-IN-EXAMPLES-FINAL-PATH}">
251+
<fileset dir="${BUILT-IN-EXAMPLES-STAGING-PATH}/${BUILT-IN-EXAMPLES-REPOSITORY-NAME}-${BUILT-IN-EXAMPLES-VERSION}/examples" />
252+
</copy>
253+
</target>
254+
235255
<target name="assemble-docs" unless="no_docs">
236256
<!-- Unzip documentation -->
237257
<antcall target="unzip">

build/shared/examples/01.Basics/AnalogReadSerial/AnalogReadSerial.ino

-26
This file was deleted.

build/shared/examples/01.Basics/AnalogReadSerial/AnalogReadSerial.txt

-1
This file was deleted.
Binary file not shown.
Binary file not shown.

build/shared/examples/01.Basics/BareMinimum/BareMinimum.ino

-9
This file was deleted.

build/shared/examples/01.Basics/BareMinimum/BareMinimum.txt

-1
This file was deleted.

build/shared/examples/01.Basics/Blink/Blink.txt

-1
This file was deleted.

build/shared/examples/01.Basics/DigitalReadSerial/DigitalReadSerial.ino

-29
This file was deleted.

build/shared/examples/01.Basics/DigitalReadSerial/DigitalReadSerial.txt

-1
This file was deleted.
Binary file not shown.
Binary file not shown.

build/shared/examples/01.Basics/Fade/Fade.ino

-40
This file was deleted.

build/shared/examples/01.Basics/Fade/Fade.txt

-1
This file was deleted.
Binary file not shown.
Binary file not shown.

build/shared/examples/01.Basics/ReadAnalogVoltage/ReadAnalogVoltage.ino

-27
This file was deleted.

build/shared/examples/01.Basics/ReadAnalogVoltage/ReadAnalogVoltage.txt

-1
This file was deleted.
Binary file not shown.
Binary file not shown.

build/shared/examples/02.Digital/BlinkWithoutDelay/BlinkWithoutDelay.ino

-71
This file was deleted.

build/shared/examples/02.Digital/BlinkWithoutDelay/BlinkWithoutDelay.txt

-1
This file was deleted.
Binary file not shown.
Binary file not shown.

build/shared/examples/02.Digital/Button/Button.ino

-51
This file was deleted.

build/shared/examples/02.Digital/Button/Button.txt

-1
This file was deleted.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)