-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathMakefile
More file actions
107 lines (88 loc) · 3.81 KB
/
Makefile
File metadata and controls
107 lines (88 loc) · 3.81 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
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
# Repository versions and URLs
COSMOS_SDK_VERSION := v0.50.14-inj.9
COSMOS_SDK_REPO := https://github.com/InjectiveLabs/cosmos-sdk.git
INJECTIVE_CORE_VERSION := v1.19.0
INJECTIVE_CORE_REPO := https://github.com/InjectiveLabs/injective-core.git
INDEXER_VERSION := v1.19.0
INDEXER_REPO := https://github.com/InjectiveLabs/injective-indexer.git
IBC_GO_VERSION := v8.7.0-inj.4
IBC_GO_REPO := https://github.com/InjectiveLabs/ibc-go.git
COMETBFT_VERSION := v1.0.1-inj.7
COMETBFT_REPO := https://github.com/InjectiveLabs/cometbft.git
WASMD_VERSION := v0.53.3-inj.3
WASMD_REPO := https://github.com/InjectiveLabs/wasmd.git
PYTHON_SDK_VERSION := v1.14.0
PYTHON_SDK_REPO := https://github.com/InjectiveLabs/sdk-python.git
GO_SDK_VERSION := v1.61.0
GO_SDK_REPO := https://github.com/InjectiveLabs/sdk-go.git
# Temporary directories
TEMP_DIR := /tmp/injective-docs-repos
COSMOS_SDK_DIR := $(TEMP_DIR)/cosmos-sdk
INJECTIVE_CORE_DIR := $(TEMP_DIR)/injective-core
INDEXER_DIR := $(TEMP_DIR)/injective-indexer
IBC_GO_DIR := $(TEMP_DIR)/ibc-go
COMETBFT_DIR := $(TEMP_DIR)/cometbft
WASMD_DIR := $(TEMP_DIR)/wasmd
PYTHON_SDK_DIR := tmp-python-sdk
GO_SDK_DIR := tmp-go-sdk
clone-sdk-repos:
@echo "Cloning SDK repositories..."
@git clone -q --depth 1 --branch $(PYTHON_SDK_VERSION) $(PYTHON_SDK_REPO) $(PYTHON_SDK_DIR)
@git clone -q --depth 1 --branch $(GO_SDK_VERSION) $(GO_SDK_REPO) $(GO_SDK_DIR)
@echo "SDK repositories cloned successfully!"
clean-sdk-repos:
@echo "Cleaning up SDK repositories..."
@rm -rf $(PYTHON_SDK_DIR)
@rm -rf $(GO_SDK_DIR)
@echo "SDK repositories cleaned successfully!"
# Documentation targets
refresh-examples:
@$(MAKE) clone-sdk-repos
markdown-autodocs -c code-block -c json-to-html-table -o source/includes/*.md
@$(MAKE) clean-sdk-repos
# Internal targets without repository management
_update-errors:
@echo "Cleaning existing errors directory..."
@rm -rf source/json_tables/errors
@mkdir -p source/json_tables/errors
@echo "Generating errors JSON files..."
@cd $(INJECTIVE_CORE_DIR) && go run scripts/docs/document_error_codes_script.go -dest $(CURDIR)/source/json_tables/errors
@echo "Generating markdown documentation..."
@./scripts/generate_errors_md.sh
@echo "Error documentation update complete!"
_update-proto:
@echo "Generating proto JSON files..."
@./scripts/generate_proto_json_files.sh $(COSMOS_SDK_DIR) $(INJECTIVE_CORE_DIR) $(INDEXER_DIR) $(IBC_GO_DIR) $(COMETBFT_DIR) $(WASMD_DIR)
# Public targets with repository management
update-errors-documentation:
@$(MAKE) clone-repos
@$(MAKE) _update-errors
@$(MAKE) clean-repos
update-proto-json:
@$(MAKE) clone-repos
@$(MAKE) _update-proto
@$(MAKE) clean-repos
# Repository management targets
clone-repos:
@echo "Cloning repositories..."
@rm -rf $(TEMP_DIR)
@mkdir -p $(TEMP_DIR)
@git clone -q --depth 1 --branch $(COSMOS_SDK_VERSION) $(COSMOS_SDK_REPO) $(COSMOS_SDK_DIR)
@git clone -q --depth 1 --branch $(INJECTIVE_CORE_VERSION) $(INJECTIVE_CORE_REPO) $(INJECTIVE_CORE_DIR)
@git clone -q --depth 1 --branch $(INDEXER_VERSION) $(INDEXER_REPO) $(INDEXER_DIR)
@git clone -q --depth 1 --branch $(IBC_GO_VERSION) $(IBC_GO_REPO) $(IBC_GO_DIR)
@git clone -q --depth 1 --branch $(COMETBFT_VERSION) $(COMETBFT_REPO) $(COMETBFT_DIR)
@git clone -q --depth 1 --branch $(WASMD_VERSION) $(WASMD_REPO) $(WASMD_DIR)
clean-repos:
@echo "Cleaning up repositories..."
@rm -rf $(TEMP_DIR)
# Combined documentation update target
update-all-proto-related-files:
@$(MAKE) clone-repos
@echo "Updating all documentation..."
@$(MAKE) -s _update-proto
@$(MAKE) -s _update-errors
@$(MAKE) clean-repos
@echo "All documentation has been updated successfully!"
# Declare all phony targets at once
.PHONY: refresh-examples update-errors-documentation update-proto-json clone-repos clean-repos clone-sdk-repos clean-sdk-repos update-all-docs _update-errors _update-proto update-all-proto-related-files