2014-11-06 10:00:06 +03:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Wide package tool.
|
|
|
|
#
|
|
|
|
# Command:
|
|
|
|
# ./pkg.sh ${version} ${target}
|
|
|
|
# Example:
|
2015-04-15 12:45:24 +03:00
|
|
|
# ./pkg.sh 1.0.0 /home/daniel/1.0.0/
|
2014-11-06 10:00:06 +03:00
|
|
|
|
|
|
|
ver=$1
|
|
|
|
target=$2
|
2015-03-09 06:58:13 +03:00
|
|
|
list="conf doc i18n static views README.md TERMS.md LICENSE"
|
2014-11-06 10:00:06 +03:00
|
|
|
|
|
|
|
mkdir -p ${target}
|
|
|
|
|
|
|
|
echo version=${ver}
|
|
|
|
echo target=${target}
|
|
|
|
|
|
|
|
## darwin
|
|
|
|
os=darwin
|
|
|
|
|
|
|
|
export GOOS=${os}
|
|
|
|
export GOARCH=386
|
|
|
|
go build
|
2015-04-15 12:45:24 +03:00
|
|
|
go build github.com/88250/ide_stub
|
|
|
|
go build github.com/nsf/gocode
|
|
|
|
cp ${GOPATH}/bin/${GOOS}_${GOARCH}/ide_stub .
|
|
|
|
cp ${GOPATH}/bin/${GOOS}_${GOARCH}/gocode .
|
|
|
|
tar zcvf ${target}/wide-${ver}-${GOOS}-${GOARCH}.tar.gz ${list} ide_stub gocode wide --exclude-vcs --exclude='conf/*.go' --exclude='i18n/*.go'
|
|
|
|
rm -f wide ide_stub gocode
|
2014-11-06 10:00:06 +03:00
|
|
|
|
|
|
|
export GOOS=${os}
|
|
|
|
export GOARCH=amd64
|
|
|
|
go build
|
2015-04-15 12:45:24 +03:00
|
|
|
go build github.com/88250/ide_stub
|
|
|
|
go build github.com/nsf/gocode
|
|
|
|
cp ${GOPATH}/bin/${GOOS}_${GOARCH}/ide_stub .
|
|
|
|
cp ${GOPATH}/bin/${GOOS}_${GOARCH}/gocode .
|
|
|
|
tar zcvf ${target}/wide-${ver}-${GOOS}-${GOARCH}.tar.gz ${list} ide_stub gocode wide --exclude-vcs --exclude='conf/*.go' --exclude='i18n/*.go'
|
|
|
|
rm -f wide ide_stub gocode
|
2014-11-06 10:00:06 +03:00
|
|
|
|
|
|
|
## linux
|
|
|
|
os=linux
|
|
|
|
|
|
|
|
export GOOS=${os}
|
|
|
|
export GOARCH=386
|
|
|
|
go build
|
2015-04-15 12:45:24 +03:00
|
|
|
go build github.com/88250/ide_stub
|
|
|
|
go build github.com/nsf/gocode
|
|
|
|
cp ${GOPATH}/bin/${GOOS}_${GOARCH}/ide_stub .
|
|
|
|
cp ${GOPATH}/bin/${GOOS}_${GOARCH}/gocode .
|
|
|
|
tar zcvf ${target}/wide-${ver}-${GOOS}-${GOARCH}.tar.gz ${list} ide_stub gocode wide --exclude-vcs --exclude='conf/*.go' --exclude='i18n/*.go'
|
|
|
|
rm -f wide ide_stub gocode
|
2014-11-06 10:00:06 +03:00
|
|
|
|
|
|
|
export GOOS=${os}
|
|
|
|
export GOARCH=amd64
|
|
|
|
go build
|
2015-04-15 12:45:24 +03:00
|
|
|
go build github.com/88250/ide_stub
|
|
|
|
go build github.com/nsf/gocode
|
|
|
|
cp ${GOPATH}/bin/${GOOS}_${GOARCH}/ide_stub .
|
|
|
|
cp ${GOPATH}/bin/${GOOS}_${GOARCH}/gocode .
|
|
|
|
tar zcvf ${target}/wide-${ver}-${GOOS}-${GOARCH}.tar.gz ${list} ide_stub gocode wide --exclude-vcs --exclude='conf/*.go' --exclude='i18n/*.go'
|
|
|
|
rm -f wide ide_stub gocode
|
2014-11-06 10:00:06 +03:00
|
|
|
|
|
|
|
## windows
|
|
|
|
os=windows
|
|
|
|
|
|
|
|
export GOOS=${os}
|
|
|
|
export GOARCH=386
|
|
|
|
go build
|
2015-04-15 12:45:24 +03:00
|
|
|
go build github.com/88250/ide_stub
|
|
|
|
go build github.com/nsf/gocode
|
|
|
|
cp ${GOPATH}/bin/${GOOS}_${GOARCH}/ide_stub.exe .
|
|
|
|
cp ${GOPATH}/bin/${GOOS}_${GOARCH}/gocode.exe .
|
|
|
|
zip -r ${target}/wide-${ver}-${GOOS}-${GOARCH}.zip ${list} ide_stub.exe gocode.exe wide.exe --exclude=conf/*.go --exclude=i18n/*.go
|
|
|
|
rm -f wide.exe ide_stub.exe gocode.exe
|
2014-11-06 10:00:06 +03:00
|
|
|
|
|
|
|
export GOOS=${os}
|
|
|
|
export GOARCH=amd64
|
|
|
|
go build
|
2015-04-15 12:45:24 +03:00
|
|
|
go build github.com/88250/ide_stub
|
|
|
|
go build github.com/nsf/gocode
|
|
|
|
cp ${GOPATH}/bin/${GOOS}_${GOARCH}/ide_stub.exe .
|
|
|
|
cp ${GOPATH}/bin/${GOOS}_${GOARCH}/gocode.exe .
|
|
|
|
zip -r ${target}/wide-${ver}-${GOOS}-${GOARCH}.zip ${list} ide_stub.exe gocode.exe wide.exe --exclude=conf/*.go --exclude=i18n/*.go
|
|
|
|
rm -f wide.exe ide_stub.exe gocode.exe
|
|
|
|
|