Skip to content

Commit f3e53cf

Browse files
authored
Merge pull request #16 from atomvm/examples-cleanup
Examples cleanup
2 parents aa3b77a + 44c3fcb commit f3e53cf

Some content is hidden

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

41 files changed

+802
-53
lines changed

.github/workflows/build-examples.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,4 @@ jobs:
3838
3939
- name: "Build Erlang Example Programs"
4040
run: |
41-
REBAR="/tmp/rebar3/rebar3"
42-
EXAMPLES="arepl_example blinky esp_nvs deep_sleep gpio_interrupt i2c_example hello_world ledc_example read_priv spi_example system_info tcp_client tcp_server uart_example udp_client udp_server wifi"
43-
for i in ${EXAMPLES}; do cd ./erlang/$i; ${REBAR} fmt -c || exit 1; ${REBAR} packbeam -p -f -i || exit 1; cd ../..; done
41+
PATH=/tmp/rebar3:$PATH ./build.sh

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
**/_build/**
22
**/deps/**
33
**/mix.lock
4+
**/rebar3.crashdump

build.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/sh
2+
#
3+
# This file is part of AtomVM.
4+
#
5+
# Copyright 2023 Fred Dushin <[email protected]>
6+
#
7+
# Licensed under the Apache License, Version 2.0 (the "License");
8+
# you may not use this file except in compliance with the License.
9+
# You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS,
15+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
# See the License for the specific language governing permissions and
17+
# limitations under the License.
18+
#
19+
# SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
20+
#
21+
22+
REBAR="rebar3"
23+
cd erlang
24+
ERLANG_EXAMPLES="$(/bin/ls | grep -v README.md)"
25+
for i in ${ERLANG_EXAMPLES}; do
26+
cd $i
27+
rm -rf _build
28+
${REBAR} atomvm packbeam -l || exit 1
29+
${REBAR} as check fmt -c || exit 1
30+
cd ..
31+
done

erlang/arepl_example/rebar.config

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,32 @@
1+
%
2+
% This file is part of AtomVM.
3+
%
4+
% Copyright 2023 Fred Dushin <[email protected]>
5+
%
6+
% Licensed under the Apache License, Version 2.0 (the "License");
7+
% you may not use this file except in compliance with the License.
8+
% You may obtain a copy of the License at
9+
%
10+
% http://www.apache.org/licenses/LICENSE-2.0
11+
%
12+
% Unless required by applicable law or agreed to in writing, software
13+
% distributed under the License is distributed on an "AS IS" BASIS,
14+
% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
% See the License for the specific language governing permissions and
16+
% limitations under the License.
17+
%
18+
% SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
19+
%
120
{erl_opts, [debug_info]}.
221
{deps, []}.
322
{plugins, [
4-
atomvm_rebar3_plugin, erlfmt
23+
atomvm_rebar3_plugin
524
]}.
625
{atomvm_rebar3_plugin, [
726
{packbeam, [prune]}
827
]}.
28+
{profiles, [
29+
{check, [
30+
{plugins, [erlfmt]}
31+
]}
32+
]}.

erlang/arepl_example/src/arepl_example.app.src

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
%
2+
% This file is part of AtomVM.
3+
%
4+
% Copyright 2023 Fred Dushin <[email protected]>
5+
%
6+
% Licensed under the Apache License, Version 2.0 (the "License");
7+
% you may not use this file except in compliance with the License.
8+
% You may obtain a copy of the License at
9+
%
10+
% http://www.apache.org/licenses/LICENSE-2.0
11+
%
12+
% Unless required by applicable law or agreed to in writing, software
13+
% distributed under the License is distributed on an "AS IS" BASIS,
14+
% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
% See the License for the specific language governing permissions and
16+
% limitations under the License.
17+
%
18+
% SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
19+
%
120
{application, arepl_example, [
221
{description, "An AtomVM application"},
322
{vsn, "0.1.0"},
@@ -7,6 +26,6 @@
726
]},
827
{env, []},
928
{modules, []},
10-
{licenses, ["Apache 2.0"]},
29+
{licenses, ["Apache-2.0"]},
1130
{links, []}
1231
]}.

erlang/blinky/rebar.config

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,32 @@
1+
%
2+
% This file is part of AtomVM.
3+
%
4+
% Copyright 2023 Fred Dushin <[email protected]>
5+
%
6+
% Licensed under the Apache License, Version 2.0 (the "License");
7+
% you may not use this file except in compliance with the License.
8+
% You may obtain a copy of the License at
9+
%
10+
% http://www.apache.org/licenses/LICENSE-2.0
11+
%
12+
% Unless required by applicable law or agreed to in writing, software
13+
% distributed under the License is distributed on an "AS IS" BASIS,
14+
% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
% See the License for the specific language governing permissions and
16+
% limitations under the License.
17+
%
18+
% SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
19+
%
120
{erl_opts, [debug_info]}.
221
{deps, []}.
322
{plugins, [
4-
atomvm_rebar3_plugin, erlfmt
23+
atomvm_rebar3_plugin
524
]}.
625
{atomvm_rebar3_plugin, [
726
{packbeam, [prune]}
827
]}.
28+
{profiles, [
29+
{check, [
30+
{plugins, [erlfmt]}
31+
]}
32+
]}.

