문서의 선택한 두 판 사이의 차이를 보여줍니다.
양쪽 이전 판 이전 판 다음 판 | 이전 판 | ||
gant:targets [2012/10/17 18:57] kwon37xi |
gant:targets [2012/10/22 16:55] (현재) kwon37xi [동적 타겟 생성] |
||
---|---|---|---|
줄 27: | 줄 27: | ||
target ( adob : 'A target called adob.' ) { | target ( adob : 'A target called adob.' ) { | ||
flob ( ) //flob 이라는 타겟 호출 | flob ( ) //flob 이라는 타겟 호출 | ||
+ | this[' | ||
} | } | ||
</ | </ | ||
* 다른 타겟에 의존할 수도 있다.< | * 다른 타겟에 의존할 수도 있다.< | ||
target ( adob : 'A target called adob.' ) { | target ( adob : 'A target called adob.' ) { | ||
- | depends ( flob ) | + | depends ( flob ) // adob 타겟을 실행하면 그 전에 항상 flob 타겟 호출 |
- | | + | depends ( ' |
} | } | ||
</ | </ | ||
+ | * 의존성은 여러개 설정할 수 있으며 설정 순서에 따라 실행한다. 위 예에서는 ' | ||
===== 기본 타겟 ===== | ===== 기본 타겟 ===== | ||
* '' | * '' | ||
줄 49: | 줄 50: | ||
</ | </ | ||
+ | |||
+ | ===== 동적 타겟 생성 ===== | ||
+ | '' | ||
+ | * '' | ||
+ | def names = [' | ||
+ | |||
+ | names.each { name -> | ||
+ | target(name: | ||
+ | echo(message: | ||
+ | } | ||
+ | } | ||
+ | target(allProject: | ||
+ | names.each { | ||
+ | depends(it) // 모든 name_project에 대해 의존성 걸기 | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | * '' | ||
+ | $ gant -T | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | </ |