I use Eclipse to develop my Java Ice servers. I use the old "IcEclipse" plug-in purely to provide syntax highlighting -- it's not useful for much more. But it's not too hard to set up a good Ant build.xml file and ensure that slice2java gets run at appropriate points in the project's lifecycle, and that's worked pretty well for me.
In my build.xml, I have two targets that looks like this (where JAST_ICE_DIR is the directory where my *.ice files are, and all of my files are in the "jast" module):
Code:
<target name="slice2java">
<mkdir dir="src" />
<slice2java outputdir="src">
<includepath path="${env.JAST_ICE_DIR}" />
<includepath path="${ice_slice_dir}" />
<fileset dir="${env.JAST_ICE_DIR}/jast">
<include name="common/Agent.ice" />
<include name="common/Object.ice" />
<!-- ... and so on ... -->
</fileset>
<meta value="java:java5" />
</slice2java>
</target>
<target name="clean-slice2java">
<delete dir="src/jast" />
<delete file="src/.depend" />
</target>
You also need to make sure to "taskdef" the Ice Java tasks properly; this may be in the Ice documentation, but if not, ask me.
Then, in Eclipse, you need to set things up like this; this is based on instructions I wrote up for my colleagues recently.
- Right click on the project and choose Properties. Inside that window, choose Builders, click on New ..., and then choose Ant Builder and press OK
- On the Main tab, give it whatever name you want (e.g., "slice2java builder"). For the Buildfile, click Browse Workspace, select your new project on the left, and then select build.xml on the right and press OK. Press Apply.
- Choose the Refresh tab. Check Refresh resources on completion. Choose Specific resources and then click the Specify Resources ... button. Open the tree under your new project and check the box next to the src directory. Press OK and then Apply.
- Choose the Targets tab. You need to change the targets to run in all four of the situations: for During a “Clean” choose the clean-slice2java target and un-check all other targets; for the other three, choose slice2java and un-check the others. Once you’ve chosen the targets for all four fields, press Apply.
- Choose the Build Options tab. Check Specify working set ... and press the Specify Resources ... button. Browse to your project and select its build.xml file. Press Finish and then OK.
- Back in the Builders screen, select the new builder you just added and move it above the default Java Builder. Press OK.
If you're lucky, the project will now automatically call slice2java before trying to build itself, and all of your interfaces will be available.
I hope this is sort of useful. Let me know if something doesn't work and I can clarify.
MEF