Don't hold the lock on the task history cache while compiling native languages, as this will prevent any other task from executing concurrently.

Still holds the lock while processing the source and header file dependencies.
Minor tidy ups.
Handle null publication date when writing out ivy.xml.
Include last modified time in metadata for local resource
Changed some source files so that they will compile under Groovy 2.x