-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
67 lines (57 loc) · 1.99 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
# Make settings - @see https://tech.davis-hansson.com/p/make/
# Reminder: Make relies on the tab preceding commands; if your IDE replaces tabs spaces it could mess this up
SHELL := bash
.ONESHELL:
.SHELLFLAGS := -eu -o pipefail -c
.DELETE_ON_ERROR:
MAKEFLAGS += --warn-undefined-variables
MAKEFLAGS += --no-builtin-rules
# Log levels
DEBUG := $(shell printf "\e[2D\e[35m")
INFO := $(shell printf "\e[2D\e[36m🔵 ")
OK := $(shell printf "\e[2D\e[32m🟢 ")
WARN := $(shell printf "\e[2D\e[33m🟡 ")
ERROR := $(shell printf "\e[2D\e[31m🔴 ")
END := $(shell printf "\e[0m")
.PHONY: default
default: help
## help - Print help message.
.PHONY: help
help: Makefile
@echo "usage: make <target>"
@sed -n 's/^##//p' $<
## test-data
testDataDir := eppo/src/androidTest/assets
tempDir := ${testDataDir}/temp
gitDataDir := ${tempDir}/sdk-test-data
branchName := main
githubRepoLink := https://github.com/Eppo-exp/sdk-test-data.git
.PHONY: test-data
test-data:
rm -rf $(testDataDir)
mkdir -p $(tempDir)
git clone -b ${branchName} --depth 1 --single-branch ${githubRepoLink} ${gitDataDir}
cp ${gitDataDir}/ufc/flags-v1.json ${testDataDir}
cp ${gitDataDir}/ufc/flags-v1-obfuscated.json ${testDataDir}
cp -r ${gitDataDir}/ufc/tests ${testDataDir}
rm -rf ${tempDir}
## test
.PHONY: test
test: test-data
# $(INFO)Uninstalling old version of test app(END)
adb uninstall cloud.eppo.android.test
# $(INFO)Running tests(END)
./gradlew connectedCheck
check-maven-credentials-and-publish:
# $(INFO)Checking required gradle configuration(END)
@for required_property in "OSSRH_USERNAME" "OSSRH_PASSWORD"; do \
cat ~/.gradle/gradle.properties | grep -q $$required_property; \
if [ $$? != 0 ]; then \
echo "$(ERROR)ERROR: ~/.gradle/gradle.properties file is missing property: $$required_property$(END)"; \
exit 1; \
fi; \
done
# $(INFO)Publishing release(END)
./gradlew :eppo:publishReleasePublicationToMavenRepository
.PHONY: publish-release
publish-release: test check-maven-credentials-and-publish