-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yml
45 lines (39 loc) · 1.23 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
# https://taskfile.dev
version: "3"
tasks:
_generateImports:
internal: true
dir: "./src/"
cmds:
- mkdir -p {{.TYPE}}
- cp TMPL/TMPLSwapperDeployer.tmpl.sol {{.TYPE}}/{{.TYPE}}SwapperDeployer.gen.sol
- cp TMPL/TMPLSwapperBase.tmpl.sol {{.TYPE}}/{{.TYPE}}SwapperBase.gen.sol
- cp TMPL/For{{.CONSIDERATION}}Swapper.tmpl.sol {{.TYPE}}/{{.TYPE}}Swapper.gen.sol
- sed -i 's|TMPL|{{.TYPE}}|g' {{.TYPE}}/*.gen.sol
- sed -i 's|.tmpl.sol|.gen.sol|g' {{.TYPE}}/*.gen.sol
generateImports:
cmds:
- for: ['ERC721ForNative', 'MultiERC721ForNative']
task: _generateImports
vars:
TYPE: '{{.ITEM}}'
CONSIDERATION: 'Native'
- for: ['ERC721ForERC20', 'MultiERC721ForERC20']
task: _generateImports
vars:
TYPE: '{{.ITEM}}'
CONSIDERATION: 'ERC20'
generateSwapStructBoilerplate:
dir: "./src/"
preconditions:
- test ! -e {{.TYPE}}/{{.TYPE}}Swap.sol
cmds:
- < TMPL/TMPLSwap.sol sed 's|TMPL|{{.TYPE}}|g' > {{.TYPE}}/{{.TYPE}}Swap.sol
generateBoilerplate:
dir: "./src/"
cmds:
- mkdir -p {{.TYPE}}
- task: generateSwapStructBoilerplate
default:
cmds:
- task: generateImports