You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- fixes: go-flutter-desktop/go-flutter#169
- provide a `hover upgrade `command (like flutter upgrade)
- every 2 days a check is made to see if the current project tags uses the last
github release. if a new release is available print a message about
`hover upgrade`
- adds more debug message, 'bundling flutter', 'compiling
go-flutter', 'running project',...
- only print the 'channel beta' message if the user is on master,
if the user was on stable the message was printed for no reason.
The behaviour of `hover run` and `hover build` is the same as before
when `--branch` is provided.
But there is a little twist, if the current version is a valid release
(available on github), `hover run` will not overwrite the 'go-flutter'
version. Example:
```
$ hover run --branch '@v0.20.0'
$ hover run # no upgrade trigged running on v0.20.0, at some point you
# will get a `hover upgrade` notice
$ hover upgrade # user has to run to upgrade away from v0.20.0
$
$ hover run --branch '@master'
$ hover run # auto upgrade trigged! Not a real release.
# If the user hasn't access to internet, fail silently and
# keep using '@master'
```
To check every two days, a hidden file `./desktop/.last_goflutter_check`
is created on a project bases, the file contains a timestamps indicating
the last hover update check.
About the hover repo:
A empty go.mod file has been added to hover/assets/app/ this prevent adding
`go-flutter` as a go mod dependency. (because `go mod tidy` was peeking
listing hover/asset/options.go as a hover code file)
Copy file name to clipboardExpand all lines: cmd/build.go
+42-28Lines changed: 42 additions & 28 deletions
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,7 @@ import (
9
9
"runtime"
10
10
"strings"
11
11
12
+
version "github.com/hashicorp/go-version"
12
13
"github.com/otiai10/copy"
13
14
"github.com/spf13/cobra"
14
15
@@ -28,7 +29,7 @@ var (
28
29
funcinit() {
29
30
buildCmd.Flags().StringVarP(&buildTarget, "target", "t", "lib/main_desktop.dart", "The main entry-point file of the application.")
30
31
buildCmd.Flags().StringVarP(&buildManifest, "manifest", "m", "pubspec.yaml", "Flutter manifest file of the application.")
31
-
buildCmd.Flags().StringVarP(&buildBranch, "branch", "b", "", "The go-flutter-desktop/go-flutter branch to use when building the embedder. (@master for example)")
32
+
buildCmd.Flags().StringVarP(&buildBranch, "branch", "b", "", "The 'go-flutter' version to use. (@master for example)")
32
33
buildCmd.Flags().BoolVar(&buildDebug, "debug", false, "Build a debug version of the app.")
33
34
buildCmd.Flags().StringVarP(&buildCachePath, "cache-path", "", "", "The path that hover uses to cache dependencies such as the Flutter engine .so/.dll (defaults to the standard user cache directory)")
runCmd.Flags().StringVarP(&buildTarget, "target", "t", "lib/main_desktop.dart", "The main entry-point file of the application.")
21
21
runCmd.Flags().StringVarP(&buildManifest, "manifest", "m", "pubspec.yaml", "Flutter manifest file of the application.")
22
-
runCmd.Flags().StringVarP(&buildBranch, "branch", "b", "", "The go-flutter-desktop/go-flutter branch to use when building the embedder. (@master for example)")
22
+
runCmd.Flags().StringVarP(&buildBranch, "branch", "b", "", "The 'go-flutter' version to use. (@master for example)")
23
23
runCmd.Flags().StringVarP(&buildCachePath, "cache-path", "", "", "The path that hover uses to cache dependencies such as the Flutter engine .so/.dll (defaults to the standard user cache directory)")
upgradeCmd.Flags().StringVarP(&buildCachePath, "cache-path", "", "", "The path that hover uses to cache dependencies such as the Flutter engine .so/.dll (defaults to the standard user cache directory)")
16
+
upgradeCmd.Flags().MarkHidden("branch")
17
+
rootCmd.AddCommand(upgradeCmd)
18
+
}
19
+
20
+
varupgradeCmd=&cobra.Command{
21
+
Use: "upgrade",
22
+
Short: "upgrade the 'go-flutter' core library",
23
+
Run: func(cmd*cobra.Command, args []string) {
24
+
assertInFlutterProject()
25
+
// Hardcode target to the current OS (no cross-compile support yet)
0 commit comments