Skip to content

Commit e5b7b6c

Browse files
authored
Move examples to github.com/goadesign/examples (goadesign#2030)
* Move examples to goadesign/examples * Move examples to goadesign/examples * Remove example generation from Makefile As examples are now moved to github.com/goadesign/examples. * Test plugins and examples during Travis builds * Add build dependency required by go-getter * Cleanup after testing examples So that testing plugins doesn't test examples again.
1 parent 9d0e249 commit e5b7b6c

File tree

269 files changed

+28
-39571
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

269 files changed

+28
-39571
lines changed

.golint_exclude

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
^examples[/\].*
21
dsl[/\]http.go
32
expr[/\]http_response.go
43
codegen[/\]service[/\]testing[/\].*

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
language: go
22
go:
3-
- 1.11.x
3+
- 1.12.x
44
install:
55
- export PATH=${PATH}:${HOME}/gopath/bin
66
script:

Makefile

+27-57
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@ DIRS=$(shell go list -f {{.Dir}} goa.design/goa/expr/...)
1515
# Only list test and build dependencies
1616
# Standard dependencies are installed via go get
1717
DEPEND=\
18-
github.com/sergi/go-diff/diffmatchpatch \
1918
golang.org/x/lint/golint \
2019
golang.org/x/tools/cmd/goimports \
21-
github.com/hashicorp/go-getter \
2220
github.com/cheggaaa/pb \
21+
github.com/hashicorp/go-getter \
2322
github.com/golang/protobuf/protoc-gen-go \
2423
github.com/golang/protobuf/proto
24+
# github.com/sergi/go-diff/diffmatchpatch \
2525
26-
all: lint gen test
26+
all: lint test
2727

28-
travis: depend all build-examples clean
28+
travis: depend all test-examples test-plugins
2929

3030
# Install protoc
3131
GOOS=$(shell go env GOOS)
@@ -66,71 +66,41 @@ lint:
6666
echo "^ - Lint errors!" && echo && exit 1; \
6767
fi
6868

69-
gen:
70-
@cd cmd/goa && \
71-
go install && \
72-
rm -rf $(GOPATH)/src/goa.design/goa/examples/basic/cmd && \
73-
rm -rf $(GOPATH)/src/goa.design/goa/examples/cellar/cmd/cellar-cli && \
74-
rm -rf $(GOPATH)/src/goa.design/goa/examples/error/cmd && \
75-
rm -rf $(GOPATH)/src/goa.design/goa/examples/multipart/cmd && \
76-
rm -rf $(GOPATH)/src/goa.design/goa/examples/security/cmd && \
77-
goa gen goa.design/goa/examples/basic/design -o $(GOPATH)/src/goa.design/goa/examples/basic && \
78-
goa example goa.design/goa/examples/basic/design -o $(GOPATH)/src/goa.design/goa/examples/basic && \
79-
goa gen goa.design/goa/examples/cellar/design -o $(GOPATH)/src/goa.design/goa/examples/cellar && \
80-
goa example goa.design/goa/examples/cellar/design -o $(GOPATH)/src/goa.design/goa/examples/cellar && \
81-
goa gen goa.design/goa/examples/error/design -o $(GOPATH)/src/goa.design/goa/examples/error && \
82-
goa example goa.design/goa/examples/error/design -o $(GOPATH)/src/goa.design/goa/examples/error && \
83-
goa gen goa.design/goa/examples/multipart/design -o $(GOPATH)/src/goa.design/goa/examples/multipart && \
84-
goa example goa.design/goa/examples/multipart/design -o $(GOPATH)/src/goa.design/goa/examples/multipart && \
85-
goa gen goa.design/goa/examples/security/design -o $(GOPATH)/src/goa.design/goa/examples/security && \
86-
goa example goa.design/goa/examples/security/design -o $(GOPATH)/src/goa.design/goa/examples/security && \
87-
goa gen goa.design/goa/examples/streaming/design -o $(GOPATH)/src/goa.design/goa/examples/streaming && \
88-
goa example goa.design/goa/examples/streaming/design -o $(GOPATH)/src/goa.design/goa/examples/streaming
89-
90-
build-examples:
91-
@cd $(GOPATH)/src/goa.design/goa/examples/basic && \
92-
go build ./cmd/calc && go build ./cmd/calc-cli
93-
@cd $(GOPATH)/src/goa.design/goa/examples/cellar && \
94-
go build ./cmd/cellar && go build ./cmd/cellar-cli
95-
@cd $(GOPATH)/src/goa.design/goa/examples/error && \
96-
go build ./cmd/divider && go build ./cmd/divider-cli
97-
@cd $(GOPATH)/src/goa.design/goa/examples/multipart && \
98-
go build ./cmd/resume && go build ./cmd/resume-cli
99-
@cd $(GOPATH)/src/goa.design/goa/examples/security && \
100-
go build ./cmd/multi_auth && go build ./cmd/multi_auth-cli
101-
@cd $(GOPATH)/src/goa.design/goa/examples/streaming && \
102-
go build ./cmd/chatter && go build ./cmd/chatter-cli
103-
104-
clean:
105-
@cd $(GOPATH)/src/goa.design/goa/examples/basic && \
106-
rm -f calc calc-cli
107-
@cd $(GOPATH)/src/goa.design/goa/examples/cellar && \
108-
rm -f cellar cellar-cli
109-
@cd $(GOPATH)/src/goa.design/goa/examples/error && \
110-
rm -f divider divider-cli
111-
@cd $(GOPATH)/src/goa.design/goa/examples/multipart && \
112-
rm -f resume resume-cli
113-
@cd $(GOPATH)/src/goa.design/goa/examples/security && \
114-
rm -f multi_auth multi_auth-cli
115-
@cd $(GOPATH)/src/goa.design/goa/examples/streaming && \
116-
rm -f chatter chatter-cli
117-
11869
test:
11970
go test ./...
12071

12172
ifeq ($(GOOS),windows)
122-
PLUGINS_BRANCH="$(GOPATH)\src\goa.design\plugins"
73+
EXAMPLES_DIR="$(GOPATH)\src\goa.design\examples"
74+
else
75+
EXAMPLES_DIR="$(GOPATH)/src/goa.design/examples"
76+
endif
77+
test-examples:
78+
@if [ -z $(GOA_BRANCH) ]; then\
79+
GOA_BRANCH=$$(git rev-parse --abbrev-ref HEAD); \
80+
fi
81+
@if [ ! -d "$(GOPATH)/src/goa.design/examples" ]; then\
82+
git clone https://github.com/goadesign/examples.git $(EXAMPLES_DIR); \
83+
fi
84+
@cd $(EXAMPLES_DIR) && git checkout $(GOA_BRANCH) || echo "Using master branch in examples repo" && \
85+
make -k travis || (echo "Tests in examples repo (https://github.com/goadesign/examples) failed" \
86+
"due to changes in goa repo (branch: $(GOA_BRANCH))!" \
87+
"Create a branch with name '$(GOA_BRANCH)' in the examples repo and fix these errors." && exit 1)
88+
@rm -rf "$(GOPATH)/src/goa.design/examples"
89+
90+
ifeq ($(GOOS),windows)
91+
PLUGINS_DIR="$(GOPATH)\src\goa.design\plugins"
12392
else
124-
PLUGINS_BRANCH="$(GOPATH)/src/goa.design/plugins"
93+
PLUGINS_DIR="$(GOPATH)/src/goa.design/plugins"
12594
endif
12695
test-plugins:
12796
@if [ -z $(GOA_BRANCH) ]; then\
12897
GOA_BRANCH=$$(git rev-parse --abbrev-ref HEAD); \
12998
fi
13099
@if [ ! -d "$(GOPATH)/src/goa.design/plugins" ]; then\
131-
git clone https://github.com/goadesign/plugins.git $(PLUGINS_BRANCH); \
100+
git clone https://github.com/goadesign/plugins.git $(PLUGINS_DIR); \
132101
fi
133-
@cd $(PLUGINS_BRANCH) && git checkout $(GOA_BRANCH) || echo "Using master branch in plugins repo" && \
102+
@cd $(PLUGINS_DIR) && git checkout $(GOA_BRANCH) || echo "Using master branch in plugins repo" && \
134103
make -k test-plugins || (echo "Tests in plugin repo (https://github.com/goadesign/plugins) failed" \
135104
"due to changes in goa repo (branch: $(GOA_BRANCH))!" \
136105
"Create a branch with name '$(GOA_BRANCH)' in the plugin repo and fix these errors." && exit 1)
106+
@rm -rf "$(GOPATH)/src/goa.design/plugins"

examples/basic/README.md

-189
This file was deleted.

examples/basic/calc.go

-24
This file was deleted.

examples/basic/cmd/calc-cli/grpc.go

-18
This file was deleted.

0 commit comments

Comments
 (0)