erlang/blinky/src/blinky.app.src

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
%
2+
% This file is part of AtomVM.
3+
%
4+
% Copyright 2023 Fred Dushin <[email protected]>
5+
%
6+
% Licensed under the Apache License, Version 2.0 (the "License");
7+
% you may not use this file except in compliance with the License.
8+
% You may obtain a copy of the License at
9+
%
10+
% http://www.apache.org/licenses/LICENSE-2.0
11+
%
12+
% Unless required by applicable law or agreed to in writing, software
13+
% distributed under the License is distributed on an "AS IS" BASIS,
14+
% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
% See the License for the specific language governing permissions and
16+
% limitations under the License.
17+
%
18+
% SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
19+
%
120
{application, blinky, [
221
{description, "An AtomVM application"},
322
{vsn, "0.1.0"},
@@ -7,6 +26,6 @@
726
]},
827
{env, []},
928
{modules, []},
10-
{licenses, ["Apache 2.0"]},
29+
{licenses, ["Apache-2.0"]},
1130
{links, []}
1231
]}.

erlang/deep_sleep/rebar.config

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,32 @@
1+
%
2+
% This file is part of AtomVM.
3+
%
4+
% Copyright 2023 Fred Dushin <[email protected]>
5+
%
6+
% Licensed under the Apache License, Version 2.0 (the "License");
7+
% you may not use this file except in compliance with the License.
8+
% You may obtain a copy of the License at
9+
%
10+
% http://www.apache.org/licenses/LICENSE-2.0
11+
%
12+
% Unless required by applicable law or agreed to in writing, software
13+
% distributed under the License is distributed on an "AS IS" BASIS,
14+
% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
% See the License for the specific language governing permissions and
16+
% limitations under the License.
17+
%
18+
% SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
19+
%
120
{erl_opts, [debug_info]}.
221
{deps, []}.
322
{plugins, [
4-
atomvm_rebar3_plugin, erlfmt
23+
atomvm_rebar3_plugin
524
]}.
625
{atomvm_rebar3_plugin, [
726
{packbeam, [prune]}
827
]}.
28+
{profiles, [
29+
{check, [
30+
{plugins, [erlfmt]}
31+
]}
32+
]}.

erlang/deep_sleep/src/deep_sleep.app.src

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
%
2+
% This file is part of AtomVM.
3+
%
4+
% Copyright 2023 Fred Dushin <[email protected]>
5+
%
6+
% Licensed under the Apache License, Version 2.0 (the "License");
7+
% you may not use this file except in compliance with the License.
8+
% You may obtain a copy of the License at
9+
%
10+
% http://www.apache.org/licenses/LICENSE-2.0
11+
%
12+
% Unless required by applicable law or agreed to in writing, software
13+
% distributed under the License is distributed on an "AS IS" BASIS,
14+
% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
% See the License for the specific language governing permissions and
16+
% limitations under the License.
17+
%
18+
% SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
19+
%
120
{application, deep_sleep, [
221
{description, "An AtomVM application"},
322
{vsn, "0.1.0"},
@@ -7,6 +26,6 @@
726
]},
827
{env, []},
928
{modules, []},
10-
{licenses, ["Apache 2.0"]},
29+
{licenses, ["Apache-2.0"]},
1130
{links, []}
1231
]}.

erlang/esp_nvs/rebar.config

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,32 @@
1+
%
2+
% This file is part of AtomVM.
3+
%
4+
% Copyright 2023 Fred Dushin <[email protected]>
5+
%
6+
% Licensed under the Apache License, Version 2.0 (the "License");
7+
% you may not use this file except in compliance with the License.
8+
% You may obtain a copy of the License at
9+
%
10+
% http://www.apache.org/licenses/LICENSE-2.0
11+
%
12+
% Unless required by applicable law or agreed to in writing, software
13+
% distributed under the License is distributed on an "AS IS" BASIS,
14+
% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
% See the License for the specific language governing permissions and
16+
% limitations under the License.
17+
%
18+
% SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
19+
%
120
{erl_opts, [debug_info]}.
221
{deps, []}.
322
{plugins, [
4-
atomvm_rebar3_plugin, erlfmt
23+
atomvm_rebar3_plugin
524
]}.
625
{atomvm_rebar3_plugin, [
726
{packbeam, [prune]}
827
]}.
28+
{profiles, [
29+
{check, [
30+
{plugins, [erlfmt]}
31+
]}
32+
]}.

0 commit comments

Comments
 (0)