Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Commit

Permalink
Kelp UI: package windows UI using cli instead of using astilectron-bu…
Browse files Browse the repository at this point in the history
…ndler (#401)

* 1 - package windows GUI with cli tool instead of using astilectron-bundler

* 2 - update kelp-start.bat to invoke the executable directly instead of via bash -c
  • Loading branch information
nikhilsaraf authored Apr 9, 2020
1 parent e6d89f7 commit 3cd3346
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
2 changes: 1 addition & 1 deletion gui/windows-bat-file/kelp-start.bat
Original file line number Diff line number Diff line change
@@ -1 +1 @@
bash -c "./Kelp.exe"
Kelp.exe
23 changes: 17 additions & 6 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -310,17 +310,28 @@ do
GOARCH=amd64
unset GOARM

# generate bundler.json for platform
gen_bundler_json -p $GOOS
echo "no need to generate bind files separately since we build using astilectron bundler directly for GUI"
# compile
echo -n "compiling UI for (GOOS=$GOOS, GOARCH=$GOARCH, FLAG=$FLAG) ... "
astilectron-bundler $FLAG -o $ARCHIVE_DIR_SOURCE_UI $LDFLAGS_UI
check_build_result $?
echo "successful"

if [[ $GOOS == "windows" ]]
then
gen_bind_files
# compile
# need to use cli tool for windows because building a GUI version will trigger the command prompt to open every time we invoke a "bash -c" command which is too frequent
echo -n "compiling UI for windows using cli tool instead of using astilectron-bundler (GOOS=$GOOS, GOARCH=$GOARCH) ... "
env GOOS=$GOOS GOARCH=$GOARCH GOARM=$GOARM go build -ldflags "$LDFLAGS" -o $ARCHIVE_DIR_SOURCE_UI/$GOOS-$GOARCH/kelp.exe
check_build_result $?
echo "successful"

echo -n "copying over kelp-start.bat file to the windows build ..."
cp $KELP/gui/windows-bat-file/kelp-start.bat $ARCHIVE_DIR_SOURCE_UI/$GOOS-$GOARCH/
echo "done"
else
# compile
echo "no need to generate bind files separately since we build using astilectron bundler directly for GUI"
astilectron-bundler $FLAG -o $ARCHIVE_DIR_SOURCE_UI $LDFLAGS_UI
check_build_result $?
echo "successful"
fi

# archive
Expand Down

0 comments on commit 3cd3346

Please sign in to comment.