@@ -861,12 +861,11 @@ You can use the `module build start` or `module build local` commands to build y
861861- Use ` build start ` to build or compile your module on a cloud build host that might offer more platform support than you have access to locally.
862862- Use ` build local ` to quickly test that your module builds or compiles as expected on your local hardware.
863863
864- To configure your module's build steps, add a ` build ` object to your [ ` meta.json ` file] ( #the-metajson-file ) like the following:
864+ To configure your module's build steps, add a ` build ` object to your [ ` meta.json ` file] ( #the-metajson-file ) like the following.
865+ You can either have a single build file for all platforms, or platform specific files.
865866
866- <!-- Developers can either have a single build file for all platforms, or platform specific files: -->
867-
868- <!-- { {< tabs >}}
869- { {% tab name="Single Build File" %}} -->
867+ {{< tabs >}}
868+ {{% tab name="Single Build File" %}}
870869
871870``` json {class="line-numbers linkable-line-numbers"}
872871"build" : {
@@ -878,6 +877,27 @@ To configure your module's build steps, add a `build` object to your [`meta.json
878877}
879878```
880879
880+ {{% /tab %}}
881+ {{% tab name="Platform Specific" %}}
882+
883+ ``` json {class="line-numbers linkable-line-numbers"}
884+ "build" : {
885+ "path" : " dist/archive.tar.gz" , // optional - path to your built module
886+ // (passed to the 'viam module upload' command)
887+ "arch" : {
888+ "linux/arm64" : {
889+ "build" : " ./build-linux-arm64.sh" // command that will build your module
890+ },
891+ "darwin/arm64" : {
892+ "build" : " ./build-darwin-arm64.sh" // command that will build your module
893+ }
894+ } // architecture(s) to build for
895+ }
896+ ```
897+
898+ {{% /tab %}}
899+ {{< /tabs >}}
900+
881901{{% expand "Click to view example setup.sh" %}}
882902
883903``` sh {class="line-numbers linkable-line-numbers"}
@@ -941,27 +961,9 @@ tar -czvf dist/archive.tar.gz <PATH-TO-EXECUTABLE>
941961
942962{{% /expand%}}
943963
944- <!-- { {% /tab %}} -->
945- <!-- { {% tab name="Platform Specific" %}}
964+ {{%expand "Click to view example build-linux-arm64.sh" %}}
946965
947- ```json {class="line-numbers linkable-line-numbers"}
948- "build": {
949- "path" : "dist/archive.tar.gz", // optional - path to your built module
950- // (passed to the 'viam module upload' command)
951- "arch": {
952- "linux/arm64": {
953- "build": "./build-linux-arm64.sh" // command that will build your module
954- },
955- "darwin/arm64": {
956- "build": "./build-darwin-arm64.sh" // command that will build your module
957- }
958- } // architecture(s) to build for
959- }
960- ```
961-
962- { {%expand "Click to view example build-linux-arm64.sh" %}}
963-
964- ```sh { class="command-line"}
966+ ``` sh {class="line-numbers linkable-line-numbers"}
965967#! /bin/bash
966968set -e
967969
@@ -989,10 +991,7 @@ python3 -m PyInstaller --onefile --hidden-import="googleapiclient" src/main.py
989991tar -czvf dist/archive.tar.gz < PATH-TO-EXECUTABLE>
990992```
991993
992- { {% /expand%}}
993-
994- {{ % /tab %}}
995- { {< /tabs >}} -->
994+ {{% /expand%}}
996995
997996For example, the following extends the ` my-module ` <file >meta.json</file > file from the previous section using the single build file approach, adding a new ` build ` object to control its build parameters when used with ` module build start ` or ` module build local ` :
998997
0 commit comments