-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(server): install air and add dev command for hotreload (#1337)
Co-authored-by: YuyaSoneda <[email protected]>
- Loading branch information
1 parent
189fdab
commit 42e2b7b
Showing
4 changed files
with
45 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# project root directory | ||
root = "." | ||
tmp_dir = "tmp" | ||
|
||
[build] | ||
# execute command | ||
cmd = "go build -o ./tmp/api ./cmd/reearth" | ||
bin = "tmp/api" | ||
full_bin = "tmp/api" | ||
delay = 1000 # ms | ||
stop_on_error = true | ||
send_interrupt = false | ||
kill_delay = 1000 # ms | ||
|
||
# include file extensions | ||
include_ext = ["go"] | ||
|
||
# exclude directories | ||
exclude_dir = ["e2e", "tmp"] | ||
|
||
# exclude files | ||
exclude_file = ["*_test.go"] | ||
|
||
[log] | ||
# Air log settings | ||
level = "debug" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,3 +28,4 @@ __debug_bin | |
!/.env.example | ||
/coverage.txt | ||
/web | ||
tmp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,8 @@ TEST_DIR ?= ./... | |
SCHEMATYPER := github.com/idubinskiy/schematyper | ||
MANIFEST_DIR := pkg/plugin/manifest | ||
|
||
default: help | ||
|
||
help: | ||
@echo "Usage:" | ||
@echo " make <target>" | ||
|
@@ -13,6 +15,8 @@ help: | |
@echo " failcheck Run unit tests with fail-fast and no parallel execution" | ||
@echo " e2e Run end-to-end tests" | ||
@echo " build Build the project" | ||
@echo " dev-install Install tools for make dev - behavior not confirmed in windows." | ||
@echo " dev Run the application with hot reloading" | ||
@echo " run-app Run the application" | ||
@echo " run-db Run the MongoDB database using Docker Compose" | ||
@echo " gql Generate GraphQL code include dataloader" | ||
|
@@ -34,6 +38,18 @@ e2e: | |
build: | ||
go build ./cmd/reearth | ||
|
||
AIR_BIN := $(shell which air) | ||
dev-install: | ||
ifndef AIR_BIN | ||
@echo "reflex is not installed. Installing..." | ||
@go install github.com/air-verse/[email protected] | ||
else | ||
@echo "air is already installed." | ||
endif | ||
|
||
dev: dev-install | ||
air | ||
|
||
run-app: | ||
go run ./cmd/reearth | ||
|
||
|
@@ -51,4 +67,4 @@ schematyper: | |
go run $(SCHEMATYPER) -o $(MANIFEST_DIR)/schema_translation.go --package manifest --prefix Translation ./schemas/plugin_manifest_translation.json | ||
go run $(SCHEMATYPER) -o $(MANIFEST_DIR)/schema_gen.go --package manifest ./schemas/plugin_manifest.json | ||
|
||
.PHONY: lint test failcheck e2e build run-app run-db gql mockuser schematyper | ||
.PHONY: lint test failcheck e2e build dev-install dev run-app run-db gql mockuser schematyper |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters