Do not install gx unless user asks for it Build scripts should never touch user's environment. This patch intoduces existance and version check for gx and gx-go Prints nice error message if they are missing or outdated.
Do not install gx unless user asks for it Build scripts should never touch user's environment. This patch intoduces existance and version check for gx and gx-go Prints nice error message if they are missing or outdated. License: MIT Signed-off-by: Jakub Sztandera <kubuxu@gmail.com>
Jakub Sztandera committed
Feb 9, 2016 at 22:51 UTC
cd34b3d40581468332c7e790ef98722931562fc7
3 files changed
+16
-5
.travis.yml
+3
-1
@@ -13,7 +13,9 @@ env:
13
- TEST_NO_FUSE=1 TEST_VERBOSE=1 TEST_SUITE=test_go_expensive
14
- TEST_NO_FUSE=1 TEST_VERBOSE=1 TEST_SUITE=test_sharness_expensive
15
16
-install: make install
16
+install:
17
+ - make toolkit_upgrade
18
+ - make install
19
20
script:
21
- make $TEST_SUITE
Makefile
+12
-3
@@ -14,11 +14,19 @@ all: help
14
godep:
15
go get github.com/tools/godep
16
17
-gx:
17
+toolkit_upgrade: gx_upgrade gxgo_upgrade
18
+
19
+gx_upgrade:
20
go get -u github.com/whyrusleeping/gx
21
+
22
+gxgo_upgrade:
23
go get -u github.com/whyrusleeping/gx-go
24
21
-deps: gx
25
+gx_check:
26
+ @bin/check_gx_program "gx" "0.3" 'Upgrade or install gx using your package manager or run `make gx_upgrade`'
27
+ @bin/check_gx_program "gx-go" "0.2" 'Upgrade or install gx-go using your package manager or run `make gxgo_upgrade`'
28
+
29
+deps: gx_check
30
gx --verbose install --global
31
32
# saves/vendors third-party dependencies to Godeps/_workspace
@@ -42,7 +50,7 @@ clean:
50
uninstall:
51
cd cmd/ipfs && go clean -i -ldflags=$(ldflags)
52
45
-PHONY += all help godep install build nofuse clean uninstall
53
+PHONY += all help godep toolkit_upgrade gx_upgrade gxgo_upgrade gx_check deps vendor install build nofuse clean uninstall
54
55
##############################################################
56
# tests targets
@@ -98,6 +106,7 @@ PHONY += test test_short test_expensive
106
help:
107
@echo 'DEPENDENCY TARGETS:'
108
@echo ''
109
+ @echo ' deps - Download dependencies using gx'
110
@echo ' vendor - Create a Godep workspace of 3rd party dependencies'
111
@echo ''
112
@echo 'BUILD TARGETS:'
appveyor.yml
+1
-1
@@ -40,7 +40,7 @@ install:
40
# default file handles. Ensure a dummy file descriptor is opened with 'exec'.
41
#
42
build_script:
43
- - '%BASH% -lc "cd $APPVEYOR_BUILD_FOLDER; exec 0</dev/null; export PATH=$GOPATH/bin:$PATH; make nofuse"'
43
+ - '%BASH% -lc "cd $APPVEYOR_BUILD_FOLDER; exec 0</dev/null; export PATH=$GOPATH/bin:$PATH; make toolkit_upgrade; make nofuse"'
44
45
test_script:
46
- '%BASH% -lc "cd $APPVEYOR_BUILD_FOLDER; exec 0</dev/null; export PATH=$GOPATH/bin:$PATH; export GOFLAGS=''-tags nofuse''; export TEST_NO_FUSE=1; export TEST_VERBOSE=1; export TEST_SUITE=test_sharness_expensive; make $TEST_SUITE"'