-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
63 lines (46 loc) · 2.55 KB
/
Makefile
File metadata and controls
63 lines (46 loc) · 2.55 KB
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
PROJECTNAME=$(shell basename "$(PWD)")
all: build
get:
@echo " > \033[32mDownloading & Installing all the modules...\033[0m "
go mod tidy && go mod download
fmt:
go fmt ./...
get-lint:
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s latest
lint:
golangci-lint run ./... --skip-files ".+_test.go"
build:
@echo " > \033[32mBuilding binary...\033[0m "
cd cmd/relay && go build -o ../../build/relay
cd cmd/solvault && go build -o ../../build/solvault
cd cmd/soltool && go build -o ../../build/soltool
install:
@echo " > \033[32mInstalling rtoken-relay...\033[0m "
cd cmd/relay && go install
cd cmd/solvault && go install
cd cmd/soltool && go install
## license: Adds license header to missing files.
license:
@echo " > \033[32mAdding license headers...\033[0m "
GO111MODULE=off go get -u github.com/google/addlicense
addlicense -c "Stafi Protocol" -f ./scripts/header.txt -y 2020 .
## Install dependency subkey
install-subkey:
curl https://getsubstrate.io -sSf | bash -s -- --fast
cargo install --force --git https://github.com/paritytech/substrate subkey
abi:
@echo " > \033[32mGenabi...\033[0m "
abigen --abi ./bindings/StakeERC20Portal/stakeportal_abi.json --pkg stake_erc20_portal --type StakeERC20Portal --out ./bindings/StakeERC20Portal/StakeERC20Portal.go
abigen --abi ./bindings/StakeERC20PortalWithRate/stakeportalwithrate_abi.json --pkg stake_erc20_portal_with_rate --type StakeERC20PortalWithRate --out ./bindings/StakeERC20PortalWithRate/StakeERC20PortalWithRate.go
abigen --abi ./bindings/StakePortalRate/stakeportalrate_abi.json --pkg stake_portal_rate --type StakePortalRate --out ./bindings/StakePortalRate/StakePortalRate.go
abigen --abi ./bindings/StakeNativePortal/stakenativeportal_abi.json --pkg stake_native_portal --type StakeNativePortal --out ./bindings/StakeNativePortal/StakeNativePortal.go
abigen --abi ./bindings/MultisigOnchain/multisigonchain_abi.json --pkg multisig_onchain --type MultisigOnchain --out ./bindings/MultisigOnchain/MultisigOnchain.go
abigen --abi ./bindings/Staking/staking_abi.json --pkg staking --type Staking --out ./bindings/Staking/Staking.go
abigen --abi ./bindings/RMaticStakeManager/StakeManager_abi.json --pkg rmatic_stake_manager --type RMaticStakeManager --out ./bindings/RMaticStakeManager/RMaticStakeManager.go
## Runs go test for all packages except the solidity bindings
test:
@echo " > \033[32mRunning tests...\033[0m "
go test `go list ./... | grep -v bindings | grep -v e2e`
clean:
rm -rf build/
.PHONY: help run build install license lint lint-fix get-lint abi