From cea5a19b97f0f26a9884dc9f6f7ce286ffc019e5 Mon Sep 17 00:00:00 2001 From: Fred Dushin Date: Wed, 1 Nov 2023 11:58:20 -0400 Subject: [PATCH 1/3] Fixed TCP and UDP examples to print IP addresses and port numbers in a more readable way. --- erlang/tcp_client/src/tcp_client.erl | 11 ++++++----- erlang/tcp_server/src/tcp_server.erl | 8 ++++---- erlang/udp_client/src/udp_client.erl | 8 ++++---- erlang/udp_server/src/udp_server.erl | 6 +++--- 4 files changed, 17 insertions(+), 16 deletions(-) diff --git a/erlang/tcp_client/src/tcp_client.erl b/erlang/tcp_client/src/tcp_client.erl index 14413ff..97411b1 100644 --- a/erlang/tcp_client/src/tcp_client.erl +++ b/erlang/tcp_client/src/tcp_client.erl @@ -26,19 +26,20 @@ start() -> ok = maybe_start_network(atomvm:platform()), Host = maps:get(host, config:get()), Port = maps:get(port, config:get()), + io:format("Attempting to connect to host ~p on port ~p ...~n", [Host, Port]), case gen_tcp:connect(Host, Port, []) of {ok, Socket} -> - io:format("Connected to ~p from ~p~n", [peer_address(Socket), local_address(Socket)]), + io:format("Connected to ~s from ~s~n", [peer_address(Socket), local_address(Socket)]), loop(Socket); Error -> io:format("An error occurred connecting: ~p~n", [Error]) end. loop(Socket) -> - SendPacket = <<"AtomVM rocks!">>, + SendPacket = <<"AtomVM">>, case gen_tcp:send(Socket, SendPacket) of ok -> - io:format("Sent ~p to ~p\n", [SendPacket, peer_address(Socket)]), + io:format("Sent ~p to ~s\n", [SendPacket, peer_address(Socket)]), receive {tcp_closed, Socket} -> io:format("Connection closed.~n"), @@ -47,7 +48,7 @@ loop(Socket) -> io:format("TCP error ~p.~n", [Error]), ok; {tcp, Socket, ReceivedPacket} -> - io:format("Received ~p from ~p~n", [ReceivedPacket, peer_address(Socket)]), + io:format("Received ~p from ~s~n", [ReceivedPacket, peer_address(Socket)]), timer:sleep(1000), loop(Socket); Other -> @@ -76,7 +77,7 @@ maybe_start_network(esp32) -> case network:wait_for_sta(Config, 30000) of {ok, {Address, Netmask, Gateway}} -> io:format( - "Acquired IP address: ~p Netmask: ~p Gateway: ~p~n", + "Acquired IP address: ~s Netmask: ~s Gateway: ~s~n", [to_string(Address), to_string(Netmask), to_string(Gateway)] ), ok; diff --git a/erlang/tcp_server/src/tcp_server.erl b/erlang/tcp_server/src/tcp_server.erl index 8fd1b0b..b6240b4 100644 --- a/erlang/tcp_server/src/tcp_server.erl +++ b/erlang/tcp_server/src/tcp_server.erl @@ -27,7 +27,7 @@ start() -> Port = maps:get(port, config:get()), case gen_tcp:listen(Port, []) of {ok, ListenSocket} -> - io:format("Listening on ~p.~n", [local_address(ListenSocket)]), + io:format("Listening on ~s.~n", [local_address(ListenSocket)]), spawn(fun() -> accept(ListenSocket) end), timer:sleep(infinity); Error -> @@ -38,7 +38,7 @@ accept(ListenSocket) -> io:format("Waiting to accept connection...~n"), case gen_tcp:accept(ListenSocket) of {ok, Socket} -> - io:format("Accepted connection. local: ~p peer: ~p~n", [ + io:format("Accepted connection. local: ~s peer: ~s~n", [ local_address(Socket), peer_address(Socket) ]), spawn(fun() -> accept(ListenSocket) end), @@ -57,7 +57,7 @@ echo(Socket) -> io:format("TCP error ~p.~n", [Error]), ok; {tcp, Socket, Packet} -> - io:format("Received packet ~p from ~p. Echoing back...~n", [ + io:format("Received packet ~p from ~s. Echoing back...~n", [ Packet, peer_address(Socket) ]), gen_tcp:send(Socket, Packet), @@ -85,7 +85,7 @@ maybe_start_network(esp32) -> case network:wait_for_sta(Config, 30000) of {ok, {Address, Netmask, Gateway}} -> io:format( - "Acquired IP address: ~p Netmask: ~p Gateway: ~p~n", + "Acquired IP address: ~s Netmask: ~s Gateway: ~s~n", [to_string(Address), to_string(Netmask), to_string(Gateway)] ), ok; diff --git a/erlang/udp_client/src/udp_client.erl b/erlang/udp_client/src/udp_client.erl index dc70af7..00f621a 100644 --- a/erlang/udp_client/src/udp_client.erl +++ b/erlang/udp_client/src/udp_client.erl @@ -26,19 +26,19 @@ start() -> ok = maybe_start_network(atomvm:platform()), case gen_udp:open(0) of {ok, Socket} -> - io:format("Opened UDP socket on ~p.~n", [local_address(Socket)]), + io:format("Opened UDP socket on ~s.~n", [local_address(Socket)]), loop(Socket); Error -> io:format("An error occurred opening UDP socket: ~p~n", [Error]) end. loop(Socket) -> - Packet = <<"AtomVM rocks!">>, + Packet = <<"AtomVM">>, Host = maps:get(host, config:get()), Port = maps:get(port, config:get()), case gen_udp:send(Socket, Host, Port, Packet) of ok -> - io:format("Sent ~p to ~p:~p~n", [Packet, Host, Port]); + io:format("Sent ~p to ~s~n", [Packet, to_string({Host, Port})]); Error -> io:format("An error occurred sending a packet: ~p~n", [Error]) end, @@ -59,7 +59,7 @@ maybe_start_network(esp32) -> case network:wait_for_sta(Config, 30000) of {ok, {Address, Netmask, Gateway}} -> io:format( - "Acquired IP address: ~p Netmask: ~p Gateway: ~p~n", + "Acquired IP address: ~s Netmask: ~s Gateway: ~s~n", [to_string(Address), to_string(Netmask), to_string(Gateway)] ), ok; diff --git a/erlang/udp_server/src/udp_server.erl b/erlang/udp_server/src/udp_server.erl index 5c744a0..041449a 100644 --- a/erlang/udp_server/src/udp_server.erl +++ b/erlang/udp_server/src/udp_server.erl @@ -27,7 +27,7 @@ start() -> Port = maps:get(port, config:get()), case gen_udp:open(Port, [{active, true}]) of {ok, Socket} -> - io:format("Opened UDP socket on ~p.~n", [local_address(Socket)]), + io:format("Opened UDP socket on ~s.~n", [local_address(Socket)]), loop(); Error -> io:format("An error occurred opening UDP socket: ~p~n", [Error]) @@ -37,7 +37,7 @@ loop() -> io:format("Waiting to receive data...~n"), receive {udp, _Socket, Address, Port, Packet} -> - io:format("Received UDP packet ~p from ~p~n", [Packet, to_string({Address, Port})]) + io:format("Received UDP packet ~p from ~s~n", [Packet, to_string({Address, Port})]) end, loop(). @@ -55,7 +55,7 @@ maybe_start_network(esp32) -> case network:wait_for_sta(Config, 30000) of {ok, {Address, Netmask, Gateway}} -> io:format( - "Acquired IP address: ~p Netmask: ~p Gateway: ~p~n", + "Acquired IP address: ~s Netmask: ~s Gateway: ~s~n", [to_string(Address), to_string(Netmask), to_string(Gateway)] ), ok; From 8118ddd82b5b5295a6d3417af6266a40cf36897c Mon Sep 17 00:00:00 2001 From: Fred Dushin Date: Thu, 23 Nov 2023 13:19:32 -0500 Subject: [PATCH 2/3] Update copyright and license files Also use profiles for erlfmt. --- .gitignore | 1 + erlang/arepl_example/rebar.config | 26 ++++++++++++++++- .../arepl_example/src/arepl_example.app.src | 21 +++++++++++++- erlang/blinky/rebar.config | 26 ++++++++++++++++- erlang/blinky/src/blinky.app.src | 21 +++++++++++++- erlang/deep_sleep/rebar.config | 26 ++++++++++++++++- erlang/deep_sleep/src/deep_sleep.app.src | 21 +++++++++++++- erlang/esp_nvs/rebar.config | 26 ++++++++++++++++- erlang/esp_nvs/src/esp_nvs.app.src | 21 +++++++++++++- erlang/gpio_interrupt/rebar.config | 29 ++++++++++++++++++- .../gpio_interrupt/src/gpio_interrupt.app.src | 21 +++++++++++++- erlang/hello_world/rebar.config | 29 ++++++++++++++++++- erlang/hello_world/src/hello_world.app.src | 21 +++++++++++++- erlang/i2c_example/rebar.config | 26 ++++++++++++++++- erlang/i2c_example/src/i2c_example.app.src | 21 +++++++++++++- erlang/ledc_example/rebar.config | 26 ++++++++++++++++- erlang/ledc_example/src/ledc_example.app.src | 21 +++++++++++++- erlang/read_priv/rebar.config | 26 ++++++++++++++++- erlang/read_priv/src/read_priv.app.src | 21 +++++++++++++- erlang/spi_example/rebar.config | 26 ++++++++++++++++- erlang/spi_example/src/spi_example.app.src | 21 +++++++++++++- erlang/system_info/rebar.config | 26 ++++++++++++++++- erlang/system_info/src/system_info.app.src | 21 +++++++++++++- erlang/tcp_client/rebar.config | 26 ++++++++++++++++- erlang/tcp_client/src/tcp_client.app.src | 21 +++++++++++++- erlang/tcp_server/rebar.config | 26 ++++++++++++++++- erlang/tcp_server/src/tcp_server.app.src | 21 +++++++++++++- erlang/uart_example/rebar.config | 26 ++++++++++++++++- erlang/uart_example/src/uart_example.app.src | 21 +++++++++++++- erlang/udp_client/rebar.config | 26 ++++++++++++++++- erlang/udp_client/src/udp_client.app.src | 21 +++++++++++++- erlang/udp_server/rebar.config | 26 ++++++++++++++++- erlang/udp_server/src/udp_server.app.src | 2 +- erlang/wifi/rebar.config | 26 ++++++++++++++++- erlang/wifi/src/wifi.app.src | 21 +++++++++++++- 35 files changed, 753 insertions(+), 34 deletions(-) diff --git a/.gitignore b/.gitignore index b307fef..b41fd71 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ **/_build/** **/deps/** **/mix.lock +**/rebar3.crashdump diff --git a/erlang/arepl_example/rebar.config b/erlang/arepl_example/rebar.config index 0001a09..ee3b246 100644 --- a/erlang/arepl_example/rebar.config +++ b/erlang/arepl_example/rebar.config @@ -1,8 +1,32 @@ +% +% This file is part of AtomVM. +% +% Copyright 2023 Fred Dushin +% +% Licensed under the Apache License, Version 2.0 (the "License"); +% you may not use this file except in compliance with the License. +% You may obtain a copy of the License at +% +% http://www.apache.org/licenses/LICENSE-2.0 +% +% Unless required by applicable law or agreed to in writing, software +% distributed under the License is distributed on an "AS IS" BASIS, +% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +% See the License for the specific language governing permissions and +% limitations under the License. +% +% SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later +% {erl_opts, [debug_info]}. {deps, []}. {plugins, [ - atomvm_rebar3_plugin, erlfmt + atomvm_rebar3_plugin ]}. {atomvm_rebar3_plugin, [ {packbeam, [prune]} ]}. +{profiles, [ + {check, [ + {plugins, [erlfmt]} + ]} +]}. diff --git a/erlang/arepl_example/src/arepl_example.app.src b/erlang/arepl_example/src/arepl_example.app.src index 237609e..b7db4e2 100644 --- a/erlang/arepl_example/src/arepl_example.app.src +++ b/erlang/arepl_example/src/arepl_example.app.src @@ -1,3 +1,22 @@ +% +% This file is part of AtomVM. +% +% Copyright 2023 Fred Dushin +% +% Licensed under the Apache License, Version 2.0 (the "License"); +% you may not use this file except in compliance with the License. +% You may obtain a copy of the License at +% +% http://www.apache.org/licenses/LICENSE-2.0 +% +% Unless required by applicable law or agreed to in writing, software +% distributed under the License is distributed on an "AS IS" BASIS, +% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +% See the License for the specific language governing permissions and +% limitations under the License. +% +% SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later +% {application, arepl_example, [ {description, "An AtomVM application"}, {vsn, "0.1.0"}, @@ -7,6 +26,6 @@ ]}, {env, []}, {modules, []}, - {licenses, ["Apache 2.0"]}, + {licenses, ["Apache-2.0"]}, {links, []} ]}. diff --git a/erlang/blinky/rebar.config b/erlang/blinky/rebar.config index 0001a09..ee3b246 100644 --- a/erlang/blinky/rebar.config +++ b/erlang/blinky/rebar.config @@ -1,8 +1,32 @@ +% +% This file is part of AtomVM. +% +% Copyright 2023 Fred Dushin +% +% Licensed under the Apache License, Version 2.0 (the "License"); +% you may not use this file except in compliance with the License. +% You may obtain a copy of the License at +% +% http://www.apache.org/licenses/LICENSE-2.0 +% +% Unless required by applicable law or agreed to in writing, software +% distributed under the License is distributed on an "AS IS" BASIS, +% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +% See the License for the specific language governing permissions and +% limitations under the License. +% +% SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later +% {erl_opts, [debug_info]}. {deps, []}. {plugins, [ - atomvm_rebar3_plugin, erlfmt + atomvm_rebar3_plugin ]}. {atomvm_rebar3_plugin, [ {packbeam, [prune]} ]}. +{profiles, [ + {check, [ + {plugins, [erlfmt]} + ]} +]}. diff --git a/erlang/blinky/src/blinky.app.src b/erlang/blinky/src/blinky.app.src index 7f563a5..eeec48e 100644 --- a/erlang/blinky/src/blinky.app.src +++ b/erlang/blinky/src/blinky.app.src @@ -1,3 +1,22 @@ +% +% This file is part of AtomVM. +% +% Copyright 2023 Fred Dushin +% +% Licensed under the Apache License, Version 2.0 (the "License"); +% you may not use this file except in compliance with the License. +% You may obtain a copy of the License at +% +% http://www.apache.org/licenses/LICENSE-2.0 +% +% Unless required by applicable law or agreed to in writing, software +% distributed under the License is distributed on an "AS IS" BASIS, +% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +% See the License for the specific language governing permissions and +% limitations under the License. +% +% SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later +% {application, blinky, [ {description, "An AtomVM application"}, {vsn, "0.1.0"}, @@ -7,6 +26,6 @@ ]}, {env, []}, {modules, []}, - {licenses, ["Apache 2.0"]}, + {licenses, ["Apache-2.0"]}, {links, []} ]}. diff --git a/erlang/deep_sleep/rebar.config b/erlang/deep_sleep/rebar.config index 0001a09..ee3b246 100644 --- a/erlang/deep_sleep/rebar.config +++ b/erlang/deep_sleep/rebar.config @@ -1,8 +1,32 @@ +% +% This file is part of AtomVM. +% +% Copyright 2023 Fred Dushin +% +% Licensed under the Apache License, Version 2.0 (the "License"); +% you may not use this file except in compliance with the License. +% You may obtain a copy of the License at +% +% http://www.apache.org/licenses/LICENSE-2.0 +% +% Unless required by applicable law or agreed to in writing, software +% distributed under the License is distributed on an "AS IS" BASIS, +% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +% See the License for the specific language governing permissions and +% limitations under the License. +% +% SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later +% {erl_opts, [debug_info]}. {deps, []}. {plugins, [ - atomvm_rebar3_plugin, erlfmt + atomvm_rebar3_plugin ]}. {atomvm_rebar3_plugin, [ {packbeam, [prune]} ]}. +{profiles, [ + {check, [ + {plugins, [erlfmt]} + ]} +]}. diff --git a/erlang/deep_sleep/src/deep_sleep.app.src b/erlang/deep_sleep/src/deep_sleep.app.src index e70c0be..f95f3e9 100644 --- a/erlang/deep_sleep/src/deep_sleep.app.src +++ b/erlang/deep_sleep/src/deep_sleep.app.src @@ -1,3 +1,22 @@ +% +% This file is part of AtomVM. +% +% Copyright 2023 Fred Dushin +% +% Licensed under the Apache License, Version 2.0 (the "License"); +% you may not use this file except in compliance with the License. +% You may obtain a copy of the License at +% +% http://www.apache.org/licenses/LICENSE-2.0 +% +% Unless required by applicable law or agreed to in writing, software +% distributed under the License is distributed on an "AS IS" BASIS, +% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +% See the License for the specific language governing permissions and +% limitations under the License. +% +% SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later +% {application, deep_sleep, [ {description, "An AtomVM application"}, {vsn, "0.1.0"}, @@ -7,6 +26,6 @@ ]}, {env, []}, {modules, []}, - {licenses, ["Apache 2.0"]}, + {licenses, ["Apache-2.0"]}, {links, []} ]}. diff --git a/erlang/esp_nvs/rebar.config b/erlang/esp_nvs/rebar.config index 0001a09..ee3b246 100644 --- a/erlang/esp_nvs/rebar.config +++ b/erlang/esp_nvs/rebar.config @@ -1,8 +1,32 @@ +% +% This file is part of AtomVM. +% +% Copyright 2023 Fred Dushin +% +% Licensed under the Apache License, Version 2.0 (the "License"); +% you may not use this file except in compliance with the License. +% You may obtain a copy of the License at +% +% http://www.apache.org/licenses/LICENSE-2.0 +% +% Unless required by applicable law or agreed to in writing, software +% distributed under the License is distributed on an "AS IS" BASIS, +% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +% See the License for the specific language governing permissions and +% limitations under the License. +% +% SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later +% {erl_opts, [debug_info]}. {deps, []}. {plugins, [ - atomvm_rebar3_plugin, erlfmt + atomvm_rebar3_plugin ]}. {atomvm_rebar3_plugin, [ {packbeam, [prune]} ]}. +{profiles, [ + {check, [ + {plugins, [erlfmt]} + ]} +]}. diff --git a/erlang/esp_nvs/src/esp_nvs.app.src b/erlang/esp_nvs/src/esp_nvs.app.src index b07a175..7221087 100644 --- a/erlang/esp_nvs/src/esp_nvs.app.src +++ b/erlang/esp_nvs/src/esp_nvs.app.src @@ -1,3 +1,22 @@ +% +% This file is part of AtomVM. +% +% Copyright 2023 Fred Dushin +% +% Licensed under the Apache License, Version 2.0 (the "License"); +% you may not use this file except in compliance with the License. +% You may obtain a copy of the License at +% +% http://www.apache.org/licenses/LICENSE-2.0 +% +% Unless required by applicable law or agreed to in writing, software +% distributed under the License is distributed on an "AS IS" BASIS, +% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +% See the License for the specific language governing permissions and +% limitations under the License. +% +% SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later +% {application, esp_nvs, [ {description, "An AtomVM application"}, {vsn, "0.1.0"}, @@ -7,6 +26,6 @@ ]}, {env, []}, {modules, []}, - {licenses, ["Apache 2.0"]}, + {licenses, ["Apache-2.0"]}, {links, []} ]}. diff --git a/erlang/gpio_interrupt/rebar.config b/erlang/gpio_interrupt/rebar.config index eab67e0..ee3b246 100644 --- a/erlang/gpio_interrupt/rebar.config +++ b/erlang/gpio_interrupt/rebar.config @@ -1,5 +1,32 @@ +% +% This file is part of AtomVM. +% +% Copyright 2023 Fred Dushin +% +% Licensed under the Apache License, Version 2.0 (the "License"); +% you may not use this file except in compliance with the License. +% You may obtain a copy of the License at +% +% http://www.apache.org/licenses/LICENSE-2.0 +% +% Unless required by applicable law or agreed to in writing, software +% distributed under the License is distributed on an "AS IS" BASIS, +% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +% See the License for the specific language governing permissions and +% limitations under the License. +% +% SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later +% {erl_opts, [debug_info]}. {deps, []}. {plugins, [ - atomvm_rebar3_plugin, erlfmt + atomvm_rebar3_plugin +]}. +{atomvm_rebar3_plugin, [ + {packbeam, [prune]} +]}. +{profiles, [ + {check, [ + {plugins, [erlfmt]} + ]} ]}. diff --git a/erlang/gpio_interrupt/src/gpio_interrupt.app.src b/erlang/gpio_interrupt/src/gpio_interrupt.app.src index 459ad9c..8db5ea8 100644 --- a/erlang/gpio_interrupt/src/gpio_interrupt.app.src +++ b/erlang/gpio_interrupt/src/gpio_interrupt.app.src @@ -1,3 +1,22 @@ +% +% This file is part of AtomVM. +% +% Copyright 2023 Fred Dushin +% +% Licensed under the Apache License, Version 2.0 (the "License"); +% you may not use this file except in compliance with the License. +% You may obtain a copy of the License at +% +% http://www.apache.org/licenses/LICENSE-2.0 +% +% Unless required by applicable law or agreed to in writing, software +% distributed under the License is distributed on an "AS IS" BASIS, +% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +% See the License for the specific language governing permissions and +% limitations under the License. +% +% SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later +% {application, gpio_interrupt, [ {description, "An AtomVM application"}, {vsn, "0.1.0"}, @@ -7,6 +26,6 @@ ]}, {env, []}, {modules, []}, - {licenses, ["Apache 2.0"]}, + {licenses, ["Apache-2.0"]}, {links, []} ]}. diff --git a/erlang/hello_world/rebar.config b/erlang/hello_world/rebar.config index eab67e0..ee3b246 100644 --- a/erlang/hello_world/rebar.config +++ b/erlang/hello_world/rebar.config @@ -1,5 +1,32 @@ +% +% This file is part of AtomVM. +% +% Copyright 2023 Fred Dushin +% +% Licensed under the Apache License, Version 2.0 (the "License"); +% you may not use this file except in compliance with the License. +% You may obtain a copy of the License at +% +% http://www.apache.org/licenses/LICENSE-2.0 +% +% Unless required by applicable law or agreed to in writing, software +% distributed under the License is distributed on an "AS IS" BASIS, +% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +% See the License for the specific language governing permissions and +% limitations under the License. +% +% SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later +% {erl_opts, [debug_info]}. {deps, []}. {plugins, [ - atomvm_rebar3_plugin, erlfmt + atomvm_rebar3_plugin +]}. +{atomvm_rebar3_plugin, [ + {packbeam, [prune]} +]}. +{profiles, [ + {check, [ + {plugins, [erlfmt]} + ]} ]}. diff --git a/erlang/hello_world/src/hello_world.app.src b/erlang/hello_world/src/hello_world.app.src index fcbde9c..e18e7c0 100644 --- a/erlang/hello_world/src/hello_world.app.src +++ b/erlang/hello_world/src/hello_world.app.src @@ -1,3 +1,22 @@ +% +% This file is part of AtomVM. +% +% Copyright 2023 Fred Dushin +% +% Licensed under the Apache License, Version 2.0 (the "License"); +% you may not use this file except in compliance with the License. +% You may obtain a copy of the License at +% +% http://www.apache.org/licenses/LICENSE-2.0 +% +% Unless required by applicable law or agreed to in writing, software +% distributed under the License is distributed on an "AS IS" BASIS, +% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +% See the License for the specific language governing permissions and +% limitations under the License. +% +% SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later +% {application, hello_world, [ {description, "An AtomVM application"}, {vsn, "0.1.0"}, @@ -7,6 +26,6 @@ ]}, {env, []}, {modules, []}, - {licenses, ["Apache 2.0"]}, + {licenses, ["Apache-2.0"]}, {links, []} ]}. diff --git a/erlang/i2c_example/rebar.config b/erlang/i2c_example/rebar.config index 0001a09..ee3b246 100644 --- a/erlang/i2c_example/rebar.config +++ b/erlang/i2c_example/rebar.config @@ -1,8 +1,32 @@ +% +% This file is part of AtomVM. +% +% Copyright 2023 Fred Dushin +% +% Licensed under the Apache License, Version 2.0 (the "License"); +% you may not use this file except in compliance with the License. +% You may obtain a copy of the License at +% +% http://www.apache.org/licenses/LICENSE-2.0 +% +% Unless required by applicable law or agreed to in writing, software +% distributed under the License is distributed on an "AS IS" BASIS, +% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +% See the License for the specific language governing permissions and +% limitations under the License. +% +% SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later +% {erl_opts, [debug_info]}. {deps, []}. {plugins, [ - atomvm_rebar3_plugin, erlfmt + atomvm_rebar3_plugin ]}. {atomvm_rebar3_plugin, [ {packbeam, [prune]} ]}. +{profiles, [ + {check, [ + {plugins, [erlfmt]} + ]} +]}. diff --git a/erlang/i2c_example/src/i2c_example.app.src b/erlang/i2c_example/src/i2c_example.app.src index b9b8cff..2b7e1cf 100644 --- a/erlang/i2c_example/src/i2c_example.app.src +++ b/erlang/i2c_example/src/i2c_example.app.src @@ -1,3 +1,22 @@ +% +% This file is part of AtomVM. +% +% Copyright 2023 Fred Dushin +% +% Licensed under the Apache License, Version 2.0 (the "License"); +% you may not use this file except in compliance with the License. +% You may obtain a copy of the License at +% +% http://www.apache.org/licenses/LICENSE-2.0 +% +% Unless required by applicable law or agreed to in writing, software +% distributed under the License is distributed on an "AS IS" BASIS, +% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +% See the License for the specific language governing permissions and +% limitations under the License. +% +% SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later +% {application, i2c_example, [ {description, "An AtomVM application"}, {vsn, "0.1.0"}, @@ -7,6 +26,6 @@ ]}, {env, []}, {modules, []}, - {licenses, ["Apache 2.0"]}, + {licenses, ["Apache-2.0"]}, {links, []} ]}. diff --git a/erlang/ledc_example/rebar.config b/erlang/ledc_example/rebar.config index 0001a09..ee3b246 100644 --- a/erlang/ledc_example/rebar.config +++ b/erlang/ledc_example/rebar.config @@ -1,8 +1,32 @@ +% +% This file is part of AtomVM. +% +% Copyright 2023 Fred Dushin +% +% Licensed under the Apache License, Version 2.0 (the "License"); +% you may not use this file except in compliance with the License. +% You may obtain a copy of the License at +% +% http://www.apache.org/licenses/LICENSE-2.0 +% +% Unless required by applicable law or agreed to in writing, software +% distributed under the License is distributed on an "AS IS" BASIS, +% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +% See the License for the specific language governing permissions and +% limitations under the License. +% +% SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later +% {erl_opts, [debug_info]}. {deps, []}. {plugins, [ - atomvm_rebar3_plugin, erlfmt + atomvm_rebar3_plugin ]}. {atomvm_rebar3_plugin, [ {packbeam, [prune]} ]}. +{profiles, [ + {check, [ + {plugins, [erlfmt]} + ]} +]}. diff --git a/erlang/ledc_example/src/ledc_example.app.src b/erlang/ledc_example/src/ledc_example.app.src index ffdf9fd..1ab50fc 100644 --- a/erlang/ledc_example/src/ledc_example.app.src +++ b/erlang/ledc_example/src/ledc_example.app.src @@ -1,3 +1,22 @@ +% +% This file is part of AtomVM. +% +% Copyright 2023 Fred Dushin +% +% Licensed under the Apache License, Version 2.0 (the "License"); +% you may not use this file except in compliance with the License. +% You may obtain a copy of the License at +% +% http://www.apache.org/licenses/LICENSE-2.0 +% +% Unless required by applicable law or agreed to in writing, software +% distributed under the License is distributed on an "AS IS" BASIS, +% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +% See the License for the specific language governing permissions and +% limitations under the License. +% +% SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later +% {application, ledc_example, [ {description, "An AtomVM application"}, {vsn, "0.1.0"}, @@ -7,6 +26,6 @@ ]}, {env, []}, {modules, []}, - {licenses, ["Apache 2.0"]}, + {licenses, ["Apache-2.0"]}, {links, []} ]}. diff --git a/erlang/read_priv/rebar.config b/erlang/read_priv/rebar.config index 0001a09..ee3b246 100644 --- a/erlang/read_priv/rebar.config +++ b/erlang/read_priv/rebar.config @@ -1,8 +1,32 @@ +% +% This file is part of AtomVM. +% +% Copyright 2023 Fred Dushin +% +% Licensed under the Apache License, Version 2.0 (the "License"); +% you may not use this file except in compliance with the License. +% You may obtain a copy of the License at +% +% http://www.apache.org/licenses/LICENSE-2.0 +% +% Unless required by applicable law or agreed to in writing, software +% distributed under the License is distributed on an "AS IS" BASIS, +% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +% See the License for the specific language governing permissions and +% limitations under the License. +% +% SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later +% {erl_opts, [debug_info]}. {deps, []}. {plugins, [ - atomvm_rebar3_plugin, erlfmt + atomvm_rebar3_plugin ]}. {atomvm_rebar3_plugin, [ {packbeam, [prune]} ]}. +{profiles, [ + {check, [ + {plugins, [erlfmt]} + ]} +]}. diff --git a/erlang/read_priv/src/read_priv.app.src b/erlang/read_priv/src/read_priv.app.src index 83b726e..2fa9346 100644 --- a/erlang/read_priv/src/read_priv.app.src +++ b/erlang/read_priv/src/read_priv.app.src @@ -1,3 +1,22 @@ +% +% This file is part of AtomVM. +% +% Copyright 2023 Fred Dushin +% +% Licensed under the Apache License, Version 2.0 (the "License"); +% you may not use this file except in compliance with the License. +% You may obtain a copy of the License at +% +% http://www.apache.org/licenses/LICENSE-2.0 +% +% Unless required by applicable law or agreed to in writing, software +% distributed under the License is distributed on an "AS IS" BASIS, +% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +% See the License for the specific language governing permissions and +% limitations under the License. +% +% SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later +% {application, read_priv, [ {description, "An AtomVM application"}, {vsn, "0.1.0"}, @@ -7,6 +26,6 @@ ]}, {env, []}, {modules, []}, - {licenses, ["Apache 2.0"]}, + {licenses, ["Apache-2.0"]}, {links, []} ]}. diff --git a/erlang/spi_example/rebar.config b/erlang/spi_example/rebar.config index 0001a09..ee3b246 100644 --- a/erlang/spi_example/rebar.config +++ b/erlang/spi_example/rebar.config @@ -1,8 +1,32 @@ +% +% This file is part of AtomVM. +% +% Copyright 2023 Fred Dushin +% +% Licensed under the Apache License, Version 2.0 (the "License"); +% you may not use this file except in compliance with the License. +% You may obtain a copy of the License at +% +% http://www.apache.org/licenses/LICENSE-2.0 +% +% Unless required by applicable law or agreed to in writing, software +% distributed under the License is distributed on an "AS IS" BASIS, +% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +% See the License for the specific language governing permissions and +% limitations under the License. +% +% SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later +% {erl_opts, [debug_info]}. {deps, []}. {plugins, [ - atomvm_rebar3_plugin, erlfmt + atomvm_rebar3_plugin ]}. {atomvm_rebar3_plugin, [ {packbeam, [prune]} ]}. +{profiles, [ + {check, [ + {plugins, [erlfmt]} + ]} +]}. diff --git a/erlang/spi_example/src/spi_example.app.src b/erlang/spi_example/src/spi_example.app.src index 5cfc729..f81f8f8 100644 --- a/erlang/spi_example/src/spi_example.app.src +++ b/erlang/spi_example/src/spi_example.app.src @@ -1,3 +1,22 @@ +% +% This file is part of AtomVM. +% +% Copyright 2023 Fred Dushin +% +% Licensed under the Apache License, Version 2.0 (the "License"); +% you may not use this file except in compliance with the License. +% You may obtain a copy of the License at +% +% http://www.apache.org/licenses/LICENSE-2.0 +% +% Unless required by applicable law or agreed to in writing, software +% distributed under the License is distributed on an "AS IS" BASIS, +% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +% See the License for the specific language governing permissions and +% limitations under the License. +% +% SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later +% {application, spi_example, [ {description, "An AtomVM application"}, {vsn, "0.1.0"}, @@ -7,6 +26,6 @@ ]}, {env, []}, {modules, []}, - {licenses, ["Apache 2.0"]}, + {licenses, ["Apache-2.0"]}, {links, []} ]}. diff --git a/erlang/system_info/rebar.config b/erlang/system_info/rebar.config index 0001a09..ee3b246 100644 --- a/erlang/system_info/rebar.config +++ b/erlang/system_info/rebar.config @@ -1,8 +1,32 @@ +% +% This file is part of AtomVM. +% +% Copyright 2023 Fred Dushin +% +% Licensed under the Apache License, Version 2.0 (the "License"); +% you may not use this file except in compliance with the License. +% You may obtain a copy of the License at +% +% http://www.apache.org/licenses/LICENSE-2.0 +% +% Unless required by applicable law or agreed to in writing, software +% distributed under the License is distributed on an "AS IS" BASIS, +% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +% See the License for the specific language governing permissions and +% limitations under the License. +% +% SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later +% {erl_opts, [debug_info]}. {deps, []}. {plugins, [ - atomvm_rebar3_plugin, erlfmt + atomvm_rebar3_plugin ]}. {atomvm_rebar3_plugin, [ {packbeam, [prune]} ]}. +{profiles, [ + {check, [ + {plugins, [erlfmt]} + ]} +]}. diff --git a/erlang/system_info/src/system_info.app.src b/erlang/system_info/src/system_info.app.src index b015b35..1b0df62 100644 --- a/erlang/system_info/src/system_info.app.src +++ b/erlang/system_info/src/system_info.app.src @@ -1,3 +1,22 @@ +% +% This file is part of AtomVM. +% +% Copyright 2023 Fred Dushin +% +% Licensed under the Apache License, Version 2.0 (the "License"); +% you may not use this file except in compliance with the License. +% You may obtain a copy of the License at +% +% http://www.apache.org/licenses/LICENSE-2.0 +% +% Unless required by applicable law or agreed to in writing, software +% distributed under the License is distributed on an "AS IS" BASIS, +% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +% See the License for the specific language governing permissions and +% limitations under the License. +% +% SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later +% {application, system_info, [ {description, "An AtomVM application"}, {vsn, "0.1.0"}, @@ -7,6 +26,6 @@ ]}, {env, []}, {modules, []}, - {licenses, ["Apache 2.0"]}, + {licenses, ["Apache-2.0"]}, {links, []} ]}. diff --git a/erlang/tcp_client/rebar.config b/erlang/tcp_client/rebar.config index 0001a09..ee3b246 100644 --- a/erlang/tcp_client/rebar.config +++ b/erlang/tcp_client/rebar.config @@ -1,8 +1,32 @@ +% +% This file is part of AtomVM. +% +% Copyright 2023 Fred Dushin +% +% Licensed under the Apache License, Version 2.0 (the "License"); +% you may not use this file except in compliance with the License. +% You may obtain a copy of the License at +% +% http://www.apache.org/licenses/LICENSE-2.0 +% +% Unless required by applicable law or agreed to in writing, software +% distributed under the License is distributed on an "AS IS" BASIS, +% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +% See the License for the specific language governing permissions and +% limitations under the License. +% +% SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later +% {erl_opts, [debug_info]}. {deps, []}. {plugins, [ - atomvm_rebar3_plugin, erlfmt + atomvm_rebar3_plugin ]}. {atomvm_rebar3_plugin, [ {packbeam, [prune]} ]}. +{profiles, [ + {check, [ + {plugins, [erlfmt]} + ]} +]}. diff --git a/erlang/tcp_client/src/tcp_client.app.src b/erlang/tcp_client/src/tcp_client.app.src index 701f57f..a049f87 100644 --- a/erlang/tcp_client/src/tcp_client.app.src +++ b/erlang/tcp_client/src/tcp_client.app.src @@ -1,3 +1,22 @@ +% +% This file is part of AtomVM. +% +% Copyright 2023 Fred Dushin +% +% Licensed under the Apache License, Version 2.0 (the "License"); +% you may not use this file except in compliance with the License. +% You may obtain a copy of the License at +% +% http://www.apache.org/licenses/LICENSE-2.0 +% +% Unless required by applicable law or agreed to in writing, software +% distributed under the License is distributed on an "AS IS" BASIS, +% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +% See the License for the specific language governing permissions and +% limitations under the License. +% +% SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later +% {application, tcp_client, [ {description, "An AtomVM application"}, {vsn, "0.1.0"}, @@ -7,6 +26,6 @@ ]}, {env, []}, {modules, []}, - {licenses, ["Apache 2.0"]}, + {licenses, ["Apache-2.0"]}, {links, []} ]}. diff --git a/erlang/tcp_server/rebar.config b/erlang/tcp_server/rebar.config index 0001a09..ee3b246 100644 --- a/erlang/tcp_server/rebar.config +++ b/erlang/tcp_server/rebar.config @@ -1,8 +1,32 @@ +% +% This file is part of AtomVM. +% +% Copyright 2023 Fred Dushin +% +% Licensed under the Apache License, Version 2.0 (the "License"); +% you may not use this file except in compliance with the License. +% You may obtain a copy of the License at +% +% http://www.apache.org/licenses/LICENSE-2.0 +% +% Unless required by applicable law or agreed to in writing, software +% distributed under the License is distributed on an "AS IS" BASIS, +% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +% See the License for the specific language governing permissions and +% limitations under the License. +% +% SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later +% {erl_opts, [debug_info]}. {deps, []}. {plugins, [ - atomvm_rebar3_plugin, erlfmt + atomvm_rebar3_plugin ]}. {atomvm_rebar3_plugin, [ {packbeam, [prune]} ]}. +{profiles, [ + {check, [ + {plugins, [erlfmt]} + ]} +]}. diff --git a/erlang/tcp_server/src/tcp_server.app.src b/erlang/tcp_server/src/tcp_server.app.src index 1fd7a34..a6e8c79 100644 --- a/erlang/tcp_server/src/tcp_server.app.src +++ b/erlang/tcp_server/src/tcp_server.app.src @@ -1,3 +1,22 @@ +% +% This file is part of AtomVM. +% +% Copyright 2023 Fred Dushin +% +% Licensed under the Apache License, Version 2.0 (the "License"); +% you may not use this file except in compliance with the License. +% You may obtain a copy of the License at +% +% http://www.apache.org/licenses/LICENSE-2.0 +% +% Unless required by applicable law or agreed to in writing, software +% distributed under the License is distributed on an "AS IS" BASIS, +% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +% See the License for the specific language governing permissions and +% limitations under the License. +% +% SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later +% {application, tcp_server, [ {description, "An AtomVM application"}, {vsn, "0.1.0"}, @@ -7,6 +26,6 @@ ]}, {env, []}, {modules, []}, - {licenses, ["Apache 2.0"]}, + {licenses, ["Apache-2.0"]}, {links, []} ]}. diff --git a/erlang/uart_example/rebar.config b/erlang/uart_example/rebar.config index 0001a09..ee3b246 100644 --- a/erlang/uart_example/rebar.config +++ b/erlang/uart_example/rebar.config @@ -1,8 +1,32 @@ +% +% This file is part of AtomVM. +% +% Copyright 2023 Fred Dushin +% +% Licensed under the Apache License, Version 2.0 (the "License"); +% you may not use this file except in compliance with the License. +% You may obtain a copy of the License at +% +% http://www.apache.org/licenses/LICENSE-2.0 +% +% Unless required by applicable law or agreed to in writing, software +% distributed under the License is distributed on an "AS IS" BASIS, +% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +% See the License for the specific language governing permissions and +% limitations under the License. +% +% SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later +% {erl_opts, [debug_info]}. {deps, []}. {plugins, [ - atomvm_rebar3_plugin, erlfmt + atomvm_rebar3_plugin ]}. {atomvm_rebar3_plugin, [ {packbeam, [prune]} ]}. +{profiles, [ + {check, [ + {plugins, [erlfmt]} + ]} +]}. diff --git a/erlang/uart_example/src/uart_example.app.src b/erlang/uart_example/src/uart_example.app.src index e0cf211..788ec14 100644 --- a/erlang/uart_example/src/uart_example.app.src +++ b/erlang/uart_example/src/uart_example.app.src @@ -1,3 +1,22 @@ +% +% This file is part of AtomVM. +% +% Copyright 2023 Fred Dushin +% +% Licensed under the Apache License, Version 2.0 (the "License"); +% you may not use this file except in compliance with the License. +% You may obtain a copy of the License at +% +% http://www.apache.org/licenses/LICENSE-2.0 +% +% Unless required by applicable law or agreed to in writing, software +% distributed under the License is distributed on an "AS IS" BASIS, +% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +% See the License for the specific language governing permissions and +% limitations under the License. +% +% SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later +% {application, uart_example, [ {description, "An AtomVM application"}, {vsn, "0.1.0"}, @@ -7,6 +26,6 @@ ]}, {env, []}, {modules, []}, - {licenses, ["Apache 2.0"]}, + {licenses, ["Apache-2.0"]}, {links, []} ]}. diff --git a/erlang/udp_client/rebar.config b/erlang/udp_client/rebar.config index 0001a09..ee3b246 100644 --- a/erlang/udp_client/rebar.config +++ b/erlang/udp_client/rebar.config @@ -1,8 +1,32 @@ +% +% This file is part of AtomVM. +% +% Copyright 2023 Fred Dushin +% +% Licensed under the Apache License, Version 2.0 (the "License"); +% you may not use this file except in compliance with the License. +% You may obtain a copy of the License at +% +% http://www.apache.org/licenses/LICENSE-2.0 +% +% Unless required by applicable law or agreed to in writing, software +% distributed under the License is distributed on an "AS IS" BASIS, +% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +% See the License for the specific language governing permissions and +% limitations under the License. +% +% SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later +% {erl_opts, [debug_info]}. {deps, []}. {plugins, [ - atomvm_rebar3_plugin, erlfmt + atomvm_rebar3_plugin ]}. {atomvm_rebar3_plugin, [ {packbeam, [prune]} ]}. +{profiles, [ + {check, [ + {plugins, [erlfmt]} + ]} +]}. diff --git a/erlang/udp_client/src/udp_client.app.src b/erlang/udp_client/src/udp_client.app.src index 3c44f02..cea39e6 100644 --- a/erlang/udp_client/src/udp_client.app.src +++ b/erlang/udp_client/src/udp_client.app.src @@ -1,3 +1,22 @@ +% +% This file is part of AtomVM. +% +% Copyright 2023 Fred Dushin +% +% Licensed under the Apache License, Version 2.0 (the "License"); +% you may not use this file except in compliance with the License. +% You may obtain a copy of the License at +% +% http://www.apache.org/licenses/LICENSE-2.0 +% +% Unless required by applicable law or agreed to in writing, software +% distributed under the License is distributed on an "AS IS" BASIS, +% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +% See the License for the specific language governing permissions and +% limitations under the License. +% +% SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later +% {application, udp_client, [ {description, "An AtomVM application"}, {vsn, "0.1.0"}, @@ -7,6 +26,6 @@ ]}, {env, []}, {modules, []}, - {licenses, ["Apache 2.0"]}, + {licenses, ["Apache-2.0"]}, {links, []} ]}. diff --git a/erlang/udp_server/rebar.config b/erlang/udp_server/rebar.config index 0001a09..ee3b246 100644 --- a/erlang/udp_server/rebar.config +++ b/erlang/udp_server/rebar.config @@ -1,8 +1,32 @@ +% +% This file is part of AtomVM. +% +% Copyright 2023 Fred Dushin +% +% Licensed under the Apache License, Version 2.0 (the "License"); +% you may not use this file except in compliance with the License. +% You may obtain a copy of the License at +% +% http://www.apache.org/licenses/LICENSE-2.0 +% +% Unless required by applicable law or agreed to in writing, software +% distributed under the License is distributed on an "AS IS" BASIS, +% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +% See the License for the specific language governing permissions and +% limitations under the License. +% +% SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later +% {erl_opts, [debug_info]}. {deps, []}. {plugins, [ - atomvm_rebar3_plugin, erlfmt + atomvm_rebar3_plugin ]}. {atomvm_rebar3_plugin, [ {packbeam, [prune]} ]}. +{profiles, [ + {check, [ + {plugins, [erlfmt]} + ]} +]}. diff --git a/erlang/udp_server/src/udp_server.app.src b/erlang/udp_server/src/udp_server.app.src index f93e1ce..c62be78 100644 --- a/erlang/udp_server/src/udp_server.app.src +++ b/erlang/udp_server/src/udp_server.app.src @@ -26,6 +26,6 @@ ]}, {env, []}, {modules, []}, - {licenses, ["Apache 2.0"]}, + {licenses, ["Apache-2.0"]}, {links, []} ]}. diff --git a/erlang/wifi/rebar.config b/erlang/wifi/rebar.config index 0001a09..ee3b246 100644 --- a/erlang/wifi/rebar.config +++ b/erlang/wifi/rebar.config @@ -1,8 +1,32 @@ +% +% This file is part of AtomVM. +% +% Copyright 2023 Fred Dushin +% +% Licensed under the Apache License, Version 2.0 (the "License"); +% you may not use this file except in compliance with the License. +% You may obtain a copy of the License at +% +% http://www.apache.org/licenses/LICENSE-2.0 +% +% Unless required by applicable law or agreed to in writing, software +% distributed under the License is distributed on an "AS IS" BASIS, +% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +% See the License for the specific language governing permissions and +% limitations under the License. +% +% SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later +% {erl_opts, [debug_info]}. {deps, []}. {plugins, [ - atomvm_rebar3_plugin, erlfmt + atomvm_rebar3_plugin ]}. {atomvm_rebar3_plugin, [ {packbeam, [prune]} ]}. +{profiles, [ + {check, [ + {plugins, [erlfmt]} + ]} +]}. diff --git a/erlang/wifi/src/wifi.app.src b/erlang/wifi/src/wifi.app.src index 18e8ab0..c7c5e08 100644 --- a/erlang/wifi/src/wifi.app.src +++ b/erlang/wifi/src/wifi.app.src @@ -1,3 +1,22 @@ +% +% This file is part of AtomVM. +% +% Copyright 2023 Fred Dushin +% +% Licensed under the Apache License, Version 2.0 (the "License"); +% you may not use this file except in compliance with the License. +% You may obtain a copy of the License at +% +% http://www.apache.org/licenses/LICENSE-2.0 +% +% Unless required by applicable law or agreed to in writing, software +% distributed under the License is distributed on an "AS IS" BASIS, +% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +% See the License for the specific language governing permissions and +% limitations under the License. +% +% SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later +% {application, wifi, [ {description, "An AtomVM application"}, {vsn, "0.1.0"}, @@ -7,6 +26,6 @@ ]}, {env, []}, {modules, []}, - {licenses, ["Apache 2.0"]}, + {licenses, ["Apache-2.0"]}, {links, []} ]}. From 44c3fcb2b3771c9f738c3c1d33a9ca0d4dd1abe5 Mon Sep 17 00:00:00 2001 From: Fred Dushin Date: Thu, 23 Nov 2023 13:19:50 -0500 Subject: [PATCH 3/3] Use a build script in CI and for local testing --- .github/workflows/build-examples.yaml | 4 +--- build.sh | 31 +++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 3 deletions(-) create mode 100755 build.sh diff --git a/.github/workflows/build-examples.yaml b/.github/workflows/build-examples.yaml index 4ee7d0e..304ecb6 100644 --- a/.github/workflows/build-examples.yaml +++ b/.github/workflows/build-examples.yaml @@ -38,6 +38,4 @@ jobs: - name: "Build Erlang Example Programs" run: | - REBAR="/tmp/rebar3/rebar3" - 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" - for i in ${EXAMPLES}; do cd ./erlang/$i; ${REBAR} fmt -c || exit 1; ${REBAR} packbeam -p -f -i || exit 1; cd ../..; done + PATH=/tmp/rebar3:$PATH ./build.sh diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..016e957 --- /dev/null +++ b/build.sh @@ -0,0 +1,31 @@ +#!/bin/sh +# +# This file is part of AtomVM. +# +# Copyright 2023 Fred Dushin +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later +# + +REBAR="rebar3" +cd erlang +ERLANG_EXAMPLES="$(/bin/ls | grep -v README.md)" +for i in ${ERLANG_EXAMPLES}; do + cd $i + rm -rf _build + ${REBAR} atomvm packbeam -l || exit 1 + ${REBAR} as check fmt -c || exit 1 + cd .. +done