Grunt@0 - Grunt v0 工作
使用此工作來執行 Grunt JavaScript 工作執行器。
語法
# Grunt v0
# Run the Grunt JavaScript task runner.
- task: Grunt@0
inputs:
gruntFile: 'gruntfile.js' # string. Required. Grunt File Path. Default: gruntfile.js.
#targets: # string. Grunt Task(s).
#arguments: # string. Arguments.
# Advanced
#workingDirectory: # string. Alias: cwd. Working Directory.
gruntCli: 'node_modules/grunt-cli/bin/grunt' # string. Required. grunt-cli location. Default: node_modules/grunt-cli/bin/grunt.
# JUnit Test Results
#publishJUnitResults: false # boolean. Publish to Azure Pipelines. Default: false.
#testResultsFiles: '**/TEST-*.xml' # string. Required when publishJUnitResults = true. Test Results Files. Default: **/TEST-*.xml.
#testRunTitle: # string. Optional. Use when publishJUnitResults = true. Test Run Title.
# Code Coverage
#enableCodeCoverage: false # boolean. Enable Code Coverage. Default: false.
#testFramework: 'Mocha' # 'Mocha' | 'Jasmine'. Optional. Use when enableCodeCoverage = true. Test Framework. Default: Mocha.
#srcFiles: # string. Optional. Use when enableCodeCoverage = true. Source Files.
#testFiles: 'test/*.js' # string. Required when enableCodeCoverage = true. Test Script Files. Default: test/*.js.
輸入
gruntFile
-
Grunt 檔案路徑
string
。 必須的。 預設值:gruntfile.js
。
指定從存放庫根目錄到 Grunt 文稿的相對路徑。
targets
-
格魯特任務
string
。
選擇性。 指定要執行之工作的空間分隔清單。 如果未指定,則會執行預設工作。
arguments
-
自變數
string
。
指定傳遞至 Grunt 的其他自變數。 如需詳細資訊,請參閱使用 CLI 。
注意:--gruntfile
,因為它已經透過上述 gruntFile 輸入新增。
workingDirectory
-
工作目錄
輸入別名:cwd
。
string
。
選擇性。 指定執行文稿時目前的工作目錄。 如果未指定,工作目錄會預設為腳本所在的資料夾。
gruntCli
-
grunt-cli 位置
string
。 必須的。 預設值:node_modules/grunt-cli/bin/grunt
。
指定要在代理程式找不到全域安裝的 grunt-cli 時執行的 grunt-cli。 預設為工作目錄 node_modules
資料夾下的 grunt-cli。
publishJUnitResults
-
發佈至 Azure Pipelines
boolean
。 預設值:false
。
選取此選項可將 Grunt 組建所產生的 JUnit 測試結果發佈至 Azure Pipelines/TFS。
testResultsFiles
-
測試結果檔案
string
。
publishJUnitResults = true
時為必要項。 預設值:**/TEST-*.xml
。
指定測試結果檔案路徑。 可使用萬用字元。
例如,針對開頭為 TEST-
的所有 XML 檔名 **/TEST-*.xml
。
testRunTitle
-
測試回合標題
string
。 選擇性。
publishJUnitResults = true
時使用 。
指定測試回合的名稱。
enableCodeCoverage
-
啟用程式代碼涵蓋範圍
boolean
。 預設值:false
。
選取此選項以使用伊斯坦布爾啟用程式代碼涵蓋範圍。
testFramework
-
Test Framework
string
。 選擇性。
enableCodeCoverage = true
時使用 。 允許的值:Mocha
、Jasmine
。 預設值:Mocha
。
指定您的測試架構。
srcFiles
-
原始程式檔
string
。 選擇性。
enableCodeCoverage = true
時使用 。
指定您要 hookRequire()
來源檔案的路徑。
testFiles
-
測試腳本檔案
string
。
enableCodeCoverage = true
時為必要項。 預設值:test/*.js
。
指定測試文稿檔案的路徑。
工作控制選項
除了工作輸入之外,所有工作都有控制選項。 如需詳細資訊,請參閱 控制項選項和一般工作屬性。
輸出變數
沒有。
備註
使用此工作,使用 JavaScript 工作執行器來執行 Grunt 工作。
範例
請參閱 範例 Gruntfile。
需求
要求 | 說明 |
---|---|
管線類型 | YAML,傳統組建 |
執行於 | Agent、DeploymentGroup |
需求 | 自我裝載代理程式必須具有符合下列 需求 功能,才能執行使用此工作的工作:node.js |
功能 | 此工作不符合作業中後續工作的任何需求。 |
命令限制 | 任意 |
Settable 變數 | 任意 |
代理程式版本 | 1.91.0 或更新 |
工作類別 | 建造 |