forked from ratfactor/ziglings
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
127 lines (104 loc) · 3.12 KB
/
Copy pathTaskfile.yml
File metadata and controls
127 lines (104 loc) · 3.12 KB
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
version: "3"
################################################################################################
# includes:
# basic:
# taskfile: ./packages/basic/Taskfile.yml
# dir: ./packages/basic/
################################################################################################
#
# global vars: https://taskfile.dev/#/usage?id=variables
#
vars:
VAR1: "some-var"
#
# global env: https://taskfile.dev/#/usage?id=environment-variables
#
env:
ENV1: testing-env
PATH: $PATH:$HOME/.local/bin
# env file:
dotenv:
- .env
################################################################################################
tasks:
init:
cmds:
- echo "os init"
- task: setup
# for macos + m1:
install:zig:dev:
cmds:
- mkdir -p $HOME/.local/bin/;
- cd $HOME/.local/bin/; curl -L https://ziglang.org/builds/zig-macos-aarch64-0.10.0-dev.2617+47c4d4450.tar.xz | tar -xJ --strip-components=1 -C .;
- chmod +x $HOME/.local/bin/zig;
- zig version
install:zig:
cmds:
- brew install zig
- zig version
- brew install xz # for zig zls
- mkdir $HOME/zls && cd $HOME/zls && curl -L https://github.com/zigtools/zls/releases/download/0.9.0/x86_64-macos.tar.xz | tar -xJ --strip-components=1 -C .
- chmod +x $HOME/zls/zls
- sudo $HOME/zls/zls configure
ignore_error: true
#
# ref: https://github.com/nektro/zigmod
#
install:tools:
cmds:
- task: install:zigmod:m1
#
# ref: https://github.com/nektro/zigmod
#
# for macos + intel cpu
install:zigmod:intel:
cmds:
- mkdir -p $HOME/.local/bin/;
# - export PATH=$HOME/.local/bin:$PATH;
- curl -L https://github.com/nektro/zigmod/releases/download/r80/zigmod-x86_64-macos -o $HOME/.local/bin/zigmod;
- chmod +x $HOME/.local/bin/zigmod;
- zigmod version
# for macos + m1 cpu
install:zigmod:m1:
cmds:
- mkdir -p $HOME/.local/bin/;
# - export PATH=$HOME/.local/bin:$PATH;
- curl -L https://github.com/nektro/zigmod/releases/download/r80/zigmod-aarch64-macos -o $HOME/.local/bin/zigmod;
- chmod +x $HOME/.local/bin/zigmod;
- zigmod version
docs:
cmds:
- open https://ziglang.org/zh/learn/
- open https://ziglang.org/documentation/0.9.1/
- open https://aquila.red/
new:
cmds:
- mkdir ${NEW_PACKAGE_NAME}; cd ${NEW_PACKAGE_NAME}; zig init-exe
dir: packages/
new:lib:
cmds:
- mkdir ${NEW_PACKAGE_NAME}; cd ${NEW_PACKAGE_NAME}; zig init-lib
dir: packages/
run:
cmds:
- cd ${NEW_PACKAGE_NAME}; zig build run
dir: packages/
build:lib:
cmds:
- cd ${NEW_PACKAGE_NAME}; zig build test
dir: packages/
dev:
cmds:
- echo "zig build ex"${EXERCISE_NO}
- zig build ${EXERCISE_NO}
dev:all:
cmds:
- zig build
clean:
cmds:
- rm -rf zig-cache/
###########################################################################
push:
cmds:
- git push origin solutions --tags
- repo_url=`git remote -v | grep origin | awk -F ":" '{print $2}' | awk -F ".git " '{print "https://github.com/"$1}'`; open $repo_url