Last updated June 16, 2012 02:28, by dr2chase

Fortress development with Eclipse currently requires: (3.5-3.7 plugins) (3.6-3.7 plugins)

Ant requires too many platform-specific options (stack and heap size, for example) to be easily configurable from within Eclipse, so common practice is to at least build the generated files outside Eclipse ("ant generated"), and then refresh and rebuild. In practice, relevant changes to the generated files or the code generating them are rare, so it is easy enough to work almost entirely within Eclipse. If Eclipse reports a large number of errors with a freshly checked-out and ant-generated repository, try instead "ant compile" and refresh. If that fails, try cleaning the project and rebuilding.

Expanding heap and stack

Find and edit eclipse.ini, which might be located someplace like this:


The vmargs parameter as shipped uses these heap settings:


It needs to specify a larger heap and more stack.


Adjust the max heap size ("mx") to be sure that it fits in real memory. "ms" should be at least twice the "NewSize".

Cloning (checking out) with MercurialEclipse

1. New -> Project...

2. Mercurial -> Clone Existing Mercurial Repository

3. Specify the repository url, username, and directory for the checkout (that should not conflict with existing directories)

4. Choose the default revision

5. This next step is a little confusing. If the name of the project (specified in the embedded .project file) conflicts with an existing project, the project and directory will be grayed out and unselectable. To fix this, double-click on the grayed-out name itself.

6. You should then see a pane giving you the option to rename the project itself.

7. And then it is possible to go forward.

Initial build

We haven't been able to get Eclipse's ant integration to work properly across all platforms. Instead, in the top-level directory, from the command line, type "./ant compile". This will create all the generated files need to compile the system, and then compile the system. The reason for "./ant" is that ant requires different JVM parameters to build Fortress on different platforms (this is also why we have not succeeded in running ant from within Eclipse).

Whenever the project appears to get in a peculiar state within Eclipse, if all else fails, exit Eclipse, rebuild from the command line, start Eclipse, and Refresh the project.

Fortress Compiler and Runtime Run Configurations

The portions of the Fortress Compiler and Runtime written and Java can be stepped through using the Eclipse debugger (also works for those portions written in Scala, though less nicely).

Compiler Run Configuration

1. Run -> Run Configurations ...

2. New Java Application launch configuration [image]

3. Main Tab:


4. Arguments Tab:

for example: "link -debug stacktrace ProjectFortress/compiler_tests/Compiled17dddd.fss"

Runtime Run Configuration

1. Run -> Run Configurations ...

2. New Java Application launch configuration

3. Main Tab:

4. Arguments Tab:

for example: Compiled17dddd

for example: -Dfortress.bytecode.list=1 (saves on the fly classes)

5. Classpath Tab: Add two entries under User Entries by selecting the "Advanced..." button on the left and adding a Variable String for:

Be sure that these appear BEFORE the default classpath; order is important.