Skip to content

Commit d501434

Browse files
committed
chore(Makefile): update tools
- Refactor Makefile
1 parent d5144b7 commit d501434

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

Makefile

+13-5
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,29 @@ BUF_VERSION := 0.43.2
2828

2929
.PHONY: install
3030
install: install.buf ## install buf, protoc, protoc-gen for Go & Dart
31+
make install.protoc
32+
make install.go
33+
make install.dart
34+
35+
.PHONY: install.protoc
36+
install.protoc: ## install Protoc dependencies
3137
curl -OL $(PROTOC_FULL_URL)
3238
unzip -o $(PROTOC_FILE) -d $(BIN_INSTALL_DIR)/../
3339
export PATH="$${PATH}:$(BIN_INSTALL_DIR)"
3440
rm -f protoc-*.zip
35-
make install.go
36-
flutter pub global activate protoc_plugin
37-
make install.dart
3841

3942
.PHONY: install.dart
4043
install.dart: ## install Dart dependencies
44+
flutter pub global activate protoc_plugin
4145
cd client && flutter pub get
4246

4347
.PHONY: install.go
44-
install.go: ## install go with dependencies
45-
cd server && go mod download && grep _ ./cmd/tools/tools.go | cut -d' ' -f2 | sed 's/\r//' | xargs go install && go mod tidy
48+
install.go: install.go.notidy ## install go with dependencies
49+
cd server && go mod tidy
50+
51+
.PHONY: install.go.notidy
52+
install.go.notidy: ## install go with dependencies but no tidy
53+
cd server && go mod download && grep _ ./cmd/tools/tools.go | cut -d' ' -f2 | sed 's/\r//' | xargs go install
4654
cd dbctl && go mod download
4755

4856
.PHONY: install.buf

tools/Dockerfile

+3-4
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,11 @@ COPY --from=golang:1.16 /usr/local/go/ /usr/local/go/
1313
# Install dependencies
1414
WORKDIR /workspace
1515
COPY ./client/pubspec.lock ./client/pubspec.yaml ./client/
16-
COPY ./server ./server/
17-
COPY ./dbctl ./dbctl/
16+
COPY ./server/go.* ./server/
17+
COPY ./dbctl/go.* ./dbctl/
1818
COPY Makefile .
1919

20-
RUN make install
21-
RUN cd dbctl && go mod download
20+
RUN make install.buf install.protoc install.go.notidy install.dart
2221
RUN rm -rf client server Makefile dbctl
2322

2423
# Install golangci-lint.

0 commit comments

Comments
 (0)