Rebuilding an ECF Project Configuration

9 views
Skip to first unread message

Larry Rix

unread,
Jan 20, 2019, 8:59:38 AM1/20/19
to Eiffel Users
SITUATION: You have an existing ECF. Something has gone horribly wrong. Your project will not compile and the errors stem from how you have your ECF configured.

There are (perhaps) several solutions:

1. Learn—try to figure out what is wrong and fix it. However, this might be more complex than you and the surrounding community can handle (for various reasons).

2. Remove-and-Remake—the steps are fairly simple: a) delete the ECF (or simply rename it so Eiffel Studio no longer sees it as an ECF file). Then—b) use Eiffel Studio to create a new project ECF using its facilities (i.e. project creation wizard).

NOTE: I am going to attempt to create such a situation in a sample project and then correct it. I will create a video of that process and then add a link to the video here. This ought to make it easier, rather than writing a lengthy explanation or stopping here and letting you figure it out on your own (note that you might be able to do that—if so—yay!)

Larry Rix

unread,
Jan 20, 2019, 11:09:02 AM1/20/19
to Eiffel Users
The video can be found here.

The highlights are:

  1. Delete or rename your corrupted ECF file. I recommend renaming and moving to another location on your file system. You can still use it as a reference, but it is away from where it will be confusing.
  2. Open Eiffel Studio to where it asks you to either create a new project or open an existing project.
  3. Create a new project: a) Basic application and then b) Create button
    • image.png
  4. On the "Choose your project name and directory" dialog, change the appropriate information (i.e. System name and Location). Leave the Root class and Root feature alone.
    • image.png
  5. Allow the precompile (if it wants to—we will delete it later if we choose to).
    • image.png
  6. At a minimum, you will most likely have other libraries that your code has dependencies on.
    • Because your new ECF has a Root class and feature of APPLICATION.make, you may find that your project compiles without error. This is okay! You're about to change things so that it blows up (i.e. has errors). Don't worry. We will make things okay again by adding the needed libraries.
    • In my situation, my project is a library project, so it has no Root class or application as such.
    • I can see this by examining my project and noting that all of my test classes are "out-of-system".
    • Also—my production code is also "out-of-system", for the very same reason.
    • This means that there is no reference leading from my new APPLICATION.make (my Root class and feature) to either my production code or my testing code. So, the project compiles without failing.
    • Once I add the testing library, this will change and I will generate errors because both my testing classes and some (perhaps not all) of my production classes will be in system, but will not have all of the library references they need in the ECF file.
    • image.png
    • In my case, adding the testing library has the following result:
    • image.png
  7. The next step is to bring back all of the library references my project code needs.
    • image.png
    • In my case, I saved text I copied from my old ECF to the clipboard. I then simply pasted that text into my newly created ECF file in Notepad.
    • I did a little editing (delete the items lined out in red and keeping all else).
    • I then deleted the white space, saved the ECF file, closed the editor, and opened Eiffel Studio to "clean compile" the project.
    • image.png
    • The clean compile revealed two more issues with my ECF (not necessarily with yours).
    • I need to a) Set my void safety to Tranisional and b) Set my Concurrency to Thread. My libraries have need of both of these settings (someday soon, they'll be SCOOP'd instead of Thread).
    • image.png
    • My clean compile is now working.
  8. And what am I left with?
    • image.png
    • All of my tests are now shown in Auto Test and they all pass, which is how they were in my former ECF that I deleted (but am pretending was corrupted).
  9. Starting at about minute 7 in the video (link above), I do a recap.
  10. Recap
    • Deleted my "corrupt" ECF
    • Rebuilt it using the Eiffel Studio basic console application project creation wizard in the same root directory with the same ECF name.
    • Added in the testing library to bring my tests back in-system resulting in missing library reference errors
    • Added in the missing libraries to my ECF using my text editor. You can add yours using the Project editor dialog window if you like.
    • Finally—I made minor configuration changes needed by my project for void safety and concurrency.
    • Done! The world is basically happy again.
  11. What's more?
    • In my case, I am building a library, so the APPLICATION class can be deleted and the ECF configuration can be given a "Library Target" of "ereport", and the ECF can be configured to use all classes.
    • If YOU are building an application, you will want to delete the APPLICATION class and re-target the Root class and feature to whatever your system needs.
      • NOTE: In the beginning, if your application project happens to use an APPLICATION class, you may want to save a copy of your existing APPLICATION class in case Eiffel Studio overwrites it from its project creation wizard. For example, if your project is on GitHub, then you can simply discard the changes made by Eiffel Studio when it "creates".
    • BE AWARE: You have several choices of how to configure a project(s).
      1. A single ECF, which contains both your production/library code + testing code, but with a single project target.
      2. A single ECF, which contains both production/library code + testing code, but with multiple targets (e.g. one for library, one for testing, and so on).
      3. Multiple ECF files, each which are purposed to notions like production and testing (e.g. you'd have one ECF for production and another for testing).
I hope this helps you out. I will try also to create a video better explaining how I configure choice #2 (see above). Until then ...

Happy Eiffeling!


Reply all
Reply to author
Forward
0 new messages