I can imagine two solutions, either check in the antlr.jar so it can be referenced using a local file (but not sure about the license implications), or the build.rs logic could be triggered only when an environment variable is set, since this seems to be needed for tests only. Detecting the test profile from within build.rs does not seem to be possible yet.
The
build.rs
references a local antlr.jar that usually does not exist when using antlr4rust as a dependency. This seems to trigger a full rebuild every time, according to a cargo issue that is the expected behaviour.I can imagine two solutions, either check in the
antlr.jar
so it can be referenced using a local file (but not sure about the license implications), or thebuild.rs
logic could be triggered only when an environment variable is set, since this seems to be needed for tests only. Detecting the test profile from withinbuild.rs
does not seem to be possible yet.