asticode / go-astilectron-demo

Discover the power of Astilectron through a demo app
MIT License
404 stars 83 forks source link

bind_linux_amd64.go very large make vscode slow #46

Closed nnttoo closed 5 years ago

nnttoo commented 5 years ago

as in the instructions, I deleted bind.go and built it successfully. after build will generate bind_linux_amd64.go has a very large size (300mb) this makes vscode slow, I tried exclude bind_linux_amd64.go from vscode, but this makes vscode give a warning that AssetDir is undefined.

can I not need to delete bind.go before build and put bind_linux_amd64.go in another folder after build?

asticode commented 5 years ago

When building the project I would do the following:

1) Create a temporary directory 2) Copy all project files in the temporary directory 3) Remove bind.go from the temporary directory 4) Run the go build command in the temporary directory

That way your IDE still detect bind.go functions and you don't have bind_linux_amd64.go that messes it up.

Does that make sense?

nnttoo commented 5 years ago

thank you for the instructions I made a script like this, I rename files bind.go and bind_linux_amd64.go instead of moving everything to another folder if bind_linux_amd64.go file exists, i use go build instead of astilectron-bundler -v because it's faster, do i do the right thing?

 #!/bin/sh 
mv bind.go bind.txt 
if [ -e bind_linux_amd64.txt ]
then 
mv bind_linux_amd64.txt bind_linux_amd64.go
go build -o "./output/Astilectrondemo"
echo "file ada build pake go build"
else
astilectron-bundler -v
echo "file gak ada build pake astilectron-bundler"
fi
mv bind_linux_amd64.go bind_linux_amd64.txt
mv bind.txt bind.go
asticode commented 5 years ago

Mmm I would simplify to:

#!/bin/sh 
mv bind.go bind.txt 
astilectron-bundler -v
rm bind_linux_amd64.go
mv bind.txt bind.go

since go build doesn't do all astilectron-bundler does

nnttoo commented 5 years ago

Thank you very much