build

package
v0.77.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 5, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

README

Reusable Mage build tools

This package includes standard mage targets useful in the build.

See: https://magefile.org/magefiles/.

These targets can be used in your plugin project by creating Magefile.go in the root of your project like the following:

//+build mage

package main

import (
	// mage:import
	build "github.com/grafana/grafana-plugin-sdk-go/build"
)

// Default configures the default target.
var Default = build.BuildAll

https://magefile.org/importing/

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildAll

func BuildAll()

BuildAll builds production executables for all supported platforms.

func Clean

func Clean() error

Clean cleans build artifacts, by deleting the dist directory.

func Coverage

func Coverage() error

Coverage runs backend tests and makes a coverage report.

func Debugger

func Debugger() error

Debugger makes a new debug build, re-launches the plugin and attaches the Delve debugger, in headless mode listening on port 3222.

The plugin process is killed after re-building, in order to make Grafana launch the new version. Once the new version is up, we attach to it with Delve.

func Format

func Format() error

Format formats the sources.

func Lint

func Lint() error

Lint audits the source style

func ReloadPlugin

func ReloadPlugin() error

ReloadPlugin - kills any running instances and waits for grafana to reload the plugin

func SetBeforeBuildCallback

func SetBeforeBuildCallback(cb BeforeBuildCallback) error

SetBeforeBuildCallback configures a custom callback

func Test

func Test() error

Test runs backend tests.

Types

type BeforeBuildCallback

type BeforeBuildCallback func(cfg Config) (Config, error)

BeforeBuildCallback hooks into the build process

type Build

type Build mg.Namespace

Build is a namespace.

func (Build) Backend

func (Build) Backend() error

Backend build a production build for the current platform

func (Build) Darwin

func (Build) Darwin() error

Darwin builds the back-end plugin for OSX.

func (Build) Debug

func (Build) Debug() error

Debug builds the debug version for the current platform

func (Build) Linux

func (Build) Linux() error

Linux builds the back-end plugin for Linux.

func (Build) LinuxARM

func (Build) LinuxARM() error

LinuxARM builds the back-end plugin for Linux on ARM.

func (Build) LinuxARM64

func (Build) LinuxARM64() error

LinuxARM64 builds the back-end plugin for Linux on ARM64.

func (Build) Windows

func (Build) Windows() error

Windows builds the back-end plugin for Windows.

type Config

type Config struct {
	OS          string // GOOS
	Arch        string // GOOS
	EnableDebug bool
	Env         map[string]string
	EnableCGo   bool
}

Config holds the setup variables required for a build

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL