Reputation: 3694
In most programming IDE I can run a process (a jar or exe) before compile or build. For example, I can run an exe file to generate a few classes. This is more enhanced with text templates in Visual Studio.
Is it possible to run a process before compile or build in Netbeans? Do we have a similar concept like text templates in NetBeans? I am using NetBeans version 8.0.2
Upvotes: 1
Views: 2828
Reputation: 7008
To execute a command before compiling, put it in the build.xml file as this:
<target name="-pre-compile">
<exec executable="cmd">
<arg value="arg1"/>
<arg value="arg2"/>
</exec>
</target>
See the Exec Task for Ant. https://ant.apache.org/manual/Tasks/exec.html
Code templates that can be accessed from Tools -> Templates are a completely separate matter. The templates are used when File -> New for the appropriate type is executed.
Upvotes: 2