forked from icon-project/xcall-multi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
69 lines (52 loc) · 2.91 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/make -f
DOCKER := $(shell which docker)
DOCKER_BUF := $(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace bufbuild/buf:1.9.0
PROJECT_NAME = $(shell git remote get-url origin | xargs basename -s .git)
export GO111MODULE = on
###############################################################################
### Protobuf ###
###############################################################################
protoVer=0.11.1
protoImageName=ghcr.io/cosmos/proto-builder:$(protoVer)
openJdkImage=adoptopenjdk/openjdk11
containerProtoGenGo=$(PROJECT_NAME)-proto-gen-go-$(protoVer)
containerProtoGenRust=$(PROJECT_NAME)-proto-gen-rust-$(protoVer)
containerOptimizedJar=$(PROJECT_NAME)-optimized-jar
containerProtoFmt=$(PROJECT_NAME)-proto-fmt-$(protoVer)
proto-all: proto-format proto-lint proto-gen
proto-format:
@echo "Formatting Protobuf files"
@if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoFmt}$$"; then docker start -a $(containerProtoFmt); else docker run --name $(containerProtoFmt) -v $(CURDIR):/workspace --workdir /workspace $(protoImageName) \
find ./ -name "*.proto" -exec clang-format -i {} \; ; fi
proto-lint:
@$(DOCKER_BUF) lint --error-format=json
proto-gen-go:
@echo "Generating Go Protobuf files"
@if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoGenGo}$$"; then docker start -a $(containerProtoGenGo); else docker run --name $(containerProtoGenGo) -v $(CURDIR):/workspace --workdir /workspace -d $(protoImageName) \
sh ./scripts/protocgen_go.sh; fi
proto-gen-rust:
@echo "Generating Rust Protobuf files"
@if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoGenRust}$$"; then docker start -a $(containerProtoGenRust); else docker run --name $(containerProtoGenRust) -v $(CURDIR):/workspace --workdir /workspace -d $(protoImageName) \
sh ./scripts/protocgen_rust.sh; fi
optimize-jar:
@echo "Generating optimized jar for ICON contracts"
@if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerOptimizedJar}$$"; then docker start -a ${containerOptimizedJar}; else docker run --name $(containerOptimizedJar) -v $(CURDIR):/workspace --workdir /workspace -d $(openJdkImage) \
sh ./scripts/optimize-jar.sh; fi
optimize-cosmwasm:
@echo "Generating optimized cosmwasm for Archway contracts"
sh ./scripts/optimize-cosmwasm.sh
build-solidity:
@echo "Build solidity contracts"
sh ./scripts/optimize-solc.sh build
build-solidity-docker:
@echo "Build solidity contracts"
docker-compose -f ./scripts/docker-compose.yml up solidity
build-java-docker:
@echo "Build java contracts"
docker-compose -f ./scripts/docker-compose.yml up java
build-wasm-docker:
@echo "Build wasm contracts"
docker-compose -f ./scripts/docker-compose.yml up wasm
gobuild:
go build .
.PHONY: proto-all proto-gen proto-gen-any proto-swagger-gen proto-format proto-lint proto-check-breaking proto-update-deps gobuild