Question

We have a project that we compile through Ant, we had some issues people wrote code that's only compilable by eclipse compiler, not through the regular javac, so we changed the compiler by passing in the ecj* jar file when calling ant on the commend-line.

We currently decide to use Project Lombok, it looks good, and it works great on local eclipse IDE's, when it comes to compile on server through a build script, it doesn't encounter in any exception, but at run-time he could not find the getter method etc.

The lomboc.jar file is in our lib folder we specify in build.xml.

Does any body have experience with this scenario?

Thanks

UPDATE

I found a link http://projectlombok.org/setup/ecj.html that explains how to use it with ecj, but i don't understand how i could use it, because we call ant and pass in the ecj jar file in the lib argument.

Était-ce utile?

La solution

Finally i figured it out. I have to use <exec executable="java"> to compile, instead of the javac tag. Hare is my example:

<exec executable="${env.JAVA_HOME}/bin/java"> <arg value="-javaagent:${lombok_jar}=ECJ"/> <arg value="-cp"/> <arg pathref="compile.classpath"/> <arg value="-jar"/> <arg value="${ecj_jar}"/> <arg value="-cp"/> <arg pathref="compile.classpath"/> <arg value="-d"/> <arg value="${classes}"/> <arg value="${src}"/> </exec>

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top