Skip to content

Commit

Permalink
[CMakeV1] Added option to run cmake inside shell (microsoft#13099)
Browse files Browse the repository at this point in the history
* Added option which allows running CMake command inside shell.
  • Loading branch information
egor-bryzgalov committed Jun 22, 2020
1 parent 89dfff6 commit 188fa19
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
"loc.helpMarkDown": "[Learn more about this task](https://go.microsoft.com/fwlink/?LinkID=613719)",
"loc.description": "Build with the CMake cross-platform build system",
"loc.instanceNameFormat": "CMake $(cmakeArgs)",
"loc.group.displayName.advanced": "Advanced",
"loc.input.label.cwd": "Working Directory",
"loc.input.help.cwd": "Current working directory when cmake is run.",
"loc.input.label.cmakeArgs": "Arguments",
"loc.input.help.cmakeArgs": "Arguments passed to cmake",
"loc.input.label.runInsideShell": "Run cmake command inside shell",
"loc.input.help.runInsideShell": "CMake arguments will be handled like they would be inside of an OS specific shell. It can be used to handle environment variables inside of argument strings.",
"loc.messages.CMakeReturnCode": "CMake exited with return code: %d",
"loc.messages.CMakeFailed": "CMake failed with error: %s"
}
4 changes: 3 additions & 1 deletion Tasks/CMakeV1/cmaketask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ async function run() {

cmake.line(tl.getInput('cmakeArgs', false));

const runInsideShell: boolean = tl.getBoolInput('runInsideShell', false);

const options: trm.IExecOptions = <trm.IExecOptions>{
shell: false
shell: runInsideShell
};

const code: number = await cmake.exec(options);
Expand Down
6 changes: 3 additions & 3 deletions Tasks/CMakeV1/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Tasks/CMakeV1/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
},
"homepage": "https://github.com/Microsoft/azure-pipelines-tasks#readme",
"dependencies": {
"azure-pipelines-task-lib": "^2.9.5"
"azure-pipelines-task-lib": "^2.9.6"
}
}
19 changes: 17 additions & 2 deletions Tasks/CMakeV1/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,19 @@
"Build"
],
"author": "Microsoft Corporation",
"groups": [
{
"name": "advanced",
"displayName": "Advanced"
}
],
"demands": [
"cmake"
],
"version": {
"Major": 1,
"Minor": 170,
"Patch": 2
"Minor": 172,
"Patch": 0
},
"minimumAgentVersion": "1.91.0",
"instanceNameFormat": "CMake $(cmakeArgs)",
Expand All @@ -39,6 +45,15 @@
"defaultValue": "",
"required": false,
"helpMarkDown": "Arguments passed to cmake"
},
{
"name": "runInsideShell",
"type": "boolean",
"label": "Run cmake command inside shell",
"required": false,
"defaultValue": false,
"helpMarkDown": "CMake arguments will be handled like they would be inside of an OS specific shell. It can be used to handle environment variables inside of argument strings.",
"groupName": "advanced"
}
],
"execution": {
Expand Down
19 changes: 17 additions & 2 deletions Tasks/CMakeV1/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,19 @@
"Build"
],
"author": "Microsoft Corporation",
"groups": [
{
"name": "advanced",
"displayName": "ms-resource:loc.group.displayName.advanced"
}
],
"demands": [
"cmake"
],
"version": {
"Major": 1,
"Minor": 170,
"Patch": 2
"Minor": 172,
"Patch": 0
},
"minimumAgentVersion": "1.91.0",
"instanceNameFormat": "ms-resource:loc.instanceNameFormat",
Expand All @@ -39,6 +45,15 @@
"defaultValue": "",
"required": false,
"helpMarkDown": "ms-resource:loc.input.help.cmakeArgs"
},
{
"name": "runInsideShell",
"type": "boolean",
"label": "ms-resource:loc.input.label.runInsideShell",
"required": false,
"defaultValue": false,
"helpMarkDown": "ms-resource:loc.input.help.runInsideShell",
"groupName": "advanced"
}
],
"execution": {
Expand Down

0 comments on commit 188fa19

Please sign in to comment.