forked from tphakala/birdnet-go
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.air.toml
More file actions
84 lines (72 loc) · 3.07 KB
/
.air.toml
File metadata and controls
84 lines (72 loc) · 3.07 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# Root directory configuration
root = "." # Set the root directory to the current directory
tmp_dir = "tmp" # Temporary directory for build artifacts
# Build configuration
[build]
# No pre-build commands needed - frontend is built separately via 'task frontend-watch'
# The Go server automatically serves from frontend/dist/ when it exists on disk.
pre_cmd = []
# Main build command
cmd = """
# Enable CGO for TensorFlow Lite integration
export CGO_ENABLED=1
export CGO_CFLAGS="-I${HOME}/src/tensorflow"
# Set library paths based on OS
if [ "$(uname)" = "Darwin" ]; then
# macOS: use Homebrew lib path (works for both ARM64 and Intel)
TFLITE_LIB_DIR="/opt/homebrew/lib"
if [ ! -d "$TFLITE_LIB_DIR" ]; then
TFLITE_LIB_DIR="/usr/local/lib"
fi
else
# Linux
TFLITE_LIB_DIR="/usr/lib"
fi
export CGO_LDFLAGS="-L${TFLITE_LIB_DIR} -ltensorflowlite_c"
# Build the Go application with version and build date
go build -ldflags "-s -w -r /usr/local/lib \
-X 'main.buildDate=$(date -u +%Y-%m-%dT%H:%M:%SZ)' \
-X 'main.version=$(git describe --tags --always)'" \
-o ./tmp/main .
# On macOS, add the Homebrew library path to rpath since Go's -r flag
# doesn't properly handle multiple rpaths
if [ "$(uname)" = "Darwin" ]; then
install_name_tool -add_rpath "${TFLITE_LIB_DIR}" ./tmp/main 2>/dev/null || true
fi
"""
entrypoint = ["./tmp/main"] # Path to the compiled binary
delay = 1000 # Delay (in milliseconds) before restarting the app after a change
rerun_delay = 5000
# Directories to exclude from watching
# Frontend is excluded - use 'task frontend-watch' for frontend changes
exclude_dir = ["tmp", "vendor", "testdata", "bin", "frontend", "node_modules", "dist", ".git"]
exclude_file = [] # Files to exclude from watching (none specified)
exclude_regex = ["_test.go"] # Exclude test files
exclude_unchanged = false # Watch even files that haven't changed
follow_symlink = false # Don't follow symlinks
args_bin = [] # Additional arguments when running the built binary
# Only watch Go backend files - frontend is handled by 'task frontend-watch'
include_dir = ["internal", "assets", "cmd", "pkg"]
include_ext = ["go"] # File extensions to watch
include_file = ["main.go"] # Files to watch
kill_delay = "0s" # Delay before killing the app on a rebuild
log = "build-errors.log" # File to log build errors
send_interrupt = false # Send interrupt signal before killing the app
stop_on_error = true # Stop restarting if build errors occur
# Color configuration for console output
[color]
app = "" # Default terminal color for app output
build = "yellow"
main = "magenta"
runner = "green"
watcher = "cyan"
# Logging configuration
[log]
time = false # Don't include timestamps in logs
# Miscellaneous settings
[misc]
clean_on_exit = false # Don't clean temporary directory on exit
# Screen settings
[screen]
clear_on_rebuild = false # Don't clear the screen on rebuild
keep_scroll = true # Keep scroll position when output screen is full