[GRADLE-2512] Provide a better error message when trying to add an action to an already executing task Created: 08/Oct/12 Updated: 07/May/13 Resolved: 14/Nov/12 | 
|
| Status: | Resolved | 
| Project: | Gradle | 
| Affects Version/s: | None | 
| Fix Version/s: | 1.4-rc-1 | 
| Type: | Improvement | ||
| Reporter: | Szczepan Faber | Assignee: | Unassigned | 
| Resolution: | Fixed | Votes: | 0 | 
| Issue Links: | 
  | 
||||||||
| Description | 
task foo << {
  doLast { println 'foo' }
}
Above is a user mistake easy to make. However, the error message not very friendly (ConcurrentModificationException). I'd expect to see something like: 'you cannot add task action at configuration time, please check if ...'  | 
| Comments | 
| Comment by Adam Murdoch [ 12/Nov/12 ] | 
| 
 Doing any of the following after the task has started executing should be deprecated and result in a warning: 
  | 
| Comment by Szczepan Faber [ 13/Nov/12 ] | 
| 
 Awesome. I vote for making the exception message descriptive and hinting. I would even mention in the message that typically this problem often appears for misused '<<' at task declaration.  | 
| Comment by René Gröschke (Inactive) [ 14/Nov/12 ] | 
| 
 I added warnings for all cases above + TaskInputs.file() & TaskOutputs.file(). You can lookup the warning messages in the according integration test class 'ExecutionTimeTaskConfigurationIntegrationTest'  |