사용자 도구

사이트 도구


gradle:groovy

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판
이전 판
gradle:groovy [2012/10/06 19:44]
kwon37xi [소스셋 프라퍼티]
gradle:groovy [2014/09/11 03:17] (현재)
kwon37xi
줄 94: 줄 94:
  
 ===== CompileGroovy ===== ===== CompileGroovy =====
 +Groovy 플러그인은 프로젝트의 각 소스셋에 [[http://www.gradle.org/docs/current/dsl/org.gradle.api.tasks.compile.GroovyCompile.html|GroovyCompile]] 인스턴스를 추가한다. 이는 ''Compile'' 태스크를 상속한다. 이 태스크는 Ant Groovyc 태스크에 컴파일을 위임한다.
  
 +CompileGroovy의 프라퍼티들은 다음과 같다.
  
 +^태스크 프라퍼티 ^타입 ^기본값 ^
 +| classpath | [[http://www.gradle.org/docs/current/javadoc/org/gradle/api/file/FileCollection.html|FileCollection]] | //소스셋//.compileClasspath |
 +| source | [[http://www.gradle.org/docs/current/javadoc/org/gradle/api/file/FileTree.html|FileTree]] | //소스셋//.groovy
 +| destinationDir | File | //소스셋//.output.classesDir |
 +| groovyClasspath | [[http://www.gradle.org/docs/current/javadoc/org/gradle/api/file/FileCollection.html|FileCollection]] | groovy configuration |
  
 +===== 컴파일 옵션들 =====
 +  * http://nobeans-en.blogspot.de/2009/12/how-to-specify-character-encoding-in.html
 +  * Groovy 소스 인코딩 지정 <code groovy>
 +// /src/main/groovy 안의 *.java 인코딩
 +[compileGroovy, compileTestGroovy]*.options*.encoding = 'UTF-8' 
 +// /src/main/groovy 안의 *.groovy 인코딩
 +[compileGroovy, compileTestGroovy]*.groovyOptions*.encoding = 'UTF-8' 
  
 +// 길게 풀어쓰면
 +compileGroovy {  
 +    groovyOptions.encoding = defaultEncoding  // affects *.groovy under src/main/groovy  
 +    options.encoding = defaultEncoding        // affects *.java under src/main/groovy  
 +}  
 +</code>
 +  * [[http://blog.freeside.co/2014/06/24/enabling-groovys-invokedynamic-support-in-gradle/|Enabling Groovy’s “invokedynamic” support in Gradle]]<code groovy>
 +tasks.withType(GroovyCompile) {
 +  groovyOptions.optimizationOptions.indy = true
 +}
 +</code>
 +  * you should use **JDK 7u60** or above to avoid any potential invokedynamic related bugs.
gradle/groovy.1349520249.txt.gz · 마지막으로 수정됨: 2012/10/06 19:44 저자 kwon37xi