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
Copy file name to clipboardExpand all lines: cmd/build.go
+52-46Lines changed: 52 additions & 46 deletions
Original file line number
Diff line number
Diff line change
@@ -28,17 +28,25 @@ var dotSlash = string([]byte{'.', filepath.Separator})
28
28
29
29
var (
30
30
// common build flages (shared with `hover run`)
31
-
buildTargetstring
32
-
buildGoFlutterBranchstring
33
-
buildCachePathstring
34
-
buildOpenGlVersionstring
35
-
buildEngineVersionstring
36
-
// TODO(GeertJohan): Separate the init code for the common build flags (run
37
-
// and build) into a function that's used for both buildCmd and runCmd. Also
38
-
// rename those to `compileFooBar`.
31
+
buildOrRunFlutterTargetstring
32
+
buildOrRunGoFlutterBranchstring
33
+
buildOrRunCachePathstring
34
+
buildOrRunOpenGlVersionstring
35
+
buildOrRunEngineVersionstring
36
+
buildOrRunDockerbool
37
+
)
38
+
39
+
funcinitCompileFlags(cmd*cobra.Command) {
40
+
cmd.PersistentFlags().StringVarP(&buildOrRunFlutterTarget, "target", "t", config.BuildTargetDefault, "The main entry-point file of the application.")
41
+
cmd.PersistentFlags().StringVarP(&buildOrRunGoFlutterBranch, "branch", "b", config.BuildBranchDefault, "The 'go-flutter' version to use. (@master or @v0.20.0 for example)")
42
+
cmd.PersistentFlags().StringVar(&buildOrRunCachePath, "cache-path", enginecache.DefaultCachePath(), "The path that hover uses to cache dependencies such as the Flutter engine .so/.dll")
43
+
cmd.PersistentFlags().StringVar(&buildOrRunOpenGlVersion, "opengl", config.BuildOpenGlVersionDefault, "The OpenGL version specified here is only relevant for external texture plugin (i.e. video_plugin).\nIf 'none' is provided, texture won't be supported. Note: the Flutter Engine still needs a OpenGL compatible context.")
44
+
cmd.PersistentFlags().StringVar(&buildOrRunEngineVersion, "engine-version", config.BuildEngineDefault, "The flutter engine version to use.")
45
+
cmd.PersistentFlags().BoolVar(&buildOrRunDocker, "docker", false, "Execute the go build and packaging in a docker container. The Flutter build is always run locally")
buildCmd.PersistentFlags().StringVarP(&buildTarget, "target", "t", config.BuildTargetDefault, "The main entry-point file of the application.")
55
-
buildCmd.PersistentFlags().StringVarP(&buildGoFlutterBranch, "branch", "b", config.BuildBranchDefault, "The 'go-flutter' version to use. (@master or @v0.20.0 for example)")
56
-
buildCmd.PersistentFlags().StringVar(&buildEngineVersion, "engine-version", config.BuildEngineDefault, "The flutter engine version to use.")
57
-
buildCmd.PersistentFlags().StringVar(&buildCachePath, "cache-path", enginecache.DefaultCachePath(), "The path that hover uses to cache dependencies such as the Flutter engine .so/.dll")
58
-
buildCmd.PersistentFlags().StringVar(&buildOpenGlVersion, "opengl", config.BuildOpenGlVersionDefault, "The OpenGL version specified here is only relevant for external texture plugin (i.e. video_plugin).\nIf 'none' is provided, texture won't be supported. Note: the Flutter Engine still needs a OpenGL compatible context.")
62
+
initCompileFlags(buildCmd)
63
+
59
64
buildCmd.PersistentFlags().StringVar(&buildVersionNumber, "version-number", "", "Override the version number used in build and packaging. You may use it with $(git describe --tags)")
60
65
buildCmd.PersistentFlags().BoolVar(&buildDebug, "debug", false, "Build a debug version of the app.")
61
-
buildCmd.PersistentFlags().BoolVar(&buildDocker, "docker", false, "Execute the go build and packaging in a docker container. The Flutter build is always run locally.")
62
66
buildCmd.PersistentFlags().BoolVar(&buildSkipEngineDownload, "skip-engine-download", false, "Skip donwloading the Flutter Engine and artifacts.")
63
67
buildCmd.PersistentFlags().BoolVar(&buildSkipFlutterBuildBundle, "skip-flutter-build-bundle", false, "Skip the 'flutter build bundle' step.")
64
68
buildCmd.AddCommand(buildLinuxCmd)
@@ -181,15 +185,15 @@ var buildWindowsMsiCmd = &cobra.Command{
Copy file name to clipboardExpand all lines: cmd/bumpversion.go
+9-7Lines changed: 9 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ import (
16
16
)
17
17
18
18
funcinit() {
19
-
upgradeCmd.Flags().StringVarP(&buildCachePath, "cache-path", "", enginecache.DefaultCachePath(), "The path that hover uses to cache dependencies such as the Flutter engine .so/.dll (defaults to the standard user cache directory)")
19
+
upgradeCmd.Flags().StringVarP(&buildOrRunCachePath, "cache-path", "", enginecache.DefaultCachePath(), "The path that hover uses to cache dependencies such as the Flutter engine .so/.dll (defaults to the standard user cache directory)")
20
20
upgradeCmd.Flags().MarkHidden("branch")
21
21
rootCmd.AddCommand(upgradeCmd)
22
22
}
@@ -37,10 +37,12 @@ var upgradeCmd = &cobra.Command{
runCmd.Flags().StringVarP(&buildTarget, "target", "t", config.BuildTargetDefault, "The main entry-point file of the application.")
33
-
runCmd.Flags().StringVarP(&buildGoFlutterBranch, "branch", "b", config.BuildBranchDefault, "The 'go-flutter' version to use. (@master or @v0.20.0 for example)")
34
-
// TODO: The variable buildCachePath is set twice, once during the setup of
35
-
// buildCmd, and once during the setup of runCmd. The last of the two will
36
-
// override the value with it's default, which leads to strange problems.
37
-
runCmd.Flags().StringVar(&buildCachePath, "cache-path", enginecache.DefaultCachePath(), "The path that hover uses to cache dependencies such as the Flutter engine .so/.dll (defaults to the standard user cache directory)")
38
-
runCmd.PersistentFlags().StringVar(&buildEngineVersion, "engine-version", "", "The flutter engine version to use.")
39
-
runCmd.Flags().StringVar(&buildOpenGlVersion, "opengl", config.BuildOpenGlVersionDefault, "The OpenGL version specified here is only relevant for external texture plugin (i.e. video_plugin).\nIf 'none' is provided, texture won't be supported. Note: the Flutter Engine still needs a OpenGL compatible context.")
30
+
initCompileFlags(runCmd)
40
31
41
32
runCmd.Flags().StringVar(&runInitialRoute, "route", "", "Which route to load when running the app.")
42
33
runCmd.Flags().StringVarP(&runObservatoryPort, "observatory-port", "", "50300", "The observatory port used to connect hover to VM services (hot-reload/debug/..)")
43
34
runCmd.Flags().BoolVar(&runOmitFlutterBundle, "omit-flutter", false, "Don't (re)compile the current Flutter project, useful when only working with Golang code (plugin)")
44
35
runCmd.Flags().BoolVar(&runOmitEmbedder, "omit-embedder", false, "Don't (re)compile 'go-flutter' source code, useful when only working with Dart code")
45
-
runCmd.Flags().BoolVar(&runDocker, "docker", false, "Execute the go build in a docker container. The Flutter build is always run locally")
0 commit comments