-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yaml
More file actions
92 lines (78 loc) · 2.76 KB
/
Copy pathTaskfile.yaml
File metadata and controls
92 lines (78 loc) · 2.76 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
# 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.45'
vars:
BINARY_DIR: '{{ .BINARY_DIR | default "bin" }}'
TARGET_FRAMEWORK: '{{ .TARGET_FRAMEWORK | default "net8.0" }}'
TARGET_DIR: '{{ .USER_WORKING_DIR }}/{{ .BINARY_DIR }}'
tasks:
default:
desc: 'When run from a library directory, builds the managed project'
dir: "{{ .USER_WORKING_DIR }}"
vars:
CONFIGURATION: '{{ .CONFIGURATION | default "release" }}'
cmds:
- cmd: cd src/ &&
dotnet build
--configuration {{ .CONFIGURATION }}
--verbosity detailed
{{ .MS_ARGS }}
{{ .CLI_ARGS }}
#when build succeeds, archive the output into a tgz
postbuild_success:
dir: '{{ .USER_WORKING_DIR }}'
desc: 'Called by vnbuild after build succeeds. Used to prepare completed build artifacts.'
deps:
- task: packsource
- task: postbuild
vars: { BUILD_MODE: debug }
- task: postbuild
vars: { BUILD_MODE: release }
cmds:
- cmd: echo "Postbuild complete for {{ .PROJECT_NAME }}"
silent: true
postbuild_failed:
desc: 'Called by vnbuild when an error occurred during build task'
cmds: []
postbuild:
dir: '{{ .USER_WORKING_DIR }}'
internal: true
requires:
vars: [BINARY_DIR, BUILD_MODE, TARGET_FRAMEWORK, TARGET_DIR]
vars:
#the build output directory
BUILD_OUT: "{{ .BINARY_DIR }}/{{ .BUILD_MODE }}/{{ .TARGET_FRAMEWORK }}/publish"
#removes unnecessary files from the release packages
TAR_ARGS: '{{ if eq .BUILD_MODE "release" }}--exclude="*.pdb" --exclude="*.xml"{{ end }}'
cmds:
- cmd: tar{{ if eq OS "windows" }}.exe{{ end }}
-czf "{{ .TARGET_DIR }}/{{ .BUILD_MODE }}.tgz" {{ .TAR_ARGS }}
-C "{{ .BUILD_OUT }}" .
packsource:
dir: '{{ .USER_WORKING_DIR }}'
desc: 'Creates an archive for package source files'
internal: true
requires:
vars: [TARGET_DIR]
vars:
EXCLUDES:
--exclude 'obj/'
--exclude 'bin/'
cmds:
- cmd: cd ../ && tar{{ if eq OS "windows" }}.exe{{ end }}
{{ .EXCLUDES }}
-czf "{{ .TARGET_DIR }}/src.tgz" .
publish:
desc: 'Called by vnbuild during a publish command'
cmds: []
clean:
desc: 'Cleans local project artifacts and outputs. Typically called by vnbuild clean command.'
dir: '{{ .USER_WORKING_DIR }}'
ignore_error: true
cmds:
- for: [ bin/, obj/ ]
cmd: rm -rf '{{ .ITEM }}'