mirror of
https://github.com/wavetermdev/wails.git
synced 2026-04-22 15:26:15 -07:00
Compare commits
100 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c24aef8ea1 | |||
| 91934d1f8e | |||
| 2f7293e25c | |||
| 18c76602b5 | |||
| 93491eb2eb | |||
| 2ded86c369 | |||
| f059c35d9e | |||
| 6e8d65e3aa | |||
| a750d2d507 | |||
| 331e0268a3 | |||
| e6424dc8ab | |||
| f923a431f7 | |||
| 00db626942 | |||
| eb0f22b4ee | |||
| e068e0f2f5 | |||
| 771594519f | |||
| ec44ca58f1 | |||
| cb574148eb | |||
| 771efa527f | |||
| 28e31c46c6 | |||
| c2fa4b6103 | |||
| 99ca6d5e77 | |||
| 876b845762 | |||
| e4122ce4d2 | |||
| 7bc51725c0 | |||
| 3d02a314b9 | |||
| 30a4f47cba | |||
| 668da3a827 | |||
| 322aad166b | |||
| 3decd70319 | |||
| 24857ec04b | |||
| a016f39e97 | |||
| 8699bf7521 | |||
| 34b303a86f | |||
| e39f3eba44 | |||
| de7f08357c | |||
| 9856d2979f | |||
| 082af614ff | |||
| 0c6864c7ed | |||
| dd20985952 | |||
| 0971857e7e | |||
| 6700a4e3bd | |||
| 6a5937bd90 | |||
| aa8a8f80f0 | |||
| e17f556c25 | |||
| c190aaeddc | |||
| 4d0b0947d2 | |||
| 4afbf00e45 | |||
| cd13a05270 | |||
| db9e0fd0d3 | |||
| 6a10bf4d98 | |||
| a624ee5e35 | |||
| be15644b96 | |||
| f3783c9800 | |||
| ac3808f9c3 | |||
| c5fb2b6143 | |||
| 4a89508b50 | |||
| 30deec4224 | |||
| 642fa42f25 | |||
| e713c439f0 | |||
| ac69577182 | |||
| 46389d04f0 | |||
| 3300a08c87 | |||
| 1db0ad6298 | |||
| 728739ed4c | |||
| 965187a8bb | |||
| aa88174c28 | |||
| 160b650833 | |||
| c5036187c2 | |||
| 736d8b6b04 | |||
| 7ede3ed08a | |||
| bb867832e1 | |||
| f3cc4b5ebd | |||
| c58252386f | |||
| a7e516a43d | |||
| d0feeb938c | |||
| 2c2e053bd1 | |||
| b7647b3992 | |||
| 1e5f8e03cb | |||
| 4f3c14f25b | |||
| 6c68e59113 | |||
| 6e30c6770b | |||
| a2d447aecf | |||
| 3bcddd5b4c | |||
| b11964f0eb | |||
| 1920a545f4 | |||
| 5c24f8bf83 | |||
| b1c2065dfb | |||
| ad28527a76 | |||
| 9d519a3a3f | |||
| fa6686361c | |||
| cab268212c | |||
| f5c3907fac | |||
| 4118f348f5 | |||
| 1e4af8991b | |||
| 02ea108bea | |||
| 46d3288a50 | |||
| 6aef92950a | |||
| cfcc6cfa1c | |||
| e96410e714 |
@@ -1,10 +1,9 @@
|
||||
name: Deploy mirror | 部署镜像
|
||||
name: Sync upstream branch and deploy mirror | 同步上游分支并部署镜像
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
# pull_request:
|
||||
# branches: [ main ]
|
||||
schedule:
|
||||
- cron: "0 8,20 * * *"
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build-and-deploy:
|
||||
@@ -20,6 +19,22 @@ jobs:
|
||||
submodules: true
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Git | 设置Git
|
||||
run: |
|
||||
git config --local user.email "i@misitebao.com"
|
||||
git config --local user.name "misitebao"
|
||||
|
||||
- name: Add remote upstream repository and sync | 添加远程上游仓库并同步
|
||||
run: |
|
||||
git remote add upstream https://github.com/wailsapp/wails
|
||||
git pull -v --progress --no-rebase "upstream" master
|
||||
|
||||
- name: Push | 推送
|
||||
uses: ad-m/github-push-action@master
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
branch: ${{ github.ref }}
|
||||
|
||||
- name: Build Site | 构建网站
|
||||
run: |
|
||||
cd website &&
|
||||
|
||||
@@ -2,7 +2,6 @@ package build
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/wailsapp/wails/v2/internal/colour"
|
||||
"io"
|
||||
"os"
|
||||
"os/exec"
|
||||
@@ -12,11 +11,13 @@ import (
|
||||
"text/tabwriter"
|
||||
"time"
|
||||
|
||||
"github.com/wailsapp/wails/v2/internal/colour"
|
||||
"github.com/wailsapp/wails/v2/internal/project"
|
||||
"github.com/wailsapp/wails/v2/internal/system"
|
||||
|
||||
"github.com/wailsapp/wails/v2/cmd/wails/internal"
|
||||
"github.com/wailsapp/wails/v2/internal/gomod"
|
||||
|
||||
"github.com/wailsapp/wails/v2/internal/system"
|
||||
|
||||
"github.com/leaanthony/clir"
|
||||
"github.com/leaanthony/slicer"
|
||||
"github.com/wailsapp/wails/v2/pkg/clilogger"
|
||||
@@ -49,8 +50,14 @@ func AddBuildSubcommand(app *clir.Cli, w io.Writer) {
|
||||
command.StringFlag("upxflags", "Flags to pass to upx", &compressFlags)
|
||||
|
||||
// Setup Platform flag
|
||||
platform := runtime.GOOS
|
||||
command.StringFlag("platform", "Platform to target", &platform)
|
||||
platform := runtime.GOOS + "/"
|
||||
if system.IsAppleSilicon {
|
||||
platform += "arm64"
|
||||
} else {
|
||||
platform += runtime.GOARCH
|
||||
}
|
||||
|
||||
command.StringFlag("platform", "Platform to target. Comma separate multiple platforms", &platform)
|
||||
|
||||
// Verbosity
|
||||
verbosity := 1
|
||||
@@ -103,28 +110,6 @@ func AddBuildSubcommand(app *clir.Cli, w io.Writer) {
|
||||
app.PrintBanner()
|
||||
}
|
||||
|
||||
// Check platform
|
||||
validPlatformArch := slicer.String([]string{
|
||||
"darwin",
|
||||
"darwin/amd64",
|
||||
"darwin/arm64",
|
||||
"darwin/universal",
|
||||
"linux",
|
||||
//"linux/amd64",
|
||||
//"linux/arm-7",
|
||||
"windows",
|
||||
"windows/amd64",
|
||||
"windows/arm64",
|
||||
})
|
||||
if !validPlatformArch.Contains(platform) {
|
||||
return fmt.Errorf("platform %s is not supported. Platforms supported: %s", platform, validPlatformArch.Join(","))
|
||||
}
|
||||
|
||||
if compress && platform == "darwin/universal" {
|
||||
logger.Println("Warning: compress flag unsupported for universal binaries. Ignoring.")
|
||||
compress = false
|
||||
}
|
||||
|
||||
// Lookup compiler path
|
||||
compilerPath, err := exec.LookPath(compilerCommand)
|
||||
if err != nil {
|
||||
@@ -174,6 +159,10 @@ func AddBuildSubcommand(app *clir.Cli, w io.Writer) {
|
||||
modeString = "Debug"
|
||||
}
|
||||
|
||||
var targets slicer.StringSlicer
|
||||
targets.AddSlice(strings.Split(platform, ","))
|
||||
targets.Deduplicate()
|
||||
|
||||
// Create BuildOptions
|
||||
buildOptions := &build.Options{
|
||||
Logger: logger,
|
||||
@@ -194,27 +183,13 @@ func AddBuildSubcommand(app *clir.Cli, w io.Writer) {
|
||||
WebView2Strategy: wv2rtstrategy,
|
||||
}
|
||||
|
||||
// Calculate platform and arch
|
||||
platformSplit := strings.Split(platform, "/")
|
||||
buildOptions.Platform = platformSplit[0]
|
||||
if system.IsAppleSilicon {
|
||||
buildOptions.Arch = "arm64"
|
||||
} else {
|
||||
buildOptions.Arch = runtime.GOARCH
|
||||
}
|
||||
if len(platformSplit) == 2 {
|
||||
buildOptions.Arch = platformSplit[1]
|
||||
}
|
||||
|
||||
// Start a new tabwriter
|
||||
w := new(tabwriter.Writer)
|
||||
w.Init(os.Stdout, 8, 8, 0, '\t', 0)
|
||||
|
||||
// Write out the system information
|
||||
fmt.Fprintf(w, "\n")
|
||||
fmt.Fprintf(w, "App Type: \t%s\n", buildOptions.OutputType)
|
||||
fmt.Fprintf(w, "Platform: \t%s\n", buildOptions.Platform)
|
||||
fmt.Fprintf(w, "Arch: \t%s\n", buildOptions.Arch)
|
||||
fmt.Fprintf(w, "Platforms: \t%s\n", platform)
|
||||
fmt.Fprintf(w, "Compiler: \t%s\n", compilerPath)
|
||||
fmt.Fprintf(w, "Build Mode: \t%s\n", modeString)
|
||||
fmt.Fprintf(w, "Skip Frontend: \t%t\n", skipFrontend)
|
||||
@@ -223,7 +198,7 @@ func AddBuildSubcommand(app *clir.Cli, w io.Writer) {
|
||||
fmt.Fprintf(w, "Clean Build Dir: \t%t\n", buildOptions.CleanBuildDirectory)
|
||||
fmt.Fprintf(w, "LDFlags: \t\"%s\"\n", buildOptions.LDFlags)
|
||||
fmt.Fprintf(w, "Tags: \t[%s]\n", strings.Join(buildOptions.UserTags, ","))
|
||||
if len(buildOptions.OutputFile) > 0 {
|
||||
if len(buildOptions.OutputFile) > 0 && targets.Length() == 1 {
|
||||
fmt.Fprintf(w, "Output File: \t%s\n", buildOptions.OutputFile)
|
||||
}
|
||||
fmt.Fprintf(w, "\n")
|
||||
@@ -234,30 +209,109 @@ func AddBuildSubcommand(app *clir.Cli, w io.Writer) {
|
||||
return err
|
||||
}
|
||||
|
||||
return doBuild(buildOptions)
|
||||
cwd, err := os.Getwd()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
projectOptions, err := project.Load(cwd)
|
||||
|
||||
// Check platform
|
||||
validPlatformArch := slicer.String([]string{
|
||||
"darwin",
|
||||
"darwin/amd64",
|
||||
"darwin/arm64",
|
||||
"darwin/universal",
|
||||
"linux",
|
||||
"linux/amd64",
|
||||
"linux/arm64",
|
||||
"windows",
|
||||
"windows/amd64",
|
||||
"windows/arm64",
|
||||
})
|
||||
|
||||
targets.Each(func(platform string) {
|
||||
|
||||
if !validPlatformArch.Contains(platform) {
|
||||
buildOptions.Logger.Println("platform '%s' is not supported - skipping. Supported platforms: %s", platform, validPlatformArch.Join(","))
|
||||
return
|
||||
}
|
||||
|
||||
desiredFilename := projectOptions.OutputFilename
|
||||
if desiredFilename == "" {
|
||||
desiredFilename = projectOptions.Name
|
||||
}
|
||||
desiredFilename = strings.TrimSuffix(desiredFilename, ".exe")
|
||||
|
||||
// Calculate platform and arch
|
||||
platformSplit := strings.Split(platform, "/")
|
||||
buildOptions.Platform = platformSplit[0]
|
||||
if system.IsAppleSilicon {
|
||||
buildOptions.Arch = "arm64"
|
||||
} else {
|
||||
buildOptions.Arch = runtime.GOARCH
|
||||
}
|
||||
if len(platformSplit) == 2 {
|
||||
buildOptions.Arch = platformSplit[1]
|
||||
}
|
||||
|
||||
banner := "Building target: " + platform
|
||||
logger.Println(banner)
|
||||
logger.Println(strings.Repeat("-", len(banner)))
|
||||
|
||||
if compress && platform == "darwin/universal" {
|
||||
logger.Println("Warning: compress flag unsupported for universal binaries. Ignoring.")
|
||||
compress = false
|
||||
}
|
||||
|
||||
switch buildOptions.Platform {
|
||||
case "darwin":
|
||||
if runtime.GOOS != "darwin" {
|
||||
logger.Println("Crosscompiling to Mac not currently supported.\n")
|
||||
return
|
||||
}
|
||||
macTargets := targets.Filter(func(platform string) bool {
|
||||
return strings.HasPrefix(platform, "darwin")
|
||||
})
|
||||
if macTargets.Length() == 2 {
|
||||
buildOptions.BundleName = fmt.Sprintf("%s-%s.app", desiredFilename, buildOptions.Arch)
|
||||
}
|
||||
}
|
||||
|
||||
if targets.Length() > 1 {
|
||||
// target filename
|
||||
switch buildOptions.Platform {
|
||||
case "windows":
|
||||
desiredFilename = fmt.Sprintf("%s-%s", desiredFilename, buildOptions.Arch)
|
||||
case "linux", "darwin":
|
||||
desiredFilename = fmt.Sprintf("%s-%s-%s", desiredFilename, buildOptions.Platform, buildOptions.Arch)
|
||||
}
|
||||
}
|
||||
if buildOptions.Platform == "windows" {
|
||||
desiredFilename += ".exe"
|
||||
}
|
||||
buildOptions.OutputFile = desiredFilename
|
||||
|
||||
// Start Time
|
||||
start := time.Now()
|
||||
|
||||
outputFilename, err := build.Build(buildOptions)
|
||||
if err != nil {
|
||||
logger.Println("Error: ", err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Subsequent iterations
|
||||
buildOptions.IgnoreFrontend = true
|
||||
buildOptions.CleanBuildDirectory = false
|
||||
|
||||
// Output stats
|
||||
buildOptions.Logger.Println(fmt.Sprintf("Built '%s' in %s.\n", outputFilename, time.Since(start).Round(time.Millisecond).String()))
|
||||
|
||||
})
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
// doBuild is our main build command
|
||||
func doBuild(buildOptions *build.Options) error {
|
||||
|
||||
// Start Time
|
||||
start := time.Now()
|
||||
|
||||
outputFilename, err := build.Build(buildOptions)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Output stats
|
||||
elapsed := time.Since(start)
|
||||
buildOptions.Logger.Println("")
|
||||
buildOptions.Logger.Println(fmt.Sprintf("Built '%s' in %s.", outputFilename, elapsed.Round(time.Millisecond).String()))
|
||||
buildOptions.Logger.Println("")
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func checkGoModVersion(logger *clilogger.CLILogger, updateGoMod bool) error {
|
||||
cwd, err := os.Getwd()
|
||||
if err != nil {
|
||||
|
||||
+3
-4
@@ -16,8 +16,7 @@ window.greet = function () {
|
||||
};
|
||||
|
||||
nameElement.onkeydown = function (e) {
|
||||
console.log(e)
|
||||
if (e.keyCode == 13) {
|
||||
window.greet()
|
||||
if (e.code === "Enter") {
|
||||
window.greet();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
package internal
|
||||
|
||||
var Version = "v2.0.0-beta.29"
|
||||
var Version = "v2.0.0-beta.30"
|
||||
|
||||
@@ -7,27 +7,27 @@ require (
|
||||
github.com/fatih/structtag v1.2.0
|
||||
github.com/flytam/filenamify v1.0.0
|
||||
github.com/fsnotify/fsnotify v1.4.9
|
||||
github.com/fsouza/go-dockerclient v1.7.8
|
||||
github.com/gabriel-vasile/mimetype v1.3.1
|
||||
github.com/go-git/go-billy/v5 v5.2.0 // indirect
|
||||
github.com/go-git/go-git/v5 v5.3.0
|
||||
github.com/gofiber/fiber/v2 v2.17.0
|
||||
github.com/gofiber/websocket/v2 v2.0.8
|
||||
github.com/golang/protobuf v1.5.2 // indirect
|
||||
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
|
||||
github.com/google/uuid v1.1.2 // indirect
|
||||
github.com/gorilla/websocket v1.4.1
|
||||
github.com/google/uuid v1.2.0 // indirect
|
||||
github.com/gorilla/websocket v1.4.2
|
||||
github.com/imdario/mergo v0.3.12
|
||||
github.com/jackmordaunt/icns v1.0.0
|
||||
github.com/leaanthony/clir v1.0.4
|
||||
github.com/leaanthony/debme v1.2.1
|
||||
github.com/leaanthony/go-ansi-parser v1.0.1
|
||||
github.com/leaanthony/go-common-file-dialog v1.0.3
|
||||
github.com/leaanthony/go-webview2 v1.0.2
|
||||
github.com/leaanthony/go-webview2 v1.0.3-0.20220125181555-00f20a61c17d
|
||||
github.com/leaanthony/gosod v1.0.3
|
||||
github.com/leaanthony/idgen v1.0.0
|
||||
github.com/leaanthony/slicer v1.5.0
|
||||
github.com/leaanthony/typescriptify-golang-structs v0.1.7
|
||||
github.com/leaanthony/winc v0.0.0-20220117090042-fdd739b32c58
|
||||
github.com/leaanthony/winc v0.0.0-20220208061147-37b059b9dc3b
|
||||
github.com/leaanthony/winicon v1.0.0
|
||||
github.com/matryer/is v1.4.0
|
||||
github.com/olekukonko/tablewriter v0.0.4
|
||||
@@ -40,21 +40,29 @@ require (
|
||||
github.com/tidwall/sjson v1.1.7
|
||||
github.com/wzshiming/ctc v1.2.3
|
||||
github.com/ztrue/tracerr v0.3.0
|
||||
golang.org/x/mod v0.4.1
|
||||
golang.org/x/net v0.0.0-20210510120150-4163338589ed
|
||||
golang.org/x/mod v0.4.2
|
||||
golang.org/x/net v0.0.0-20211216030914-fe4d6282115f
|
||||
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9
|
||||
golang.org/x/tools v0.1.0
|
||||
golang.org/x/tools v0.1.5
|
||||
nhooyr.io/websocket v1.8.6
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/Microsoft/go-winio v0.4.16 // indirect
|
||||
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
|
||||
github.com/Microsoft/go-winio v0.5.1 // indirect
|
||||
github.com/Microsoft/hcsshim v0.9.2 // indirect
|
||||
github.com/andybalholm/brotli v1.0.2 // indirect
|
||||
github.com/containerd/cgroups v1.0.3 // indirect
|
||||
github.com/containerd/containerd v1.6.0 // indirect
|
||||
github.com/docker/docker v20.10.12+incompatible // indirect
|
||||
github.com/docker/go-connections v0.4.0 // indirect
|
||||
github.com/docker/go-units v0.4.0 // indirect
|
||||
github.com/emirpasic/gods v1.12.0 // indirect
|
||||
github.com/fasthttp/websocket v0.0.0-20200320073529-1554a54587ab // indirect
|
||||
github.com/go-git/gcfg v1.5.0 // indirect
|
||||
github.com/go-ole/go-ole v1.2.6 // indirect
|
||||
github.com/google/go-cmp v0.5.5 // indirect
|
||||
github.com/gogo/protobuf v1.3.2 // indirect
|
||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
|
||||
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
|
||||
github.com/jchv/go-winloader v0.0.0-20210711035445-715c2860da7e // indirect
|
||||
github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 // indirect
|
||||
@@ -63,9 +71,17 @@ require (
|
||||
github.com/logrusorgru/aurora v0.0.0-20181002194514-a7b3b318ed4e // indirect
|
||||
github.com/mattn/go-runewidth v0.0.7 // indirect
|
||||
github.com/mitchellh/go-homedir v1.1.0 // indirect
|
||||
github.com/moby/sys/mount v0.2.0 // indirect
|
||||
github.com/moby/sys/mountinfo v0.5.0 // indirect
|
||||
github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6 // indirect
|
||||
github.com/morikuni/aec v1.0.0 // indirect
|
||||
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 // indirect
|
||||
github.com/opencontainers/go-digest v1.0.0 // indirect
|
||||
github.com/opencontainers/image-spec v1.0.2 // indirect
|
||||
github.com/opencontainers/runc v1.1.0 // indirect
|
||||
github.com/savsgio/gotils v0.0.0-20200117113501-90175b0fbe3f // indirect
|
||||
github.com/sergi/go-diff v1.1.0 // indirect
|
||||
github.com/sirupsen/logrus v1.8.1 // indirect
|
||||
github.com/tidwall/gjson v1.8.0 // indirect
|
||||
github.com/tidwall/match v1.0.3 // indirect
|
||||
github.com/tidwall/pretty v1.1.0 // indirect
|
||||
@@ -75,8 +91,10 @@ require (
|
||||
github.com/valyala/tcplisten v1.0.0 // indirect
|
||||
github.com/wzshiming/winseq v0.0.0-20200112104235-db357dc107ae // indirect
|
||||
github.com/xanzy/ssh-agent v0.3.0 // indirect
|
||||
golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a // indirect
|
||||
go.opencensus.io v0.23.0 // indirect
|
||||
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 // indirect
|
||||
golang.org/x/image v0.0.0-20201208152932-35266b937fa6 // indirect
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
|
||||
gopkg.in/warnings.v0 v0.1.2 // indirect
|
||||
gotest.tools/v3 v3.1.0 // indirect
|
||||
)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//go:build darwin && !bindings
|
||||
// +build darwin,!bindings
|
||||
|
||||
package appng
|
||||
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
//go:build debug
|
||||
// +build debug
|
||||
|
||||
package appng
|
||||
|
||||
func IsDebug() bool {
|
||||
return true
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
//go:build !dev && !production && !bindings && darwin
|
||||
// +build !dev,!production,!bindings,darwin
|
||||
|
||||
package appng
|
||||
|
||||
@@ -17,16 +18,5 @@ func (a *App) Run() error {
|
||||
|
||||
// CreateApp creates the app!
|
||||
func CreateApp(_ *options.App) (*App, error) {
|
||||
// result := w32.MessageBox(0,
|
||||
// `Wails applications will not build without the correct build tags.
|
||||
//Please use "wails build" or press "OK" to open the documentation on how to use "go build"`,
|
||||
// "Error",
|
||||
// w32.MB_ICONERROR|w32.MB_OKCANCEL)
|
||||
// if result == 1 {
|
||||
// exec.Command("rundll32", "url.dll,FileProtocolHandler", "https://wails.io").Start()
|
||||
// }
|
||||
|
||||
err := fmt.Errorf(`Wails applications will not build without the correct build tags.`)
|
||||
|
||||
return nil, err
|
||||
return nil, fmt.Errorf(`Wails applications will not build without the correct build tags.`)
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//go:build !dev && !production && !bindings && linux
|
||||
// +build !dev,!production,!bindings,linux
|
||||
|
||||
package appng
|
||||
|
||||
@@ -17,16 +18,5 @@ func (a *App) Run() error {
|
||||
|
||||
// CreateApp creates the app!
|
||||
func CreateApp(_ *options.App) (*App, error) {
|
||||
// result := w32.MessageBox(0,
|
||||
// `Wails applications will not build without the correct build tags.
|
||||
//Please use "wails build" or press "OK" to open the documentation on how to use "go build"`,
|
||||
// "Error",
|
||||
// w32.MB_ICONERROR|w32.MB_OKCANCEL)
|
||||
// if result == 1 {
|
||||
// exec.Command("rundll32", "url.dll,FileProtocolHandler", "https://wails.io").Start()
|
||||
// }
|
||||
|
||||
err := fmt.Errorf(`Wails applications will not build without the correct build tags.`)
|
||||
|
||||
return nil, err
|
||||
return nil, fmt.Errorf(`Wails applications will not build without the correct build tags.`)
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//go:build !dev && !production && !bindings && windows
|
||||
// +build !dev,!production,!bindings,windows
|
||||
|
||||
package appng
|
||||
|
||||
|
||||
@@ -129,6 +129,7 @@ func CreateApp(appoptions *options.App) (*App, error) {
|
||||
|
||||
// Attach logger to context
|
||||
ctx = context.WithValue(ctx, "logger", myLogger)
|
||||
ctx = context.WithValue(ctx, "buildtype", "dev")
|
||||
|
||||
// Preflight checks
|
||||
err = PreflightChecks(appoptions, myLogger)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//go:build linux && !bindings
|
||||
// +build linux,!bindings
|
||||
|
||||
package appng
|
||||
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
//go:build !debug
|
||||
// +build !debug
|
||||
|
||||
package appng
|
||||
|
||||
func IsDebug() bool {
|
||||
return false
|
||||
}
|
||||
@@ -78,12 +78,19 @@ func CreateApp(appoptions *options.App) (*App, error) {
|
||||
ctx = context.WithValue(ctx, "events", eventHandler)
|
||||
messageDispatcher := dispatcher.NewDispatcher(myLogger, appBindings, eventHandler)
|
||||
|
||||
debug := IsDebug()
|
||||
ctx = context.WithValue(ctx, "debug", debug)
|
||||
// Attach logger to context
|
||||
if debug {
|
||||
ctx = context.WithValue(ctx, "logger", myLogger)
|
||||
ctx = context.WithValue(ctx, "buildtype", "debug")
|
||||
} else {
|
||||
ctx = context.WithValue(ctx, "buildtype", "production")
|
||||
}
|
||||
|
||||
appFrontend := desktop.NewFrontend(ctx, appoptions, myLogger, appBindings, messageDispatcher)
|
||||
eventHandler.AddFrontend(appFrontend)
|
||||
|
||||
// Attach logger to context
|
||||
ctx = context.WithValue(ctx, "logger", myLogger)
|
||||
|
||||
result := &App{
|
||||
ctx: ctx,
|
||||
frontend: appFrontend,
|
||||
@@ -91,13 +98,10 @@ func CreateApp(appoptions *options.App) (*App, error) {
|
||||
menuManager: menuManager,
|
||||
startupCallback: appoptions.OnStartup,
|
||||
shutdownCallback: appoptions.OnShutdown,
|
||||
debug: false,
|
||||
debug: debug,
|
||||
options: appoptions,
|
||||
}
|
||||
|
||||
result.options = appoptions
|
||||
|
||||
result.ctx = context.WithValue(result.ctx, "debug", result.debug)
|
||||
|
||||
return result, nil
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//go:build windows && !bindings
|
||||
// +build windows,!bindings
|
||||
|
||||
package appng
|
||||
|
||||
|
||||
@@ -129,7 +129,7 @@ func (b *Bindings) GenerateBackendTS(targetfile string) error {
|
||||
store := b.db.store
|
||||
var output bytes.Buffer
|
||||
|
||||
output.WriteString("interface go {\n")
|
||||
output.WriteString("export interface go {\n")
|
||||
|
||||
var sortedPackageNames slicer.StringSlicer
|
||||
for packageName := range store {
|
||||
@@ -201,6 +201,8 @@ declare global {
|
||||
|
||||
func goTypeToJSDocType(input string) string {
|
||||
switch true {
|
||||
case input == "interface{}":
|
||||
return "any"
|
||||
case input == "string":
|
||||
return "string"
|
||||
case input == "error":
|
||||
|
||||
@@ -56,6 +56,11 @@ func Test_goTypeToJSDocType(t *testing.T) {
|
||||
input: "bool",
|
||||
want: "boolean",
|
||||
},
|
||||
{
|
||||
name: "interface{}",
|
||||
input: "interface{}",
|
||||
want: "any",
|
||||
},
|
||||
{
|
||||
name: "[]byte",
|
||||
input: "[]byte",
|
||||
@@ -64,12 +69,12 @@ func Test_goTypeToJSDocType(t *testing.T) {
|
||||
{
|
||||
name: "[]int",
|
||||
input: "[]int",
|
||||
want: "Array.<number>",
|
||||
want: "Array<number>",
|
||||
},
|
||||
{
|
||||
name: "[]bool",
|
||||
input: "[]bool",
|
||||
want: "Array.<boolean>",
|
||||
want: "Array<boolean>",
|
||||
},
|
||||
{
|
||||
name: "anything else",
|
||||
|
||||
@@ -106,8 +106,8 @@ func (b BridgeClient) WindowFullscreen() {
|
||||
b.session.log.Info("WindowFullscreen unsupported in Bridge mode")
|
||||
}
|
||||
|
||||
func (b BridgeClient) WindowUnFullscreen() {
|
||||
b.session.log.Info("WindowUnFullscreen unsupported in Bridge mode")
|
||||
func (b BridgeClient) WindowUnfullscreen() {
|
||||
b.session.log.Info("WindowUnfullscreen unsupported in Bridge mode")
|
||||
}
|
||||
|
||||
func (b BridgeClient) WindowSetColour(colour int) {
|
||||
|
||||
@@ -2,11 +2,12 @@ package bridge
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/wailsapp/wails/v2/pkg/runtime"
|
||||
"os/exec"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/wailsapp/wails/v2/pkg/runtime"
|
||||
|
||||
"github.com/wailsapp/wails/v2/internal/messagedispatcher"
|
||||
|
||||
"github.com/wailsapp/wails/v2/internal/logger"
|
||||
@@ -126,7 +127,7 @@ func (d *DialogClient) WindowSetMaxSize(width int, height int) {
|
||||
func (d *DialogClient) WindowFullscreen() {
|
||||
}
|
||||
|
||||
func (d *DialogClient) WindowUnFullscreen() {
|
||||
func (d *DialogClient) WindowUnfullscreen() {
|
||||
}
|
||||
|
||||
func (d *DialogClient) WindowSetColour(colour int) {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user