Monday, January 24, 2011

Gradle JDK 1.6 source compatibility

To configure JDK 1.6 compatibility in the generated eclipse JDT preferences file using gradle, add this to the build.gradle file:
eclipseJdt{
 whenConfigured { domain ->
  domain.sourceCompatibility=org.gradle.api.JavaVersion.toVersion("1.6")
  domain.targetCompatibility=org.gradle.api.JavaVersion.toVersion("1.6")
    }
}
Or something simpler, add the following to the build.gradle file:
sourceCompatibility=1.6
targetCompatibility=1.6

No comments:

Post a Comment