Sybren A. Stüvel c1a728dc2f Version updates via Makefile
Flamenco now no longer uses the Git tags + hash for the application
version, but an explicit `VERSION` variable in the `Makefile`.

After changing the `VERSION` variable in the `Makefile`, run
`make update-version`.

Not every part of Flamenco looks at this variable, though. Most
importantly: the Blender add-on needs special handling, because that
doesn't just take a version string but a tuple of integers. Running
`make update-version` updates the add-on's `bl_info` dict with the new
version. If the version has any `-blabla` suffix (like `3.0-beta0`) it
will also set the `warning` field to explain that it's not a stable
release.
2022-07-25 16:08:07 +02:00

27 lines
866 B
Go

package appinfo
// SPDX-License-Identifier: GPL-3.0-or-later
import "fmt"
// ApplicationName contains the application name.
const ApplicationName = "Flamenco"
// ApplicationVersion is the version number of the application.
// It is set during the build.
var ApplicationVersion = "set-during-build"
// ApplicationGitHash has the Git hash of the commit used to create this build.
// It is set during the build.
var ApplicationGitHash = "set-during-build"
// FormattedApplicationInfo returns the application name & version as single string.
func FormattedApplicationInfo() string {
return fmt.Sprintf("%s %s", ApplicationName, ApplicationVersion)
}
// UserAgent returns the application name & version suitable for the HTTP User-Agent header.
func UserAgent() string {
return fmt.Sprintf("%s/%s (%s)", ApplicationName, ApplicationVersion, ApplicationGitHash)
}