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
-
Grunt 작업
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입니다.
Azure Pipelines게시 publishJUnitResults
-
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
-
string
; 선택 사항.
enableCodeCoverage = true
때 사용합니다. 허용되는 값: Mocha
, Jasmine
. 기본값은 Mocha
입니다.
테스트 프레임워크를 지정합니다.
소스 파일srcFiles
-
string
; 선택 사항.
enableCodeCoverage = true
때 사용합니다.
hookRequire()
원본 파일의 경로를 지정합니다.
testFiles
-
테스트 스크립트 파일
string
;
enableCodeCoverage = true
때 필요합니다. 기본값은 test/*.js
입니다.
테스트 스크립트 파일의 경로를 지정합니다.
작업 제어 옵션
모든 작업에는 작업 입력 외에 제어 옵션이 있습니다. 자세한 내용은 컨트롤 옵션 및 일반적인 작업 속성참조하세요.
출력 변수
없음.
비고
JavaScript 작업 실행기를 사용하여 Grunt 작업을 실행하려면 이 작업을 사용합니다.
예시
샘플 Gruntfile참조하세요.