forked from Fantom-foundation/Artion-API-GraphQL
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
111 lines (81 loc) · 5.1 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# --------------------------------------------------------------------------
# Makefile for the Artion API GraphQL Server
#
# v0.1 (2020/03/09) - Initial version, base API server build.
# (c) Fantom Foundation, 2020
# --------------------------------------------------------------------------
# project related vars
PROJECT := $(shell basename "$(PWD)")
# go related vars
GO_BASE := $(shell pwd)
GO_BIN := $(CURDIR)/build
# compile time variables will be injected into the app
APP_VERSION := 1.1.0
BUILD_DATE := $(shell date)
BUILD_COMPILER := $(shell go version)
BUILD_COMMIT := $(shell git show --format="%H" --no-patch)
BUILD_COMMIT_TIME := $(shell git show --format="%cD" --no-patch)
build/artionapi: internal/graphql/schema/gen/schema.graphql
@go build -v \
-gcflags="all=-N -l" \
-ldflags="-X 'artion-api-graphql/cmd/artionapi/build.Version=$(APP_VERSION)' -X 'artion-api-graphql/cmd/artionapi/build.Time=$(BUILD_DATE)' -X 'artion-api-graphql/cmd/artionapi/build.Compiler=$(BUILD_COMPILER)' -X 'artion-api-graphql/cmd/artionapi/build.Commit=$(BUILD_COMMIT)' -X 'artion-api-graphql/cmd/artionapi/build.CommitTime=$(BUILD_COMMIT_TIME)'" \
-o $@ \
./cmd/artionapi
@touch "internal/graphql/schema/gen/schema.graphql"
test: internal/graphql/schema/gen/schema.graphql
go test ./...
internal/graphql/schema/gen/schema.graphql:
@bash tools/make_graphql_bundle.sh $@ internal/graphql/definition
internal/repository/rpc/contracts/Artion.go: internal/repository/rpc/contracts/abi/Artion.json
abigen --type Artion --pkg contracts --abi $< --out $@
internal/repository/rpc/contracts/FantomArtTradable.go: internal/repository/rpc/contracts/abi/FantomArtTradable.json
abigen --type FantomArtTradable --pkg contracts --abi $< --out $@
internal/repository/rpc/contracts/FantomMarketplace.go: internal/repository/rpc/contracts/abi/FantomMarketplace.json
abigen --type FantomMarketplace --pkg contracts --abi $< --out $@
internal/repository/rpc/contracts/FantomNFTFactory.go: internal/repository/rpc/contracts/abi/FantomNFTFactory.json
abigen --type FantomNFTFactory --pkg contracts --abi $< --out $@
internal/repository/rpc/contracts/FantomNFTTradable.go: internal/repository/rpc/contracts/abi/FantomNFTTradable.json
abigen --type FantomNFTTradable --pkg contracts --abi $< --out $@
internal/repository/rpc/contracts/FantomAuction.go: internal/repository/rpc/contracts/abi/FantomAuction.json
abigen --type FantomAuction --pkg contracts --abi $< --out $@
internal/repository/rpc/contracts/FantomAuctionV1.go: internal/repository/rpc/contracts/abi/FantomAuctionV1.json
abigen --type FantomAuctionV1 --pkg contracts --abi $< --out $@
internal/repository/rpc/contracts/FantomAuctionV2.go: internal/repository/rpc/contracts/abi/FantomAuctionV2.json
abigen --type FantomAuctionV2 --pkg contracts --abi $< --out $@
internal/repository/rpc/contracts/FantomTokenRegistry.go: internal/repository/rpc/contracts/abi/FantomTokenRegistry.json
abigen --type FantomTokenRegistry --pkg contracts --abi $< --out $@
internal/repository/rpc/contracts/Erc20.go: internal/repository/rpc/contracts/abi/Erc20.json
abigen --type Erc20 --pkg contracts --abi $< --out $@
internal/repository/rpc/contracts/RandomNumberOracle.go: internal/repository/rpc/contracts/abi/RandomNumberOracle.json
abigen --type RandomNumberOracle --pkg contracts --abi $< --out $@
internal/repository/rpc/contracts/RandomTrade.go: internal/repository/rpc/contracts/abi/RandomTrade.json
abigen --type RandomTrade --pkg contracts --abi $< --out $@
internal/repository/rpc/contracts/Erc721.go: internal/repository/rpc/contracts/abi/Erc721.json
abigen --type Erc721 --pkg contracts --abi $< --out $@
internal/repository/rpc/contracts/Erc1155.go: internal/repository/rpc/contracts/abi/Erc1155.json
abigen --type Erc1155 --pkg contracts --abi $< --out $@
internal/repository/rpc/contracts/FantomRoyaltyRegistry.go: internal/repository/rpc/contracts/abi/FantomRoyaltyRegistry.json
abigen --type FantomRoyaltyRegistry --pkg contracts --abi $< --out $@
db: db_observed db_status db_notifications
db_observed: doc/db/observed.json
mongoimport --db=artion --collection=observed --file=$<
db_status: doc/db/status.json
mongoimport --db=artion --collection=status --file=$<
db_notifications: doc/db/notification_tpl.json
mongoimport --db=artion --collection=notification_tpl --file=$<
db_colcats: doc/db/colcats.json
mongoimport --db=artionshared --collection=colcats --file=$<
db_collections: doc/db/collections.json
mongoimport --db=artionshared --collection=collections --file=$<
contracts:
solc --abi --bin --overwrite --optimize --optimize-runs=200 --metadata --hashes -o doc/contracts/build/ doc/contracts/PriceOracleProxy.sol
solc --abi --bin --overwrite --optimize --optimize-runs=200 --metadata --hashes -o doc/contracts/build/ doc/contracts/RandomNumberOracle.sol
solc --abi --bin --overwrite --optimize --optimize-runs=200 --metadata --hashes -o doc/contracts/build/ doc/contracts/RandomTrade.sol
.PHONY: build/artionapi internal/graphql/schema/gen/schema.graphql help test
all: help
help: Makefile
@echo
@echo "Choose a make command in "$(PROJECT)":"
@echo
@sed -n 's/^##//p' $< | column -t -s ':' | sed -e 's/^/ /'
@echo