Support -debug for wails build

This commit is contained in:
Lea Anthony
2022-01-17 21:14:07 +11:00
parent e08cdc22d1
commit e96410e714
4 changed files with 21 additions and 1 deletions
+8
View File
@@ -0,0 +1,8 @@
//go:build debug
// +build debug
package appng
func IsDebug() bool {
return true
}
+8
View File
@@ -0,0 +1,8 @@
//go:build !debug
// +build !debug
package appng
func IsDebug() bool {
return false
}
+1 -1
View File
@@ -91,7 +91,7 @@ func CreateApp(appoptions *options.App) (*App, error) {
menuManager: menuManager,
startupCallback: appoptions.OnStartup,
shutdownCallback: appoptions.OnShutdown,
debug: false,
debug: IsDebug(),
}
result.options = appoptions
+4
View File
@@ -236,6 +236,10 @@ func (b *BaseBuilder) CompileProject(options *Options) error {
if options.Mode == Production || options.Mode == Debug {
tags.Add("production")
}
// This mode allows you to debug a production build (not dev build)
if options.Mode == Debug {
tags.Add("debug")
}
tags.Deduplicate()