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
buildCmd.PersistentFlags().StringVarP(&buildTarget, "target", "t", "lib/main_desktop.dart", "The main entry-point file of the application.")
36
44
buildCmd.PersistentFlags().StringVarP(&buildManifest, "manifest", "m", "pubspec.yaml", "Flutter manifest file of the application.")
37
45
buildCmd.PersistentFlags().StringVarP(&buildBranch, "branch", "b", "", "The 'go-flutter' version to use. (@master or @v0.20.0 for example)")
38
46
buildCmd.PersistentFlags().BoolVar(&buildDebug, "debug", false, "Build a debug version of the app.")
39
47
buildCmd.PersistentFlags().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)")
48
+
buildCmd.PersistentFlags().BoolVar(&buildDocker, "docker", false, "Compile in Docker container only. No need to install go")
fmt.Printf("hover: Could not write Dockerfile: %v\n", err)
200
+
os.Exit(1)
201
+
}
202
+
}
203
+
err=dockerFile.Close()
204
+
iferr!=nil {
205
+
fmt.Printf("hover: Could not close Dockerfile: %v\n", err)
206
+
os.Exit(1)
207
+
}
208
+
fmt.Printf("hover: A Dockerfile for cross-compiling for %s has been created at %s. You can add it to git.\n", targetOS, filepath.Join(buildPath, "cross-compiling", targetOS))
Copy file name to clipboardExpand all lines: cmd/common.go
+16-2Lines changed: 16 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -19,13 +19,27 @@ func init() {
19
19
var (
20
20
goBinstring
21
21
flutterBinstring
22
+
dockerBinstring
22
23
)
23
24
24
25
funcinitBinaries() {
25
26
varerrerror
27
+
goAvailable:=false
28
+
dockerAvailable:=false
26
29
goBin, err=exec.LookPath("go")
27
-
iferr!=nil {
28
-
fmt.Println("hover: Failed to lookup `go` executable. Please install Go.\nhttps://golang.org/doc/install")
30
+
iferr==nil {
31
+
goAvailable=true
32
+
}
33
+
dockerBin, err=exec.LookPath("docker")
34
+
iferr==nil {
35
+
dockerAvailable=true
36
+
}
37
+
if!dockerAvailable&&!goAvailable {
38
+
fmt.Println("hover: Failed to lookup `go` and `docker` executable. Please install one of them:\nGo: https://golang.org/doc/install\nDocker: https://docs.docker.com/install")
39
+
os.Exit(1)
40
+
}
41
+
ifdockerAvailable&&!goAvailable&&!buildDocker {
42
+
fmt.Println("hover: Failed to lookup `go` executable. Please install go or add '--docker' to force running in Docker container.\nhttps://golang.org/doc/install")
Copy file name to clipboardExpand all lines: cmd/run.go
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -23,6 +23,7 @@ func init() {
23
23
runCmd.Flags().StringVarP(&runObservatoryPort, "observatory-port", "", "50300", "The observatory port used to connect hover to VM services (hot-reload/debug/..)")
24
24
runCmd.Flags().BoolVar(&buildOmitEmbedder, "omit-embedder", false, "Don't (re)compile 'go-flutter' source code, useful when only working with Dart code")
25
25
runCmd.Flags().BoolVar(&buildOmitFlutterBundle, "omit-flutter", false, "Don't (re)compile the current Flutter project, useful when only working with Golang code (plugin)")
26
+
runCmd.PersistentFlags().BoolVar(&buildDocker, "docker", false, "Compile and run in Docker container only. No need to install go")
0 commit comments