On 10/10/2012 06:51, Jan Pellegrims wrote:
> Dear Eiffel enthusiasts,
>
> My task is to develop a website on which students can type Eiffel classes (plain .e-files), click a button and compile what they just have typed.
> For that I which to address the command line Eiffel compiler (ec.exe).
>
> How do I execute this compiler so that
> - The right class is used as the root class.
The easiest thing to do is to create an Eiffel Configuration File (.ECF)
which will describe the system:
- Root class and its cluster location
- list all libraries needed
- list all clusters required to compile and find the root class
- other settings.
There is also the ability to compile a system without an ECF and here
you just do `ec my_root_class.e'.
For more details look at:
http://docs.eiffel.com/book/eiffelstudio/eiffelstudio-using-command-line-options#Commands_for_compiling
http://docs.eiffel.com/book/eiffelstudio/eiffelstudio-project-settings-window
> - All Eiffel classes in the folder (which are (in-)directly used by that root class are used.
If they are in the same directory, the above 2 suggestions will find all
the needed classes.
> - I can use the precompiled library classes.
This can be specified in the ECF. If you use the ECF-less strategy, then
the precompiled library of EiffelBase will be used automatically.
> - It generates an executable program (ans some other files needed to run that program, like a .melted-file).
This is the default behavior.
> - I eventually receive some compiler feedback in case of compilation errors.
One just need to parse the output of the compiler.
> - I want the generated files are in the same folder or a subfolder of the original files.
Using the ECF-less strategy, we copy the executable automatically in the
current directory where the project was compiled. Otherwise you have to
create a script that copies the generated files.
> - The size of the project has to be reasonable for download (a simple program, 4 classes generates an .exe + .melted of about 5 Mb).
There are two modes: workbench and finalized. Workbench mode will
generate a large executable, but finalized will generate a smaller
executable. I recommend having them download the finalized version.
Let us know how it goes,
Manu