This repository has been archived by the owner on Feb 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 262
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test SQL database runs on all 3 platforms and on centralized exchanges,
closes #317 (#320) * 1 - allow server command for UI to support compilation for non-native platform (bind file dependent) astilectron-bundler will not generate bind files for GOARM versions and not adding arm64 because of duplication of server_amd64.go file for now * 2 - separate bundler.json and bundler_all.json files based on different platforms for local and deploy modes * 3 - run server command by default when running Kelp root command if UI capabiity is enabled * 4 - script to autogenerate bundler.json file for native platform and for all platforms for maximum code reuse * 5 - remove windows.syso file after building UI for windows * 6 - change ccxt panic to a log line * 7 - remove windows.syso file for all builds if it exists
- Loading branch information
1 parent
2cb5732
commit a6ffc8c
Showing
8 changed files
with
110 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,4 @@ bin/ | |
gui/filesystem_vfsdata.go | ||
kelp.prefs | ||
bind_*.go | ||
bundler.json |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,11 +32,6 @@ const kelpPrefsDirectory = ".kelp" | |
const kelpAssetsPath = "/assets" | ||
const trayIconName = "[email protected]" | ||
|
||
var serverCmd = &cobra.Command{ | ||
Use: "server", | ||
Short: "Serves the Kelp GUI", | ||
} | ||
|
||
type serverInputs struct { | ||
port *uint16 | ||
dev *bool | ||
|
@@ -47,6 +42,8 @@ type serverInputs struct { | |
} | ||
|
||
func init() { | ||
hasUICapability = true | ||
|
||
options := serverInputs{} | ||
options.port = serverCmd.Flags().Uint16P("port", "p", 8000, "port on which to serve") | ||
options.dev = serverCmd.Flags().Bool("dev", false, "run in dev mode for hot-reloading of JS code") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package cmd | ||
|
||
import ( | ||
"log" | ||
|
||
"github.com/spf13/cobra" | ||
) | ||
|
||
var hasUICapability = false | ||
|
||
var serverCmd = &cobra.Command{ | ||
Use: "server", | ||
Short: "Serves the Kelp GUI", | ||
Run: func(ccmd *cobra.Command, args []string) { | ||
log.Printf("Kelp GUI Server unsupported in this version: %s [%s]\n", version, gitHash) | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package main | ||
|
||
import ( | ||
"encoding/json" | ||
"flag" | ||
"fmt" | ||
) | ||
|
||
var bundler = `{ | ||
"app_name": "Kelp", | ||
"icon_path_darwin": "resources/[email protected]", | ||
"icon_path_linux": "resources/[email protected]", | ||
"icon_path_windows": "resources/[email protected]", | ||
"bind": { | ||
"output_path": "./cmd", | ||
"package": "cmd" | ||
} | ||
}` | ||
|
||
var environments = `{ | ||
"environments": [ | ||
{"os": "darwin", "arch": "amd64"}, | ||
{"os": "linux", "arch": "amd64"}, | ||
{"os": "windows", "arch": "amd64"} | ||
] | ||
}` | ||
|
||
func main() { | ||
buildAllP := flag.Bool("a", false, "whether to build for all platforms (default builds only for native platform)") | ||
flag.Parse() | ||
buildAll := *buildAllP | ||
|
||
var bundlerJSON map[string]interface{} | ||
e := json.Unmarshal([]byte(bundler), &bundlerJSON) | ||
if e != nil { | ||
panic(e) | ||
} | ||
|
||
if buildAll { | ||
var environmentsJSON map[string]interface{} | ||
e := json.Unmarshal([]byte(environments), &environmentsJSON) | ||
if e != nil { | ||
panic(e) | ||
} | ||
|
||
for k, v := range environmentsJSON { | ||
bundlerJSON[k] = v | ||
} | ||
} | ||
|
||
jsonBytes, e := json.MarshalIndent(bundlerJSON, "", " ") | ||
if e != nil { | ||
panic(e) | ||
} | ||
jsonString := string(jsonBytes) | ||
fmt.Println(jsonString) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters