aboutsummaryrefslogtreecommitdiff
path: root/lib/WinRpMalloc/Taskfile.yaml
diff options
context:
space:
mode:
authorLibravatar vnugent <public@vaughnnugent.com>2023-08-01 17:59:22 -0400
committerLibravatar vnugent <public@vaughnnugent.com>2023-08-01 17:59:22 -0400
commitb27a734a56f07c2e15518364c4cc3cef0b13a1e2 (patch)
tree2df5797b34339b95743f983ba74c5eddf2865c99 /lib/WinRpMalloc/Taskfile.yaml
parentf0c2337358fc43ad9c79294c539c4ddec4280011 (diff)
build config added
Diffstat (limited to 'lib/WinRpMalloc/Taskfile.yaml')
-rw-r--r--lib/WinRpMalloc/Taskfile.yaml73
1 files changed, 73 insertions, 0 deletions
diff --git a/lib/WinRpMalloc/Taskfile.yaml b/lib/WinRpMalloc/Taskfile.yaml
new file mode 100644
index 0000000..90a0898
--- /dev/null
+++ b/lib/WinRpMalloc/Taskfile.yaml
@@ -0,0 +1,73 @@
+# https://taskfile.dev
+
+#Called by the vnbuild system to produce builds for my website
+#https://www.vaughnnugent.com/resources/software
+
+#This taskfile is called in this directory and is specific to the WinRpMalloc project
+#that handles the MSBuild outside of the solution file
+
+version: '3'
+
+vars:
+ RPMALLOC_LICENSE: 'https://raw.githubusercontent.com/mjansson/rpmalloc/develop/LICENSE'
+ INT_DIR: '{{.SCRATCH_DIR}}/obj/{{.MODULE_NAME}}/'
+ MS_ARGS: '/p:Platform=x64 /p:RunAnalyzersDuringBuild=false /p:IntermediateOutputPath="{{.INT_DIR}}" /p:UseCommonOutputDirectory=true /p:BuildInParallel=true /p:MultiProcessorCompilation=true'
+
+tasks:
+
+ build:
+ #build from the src directory
+ dir: '{{.USER_WORKING_DIR}}/src'
+ cmds:
+ #build in debug mode
+ - msbuild /p:Configuration=debug {{.BUILD_FLAGS}} {{.MS_ARGS}}
+ #build in release
+ - msbuild /p:Configuration=release {{.BUILD_FLAGS}} {{.MS_ARGS}}
+
+ postbuild_success:
+ vars:
+ TARGET: '{{.USER_WORKING_DIR}}/bin'
+
+ cmds:
+ #create the target directory
+ - powershell -Command "New-Item -Type Directory -Force -Path '{{.TARGET}}'"
+
+ #remove uncessary files from outputs
+ - powershell -Command "Get-ChildItem -Recurse './src/x64/*' -Include *.log,*.recipe,*.CopyComplete,*.json,*.FileListAbsolute.txt | Remove-Item"
+ - powershell -Command "Get-ChildItem '*.tlog' -Recurse * | Remove-Item"
+
+ #run debug and release post
+ - task: postbuild
+ vars: { BUILD_MODE: debug }
+
+ - task: postbuild
+ vars: { BUILD_MODE: release }
+
+ #tar input and output
+ - cd ./src/x64/debug && tar -czf "{{.TARGET}}/debug.tgz" .
+
+ #capture only dll, license, + readme files on release
+ - cd ./src/x64/release && tar --include='*.dll' --include='license.txt' --include='readme.md' --include='rpmalloc_license.txt' -czf "{{.TARGET}}/release.tgz" *
+
+
+ postbuild:
+ vars:
+ TARGET: './src/x64/{{.BUILD_MODE}}'
+
+ cmds:
+ #add rpmalloc license to binary output
+ - powershell -Command "Invoke-WebRequest '{{.RPMALLOC_LICENSE}}' -Outfile '{{.TARGET}}/rpmalloc_license.txt'"
+
+ #add my license file
+ - powershell -Command "Copy-Item -Path ./LICENSE.txt -Destination '{{.TARGET}}/license.txt'"
+
+ #add readme file
+ - powershell -Command "Copy-Item -Path ./build.readme.md -Destination '{{.TARGET}}/readme.md'"
+
+
+ clean:
+ cmds:
+ - cmd: powershell -Command "Remove-Item -Recurse './src/x64' -ErrorAction SilentlyContinue"
+ ignore_error: true
+ - cmd: powershell -Command "Remove-Item -Recurse './src/bin' -ErrorAction SilentlyContinue"
+ ignore_error: true \ No newline at end of file