javacc / javaccPlugin

A JavaCC plugin for Gradle
MIT License
33 stars 16 forks source link

Add capability to configure compile task dependencies on javacc and jjtree tasks #23

Closed QuentinBrun closed 1 year ago

QuentinBrun commented 8 years ago

Use a custom extension containing two configurable closure used by the JavatoJavaccDepedencyAction

Sample to add to your gradle build script :

DependancyConfiguration {
    compileTasksDependenciesForJavacc = {tasks, javaccTask->tasks.matching( {task -> task.name.equals("compileJava") } )}
    compileTasksDependenciesForJjTree = {tasks, jjTreeTask->tasks.matching( {task -> task.name.equals("compileJava") } )}
}

this block declare that only the main sourceSet will depend on the javacc and jjtree tasks.

QuentinBrun commented 8 years ago

I apologize for the failing test, I will check and correct the tests.

QuentinBrun commented 8 years ago

This merge request should fix issue #22. I hope that I have respected all your needs.

johnmartel commented 8 years ago

Thanks @QuentinBrun ! I'm starting the review, I might have some questions for you? Overall this looks great, but devil's in the details :) Please allow for a week or so, as I have other matters on my plate right now and can not afford the time I'd like in reviewing this.

QuentinBrun commented 8 years ago

Ok, I reworked my whole code to do as you proposed as I must admit it is better. I will commit in a while. Thanks for your time.

QuentinBrun commented 8 years ago

This seem to be better. I will add a test to keep same test coverage. One question : the extension is now named 'javaccDependencyConfiguration'. I find it clearer than 'javacc' but it do not follow how built-in plugins do. What do you prefer ?

zbynek commented 1 year ago

@QuentinBrun are you still interested in this PR? The feature would be very useful, maybe we could simplify the configuration though (use list of sourceset names instead of lambda, call the extension just "javacc" so that there is one extension for this plugin that can contain other configuration options later).

QuentinBrun commented 1 year ago

Hi, I have not worked around Javacc for 5 years. Feel free to do whatever you want with this PR. I do not have enough time to check and help on this one.