Repository navigation
feat(taskfiles): Add cmake-install-remote-tar; Fix optional lists to properly default to an empty list. #22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
654f01f
037ca52
b912171
e8cb853
a109a0b
22b89be
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -16,6 +16,13 @@ tasks: | |||||||||
| cmake-build: | ||||||||||
| internal: true | ||||||||||
| label: "{{.TASK}}:{{.BUILD_DIR}}-{{.TARGETS}}-{{.EXTRA_ARGS}}" | ||||||||||
| vars: | ||||||||||
| EXTRA_ARGS: | ||||||||||
| ref: default (list) .EXTRA_ARGS | ||||||||||
| JOBS: >- | ||||||||||
| {{default "" .JOBS}} | ||||||||||
| TARGETS: | ||||||||||
| ref: default (list) .TARGETS | ||||||||||
|
davidlion marked this conversation as resolved.
Outdated
|
||||||||||
| requires: | ||||||||||
| vars: ["BUILD_DIR"] | ||||||||||
| cmds: | ||||||||||
|
|
@@ -37,14 +44,17 @@ tasks: | |||||||||
| # @param {string[]} [EXTRA_ARGS] Any additional arguments to pass with the clean target. | ||||||||||
| cmake-clean: | ||||||||||
| internal: true | ||||||||||
| vars: | ||||||||||
| EXTRA_ARGS: | ||||||||||
| ref: default (list) .EXTRA_ARGS | ||||||||||
|
davidlion marked this conversation as resolved.
Outdated
|
||||||||||
| requires: | ||||||||||
| vars: ["BUILD_DIR"] | ||||||||||
| cmds: | ||||||||||
| - task: "cmake-build" | ||||||||||
| vars: | ||||||||||
| BUILD_DIR: "{{.BUILD_DIR}}" | ||||||||||
| EXTRA_ARGS: | ||||||||||
| ref: "default (list) .EXTRA_ARGS" | ||||||||||
| ref: .EXTRA_ARGS | ||||||||||
|
davidlion marked this conversation as resolved.
Outdated
|
||||||||||
| TARGETS: ["clean"] | ||||||||||
|
|
||||||||||
| # Runs the CMake generate step for the given source and build directories. We purposely omit | ||||||||||
|
|
@@ -57,6 +67,9 @@ tasks: | |||||||||
| cmake-generate: | ||||||||||
| internal: true | ||||||||||
| label: "{{.TASK}}:{{.SOURCE_DIR}}-{{.BUILD_DIR}}-{{.EXTRA_ARGS}}" | ||||||||||
| vars: | ||||||||||
| EXTRA_ARGS: | ||||||||||
| ref: default (list) .EXTRA_ARGS | ||||||||||
|
davidlion marked this conversation as resolved.
Outdated
|
||||||||||
| requires: | ||||||||||
| vars: ["BUILD_DIR", "SOURCE_DIR"] | ||||||||||
| cmds: | ||||||||||
|
|
@@ -78,6 +91,9 @@ tasks: | |||||||||
| cmake-install: | ||||||||||
| internal: true | ||||||||||
| label: "{{.TASK}}:{{.BUILD_DIR}}-{{.INSTALL_PREFIX}}-{{.EXTRA_ARGS}}" | ||||||||||
| vars: | ||||||||||
| EXTRA_ARGS: | ||||||||||
| ref: default (list) .EXTRA_ARGS | ||||||||||
|
davidlion marked this conversation as resolved.
Outdated
|
||||||||||
| requires: | ||||||||||
| vars: ["BUILD_DIR", "INSTALL_PREFIX"] | ||||||||||
| cmds: | ||||||||||
|
|
@@ -88,3 +104,79 @@ tasks: | |||||||||
| {{- range .EXTRA_ARGS}} | ||||||||||
| "{{.}}" | ||||||||||
| {{- end}} | ||||||||||
|
|
||||||||||
| # Downloads a CMake project tar file from `URL` and then generates, builds, and installs the | ||||||||||
| # project. We purposely omit `sources` and `generates` as we defer to `cmake` to decide whether it | ||||||||||
| # should perform any actions. However, the download and extraction will be skipped if unnecessary. | ||||||||||
| # | ||||||||||
| # @param {string} FILE_SHA256 Content hash to verify the downloaded tar file against. | ||||||||||
| # @param {string} NAME Project name used for directory names. | ||||||||||
|
davidlion marked this conversation as resolved.
Outdated
|
||||||||||
| # @param {string} URL | ||||||||||
| # @param {string[]} [BUILD_ARGS] Any additional arguments to pass to the build command. | ||||||||||
|
davidlion marked this conversation as resolved.
Outdated
|
||||||||||
| # @param {string} [BUILD_DIR={{.WORK_DIR}}/{{.NAME}}-build] Directory in which to generate the | ||||||||||
| # build system and perform the build. | ||||||||||
| # @param {string[]} [GEN_ARGS] Any additional arguments to pass to the generate command. | ||||||||||
| # @param {string[]} [INSTALL_ARGS] Any additional arguments to pass to the install command. | ||||||||||
|
davidlion marked this conversation as resolved.
Outdated
|
||||||||||
| # @param {string} [INSTALL_PREFIX={{.WORK_DIR}}/{{.NAME}}-install] Path prefix of where the | ||||||||||
| # project should be installed. | ||||||||||
| # @param {int} [JOBS] The maximum number of concurrent processes to use when building. If | ||||||||||
| # omitted, the native build tool's default number is used. See `man cmake`. | ||||||||||
| # @param {string} [SOURCE_DIR={{.WORK_DIR}}/{{.NAME}}-src] Directory in which to extract the tar | ||||||||||
| # file. | ||||||||||
| # @param {string[]} [TARGETS] A list of specific targets to build instead of the default target. | ||||||||||
| # @param {string} [WORK_DIR={{.TASK_DIR}}] Base directory to store the build, install, and src | ||||||||||
| # directories inside. | ||||||||||
| cmake-install-remote-tar: | ||||||||||
| internal: true | ||||||||||
| label: "{{.TASK}}:{{.NAME}}-{{.URL}}-{{.INSTALL_PREFIX}}" | ||||||||||
| vars: | ||||||||||
| # Paths | ||||||||||
| WORK_DIR: >- | ||||||||||
| {{default .ROOT_DIR .WORK_DIR}} | ||||||||||
|
Comment on lines
+143
to
+144
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix WORK_DIR default value The default value uses Apply this diff to fix the default value: - {{default .ROOT_DIR .WORK_DIR}}
+ {{default .TASK_DIR .WORK_DIR}}📝 Committable suggestion
Suggested change
|
||||||||||
| BUILD_DIR: >- | ||||||||||
| {{default (printf "%s/%s-build" .WORK_DIR .NAME) .BUILD_DIR}} | ||||||||||
| INSTALL_PREFIX: >- | ||||||||||
| {{default (printf "%s/%s-install" .WORK_DIR .NAME) .INSTALL_PREFIX}} | ||||||||||
| SOURCE_DIR: >- | ||||||||||
| {{default (printf "%s/%s-src" .WORK_DIR .NAME) .SOURCE_DIR}} | ||||||||||
|
|
||||||||||
| # Optional CMake arguments | ||||||||||
| BUILD_ARGS: | ||||||||||
| ref: default (list) .BUILD_ARGS | ||||||||||
|
davidlion marked this conversation as resolved.
Outdated
|
||||||||||
| GEN_ARGS: | ||||||||||
| ref: default (list) .GEN_ARGS | ||||||||||
|
davidlion marked this conversation as resolved.
Outdated
|
||||||||||
| INSTALL_ARGS: | ||||||||||
| ref: default (list) .INSTALL_ARGS | ||||||||||
|
davidlion marked this conversation as resolved.
Outdated
|
||||||||||
| JOBS: >- | ||||||||||
| {{default "" .JOBS}} | ||||||||||
| TARGETS: | ||||||||||
| ref: default (list) .TARGETS | ||||||||||
|
davidlion marked this conversation as resolved.
Outdated
|
||||||||||
| requires: | ||||||||||
| vars: ["FILE_SHA256", "NAME", "URL"] | ||||||||||
| deps: | ||||||||||
| - task: ":utils:download-and-extract-tar" | ||||||||||
| vars: | ||||||||||
| FILE_SHA256: "{{.FILE_SHA256}}" | ||||||||||
| OUTPUT_DIR: "{{.SOURCE_DIR}}" | ||||||||||
| URL: "{{.URL}}" | ||||||||||
| cmds: | ||||||||||
| - task: ":utils:cmake-generate" | ||||||||||
| vars: | ||||||||||
| BUILD_DIR: "{{.BUILD_DIR}}" | ||||||||||
| EXTRA_ARGS: | ||||||||||
| ref: .GEN_ARGS | ||||||||||
|
davidlion marked this conversation as resolved.
Outdated
davidlion marked this conversation as resolved.
Outdated
|
||||||||||
| SOURCE_DIR: "{{.SOURCE_DIR}}" | ||||||||||
| - task: ":utils:cmake-build" | ||||||||||
| vars: | ||||||||||
| BUILD_DIR: "{{.BUILD_DIR}}" | ||||||||||
| EXTRA_ARGS: | ||||||||||
| ref: .BUILD_ARGS | ||||||||||
|
davidlion marked this conversation as resolved.
Outdated
|
||||||||||
| JOBS: "{{.JOBS}}" | ||||||||||
| TARGETS: | ||||||||||
| ref: .TARGETS | ||||||||||
|
davidlion marked this conversation as resolved.
Outdated
|
||||||||||
| - task: ":utils:cmake-install" | ||||||||||
| vars: | ||||||||||
| BUILD_DIR: "{{.BUILD_DIR}}" | ||||||||||
| EXTRA_ARGS: | ||||||||||
| ref: .INSTALL_ARGS | ||||||||||
|
davidlion marked this conversation as resolved.
Outdated
|
||||||||||
| INSTALL_PREFIX: "{{.INSTALL_PREFIX}}" | ||||||||||
Uh oh!
There was an error while loading. Please reload this page.