forked from Netflix/hollow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
55 lines (40 loc) · 1.19 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
include .makefile.inc
.PHONY: venv build test clean all docs help
.DEFAULT_GOAL := help
SHELL = /bin/sh
PROJECT_NAME := $(SHELl basename $(CURDIR))
# Define access to common tools
GRADLE = ./gradlew
# Python
VENV_NAME ?= .venv
VENV_ACTIVATE = . $(VENV_NAME)/bin/activate
PYTHON = ${VENV_NAME}/bin/python3
PIP = ${VENV_NAME}/bin/pip
MKDOCS = ${VENV_NAME}/bin/mkdocs
venv: $(VENV_NAME)/bin/activate
$(VENV_NAME)/bin/activate: requirements.txt
test -d $(VENV_NAME) || virtualenv -p python3 $(VENV_NAME)
${PYTHON} -m pip install -Ur requirements.txt
touch $(VENV_NAME)/bin/activate
build: ## builds the project.
$(GRADLE) build
test: ## runs all tests.
$(GRADLE) testAll
clean: ## Cleans the project.
$(GRADLE) clean
site-build: venv ## Builds the doc site.
$(MKDOCS) build
site-serve: venv ## Serves the doc site locally
$(MKDOCS) serve
site-deploy: site-build ## Deploys the site to Github pages.
$(MKDOCS) gh-deploy
site-clean: venv ## Removes the site directory
rm -rf site
.PHONY: help
help: ## List all available commands.
${SHOW_IDENTITY}
@echo 'Usage:'
@echo '${BLUE}make${RESET} ${GREEN}<target>${RESET}'
@echo ''
@echo 'Targets:'
@perl -ne "$${HELP_SCRIPT}" $(MAKEFILE_LIST)