Skip to content

Commit 6582283

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 6e9adef commit 6582283

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
@@ -247,6 +247,16 @@ func (Build) DarwinARM64() error {
247247
return buildBackend(newBuildConfig("darwin", "arm64"))
248248
}
249249

250+
// FreeBSD builds the back-end plugin for FreeBSD on AMD64.
251+
func (Build) FreeBSD() error {
252+
return buildBackend(newBuildConfig("freebsd", "amd64"))
253+
}
254+
255+
// FreeBSDARM64 builds the back-end plugin for FreeBSD on ARM64.
256+
func (Build) FreeBSDARM64() error {
257+
return buildBackend(newBuildConfig("freebsd", "arm"))
258+
}
259+
250260
// Custom allows customizable back-end plugin builds for the provided os and arch.
251261
// Note: Cutomized builds are not officially supported by Grafana, so this option is intended for developers who need
252262
// to create their own custom build targets.
@@ -325,6 +335,20 @@ func (Build) DebugWindowsAMD64() error {
325335
return buildBackend(cfg)
326336
}
327337

338+
// DebugFreeBSDAMD64 builds the debug version targeted for FreeBSD on AMD64.
339+
func (Build) DebugFreeBSDAMD64() error {
340+
cfg := newBuildConfig("freebsd", "amd64")
341+
cfg.EnableDebug = true
342+
return buildBackend(cfg)
343+
}
344+
345+
// DebugFreeBSDARM64 builds the debug version targeted for FreeBSD on ARM64.
346+
func (Build) DebugFreeBSDARM64() error {
347+
cfg := newBuildConfig("freebsd", "arm64")
348+
cfg.EnableDebug = true
349+
return buildBackend(cfg)
350+
}
351+
328352
// Backend build a production build for the current platform
329353
func (Build) Backend() error {
330354
// The M1 platform detection is kinda flakey, so we will just build both
@@ -342,7 +366,8 @@ func (Build) Backend() error {
342366
// BuildAll builds production executables for all supported platforms.
343367
func BuildAll() { //revive:disable-line
344368
b := Build{}
345-
mg.Deps(b.Linux, b.Windows, b.Darwin, b.DarwinARM64, b.LinuxARM64, b.LinuxARM)
369+
mg.Deps(b.Linux, b.Windows, b.Darwin, b.DarwinARM64, b.LinuxARM64, b.LinuxARM,
370+
b.FreeBSD, b.FreeBSDARM64)
346371
}
347372

348373
//go:embed tmpl/*

0 commit comments

Comments
 (0)