The Ice Builder for Eclipse provides a plug-in which automates the compilation of Slice files using the Slice-to-Java compiler and manages the resulting generated code.
An Ice installation with slice2java
version 3.4.2 or higher is required.
The Ice Builder for Eclipse plug-in provides the following features:
- Automatically compiles all the Slice files in your project
- Incrementally recompiles Slice files after modifications
- Maintains dependencies between Slice files
- Highlights Slice compilation errors in your source code
- Manages code generated by
slice2java
and removes obsolete generated files automatically
The Ice Builder for Eclipse is distributed through the Eclipse Marketplace:
- From the
Help
menu, chooseEclipse Marketplace
- Search for
Ice Builder
- Click
Install
to install theIce Builder
plug-in
The Ice Builder 4.0 adds all the project's Slice directories to the list of include directories during compilation.
Newer versions of Ice Builder no longer add these directories to the list of include directories. As a result, when upgrading from Ice Builder 4.0 to the latest Ice Builder, you may need to add some of your project's Slice directories to the Include Directories (see Configuring Project Settings below).
If you are upgrading from an Ice plug-in version 3.x, you should uninstall the old plug-in before installing the Ice Builder. For such versions, after installation it might be necessary to manually reconfigure the Ice Builder settings as old settings are not automatically migrated.
The plug-in preferences can be accessed by navigating to Window -> Preferences
and selecting Ice Builder
.
You can use Ice Home
to specify where slice2java
and the Ice Slice
files are located. Ice Builder looks for slice2java
in the bin
subdirectory
of Ice Home
, and for the Slice files in the following subdirectories of Ice Home
:
share/slice
share/ice/slice
share/Ice-<version>/slice
, where<version>
is the output returned byslice2java -v
slice
The Ice Builder uses the following Ice Home
directories by default:
Platform | Default Ice Home |
---|---|
Linux | /usr |
macOS | /usr/local |
Windows | Latest Ice installation recorded in the Windows registry |
Build Automatically
allows you to choose whether Slice files should be rebuilt
automatically as they are updated; it is generally recommended to disable this
option for larger projects.
The plug-in is enabled on a per project basis. To enable it, right click on the
project, choose Ice Builder
and select Add Ice Builder
.
Upon activation, the project immediately creates a generated
directory to hold
the Java source files the Slice compiler generates from your Slice files.
To de-activate the plug-in, navigate to the Ice Builder
menu and select
Remove Ice Builder
. Removing the Ice Builder plug-in will remove all the
generated code but will not affect your Slice files.
To configure the project-specific settings, select Properties
from the
Project
menu or right-click on the name of your project and choose
Properties
. Click on the Ice Builder
menu to view the plug-in's settings
for the selected project.
The Generated Code Directory
allows you to specify where all generated files
should be placed in the project. By default, the plug-in uses the generated
directory for this. To change the directory, you must first create the new
directory, and then click Browse
to navigate to it. The new directory must be
empty, and the plug-in requires exclusive use of it: any files or changes made
to the directory will be lost during the next Slice compilation.
The Include Directories
list allows you to specify Slice include directories
passed to slice2java
through its -I
option. These directories are searched
by slice2java
in the order you specify them. The Ice Builder automatically adds
the Slice directory found within Ice Home
to the end of this list.
You can pass additional options to the Slice compiler with the Additional Options
field. For a list of all supported options and their descriptions,
refer to the slice2java
page in the
Ice Manual.
Slice files can be manually compiled through Eclipse or by using the Compile
Button under the Ice Builder
project menu.
If automatic building is enabled, Slice files will be compiled if one of the following is true:
- Any Slice files in the project have been updated since the last compilation through the plug-in (this includes removing Slice files from projects).
- The options used to compile Slice files have changed.
During a full build, the Ice Builder plug-in automatically searches all directories within your project's scope for Slice files, and compiles all of them, in addition to removing any obsolete generated code.
For incremental builds, only the Slice files that have changed in the project, and the Slice files in the project that directly or indirectly reference them, are recompiled, and their corresponding generated code updated.
In order to build the plug-in, you need an installation of Eclipse suitable for plug-in development.
You also need to install the Eclipse Plug-in Development Environment if it is
not already installed. Go to Help > Eclipse Marketplace
and search for
Eclipse PDE
, then click Install
to install the Eclipse PDE.
To import the project choose File > Import > General > Existing Projects into Workspace
and select the java directory in this repository as the root
directory.
To create the plug-in, use File > Export > Plug-in Development > Deployable plug-ins and fragments
.