diff --git a/scripts/build_all.sh b/scripts/build_all.sh index c82567f80..2bfad6117 100755 --- a/scripts/build_all.sh +++ b/scripts/build_all.sh @@ -19,4 +19,10 @@ export GOARCH=amd64 "${__dir}/build_snap.sh" & "${__dir}/build_plugins.sh" & +export GOOS=windows +export GOARCH=amd64 +"${__dir}/build_snap.sh" & +"${__dir}/build_plugins.sh" & + + wait diff --git a/scripts/build_plugin.sh b/scripts/build_plugin.sh index 8ba0228ba..7838ec0d9 100755 --- a/scripts/build_plugin.sh +++ b/scripts/build_plugin.sh @@ -35,6 +35,9 @@ fi plugin_src_path=$1 plugin_name=$(basename "${plugin_src_path}") +if [[ "${GOOS}" == "windows" ]]; then + plugin_name="${plugin_name}.exe" +fi go_build=(go build -a -ldflags "-w") _debug "plugin source: ${plugin_src_path}" diff --git a/scripts/build_snap.sh b/scripts/build_snap.sh index ac0297862..11d275130 100755 --- a/scripts/build_snap.sh +++ b/scripts/build_snap.sh @@ -48,7 +48,14 @@ else build_path="${__proj_dir}/build/${GOOS}/${GOARCH}" fi +snaptel="snaptel" +snapteld="snapteld" +if [[ "${GOOS}" == "windows" ]]; then + snaptel="${snaptel}.exe" + snapteld="${snapteld}.exe" +fi + mkdir -p "${build_path}" -_info "building snapteld/snaptel for ${GOOS}/${GOARCH}" -"${go_build[@]}" -o "${build_path}/snapteld" . || exit 1 -(cd "${__proj_dir}/cmd/snaptel" && "${go_build[@]}" -o "${build_path}/snaptel" . || exit 1) +_info "building snapteld/${snaptel} for ${GOOS}/${GOARCH}" +"${go_build[@]}" -o "${build_path}/${snapteld}" . || exit 1 +(cd "${__proj_dir}/cmd/snaptel" && "${go_build[@]}" -o "${build_path}/${snaptel}" . || exit 1)