mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-03 14:10:58 +08:00

Some checks are pending
Build + Test v3 alpha / Run Go Tests (1.22, macos-latest) (push) Waiting to run
Build + Test v3 alpha / Run Go Tests (1.22, ubuntu-latest) (push) Waiting to run
Build + Test v3 alpha / Run Go Tests (1.22, windows-latest) (push) Waiting to run
Build + Test v3 alpha / Run JS Tests (20.x) (push) Waiting to run
Build + Test v3 alpha / Test Templates (1.23, macos-latest, lit) (push) Blocked by required conditions
Build + Test v3 alpha / Test Templates (1.23, macos-latest, lit-ts) (push) Blocked by required conditions
Build + Test v3 alpha / Test Templates (1.23, macos-latest, preact) (push) Blocked by required conditions
Build + Test v3 alpha / Test Templates (1.23, macos-latest, preact-ts) (push) Blocked by required conditions
Build + Test v3 alpha / Test Templates (1.23, macos-latest, react) (push) Blocked by required conditions
Build + Test v3 alpha / Test Templates (1.23, macos-latest, react-ts) (push) Blocked by required conditions
Build + Test v3 alpha / Test Templates (1.23, macos-latest, svelte) (push) Blocked by required conditions
Build + Test v3 alpha / Test Templates (1.23, macos-latest, svelte-ts) (push) Blocked by required conditions
Build + Test v3 alpha / Test Templates (1.23, macos-latest, vanilla) (push) Blocked by required conditions
Build + Test v3 alpha / Test Templates (1.23, macos-latest, vanilla-ts) (push) Blocked by required conditions
Build + Test v3 alpha / Test Templates (1.23, macos-latest, vue) (push) Blocked by required conditions
Build + Test v3 alpha / Test Templates (1.23, macos-latest, vue-ts) (push) Blocked by required conditions
Build + Test v3 alpha / Test Templates (1.23, ubuntu-latest, lit) (push) Blocked by required conditions
Build + Test v3 alpha / Test Templates (1.23, ubuntu-latest, lit-ts) (push) Blocked by required conditions
Build + Test v3 alpha / Test Templates (1.23, ubuntu-latest, preact) (push) Blocked by required conditions
Build + Test v3 alpha / Test Templates (1.23, ubuntu-latest, preact-ts) (push) Blocked by required conditions
Build + Test v3 alpha / Test Templates (1.23, ubuntu-latest, react) (push) Blocked by required conditions
Build + Test v3 alpha / Test Templates (1.23, ubuntu-latest, react-ts) (push) Blocked by required conditions
Build + Test v3 alpha / Test Templates (1.23, ubuntu-latest, svelte) (push) Blocked by required conditions
Build + Test v3 alpha / Test Templates (1.23, ubuntu-latest, svelte-ts) (push) Blocked by required conditions
Build + Test v3 alpha / Test Templates (1.23, ubuntu-latest, vanilla) (push) Blocked by required conditions
Build + Test v3 alpha / Test Templates (1.23, ubuntu-latest, vanilla-ts) (push) Blocked by required conditions
Build + Test v3 alpha / Test Templates (1.23, ubuntu-latest, vue) (push) Blocked by required conditions
Build + Test v3 alpha / Test Templates (1.23, ubuntu-latest, vue-ts) (push) Blocked by required conditions
Build + Test v3 alpha / Test Templates (1.23, windows-latest, lit) (push) Blocked by required conditions
Build + Test v3 alpha / Test Templates (1.23, windows-latest, lit-ts) (push) Blocked by required conditions
Build + Test v3 alpha / Test Templates (1.23, windows-latest, preact) (push) Blocked by required conditions
Build + Test v3 alpha / Test Templates (1.23, windows-latest, preact-ts) (push) Blocked by required conditions
Build + Test v3 alpha / Test Templates (1.23, windows-latest, react) (push) Blocked by required conditions
Build + Test v3 alpha / Test Templates (1.23, windows-latest, react-ts) (push) Blocked by required conditions
Build + Test v3 alpha / Test Templates (1.23, windows-latest, svelte) (push) Blocked by required conditions
Build + Test v3 alpha / Test Templates (1.23, windows-latest, svelte-ts) (push) Blocked by required conditions
Build + Test v3 alpha / Test Templates (1.23, windows-latest, vanilla) (push) Blocked by required conditions
Build + Test v3 alpha / Test Templates (1.23, windows-latest, vanilla-ts) (push) Blocked by required conditions
Build + Test v3 alpha / Test Templates (1.23, windows-latest, vue) (push) Blocked by required conditions
Build + Test v3 alpha / Test Templates (1.23, windows-latest, vue-ts) (push) Blocked by required conditions
/ publish (push) Waiting to run
Deploy to GitHub Pages / build (push) Waiting to run
Deploy to GitHub Pages / deploy (push) Blocked by required conditions
* feat: allow build with garble * docs: update * Updated docs --------- Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
72 lines
1.7 KiB
Go
72 lines
1.7 KiB
Go
//go:build !production
|
|
|
|
package application
|
|
|
|
import (
|
|
"github.com/go-git/go-git/v5"
|
|
"github.com/samber/lo"
|
|
"github.com/wailsapp/wails/v3/internal/version"
|
|
"path/filepath"
|
|
"runtime/debug"
|
|
)
|
|
|
|
// BuildSettings contains the build settings for the application
|
|
var BuildSettings map[string]string
|
|
|
|
// BuildInfo contains the build info for the application
|
|
var BuildInfo *debug.BuildInfo
|
|
|
|
func init() {
|
|
var ok bool
|
|
BuildInfo, ok = debug.ReadBuildInfo()
|
|
if !ok {
|
|
return
|
|
}
|
|
BuildSettings = lo.Associate(BuildInfo.Settings, func(setting debug.BuildSetting) (string, string) {
|
|
return setting.Key, setting.Value
|
|
})
|
|
}
|
|
|
|
// We use this to patch the application to production mode.
|
|
func newApplication(options Options) *App {
|
|
result := &App{
|
|
isDebugMode: true,
|
|
options: options,
|
|
}
|
|
result.init()
|
|
return result
|
|
}
|
|
|
|
func (a *App) logStartup() {
|
|
var args []any
|
|
|
|
// BuildInfo is nil when build with garble
|
|
if BuildInfo == nil {
|
|
return
|
|
}
|
|
|
|
wailsPackage, _ := lo.Find(BuildInfo.Deps, func(dep *debug.Module) bool {
|
|
return dep.Path == "github.com/wailsapp/wails/v3"
|
|
})
|
|
|
|
wailsVersion := version.String()
|
|
if wailsPackage != nil && wailsPackage.Replace != nil {
|
|
wailsVersion = "(local) => " + filepath.ToSlash(wailsPackage.Replace.Path)
|
|
// Get the latest commit hash
|
|
repo, err := git.PlainOpen(filepath.Join(wailsPackage.Replace.Path, ".."))
|
|
if err == nil {
|
|
head, err := repo.Head()
|
|
if err == nil {
|
|
wailsVersion += " (" + head.Hash().String()[:8] + ")"
|
|
}
|
|
}
|
|
}
|
|
args = append(args, "Wails", wailsVersion)
|
|
args = append(args, "Compiler", BuildInfo.GoVersion)
|
|
for key, value := range BuildSettings {
|
|
args = append(args, key, value)
|
|
}
|
|
|
|
a.info("Build Info:", args...)
|
|
}
|