Closed davidbokor closed 9 years ago
Hi David, I'm also having the same problem but being new to gradle, don't know how to set that. I wonder how you set the input directory manually.
Thanks,
-abdur
Hi guys,
I am currently on vacation, I will fix both issues when I come back early september. Sorry for the inconveniences. If you have patches, I will be happy to review and merge them at the same time.
Sent from my iPhone
On 2014-08-13, at 21:19, abillah notifications@github.com wrote:
Hi David, I'm also having the same problem but being new to gradle, don't know how to set that. I wonder how you set the input directory manually.
Thanks,
-abdur
— Reply to this email directly or view it on GitHub.
Very delighted to hear from you. Thank you very much. Enjoy your vacation.
-abdur
On 8/13/2014 2:53 PM, John Martel wrote:
Hi guys,
I am currently on vacation, I will fix both issues when I come back early september. Sorry for the inconveniences. If you have patches, I will be happy to review and merge them at the same time.
Sent from my iPhone
On 2014-08-13, at 21:19, abillah notifications@github.com wrote:
Hi David, I'm also having the same problem but being new to gradle, don't know how to set that. I wonder how you set the input directory manually.
Thanks,
-abdur
— Reply to this email directly or view it on GitHub.
— Reply to this email directly or view it on GitHub https://github.com/johnmartel/javaccPlugin/issues/3#issuecomment-52101349.
My workaround isn't elegant. I created a my own plugin as follows:
import ca.coglinc.gradle.plugins.javacc.CompileJavaccTask
import org.gradle.api.Plugin
import org.gradle.api.Project
class JavaCCPlugin implements Plugin<Project> {
void apply(Project project) {
project.plugins.apply('ca.coglinc.javacc')
project.tasks.withType(CompileJavaccTask.class) {
it.setInputDirectory(project.file("src/main/javacc"))
}
}
}
You can use task configuration to configure input directory:
compileJavacc {
inputDirectory = file('src/custom/directory')
}
Since the task uses getProject().getRootDir() to set the input directory, it tries to find the "src/main/javacc" directory under the root of my multi-module project instead of in the module directory itself.
As a workaround, I had to set the input directory manually but it would be nice if I didn't have to.