javacc / javaccPlugin

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

Building JavaCC with javaccPlugin #71

Closed MehrunesSky closed 5 months ago

MehrunesSky commented 5 months ago

I have the same problem as #30

I have this error on rebuild

error: cannot find symbol @SneakyThrows(ParseException.class) ^ symbol: class ParseException

I have to clean my project on every change on .jj

Do you have already got this issue?

MehrunesSky commented 5 months ago

This is my configuration compileJavacc { outputDirectory = file(project.buildDir.absolutePath + '/generated/sources/annotationProcessor/java/main/') arguments = [grammar_encoding: 'UTF-8', static: 'false'] }

I use gradle 8.6

zbynek commented 5 months ago

outputDirectory = file(project.buildDir.absolutePath + '/generated/sources/annotationProcessor/java/main/')

This doesn't look right -- the build/generated/sources/annotationProcessor path is managed by the compileJava task, which might clean that folder after JavaCC generated the files.

I'd suggest to either use the default outputDirectory which is effectively file(project.buildDir.absolutePath + '/generated/javacc') or pick something outside of the annotation processor output.