By Alvin Alexander. Last updated: June 4, 2016
Enable Java assertions in Ant (FAQ): How do I enable Java assertions in Ant?
Here's something that should have been a little more obvious to me: how to enable assertions when compiling Java code that uses the version 1.4 "assertions" feature:
<javac destdir="${build.dir}/classes" source="1.4"> ... </javac>
Of course I'm skipping the details in between, but the bold characters in the first line of my build.xml file are the most important in terms of enabling assertions in Ant while performing a javac/compile task.
I'm still trying to get comfortable with where to use assertions and where not to, but this was a major stumbling block when using Ant inside of Intellij. Now that I'm through that, I can get back to the important question: "When should I use assertions, and when shouldn't I?"