blob: 0d73872cd4d7f3cb0c4aaff33c83ce7949ab563f (
plain)
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
|
# https://taskfile.dev
#Called by the vnbuild system to produce builds for my website
#https://www.vaughnnugent.com/resources/software
#This taskfile is called from the root of a project that is being built
#and the purpose of this taskfile is to package up the output of a build
#from the solution file, and package it up into a tgz files for distribution
version: '3'
vars:
TARGET: '{{.USER_WORKING_DIR}}/bin'
RELEASE_DIR: "./bin/release/{{.TARGET_FRAMEWORK}}/publish"
tasks:
dev-setup:
desc: 'Sets up all native libraries for local development'
cmds:
#build native libs for development
- cd lib/Utils.Memory/vnlib_rpmalloc && task build
- cd lib/Utils.Memory/vnlib_mimalloc && task build
- cd lib/Utils.Cryptography/monocypher && task build
- cd lib/Utils.Cryptography/argon2 && task build
- cd lib/Net.Compression/vnlib_compress && task build
- echo "dev setup complete"
#when build succeeds, archive the output into a tgz
postbuild_success:
dir: '{{.USER_WORKING_DIR}}'
cmds:
#pack up source code
- task: packsource
#run post in debug mode
- task: postbuild
vars: { BUILD_MODE: debug }
#remove uncessary files from the release dir
- powershell -Command "Get-ChildItem -Recurse '{{.RELEASE_DIR}}/' -Include *.pdb,*.xml | Remove-Item"
#run post in release mode
- task: postbuild
vars: { BUILD_MODE: release }
postbuild_failed:
dir: '{{.USER_WORKING_DIR}}'
cmds: []
postbuild:
dir: '{{.USER_WORKING_DIR}}'
internal: true
vars:
#the build output directory
BUILD_OUT: "{{.USER_WORKING_DIR}}/bin/{{.BUILD_MODE}}/{{.TARGET_FRAMEWORK}}/publish"
cmds:
- cd .. && powershell -Command "Copy-Item -Path ./build.readme.txt -Destination '{{.BUILD_OUT}}/readme.txt'"
#tar outputs
- cd "{{.BUILD_OUT}}" && tar -czf "{{.TARGET}}/{{.BUILD_MODE}}.tgz" .
packsource:
dir: '{{.USER_WORKING_DIR}}'
internal: true
cmds:
#copy source code to target
- powershell -Command "Get-ChildItem -Include *.cs,*.csproj -Recurse | Where { \$_.FullName -notlike '*\obj\*' -and \$_.FullName -notlike '*\bin\*' } | Resolve-Path -Relative | tar --files-from - -czf '{{.TARGET}}/src.tgz'"
#Remove the output dirs on clean
clean:
dir: '{{.USER_WORKING_DIR}}'
ignore_error: true
cmds:
- for: [ bin/, obj/ ]
cmd: powershell -Command "rm -Recurse -Force '{{.ITEM}}'"
|