Skip to content

Commit a748281

Browse files
committed
grafana-plugin-sdk-go: Build also for FreeBSD
Build also for FreeBSD on amd64 and arm64. Might want to add other platforms as needed.
1 parent bc72a70 commit a748281

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

build/common.go

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,16 @@ func (Build) DarwinARM64() error {
251251
return buildBackend(newBuildConfig("darwin", "arm64"))
252252
}
253253

254+
// FreeBSD builds the back-end plugin for FreeBSD on AMD64.
255+
func (Build) FreeBSD() error {
256+
return buildBackend(newBuildConfig("freebsd", "amd64"))
257+
}
258+
259+
// FreeBSDARM64 builds the back-end plugin for FreeBSD on ARM64.
260+
func (Build) FreeBSDARM64() error {
261+
return buildBackend(newBuildConfig("freebsd", "arm"))
262+
}
263+
254264
// Custom allows customizable back-end plugin builds for the provided os and arch.
255265
// Note: Cutomized builds are not officially supported by Grafana, so this option is intended for developers who need
256266
// to create their own custom build targets.
@@ -329,6 +339,20 @@ func (Build) DebugWindowsAMD64() error {
329339
return buildBackend(cfg)
330340
}
331341

342+
// DebugFreeBSDAMD64 builds the debug version targeted for FreeBSD on AMD64.
343+
func (Build) DebugFreeBSDAMD64() error {
344+
cfg := newBuildConfig("freebsd", "amd64")
345+
cfg.EnableDebug = true
346+
return buildBackend(cfg)
347+
}
348+
349+
// DebugFreeBSDARM64 builds the debug version targeted for FreeBSD on ARM64.
350+
func (Build) DebugFreeBSDARM64() error {
351+
cfg := newBuildConfig("freebsd", "arm64")
352+
cfg.EnableDebug = true
353+
return buildBackend(cfg)
354+
}
355+
332356
// Backend build a production build for the current platform
333357
func (Build) Backend() error {
334358
// The M1 platform detection is kinda flakey, so we will just build both
@@ -346,7 +370,8 @@ func (Build) Backend() error {
346370
// BuildAll builds production executables for all supported platforms.
347371
func BuildAll() { //revive:disable-line
348372
b := Build{}
349-
mg.Deps(b.Linux, b.Windows, b.Darwin, b.DarwinARM64, b.LinuxARM64, b.LinuxARM)
373+
mg.Deps(b.Linux, b.Windows, b.Darwin, b.DarwinARM64, b.LinuxARM64, b.LinuxARM,
374+
b.FreeBSD, b.FreeBSDARM64)
350375
}
351376

352377
//go:embed tmpl/*

0 commit comments

Comments
 (0)