[GRADLE-3427] Expose CompilerDaemon functionality to Plugin Authors Created: 05/Apr/16  Updated: 24/Jan/17  Resolved: 24/Jan/17

Status: Resolved
Project: Gradle
Affects Version/s: None
Fix Version/s: None

Type: New Feature
Reporter: Pepper Lebeck-Jobe Assignee: Unassigned
Resolution: Duplicate Votes: 2


 Description   

Use Case
As a plugin-developer attempting to add support for a new language, I want to be able to run my compiler in a forked (and possibly long-running) process which can survive from build to build, so that I can take advantage of my language's compiler features like incremental compilation.

Known Prospective Users
Guidewire would like to have support for their GoSu compiler. They even put together this awesome pull request to add it to the Gradle distribution. Unfortunately, we cannot take on the engineering complexity or distribution bloat to support GoSu due to its relatively small user-base.

JetBrains is interested in adding Kotlin support.

Grails probably needs the same feature for the "unsafe incremental compiler"

Status
This issue has been filed to track our progress on this important feature for the community. The first step is definitely for someone to do the design work necessary to expose the API in a supportable, extensible, and generic way which can support the known use cases, but also not expose too much of the implementation details to the Public API.

The Core Gradle Team is currently working on prioritizing this design work so we can figure out a realistic schedule for early integrations with the API.



 Comments   
Comment by Kyle Moore [ 26/Apr/16 ]

Hi Gradle team.

I've spent a few days investigating a potential way in which a 3rd party implementation of AbstractDaemonCompiler could theoretically execute in a forked process.

Please have a look at this publicly-shared Google document and feel free to leave comments (or tell me why I'm crazy and this would never work ):

https://docs.google.com/document/d/1JqwTn0LV1sw-CHB8r4AUML0d-YLlQ6GNUYsGjYQal1Y/edit?usp=sharing

Comment by Kyle Moore [ 09/Jun/16 ]

Hi team.

I updated the above linked document with a more general introduction and links to a class diagram. The execution flow is complex but hopefully the diagram makes some sense.

Thanks again for your interest in this and see you at summit in a few weeks,

Kyle Moore

Comment by Kyle Moore [ 10/Jun/16 ]

One more note on this-

I created an experimental snapshot of my Gradle plugin for Gosu which includes an implementation of AbstractDaemonCompiler. And I also created very simple sample project which uses this snapshot and is pre-configured to use forking compilation. So it should be as simple as downloading this archive, unzipping and running $ ./gradlew clean test to see an example of the ClassNotFoundException at the heart of this issue.

The archive -> https://github.com/gosu-lang/example-gradle-simple/archive/GRADLE-3427.zip

Thanks again,

Kyle

Comment by Benjamin Muschko [ 15/Nov/16 ]

As announced on the Gradle blog we are planning to completely migrate issues from JIRA to GitHub.

We intend to prioritize issues that are actionable and impactful while working more closely with the community. Many of our JIRA issues are inactionable or irrelevant. We would like to request your help to ensure we can appropriately prioritize JIRA issues you’ve contributed to.

Please confirm that you still advocate for your JIRA issue before December 10th, 2016 by:

  • Checking that your issues contain requisite context, impact, behaviors, and examples as described in our published guidelines.
  • Leave a comment on the JIRA issue or open a new GitHub issue confirming that the above is complete.

We look forward to collaborating with you more closely on GitHub. Thank you for your contribution to Gradle!

Comment by Kyle Moore [ 16/Nov/16 ]

Thanks for the message, @bmuschko.

Yes, this issue is still quite relevant to my plugin, as well as any other 3rd-party plugin author who needs to access the client/worker APIs.

In fact, I spoke about this issue with Pepper in-person yesterday at the Bay Area meetup. Pepper claimed that changes to expose the worker API are currently being code reviewed - which is great news!! I am looking forward to taking advantage of this great feature soon.

Thanks,

Kyle

Comment by Eric Wendelin [ 24/Jan/17 ]

Moving to https://github.com/gradle/gradle/issues/1239 — please track it's progress there.

Generated at Wed Jun 30 12:48:32 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.