mirror of
https://github.com/taigrr/wails.git
synced 2026-04-16 19:55:05 -07:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
670b769f82 | ||
|
|
eb53399824 | ||
|
|
24e4fbfb68 | ||
|
|
7f54ca4ac3 | ||
|
|
b224803e4d | ||
|
|
28b2025aaa | ||
|
|
77e85705d1 | ||
|
|
9fd24595c7 |
File diff suppressed because one or more lines are too long
@@ -5,11 +5,11 @@ import (
|
|||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"path"
|
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"runtime"
|
"runtime"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
mewn "github.com/leaanthony/mewn"
|
||||||
"github.com/leaanthony/slicer"
|
"github.com/leaanthony/slicer"
|
||||||
"github.com/leaanthony/spinner"
|
"github.com/leaanthony/spinner"
|
||||||
)
|
)
|
||||||
@@ -77,7 +77,13 @@ func BuildApplication(binaryName string, forceRebuild bool, buildMode string, pa
|
|||||||
packSpinner.Start()
|
packSpinner.Start()
|
||||||
|
|
||||||
buildCommand := slicer.String()
|
buildCommand := slicer.String()
|
||||||
buildCommand.AddSlice([]string{"mewn", "build"})
|
buildCommand.Add("mewn")
|
||||||
|
|
||||||
|
if buildMode == BuildModeBridge {
|
||||||
|
// Ignore errors
|
||||||
|
buildCommand.Add("-i")
|
||||||
|
}
|
||||||
|
buildCommand.Add("build")
|
||||||
|
|
||||||
if binaryName != "" {
|
if binaryName != "" {
|
||||||
buildCommand.Add("-o")
|
buildCommand.Add("-o")
|
||||||
@@ -240,10 +246,10 @@ func InstallFrontendDeps(projectDir string, projectOptions *ProjectOptions, forc
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Copy bridge to project
|
// Copy bridge to project
|
||||||
_, filename, _, _ := runtime.Caller(1)
|
bridgeAssets := mewn.Group("../wailsruntimeassets/bridge/")
|
||||||
bridgeFileSource := filepath.Join(path.Dir(filename), "..", "..", "wailsruntimeassets", "bridge", bridgeFile)
|
bridgeFileData := bridgeAssets.Bytes(bridgeFile)
|
||||||
bridgeFileTarget := filepath.Join(projectDir, projectOptions.FrontEnd.Dir, projectOptions.FrontEnd.Bridge, "wailsbridge.js")
|
bridgeFileTarget := filepath.Join(projectDir, projectOptions.FrontEnd.Dir, projectOptions.FrontEnd.Bridge, "wailsbridge.js")
|
||||||
err = fs.CopyFile(bridgeFileSource, bridgeFileTarget)
|
err = fs.CreateFile(bridgeFileTarget, bridgeFileData)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,12 +11,15 @@ func basic() string {
|
|||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
||||||
|
js := mewn.String("./frontend/dist/app.js")
|
||||||
|
css := mewn.String("./frontend/dist/app.css")
|
||||||
|
|
||||||
app := wails.CreateApp(&wails.AppConfig{
|
app := wails.CreateApp(&wails.AppConfig{
|
||||||
Width: 1024,
|
Width: 1024,
|
||||||
Height: 768,
|
Height: 768,
|
||||||
Title: "{{.Name}}",
|
Title: "{{.Name}}",
|
||||||
JS: mewn.String("./frontend/dist/app.js"),
|
JS: js,
|
||||||
CSS: mewn.String("./frontend/dist/app.css"),
|
CSS: css,
|
||||||
Colour: "#131313",
|
Colour: "#131313",
|
||||||
})
|
})
|
||||||
app.Bind(basic)
|
app.Bind(basic)
|
||||||
|
|||||||
@@ -2,4 +2,4 @@ package cmd
|
|||||||
|
|
||||||
// Version - Wails version
|
// Version - Wails version
|
||||||
// ...oO(There must be a better way)
|
// ...oO(There must be a better way)
|
||||||
const Version = "v0.9.8"
|
const Version = "v0.10.0"
|
||||||
|
|||||||
Reference in New Issue
Block a user