[GRADLE-1329] sourceCompatibility = 1.6 broken for eclipse plugin / gradle 0.9.1 Created: 20/Jan/11 Updated: 04/Jan/13 Resolved: 25/Jan/11 |
|
Status: | Resolved |
Project: | Gradle |
Affects Version/s: | 0.9.1 |
Fix Version/s: | 1.0-milestone-1 |
Type: | Bug | ||
Reporter: | Daniel Joyce | Assignee: | Peter Niederwieser |
Resolution: | Won't Fix | Votes: | 1 |
Issue Links: |
|
Description |
my build.gradle contains a sourceCompatibility entry sourceCompatibility = 1.6 "gradle eclipse" using this line works under 0.9, but results in a stack trace under 0.9.1. It looks like a failed cast. A plain "gradle" build works under both 0.9 and 0.9.1 STACK TRACE: 12:30:41.835 [DEBUG] [org.gradle.api.internal.tasks.SkipTaskExecuter] Starting to execute task ':eclipseJdt' |
Comments |
Comment by Daniel Joyce [ 20/Jan/11 ] |
WORKAROUND Using the JavaVersion enum directly works sourceCompatibility = JavaVersion.VERSION_1_6 Using the numeric version does not work in gradle 0.9.1 sourceCompatibility = 1.6 |
Comment by Peter Niederwieser [ 20/Jan/11 ] |
I cannot reproduce this problem. Can you provide a reproducible example? |
Comment by Daniel Joyce [ 21/Jan/11 ] |
Gradle Version info: Gradle build time: Sunday, 2 January 2011 11:40:57 AM EST Just discovered order of entries in build.gradle matters for gradle 0.9.1. This is not stated anywhere in gradle docs, and appears to be a change in behaviour from 0.9.0 FAILS: WORKS: WORKS: |
Comment by Peter Niederwieser [ 21/Jan/11 ] |
Thanks. I can reproduce it now.
Order has always mattered to some degree, especially for plugins. Before a plugin has been applied, everything that it adds (tasks, configurations, etc.) won't be visible. That's why it's good practice to apply plugins at the very top of the script. Anyway, I don't know why order matters in this particular case, and if it is a bug. Will have to investigate. |
Comment by Peter Niederwieser [ 25/Jan/11 ] |
The behavior isn't specific to 0.9.1 and is currently expected. We'll try to come up with a more user-friendly behavior in the future (I'll create a new issue for this). Meanwhile, make sure that plugins are always applied at the top of the script. |