문서의 선택한 두 판 사이의 차이를 보여줍니다.
양쪽 이전 판 이전 판 다음 판 | 이전 판 | ||
gant:targets [2012/10/18 12:13] 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: | ||
</ | </ | ||
- | ===== 기본 Ant 태스크와 기타 태스크 ===== | ||
- | Groovy는 기본적으로 Ant와 JUnit을 내장하고 있다. 따라서 Gant는 어떠한 추가 없이 Ant와 JUnit 태스크를 실행할 수 있다. 기타 직접 설치한 태스크는 다음과 같이 실행할 수 있다. | ||
- | |||
- | * '' | ||
- | * '' | ||
- | * '' | ||
- | * '' | ||
- | * '' | ||
- | * '' | ||
- | * '' | ||
- | * '' | ||
===== 동적 타겟 생성 ===== | ===== 동적 타겟 생성 ===== | ||
- | '' | + | '' |
* '' | * '' | ||
def names = [' | def names = [' | ||
names.each { name -> | names.each { name -> | ||
- | target(name: | + | target(name: |
echo(message: | echo(message: | ||
+ | } | ||
+ | } | ||
+ | target(allProject: | ||
+ | names.each { | ||
+ | depends(it) // 모든 name_project에 대해 의존성 걸기 | ||
} | } | ||
} | } | ||
</ | </ | ||
+ | * '' | ||
+ | $ gant -T | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | </ |