From b4a5a50098eba9ef1633715a8a74c5ac0c32b2e2 Mon Sep 17 00:00:00 2001 From: vnugent Date: Fri, 6 Sep 2024 21:37:01 -0400 Subject: configure autobuild for master branch --- .onedev-buildspec.yml | 49 +++++++++++++++++++++++++++++++++++-------------- 1 file changed, 35 insertions(+), 14 deletions(-) diff --git a/.onedev-buildspec.yml b/.onedev-buildspec.yml index 8049766..f2ae8cb 100644 --- a/.onedev-buildspec.yml +++ b/.onedev-buildspec.yml @@ -1,6 +1,7 @@ -version: 33 +version: 35 jobs: -- name: GitHub Push + +- name: Git mirror push steps: - !PushRepository name: Github push sync @@ -25,22 +26,42 @@ jobs: maxRetries: 3 retryDelay: 30 timeout: 3600 -- name: GitHub Pull + +- name: Build and publish + jobExecutor: primary-shell-executor steps: - - !PullRepository - name: GitHub sync pull - remoteUrl: https://github.com/VnUgE/noscrypt.git - userName: VnUgE - passwordSecret: github-access-token - refs: refs/heads/* refs/tags/* + - !CheckoutStep + name: Code checkout + cloneCredential: !DefaultCredential {} withLfs: false - force: false + withSubmodules: false + checkoutPath: '@project_name@/' + condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL + - !CommandStep + name: VNBuild build + runInContainer: false + interpreter: !DefaultInterpreter + commands: | + vnbuild build -S --verbose + useTTY: true + condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL + - !CommandStep + name: VNBuild publish + runInContainer: false + interpreter: !DefaultInterpreter + commands: | + vnbuild publish --ftp "@secret:ftp_server_address@" --sign + envVars: + - name: FTP_USERNAME + value: '@secret:ftp_username@' + - name: FTP_PASSWORD + value: '@secret:ftp_password@' + useTTY: true condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL triggers: - - !ScheduleTrigger - cronExpression: 0 15 10 ? * * - projects: noscrypt + - !BranchUpdateTrigger + branches: master retryCondition: never maxRetries: 3 retryDelay: 30 - timeout: 3600 + timeout: 3600 \ No newline at end of file -- cgit From d5235f583cc984bf0a36f01aac80ca21ee712e3a Mon Sep 17 00:00:00 2001 From: vnugent Date: Fri, 6 Sep 2024 21:44:09 -0400 Subject: update changelog for v0.1.5 --- CHANGELOG.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e519972..563b347 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,12 +9,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - C# .NET 8.0 library wrapper for noscrypt -- NIP44 vector testing for encryption +- Full NIP44 vector testing for encryption + +## [0.1.5] + +### Added - `NCUtilContextAlloc()` and `NCUtilContextFree()` utilities for dynamic library context allocation ### Changed - Public and Secret key structure definition names have been correctly namespaced __(no breaking changes)__ - + ## [0.1.4] ### Fixed @@ -73,7 +77,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - NCContext structure defintion. - Internal headers from the public include directory. -[unreleased]: https://github.com/VnUgE/noscrypt/compare/v0.1.4...HEAD +[unreleased]: https://github.com/VnUgE/noscrypt/compare/v0.1.5...HEAD +[0.1.5]: https://github.com/VnUgE/noscrypt/compare/v0.1.4...v0.1.5 [0.1.4]: https://github.com/VnUgE/noscrypt/compare/v0.1.3...v0.1.4 [0.1.3]: https://github.com/VnUgE/noscrypt/compare/v0.1.2...v0.1.3 [0.1.2]: https://github.com/VnUgE/noscrypt/compare/v0.1.1...v0.1.2 -- cgit From 13bcaa274e0276bc5fe1e50008826352ffb5c87f Mon Sep 17 00:00:00 2001 From: vnugent Date: Fri, 6 Sep 2024 21:46:35 -0400 Subject: Squashed commit of the following: commit d5235f583cc984bf0a36f01aac80ca21ee712e3a Author: vnugent Date: Fri Sep 6 21:44:09 2024 -0400 update changelog for v0.1.5 commit b4a5a50098eba9ef1633715a8a74c5ac0c32b2e2 Author: vnugent Date: Fri Sep 6 21:37:01 2024 -0400 configure autobuild for master branch commit de9741b417ee04a54512af106b71cf388c93ea9d Author: vnugent Date: Wed Aug 28 19:54:45 2024 -0400 feat: add library context alloc util functions --- .onedev-buildspec.yml | 49 +++++++++++++++++++++++++++++++++++-------------- CHANGELOG.md | 15 ++++++++++++--- include/noscrypt.h | 4 ++-- include/noscryptutil.h | 13 +++++++++++++ src/noscryptutil.c | 13 +++++++++++++ tests/test.c | 14 +++++++++++--- 6 files changed, 86 insertions(+), 22 deletions(-) diff --git a/.onedev-buildspec.yml b/.onedev-buildspec.yml index 8049766..f2ae8cb 100644 --- a/.onedev-buildspec.yml +++ b/.onedev-buildspec.yml @@ -1,6 +1,7 @@ -version: 33 +version: 35 jobs: -- name: GitHub Push + +- name: Git mirror push steps: - !PushRepository name: Github push sync @@ -25,22 +26,42 @@ jobs: maxRetries: 3 retryDelay: 30 timeout: 3600 -- name: GitHub Pull + +- name: Build and publish + jobExecutor: primary-shell-executor steps: - - !PullRepository - name: GitHub sync pull - remoteUrl: https://github.com/VnUgE/noscrypt.git - userName: VnUgE - passwordSecret: github-access-token - refs: refs/heads/* refs/tags/* + - !CheckoutStep + name: Code checkout + cloneCredential: !DefaultCredential {} withLfs: false - force: false + withSubmodules: false + checkoutPath: '@project_name@/' + condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL + - !CommandStep + name: VNBuild build + runInContainer: false + interpreter: !DefaultInterpreter + commands: | + vnbuild build -S --verbose + useTTY: true + condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL + - !CommandStep + name: VNBuild publish + runInContainer: false + interpreter: !DefaultInterpreter + commands: | + vnbuild publish --ftp "@secret:ftp_server_address@" --sign + envVars: + - name: FTP_USERNAME + value: '@secret:ftp_username@' + - name: FTP_PASSWORD + value: '@secret:ftp_password@' + useTTY: true condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL triggers: - - !ScheduleTrigger - cronExpression: 0 15 10 ? * * - projects: noscrypt + - !BranchUpdateTrigger + branches: master retryCondition: never maxRetries: 3 retryDelay: 30 - timeout: 3600 + timeout: 3600 \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 2414a2b..563b347 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,8 +9,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - C# .NET 8.0 library wrapper for noscrypt -- NIP44 vector testing for encryption - +- Full NIP44 vector testing for encryption + +## [0.1.5] + +### Added +- `NCUtilContextAlloc()` and `NCUtilContextFree()` utilities for dynamic library context allocation + +### Changed +- Public and Secret key structure definition names have been correctly namespaced __(no breaking changes)__ + ## [0.1.4] ### Fixed @@ -69,7 +77,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - NCContext structure defintion. - Internal headers from the public include directory. -[unreleased]: https://github.com/VnUgE/noscrypt/compare/v0.1.4...HEAD +[unreleased]: https://github.com/VnUgE/noscrypt/compare/v0.1.5...HEAD +[0.1.5]: https://github.com/VnUgE/noscrypt/compare/v0.1.4...v0.1.5 [0.1.4]: https://github.com/VnUgE/noscrypt/compare/v0.1.3...v0.1.4 [0.1.3]: https://github.com/VnUgE/noscrypt/compare/v0.1.2...v0.1.3 [0.1.2]: https://github.com/VnUgE/noscrypt/compare/v0.1.1...v0.1.2 diff --git a/include/noscrypt.h b/include/noscrypt.h index 3702555..8ba71b0 100644 --- a/include/noscrypt.h +++ b/include/noscrypt.h @@ -156,7 +156,7 @@ typedef int64_t NCResult; /* An secp256k1 secret key (aka private key buffer) */ -typedef struct secret_key_struct { +typedef struct nc_secret_key_struct { uint8_t key[NC_SEC_KEY_SIZE]; @@ -165,7 +165,7 @@ typedef struct secret_key_struct { /* An x-only secp256k1 public key */ -typedef struct xonly_pubkey_struct { +typedef struct nc_xonly_pubkey_struct { uint8_t key[NC_PUBKEY_SIZE]; diff --git a/include/noscryptutil.h b/include/noscryptutil.h index 63e08f8..ea5dad0 100644 --- a/include/noscryptutil.h +++ b/include/noscryptutil.h @@ -77,6 +77,19 @@ NC_EXPORT NCResult NC_CC NCUtilGetEncryptionPaddedSize(uint32_t encVersion, uint */ NC_EXPORT NCResult NC_CC NCUtilGetEncryptionBufferSize(uint32_t encVersion, uint32_t plaintextSize); +/* +* Allocates a new library context structure dynamically on the heap and returns a pointer to +* it. The library context must be freed with NCUtilContextFree when it is no longer needed. +* @return A valid pointer to a new library context or NULL if the operation failed +*/ +NC_EXPORT NCContext* NC_CC NCUtilContextAlloc(void); + +/* +* Frees the library context structure and clears the memory it points to. +* @param ctx A valid pointer to a library context memory +*/ +NC_EXPORT void NC_CC NCUtilContextFree(NCContext* ctx); + /* * Allocates a new encryption context and sets the encryption version and flags. The encryption context * must be freed with NCUtilCipherFree when it is no longer needed. diff --git a/src/noscryptutil.c b/src/noscryptutil.c index 115ad04..333ef74 100644 --- a/src/noscryptutil.c +++ b/src/noscryptutil.c @@ -672,6 +672,19 @@ NC_EXPORT NCResult NC_CC NCUtilGetEncryptionBufferSize(uint32_t encVersion, uint } +NC_EXPORT NCContext* NC_CC NCUtilContextAlloc(void) +{ + /* Dynamically allocate context aligned and zeroed */ + return (NCContext*)_nc_mem_alloc(1, NCGetContextStructSize()); +} + + +NC_EXPORT void NC_CC NCUtilContextFree(NCContext* ctx) +{ + _nc_mem_free(ctx); +} + + NC_EXPORT NCUtilCipherContext* NC_CC NCUtilCipherAlloc(uint32_t encVersion, uint32_t flags) { NCUtilCipherContext* encCtx; diff --git a/tests/test.c b/tests/test.c index e8b064b..20a0e5d 100644 --- a/tests/test.c +++ b/tests/test.c @@ -66,6 +66,10 @@ #include "hex.h" +#ifdef NC_ENABLE_UTILS + #include +#endif + /*Pre-computed constants for argument errors */ #define ARG_ERROR_POS_0 E_NULL_PTR #define ARG_ERROR(pos) NCResultWithArgPosition(E_NULL_PTR, pos) @@ -365,7 +369,13 @@ static int TestPublicApiArgumentValidation() * Alloc context structure on the heap before use. * THIS WILL LEAK IN THE CURRENT CONFIG ALWAYS FREE UNDER NORMAL CONDITIONS */ + +#ifdef NOSCRYPTUTIL_H + ctx = NCUtilContextAlloc(); +#else ctx = (NCContext*)malloc(NCGetContextStructSize()); +#endif + TASSERT(ctx != NULL) /*Test null context*/ @@ -608,9 +618,7 @@ static int TestCorrectEncryption(const NCContext* context) return 0; } -#ifdef NC_ENABLE_UTILS - -#include +#ifdef NOSCRYPTUTIL_H /* Padding tests taken from the nip44 repo vectors.json file */ static const uint32_t _padTestActual[24] = { 16, 32, 33, 37, 45, 49, 64, 65, 100, 111, 200, 250, 320, 383, 384, 400, 500, 512, 515, 700, 800, 900, 1020, 65536 }; -- cgit From 0cae8cabf8fae1cf068cc026bd8b07b134d47284 Mon Sep 17 00:00:00 2001 From: vnugent Date: Fri, 6 Sep 2024 21:57:48 -0400 Subject: avoid vnbuild deps conflicts --- Taskfile.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Taskfile.yaml b/Taskfile.yaml index 0af15f3..cbc4a7a 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -120,6 +120,9 @@ tasks: BUILD_DIR: 'build/win-x64' cmds: + #remove deps dir to avoid conflicts with vnbuild + - defer: powershell rm -Recurse -Force "{{ .BUILD_DIR }}/_deps" + #invoke cmake build - cmake -S . -B {{.BUILD_DIR}} -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Release -DNC_BUILD_TESTS=OFF - cmake --build {{.BUILD_DIR}} --config Release -- cgit From dc47d096400e7a4d95dd9516c72876c8ad016dcb Mon Sep 17 00:00:00 2001 From: vnugent Date: Thu, 17 Oct 2024 23:33:46 -0400 Subject: update CI tests and run cross-platform unit testing --- .onedev-buildspec.yml | 75 ++++++++++++++++++++++++++++++++++----- Module.Taskfile.yaml | 8 +++-- Taskfile.yaml | 98 ++++++++++++++++++++++++++++++--------------------- 3 files changed, 131 insertions(+), 50 deletions(-) diff --git a/.onedev-buildspec.yml b/.onedev-buildspec.yml index f2ae8cb..8bbe9c7 100644 --- a/.onedev-buildspec.yml +++ b/.onedev-buildspec.yml @@ -1,6 +1,5 @@ -version: 35 +version: 36 jobs: - - name: Git mirror push steps: - !PushRepository @@ -27,15 +26,75 @@ jobs: retryDelay: 30 timeout: 3600 -- name: Build and publish - jobExecutor: primary-shell-executor +- name: Unit Testing + steps: + - !CheckoutStep + name: checkout + cloneCredential: !DefaultCredential {} + withLfs: false + withSubmodules: false + checkoutPath: '@project_name@' + condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL + - !CommandStep + name: run unit tests + runInContainer: false + interpreter: !DefaultInterpreter + commands: | + cd @project_name@ + task -t Module.Taskfile.yaml test + useTTY: true + condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL + triggers: + - !BranchUpdateTrigger + branches: '** -master' + retryCondition: never + maxRetries: 3 + retryDelay: 30 + timeout: 14400 +- name: Staging build + steps: + - !CheckoutStep + name: checkout + cloneCredential: !DefaultCredential {} + withLfs: false + withSubmodules: false + checkoutPath: '@project_name@' + condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL + - !CommandStep + name: VNBuild build + runInContainer: false + interpreter: !DefaultInterpreter + commands: | + vnbuild build -S --verbose + useTTY: true + condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL + - !CommandStep + name: VNBuild mock publish + runInContainer: false + interpreter: !DefaultInterpreter + commands: | + vnbuild publish --sign + useTTY: true + condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL + triggers: + - !BranchUpdateTrigger + branches: develop master + jobDependencies: + - jobName: Unit Testing + requireSuccessful: true + retryCondition: never + maxRetries: 3 + retryDelay: 30 + timeout: 14400 + +- name: Publish on tag steps: - !CheckoutStep - name: Code checkout + name: checkout cloneCredential: !DefaultCredential {} withLfs: false withSubmodules: false - checkoutPath: '@project_name@/' + checkoutPath: '@project_name@' condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL - !CommandStep name: VNBuild build @@ -59,9 +118,9 @@ jobs: useTTY: true condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL triggers: - - !BranchUpdateTrigger + - !TagCreateTrigger branches: master retryCondition: never maxRetries: 3 retryDelay: 30 - timeout: 3600 \ No newline at end of file + timeout: 14400 diff --git a/Module.Taskfile.yaml b/Module.Taskfile.yaml index d31449a..b7b991c 100644 --- a/Module.Taskfile.yaml +++ b/Module.Taskfile.yaml @@ -17,11 +17,16 @@ tasks: cmds: - git reset --hard - git remote update - - git pull origin {{.BRANCH_NAME}} --verify-signatures + - git pull origin {{ .BRANCH_NAME }} --verify-signatures #updates the project versions for all inlcuded .NET projects - dotnet-gitversion.exe /updateprojectfiles + test: + desc: 'Builds and runs noscrypt unit tests for vnbuild CI systems' + cmds: + - cmd: task test -- -DNC_ENABLE_UTILS=ON + - cmd: wsl task test -- -DNC_ENABLE_UTILS=ON #called by build pipeline to build module build: @@ -33,7 +38,6 @@ tasks: #git archive in the module directory - git archive --format {{.ARCHIVE_FILE_FORMAT}} --output {{.ARCHIVE_FILE_NAME}} HEAD - #called by build pipeline to clean module clean: cmds: diff --git a/Taskfile.yaml b/Taskfile.yaml index cbc4a7a..b19a135 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -15,6 +15,7 @@ version: '3' vars: CMAKE_BUILD_DIR: 'build/{{ OS }}' TEST_EXE_NAME: 'nctest' + CI_BUILD_CONFIG: '{{ .CI_BUILD_CONFIG | default "Release" }}' tasks: @@ -35,7 +36,7 @@ tasks: desc: "Builds a local copy of the library in a debug configuration, then runs the test executable" cmds: - task: build-debug - - cmd: cd {{.CMAKE_BUILD_DIR}} && ctest -C Debug --verbose + - cmd: cd {{ .CMAKE_BUILD_DIR }} && ctest -C Debug --verbose test-mbedtls: desc: "Builds and runs tests for noscrypt using the mbedtls crypto library for the current platform" @@ -44,36 +45,45 @@ tasks: vars: CMAKE_TEST_STATUS: 'ON' BUILD_CONFIG: 'Debug' - CLI_ARGS: '-DNC_FETCH_MBEDTLS=ON {{.CLI_ARGS}}' #fetches and enabled medtls - - cmd: cd {{.CMAKE_BUILD_DIR}} && ctest -C Debug --verbose + CLI_ARGS: '-DNC_FETCH_MBEDTLS=ON {{ .CLI_ARGS }}' #fetches and enabled medtls + + - cmd: cd {{ .CMAKE_BUILD_DIR }} && ctest -C Debug --verbose test-dev: desc: "Re-runs compilation phase and test execution" cmds: - task: compile vars: { BUILD_CONFIG: 'Debug' } - - cmd: cd {{.CMAKE_BUILD_DIR}} && ctest -C Debug --verbose --output-on-failure - - compile: - internal: true - cmds: - - cmake --build {{.CMAKE_BUILD_DIR}} --config {{.BUILD_CONFIG}} + - cmd: cd {{ .CMAKE_BUILD_DIR }} && ctest -C Debug --verbose --output-on-failure build-internal: internal: true cmds: - - cmake -S . -B{{.CMAKE_BUILD_DIR}} -DCMAKE_BUILD_TYPE={{.BUILD_CONFIG}} -DNC_BUILD_TESTS={{ .CMAKE_TEST_STATUS }} {{.CLI_ARGS}} + - cmd: cmake {{ .CLI_ARGS }} + -S . + -B{{ .CMAKE_BUILD_DIR }} + -DCMAKE_BUILD_TYPE={{ .BUILD_CONFIG }} + -DNC_BUILD_TESTS={{ .CMAKE_TEST_STATUS }} + - task: compile - vars: { BUILD_CONFIG: '{{.BUILD_CONFIG}}' } - - cmd: echo "Build complete. Your files can be found in the {{.CMAKE_BUILD_DIR}} directory" + vars: { BUILD_CONFIG: '{{ .BUILD_CONFIG }}' } + + - cmd: echo "Build complete. Your files can be found in the {{ .CMAKE_BUILD_DIR }} directory" silent: true + compile: + internal: true + cmds: + - cmd: cmake + --build {{ .CMAKE_BUILD_DIR }} + --config {{ .BUILD_CONFIG }} + install: desc: "Uses cmake to install the library on your system" cmds: - cmd: echo "Installing noscrypt globally" silent: true - - cmd: cmake --install {{.CMAKE_BUILD_DIR}} {{.CLI_ARGS}} + - cmd: cmake --install {{ .CMAKE_BUILD_DIR }} {{ .CLI_ARGS }} #CI ONLY!! @@ -81,7 +91,7 @@ tasks: #called by build pipeline to build module build: cmds: - - echo "building project {{.PROJECT_NAME}}" + - echo "building project {{ .PROJECT_NAME }}" - cmd: powershell -Command "mkdir bin/ -Force" ignore_error: true @@ -97,51 +107,59 @@ tasks: cmds: - for: [ bin/, build/ ] task: clean-internal - vars: { FILE: '{{.ITEM}}'} + vars: { FILE: '{{ .ITEM }}'} clean-internal: internal: true ignore_error: true cmds: - - cmd: rm -rf '{{.FILE}}' + - cmd: rm -rf '{{ .FILE }}' platforms: [linux, darwin] - - cmd: powershell rm -Recurse -Force '{{.FILE}}' + - cmd: powershell rm -Recurse -Force '{{ .FILE }}' platforms: [windows] build_win_x64: internal: true + platforms: [ windows ] vars: - TARGET_DLL: '{{.PROJECT_DIR}}/{{.BINARY_DIR}}/msvc-x64-release-{{.PROJECT_NAME}}.tgz' - DLL_FILES: '{{.PROJECT_NAME}}.dll {{.PROJECT_NAME}}.lib license.txt' - TARGET_STATIC: '{{.PROJECT_DIR}}/{{.BINARY_DIR}}/msvc-x64-release-{{.PROJECT_NAME}}-static.tgz' - STATIC_FILES: '{{.PROJECT_NAME}}_static.lib license.txt' + TARGET: '{{ .PROJECT_DIR }}/{{ .BINARY_DIR }}/msvc-x64-{{ .CI_BUILD_CONFIG }}-{{ .PROJECT_NAME }}.tgz' BUILD_DIR: 'build/win-x64' + + TAR_FILES: " + {{ .PROJECT_NAME }}.dll + {{ .PROJECT_NAME }}.lib + {{ .PROJECT_NAME }}_static.lib + license.txt" cmds: #remove deps dir to avoid conflicts with vnbuild - defer: powershell rm -Recurse -Force "{{ .BUILD_DIR }}/_deps" #invoke cmake build - - cmake -S . -B {{.BUILD_DIR}} -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Release -DNC_BUILD_TESTS=OFF - - cmake --build {{.BUILD_DIR}} --config Release + - cmd: cmake + -S . + -B {{ .BUILD_DIR }} + -G "Visual Studio 17 2022" + -A x64 + -DCMAKE_BUILD_TYPE={{ .CI_BUILD_CONFIG }} + -DNC_BUILD_TESTS=OFF + + - cmake --build {{ .BUILD_DIR }} --config {{ .CI_BUILD_CONFIG }} #copy license to build dir - - powershell -Command "cp license {{.BUILD_DIR}}/Release/license.txt" + - cmd: powershell cp license '{{ .BUILD_DIR }}/Release/license.txt' #tar up the binaries - - cd {{.BUILD_DIR}}/Release && tar -czf "{{.TARGET_DLL}}" {{.DLL_FILES}} - - #tar up static libs - - cd {{.BUILD_DIR}}/Release && tar -czf "{{.TARGET_STATIC}}" {{.STATIC_FILES}} + - cmd: cd {{ .BUILD_DIR }}/Release && tar -czf "{{ .TARGET }}" {{ .TAR_FILES }} pack_source: internal: true desc: "Packs up the project source code and creates a tarball in the builds binary directory" vars: - TARGET_SOURCE: '{{.PROJECT_DIR}}/{{.BINARY_DIR}}/{{.PROJECT_NAME}}-src.tgz' + TARGET_SOURCE: '{{ .PROJECT_DIR }}/{{ .BINARY_DIR }}/{{ .PROJECT_NAME }}-src.tgz' SOURCE_FILES: CMakeLists.txt Taskfile.yaml @@ -155,7 +173,7 @@ tasks: cmds: #tar up the source - - tar -czf "{{.TARGET_SOURCE}}" {{ .SOURCE_FILES | join " " }} + - tar -czf "{{ .TARGET_SOURCE }}" {{ .SOURCE_FILES | join " " }} ################################# # @@ -170,7 +188,7 @@ tasks: cmds: - task: compile vars: { BUILD_CONFIG: 'Debug' } - - cmd: gdb '{{.CMAKE_BUILD_DIR}}/{{.TEST_EXE_NAME}}' + - cmd: gdb '{{ .CMAKE_BUILD_DIR }}/{{ .TEST_EXE_NAME }}' dev-update-deps: desc: "Updates vendored projects files (headers mostly) from their source repositories to the latest version" @@ -188,13 +206,13 @@ tasks: MC_DIR: 'vendor/monocypher' TMP_DIR: '.update/mc' cmds: - - cmd: powershell mkdir '{{.TMP_DIR}}' -Force + - cmd: powershell mkdir '{{ .TMP_DIR }}' -Force ignore_error: true - - git clone --branch {{.MC_GIT_BRANCH}} {{.MC_GIT_URL}} '{{.TMP_DIR}}' + - git clone --branch {{ .MC_GIT_BRANCH }} {{ .MC_GIT_URL }} '{{ .TMP_DIR }}' - for: [ 'src/monocypher.h', 'src/monocypher.c' ] - cmd: powershell cp '{{.TMP_DIR}}/{{.ITEM}}' '{{.MC_DIR}}' + cmd: powershell cp '{{ .TMP_DIR }}/{{ .ITEM }}' '{{ .MC_DIR }}' dev-update-mbedtls-headers: vars: @@ -203,13 +221,13 @@ tasks: MBEDTLS_DIR: 'vendor/mbedtls' TMP_DIR: '.update/mbedtls' cmds: - - cmd: powershell mkdir '{{.TMP_DIR}}' -Force + - cmd: powershell mkdir '{{ .TMP_DIR }}' -Force ignore_error: true - git clone --branch {{ .MBEDTLS_GIT_BRANCH }} {{ .MBEDTLS_GIT_URL }} '{{ .TMP_DIR }}' - for: [ 'include/mbedtls' ] - cmd: powershell cp -Recurse -Force '{{ .TMP_DIR }}/{{ .ITEM }}' '{{.MBEDTLS_DIR}}/include' + cmd: powershell cp -Recurse -Force '{{ .TMP_DIR }}/{{ .ITEM }}' '{{ .MBEDTLS_DIR }}/include' dev-update-openssl-headers: vars: @@ -218,13 +236,13 @@ tasks: OPENSSL_DIR: 'vendor/openssl' TMP_DIR: '.update/openssl' cmds: - - cmd: powershell mkdir '{{.TMP_DIR}}' -Force + - cmd: powershell mkdir '{{ .TMP_DIR }}' -Force ignore_error: true - git clone --branch {{ .OPENSSL_GIT_BRANCH }} {{ .OPENSSL_GIT_URL }} '{{ .TMP_DIR }}' - for: [ 'include/openssl' ] - cmd: powershell cp -Recurse -Force '{{ .TMP_DIR }}/{{ .ITEM }}' '{{.OPENSSL_DIR}}/include/' + cmd: powershell cp -Recurse -Force '{{ .TMP_DIR }}/{{ .ITEM }}' '{{ .OPENSSL_DIR }}/include/' dev-set-secp256-headers: vars: @@ -233,10 +251,10 @@ tasks: SECP256_DIR: 'vendor/secp256k1' TMP_DIR: '.update/secp256k1' cmds: - - cmd: powershell mkdir '{{.TMP_DIR}}' -Force + - cmd: powershell mkdir '{{ .TMP_DIR }}' -Force ignore_error: true - git clone --branch {{ .SECP256_GIT_BRANCH }} {{ .SECP256_GIT_URL }} '{{ .TMP_DIR }}' - for: [ 'include/*' ] - cmd: powershell cp -Recurse -Force '{{ .TMP_DIR }}/{{ .ITEM }}' '{{.SECP256_DIR}}/include/secp256k1/' \ No newline at end of file + cmd: powershell cp -Recurse -Force '{{ .TMP_DIR }}/{{ .ITEM }}' '{{ .SECP256_DIR }}/include/secp256k1/' \ No newline at end of file -- cgit