-
Notifications
You must be signed in to change notification settings - Fork 2.8k
/
Makefile
51 lines (38 loc) · 1.43 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
# Makefile for running typical developer workflow actions.
# To run actions in a subdirectory of the repo:
# make lint build dir=translate/snippets
# Note: testing requires Application Default Credentials.
# For details about ADC, see https://cloud.google.com/docs/authentication/application-default-credentials
INTERFACE_ACTIONS="build test lint"
.ONESHELL: #ease subdirectory work by using the same subshell for all commands
.-PHONY: *
# Default to current dir if not specified.
dir ?= $(shell pwd)
# GOOGLE_SAMPLES_PROJECT takes precedence over GOOGLE_CLOUD_PROJECT
PROJECT_ID = ${GOOGLE_SAMPLES_PROJECT}
ifeq ("${PROJECT_ID}", "")
PROJECT_ID = ${GOOGLE_CLOUD_PROJECT}
endif
# export our project ID as GOOGLE_CLOUD_PROJECT in the action environment
override GOOGLE_CLOUD_PROJECT := ${PROJECT_ID}
export GOOGLE_CLOUD_PROJECT
build:
cd ${dir}
mvn compile
test: check-env build
cd ${dir}
mvn --quiet --batch-mode --fail-at-end clean verify \
-Dfile.encoding="UTF-8" \
-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \
-Dmaven.test.redirectTestOutputToFile=true \
-Dbigtable.projectID="${GOOGLE_CLOUD_PROJECT}" \
-Dbigtable.instanceID=instance
lint:
cd ${dir}
mvn -P lint checkstyle:check
check-env:
ifeq ("${PROJECT_ID}", "")
$(error At least one of the following env vars must be set: GOOGLE_SAMPLES_PROJECT, GOOGLE_CLOUD_PROJECT.)
endif
list-actions:
@ echo ${INTERFACE_ACTIONS}