2009-06-12 6 views
4

Gradle을 빌드 도구로 사용하는 프로젝트가 있으며 Ant Java task을 사용해야합니다. 이 작업의 하위 요소 중 하나는 클래스 경로에 대한 참조이므로 refid를 사용하고 싶습니다. 빌드 스크립트는 Gradle의 WAR plugin을 사용합니다. 컴파일 작업이 문제없이 작동하기 때문에 나는 클래스 경로가 올바르게 설정되어 있는지 알고클래스 경로에서 클래스 경로를 참조하는 방법 0.6

 
dependencies { 
    compile 'commons-beanutils:commons-beanutils:1.8.0' 
    compile group: 'commons-lang', name: 'commons-lang', version: '2.4' 
    ... 
} 

아니, 난이 빌드 스크립트 내 Gradle을이 클래스 경로를 참조하고 싶습니다. 나는 다음과 같은 노력했습니다

: classpathId를 사용

은 (내장?) 가 Gradle을의 메일 링리스트를 검색하고 제안을 발견

project.dependencies.antpath('compile')

이 오류가 발생합니다. 또한 이것의 변종을 시험해 보았으나 지금까지 행운은 없습니다. 모든 제안을 부탁드립니다.

답변

10

구성된 depedencies 액세스 할 다음 : 당신이 당신의 자신의 구성을 정의한 경우

 
configurations.compile.asPath 

당신은이를 이용할 수있다 :

 
configurations { 
    gwtCompile 
} 
.... 
ant.java(classname:'com.google.gwt.dev.Compiler', fork:'true', failOnError: 'true') { 
    jvmarg(value: '-Xmx184M') 
    arg(line: '-war ' + gwtBuildDir) 
    arg(value: 'com.yoobits.ocs.WebApp') 
    classpath { 
     pathElement(location: srcRootName + '/' + srcDirNames[0]) 
     pathElement(path: configurations.compile.asPath) 
     pathElement(path: configurations.gwtCompile.asPath) 
    } 
} 

을 예에서 나는 컴파일 경로를 액세스 한 위 내 자신의 구성은 GWT 컴파일러로 컴파일 할 때 특별한 단계에서 흥미 롭습니다.

관련 문제