-
Notifications
You must be signed in to change notification settings - Fork 4
/
Taskfile.yml
86 lines (72 loc) · 2.52 KB
/
Taskfile.yml
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
version: "3"
includes:
utils: "tools/yscope-dev-utils/taskfiles/utils.yml"
vars:
G_BUILD_DIR: "{{.ROOT_DIR}}/target"
G_LINT_VENV_DIR: "{{.G_BUILD_DIR}}/lint-venv"
G_PROJECT_VERSION:
sh: "mvn help:evaluate -Dexpression=project.version -q -DforceStdout"
tasks:
default:
deps: ["package-and-test"]
package-and-test: "mvn package"
package: "mvn package -DskipTests"
package-basic: "mvn package -DskipTests -Dmaven.javadoc.skip=true -Dmaven.source.skip"
jni-headers: "mvn generate-sources"
native-lib:
# NOTE: `validate` is necessary to remove spaces from the OS name
cmd: "mvn validate generate-resources assembly:single@assemble-lib-dir"
test:
cmds:
- task: "unit-tests"
- task: "integration-tests"
integration-tests:
env:
# Use a local directory for the Maven repo so that we can install the jar (for the integration
# tests to use) without affecting the user's environment.
# NOTE: Maven doesn't strip quotes around the value, but treats everything on the right hand
# side of the equals sign as the value; so we don't need to quote the path.
MAVEN_OPTS: "-Dmaven.repo.local={{.G_BUILD_DIR}}/repo"
cmds:
# NOTE: Since we're using a custom repo-directory, this will end up rebuilding the package.
- "mvn install -DskipTests"
- |-
cd "integration-tests/jar-load-native-lib"
mvn compile
mvn exec:java -Dexec.mainClass="com.yscope.clp.Main"
unit-tests: "mvn test"
lint:
deps: ["lint-venv"]
cmds:
- |-
. "{{.G_LINT_VENV_DIR}}/bin/activate"
yamllint \
--config-file "{{.ROOT_DIR}}/tools/yscope-dev-utils/lint-configs/.yamllint.yml" \
--strict \
.github \
Taskfile.yml
clean:
cmds: ["rm -rf '{{.G_BUILD_DIR}}' '{{.G_LINT_VENV_DIR}}'"]
lint-venv:
internal: true
vars:
CHECKSUM_FILE: "{{.G_BUILD_DIR}}/{{.TASK}}.md5"
OUTPUT_DIR: "{{.G_LINT_VENV_DIR}}"
sources: ["{{.TASKFILE}}", "lint-requirements.txt"]
generates: ["{{.CHECKSUM_FILE}}"]
deps:
- task: "utils:validate-checksum"
vars:
CHECKSUM_FILE: "{{.CHECKSUM_FILE}}"
DATA_DIR: "{{.OUTPUT_DIR}}"
cmds:
- task: "utils:create-venv"
vars:
LABEL: "lint"
OUTPUT_DIR: "{{.OUTPUT_DIR}}"
REQUIREMENTS_FILE: "lint-requirements.txt"
# This command must be last
- task: "utils:compute-checksum"
vars:
DATA_DIR: "{{.OUTPUT_DIR}}"
OUTPUT_FILE: "{{.CHECKSUM_FILE}}"