-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
41 lines (33 loc) · 1.34 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
.DEFAULT_GOAL := build
.PHONY: clean clean-dist dist
HARNESS_CLI_ROOT := $(abspath $(dir $(lastword $(MAKEFILE_LIST))))
PYTHON_SDK_DIR := $(HARNESS_CLI_ROOT)/python-sdk
HARNESS_CLI_DIR := $(HARNESS_CLI_ROOT)/harness-cli
DIST ?= ./dist
# not sure where to get the version number so hard code?
# the version number of the sdk is in the python code and not to be used as the cli version number
# we should mirror the harness version number here
VERSION := 0.6.0
# For containers use the "dist" target
# to install on a host OS, use the "install" target or "dist install"
clean:
find $(HARNESS_CLI_ROOT) -name "__pycache__" -exec rm -r {} \; || true
clean-dist:
cd $(DIST) && ls -1A | xargs rm -r || true
dist: clean clean-dist build
mkdir -p $(DIST) && cd $(DIST) && mkdir python-sdk harness-cli
cp -r $(PYTHON_SDK_DIR)/* $(DIST)/python-sdk/
cp $(HARNESS_CLI_DIR)/* $(DIST)/harness-cli/
#date > $(DIST)/RELEASE
# add the hard-coded version number to the date
#echo $(VERSION) >> $(DIST)/RELEASE
build:
mkdir -p $(DIST)
pip3 wheel --wheel-dir=$(DIST)/wheel $(PYTHON_SDK_DIR)
date > $(DIST)/RELEASE
# add the hard-coded version number to the date
echo $(VERSION) >> $(DIST)/RELEASE
echo $(VERSION) >> $(HARNESS_CLI_DIR)/RELEASE
# not needed for a container but used to re-install a new version on a host OS
install: build
pip3 install $(DIST)/wheel/*.whl