-
Notifications
You must be signed in to change notification settings - Fork 1
/
build-with-cli.sh
executable file
·57 lines (48 loc) · 1.51 KB
/
build-with-cli.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/bash
##############################################################################
#
# Module: build-with-cli.sh
#
# Function:
# This script sets variables and calls the common build.
#
# Usage:
# build-with-cli.sh --help
#
# Copyright and License:
# See accompanying LICENSE.md file
#
# Author:
# Terry Moore, MCCI February 2021
#
##############################################################################
set -e
# get the path to this file as the default for the build path.
PDIR=$(realpath "$(dirname "$0")")
# export the root name of this script for use by build-common.
PNAME=$(basename "$0")
export PNAME
# so the build directory shows up where this script lives, CD here.
cd "$PDIR"
# launch the common script and pass in the args.
. "${PDIR}/extra/tools-build-with-cli/build-with-cli-lib.sh"
function _setProject {
#---- project settings -----
readonly OPTOUTPUTNAME_DEFAULT=model4832
readonly OPTARDUINO_SOURCE_DEFAULT=sketches/catena4618m201_simple/catena4618m201_simple.ino
readonly OPTARDUINO_BOARD_DEFAULT=4618
readonly OPTKEYFILE_DEFAULT="$INVOKEDIR/keys/project.pem"
readonly OPTREGION_DEFAULT=us915
readonly OPTNETWORK_DEFAULT=ttn
readonly OPTSUBBAND_DEFAULT=default
readonly OPTCLOCK_DEFAULT=16
readonly OPTXSERIAL_DEFAULT=usb
}
# result is version as either x.y.z-N or x.y.z (if pre-release tag is -0)
_debug "Override _getversion"
function _getversion {
sed -n \
-e 's/^static const char sVersion\[] = "\(.*\)";$/\1/p' \
"$1"
}
_doBuild "$@"