Building a .jar file for the plug-in
Now we are ready to use the build.xml Ant buildfile that was created
in the last section:
- Select the build.xml file in the Navigator and choose Run Ant... from
the context menu.
- In the Run Ant dialog, the Targets tab should be visible. Make sure that
'build.jars' is the only item in the list selected.
- Switch to the Refresh tab. The options on this tab control if and how the
workspace looks for new, changed and deleted resources after the buildfile finishes
execution. Because refreshing can be an expensive operation, you should refresh
the smallest subset of the workspace necessary for your buildfile.
- Check Refresh resources after running tool, then select ${project} in
the list.
- Click Run.
- The Ant buildfile runs, executing the build.jars target. Output from the buildfile
is visible in the Console view.
- When the buildfile finishes, notice that there is a new .jar file under your
project containing the two class files that comprise your plug-in. If we had
chosen not to refresh the project, the .jar file would still have been created,
but we would not see it in the Navigator.
We've run the default target for the build.xml Ant buildfile, but there are many
other targets and options to be explored.