IRON provides an easy-to-use facility for using and sharing packages of quality Eiffel components, automating many of the tasks involved.Most often a package is a library or a set of libraries, but it could also other resources such as tools.
Certainly the IRON repository is a repository of Eiffel libraries. However, sometimes libraries are used together, or cross reference one another, and thus are appropriate to be delivered together as a unit. Such unit can also include other types of files, such as external .c files that may need to be compiled on the local platform to make .LIB or .OBJ files available to the linker (.a or .o on Unix and Linux systems), scripts or executables that need to be run as part of the installation process (e.g. to generate other files required by the library, install environment variables, generate source code from LEX files), or tool kits that are part of, or needed by, the library. Since the IRON repository permits programmers to install software components in “units”, and since sometimes those units can contain more than one library, as well as other types of files, a new term was required to convey this concept: package.
Empowering Teams of Developers
To configure Eiffel projects, programmers uses "ECFs" (Eiffel Configuration Files -- Microsoft Visual Studio users can think of "solution files").
One application of ECFs is to reference libraries installed in different locations. Without IRON, the usual solution is to use relative or absolute path, and generally using environment variables such as ISE_LIBRARY or EIFFEL_LIBRARY, and a few package specific variables such as GOBO, ...
Typical library references without IRON in ECF:<library name="base" location="$ISE_LIBRARY\library\base\base.ecf"/>
<library name="xml_parser" location="$EIFFEL_LIBRARY\library\text\parser\xml\parser\xml_parser.ecf"/>
<library name="dummy_foobar" location="$LIB_DUMMY\src\foo\bar.ecf"/>
As projects grow and multiply, the number of these variables adds up quickly. A dozen or more such environment variables per system is (prior to IRON) not uncommon. Coordinating their use and evolution among a team of programmers can become a challenge.
IRON has made it possible to simplify this scenario dramatically. For any commonly used library, it suffices to:
iron:package-name:relative-path-to-file.ecf
That's all! In the above example, the location of the libraries, in the project, then become something like:<library name="base" location="iron:base:base.ecf" />
<library name="xml_parser" location="iron:xml:parser/xml_parser.ecf" />
<library name="foobar" location="iron:dummy:src/foo/bar.ecf" />
There is no more need for a set of environment variables.
IRON and EiffelStudio take care of the remaining details. And all developers on a project simply share the same ECF file with no further worry about where the libraries are.
However, to get information about IRON location, use the command: iron path ...
Command | Result | Example |
---|---|---|
iron path
| Base directory of IRON (~ IRON_PATH variable) | C:\Users\jfiat\Documents\Eiffel User Files\14.05\iron |
iron path base
| location of installed package base
| C:\Users\jfiat\Documents\Eiffel User Files\14.05\iron\packages\base |
iron path xml
| location of installed package xml
| C:\Users\jfiat\Documents\Eiffel User Files\14.05\iron\packages\xml |
Notes:
IRON_PATH
or ISE_IRON_PATH
.https://iron.eiffel.com/14.05/com.eiffel/library/base/base.ecf https://iron.eiffel.com/14.05/com.eiffel/library/text/parser/xml/parser/xml_parser.ecf https://iron.eiffel.com/14.05/others/dummy/src/foo/bar.ecf
But this implies putting the version in the url (i.e 14.05), or you could set ISE_LIBRARY to https://iron.eiffel.com/14.05/com.eiffel
The iron client executable is a facility that permits Eiffel programmers to easily install, remove, update, list, examine, search and share Eiffel packages.Additionally, it permits easy maintenance of a local list of IRON repositories.
A default IRON server is provided and a default repository is added automatically by the iron executable, based on the version of EiffelStudio that installed the iron executable (example: https://iron.eiffel.com/14.05
).
The IRON facility consists of three parts:
https://iron.eiffel.com/14.05
(provides the web API and web interface for the repositories that are stored there; you can add other IRON servers as they become available).Using the EiffelStudio command prompt (installed with EiffelStudio), execute the IRON command to install the packages you want to use:
iron install <package_name>
Note that the compilation of an Eiffel project that depends on uninstalled Eiffel package(s) will suggest and propose to the user to install the missing packages (this is currently supported with ec in command line mode, and graphical mode.
Simply add the library with IRON uri iron:package-name:relative-path-to-file.ecf
, as you would have previously for local libraries. This can be done directly by editing the .ecf file, or using the EiffelStudio Project Settings tool from Eiffel Studio:
Project Settings -> <target_name> -> Groups -> Libraries
right-click Libraries and add a library. This will popup the Add Library dialog, that expects a name and a location, simply select the available library from the grid.Note that you have an easy way to install, remove IRON packages from the Iron tab of the "Add Library" dialog.
iron:package-name:relative-path-to-file.ecf
https://iron.eiffel.com/14.05/com.eiffel/library/base/base.ecf
IRON_PATH
environment variable to locate the install libraries, such as:$IRON_PATH\packages\base\base.ecf
This latter method, while it works, is not recommended simply because it defeats some of the advantages of using the IRON repository in the first place.
If the package has some other way of linking it with your Eiffel projects, e.g. to an external .dll or .so , then instructions for this should be provided within the package.
If you do not define one of these environment variables, the location used is:By default the base directory for IRON is under <Eiffel User Files>/<EiffelStudio_Version>/iron
, but it is possible to overwrite this value by setting the environment variable IRON_PATH
(or ISE_IRON_PATH
). Note that if the physical location does not exists, the local iron executable will create it.
Setting IRON_PATH, can be a way to setup different development environments (with different registered repositories, ...)
At the website provided by a particular IRON server, you can get information about available packages in a number of ways. You can start by simply visiting the server’s base address: https://iron.eiffel.com/ .
Example: clicking on version 14.05 takes you to https://iron.eiffel.com/repository/14.05/
where you can list existing packages, or add a new package if you have an account on the server.
If you click the “Package list” or “All packages” link, it takes you to a list of packages available under that version.
To filter this list, you can use the search window. You can specify search criteria in this format :criterion:search_string
Criteria available:
Criterion | Meaning |
---|---|
name | string is contained in package name (wildcards are supported) |
title | string is contained in title |
tag | package contains search_string in its tags (i.e. keywords) |
downloads | has at least N downloads, e.g. downloads:25 |
If a criterion is omitted, name is used by default.Operators available: or, and, not (example: name:er and not name:parser)
Finally, when you have found the package you want, click on its title, and the page displayed will contain detailed information about the package.
Part of the information is a portion of the URI which you can use to define the path to the package.For the base library (title: EiffelBase), these URIs look like this:
/14.05/com.eiffel/library/base /14.05/com.eiffel/library/data_structure/adt/base
Given that the server’s HTTP address is (in this example) https://iron.eiffel.com/
, you can compose full paths from this, and use them in your Eiffel project. In this case, you can include the EiffelBase library in your project by specifying either:
https://iron.eiffel.com/14.05/com.eiffel/library/base/base.ecf or https://iron.eiffel.com/14.05/com.eiffel/library/data_structure/adt/base/base.ecf
Both will cause your project to compile with the same EiffelBase library provided by this IRON repository, provided you previously issued the follwing command on your system:
> iron install base or > iron install https://iron.eiffel.com/14.05/com.eiffel/library/base
IMPORTANT: those associated URIs may be deprecated soon with the use of IRON uri iron:base:base.ecf
.
The “iron” executable is used to perform various operations such as search, install, remove, update and share. This executable is installed with EiffelStudio in $ISE_EIFFEL/tools/spec/$ISE_PLATFORM/bin/.
iron help
lists the actions that are available.
iron <action> --help
displays detailed usage syntax for the action specified. Note that most of the actions have a -v (verbose) option that will display additional helpful information about the action performed, including (when relevant) the local path to the package.
Action | Meaning |
---|---|
update | updates cached package information |
list | displays a list of available packages, and whether they are installed |
search | searches for a specified packages |
info | displays information about a specified packages |
install | installs specified packages |
remove | removes specified packages |
repository | manages repository list |
share | share and manage your packages (an account on the IRON server is required) |
iron update
For instance about the api_wrapper package:
iron info api_wrapper
If the package is installed, the installation path will also be displayed.
package IDs and URIs are displayed by the "info" action.
iron search base
iron list
iron list --installed
iron install base
or iron install https://iron.eiffel.com/14.05/com.eiffel/library/base
(This latter form is useful in resolving name conflicts when, for instance, you have multiple IRON repositories registered on your system, and two or more contain a packaged called “base”.)
iron remove base
iron install --all
iron remove --all
It is possible to have more than one IRON repository server registered. Examples:iron repository --list
iron repository --add https://iron.eiffel.com/14.05
iron repository --add https://custom.example.com/14.05
iron repository --add C:\eiffel\my_repository
iron repository --remove https://custom.example.com/14.05
If you have more than one IRON repository registered on your system, it is possible that the same package name may exist on more than one repository. If this is the case, and you attempt to perform operations using that name only, the repository that will be used will be the first repository in the list that contains a package with that name. If you need the package with that name from a different repository, then use the “id” or “uri” form of the identifying the package you want.
If the sequence of repositories is not to your liking, you can change it in three ways:
<Eiffel User Files>/<EiffelStudio_Version>/iron/
if one of these environment variables are not defined on your system). (Note that this latter method, while possible, is not recommended, since the syntax of that file can change with new releases.)An IRON package has to provide, at its root, a file package.iron
. This file describes the package with name, description, and various other information.See for instance, the package.iron for Eiffel Base package:package base
project
base_safe = "base-safe.ecf"
base = "base.ecf"
base_testing = "testing/testing-safe.ecf"
base_testing = "testing/testing.ecf"
note
title: Eiffel Base
description: "Eiffel Base: kernel library classes, data structure, Input and Output"
tags: base,kernel,structure,io
license: Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)
copyright: 1984-2013 Eiffel Software and others
link[doc]: "Documentation" http://eiffelroom.com/
link[source]: "Subversion" https://svn.eiffel.com/eiffelstudio/trunk/Src/library/base
link[license]: http://www.eiffel.com/licensing/forum.txt
maps: /com.eiffel/library/data_structure/adt/base
end
Note: The package iron file for the Eiffel Base package is available online at https://svn.eiffel.com/eiffelstudio/trunk/Src/library/base/package.iron .
Current status:
link[category]: "Optional Title" associated-url
A few packages may require post installation operations, such as compiling C code, or others. For that, use the section setup, and in particular the compile_library information.During installation, iron will launch the compile_library
tool delivered with EiffelStudio on the provided directory.
Example at https://svn.eiffel.com/eiffelstudio/trunk/Src/library/cURL/package.iron :
package cURL
setup
compile_library = Clib
...
.This compile_library
tool relies on finish_freezing -library
and thus process the Makefile-win.SH or Makefile.SH
.
There are various ways to use your own Eiffel package libraries:
Local repositories rely heavily on the package.iron
files. So if a folder is registered as iron repository, internally iron will search this folder recursively for package.iron files.
Example on Windows:iron repository --add %ISE_LIBRARY%\library
It should find and list all the official ISE IRON packages.Now if you want to install the time package from it, just do
> iron install time Searching [time] -> several packages for name [time]! 1) time (https://iron.eiffel.com/14.05) "EiffelTime" 2) time (file:///C:/EiffelDev/Src/library) > Select a package [1] (q=cancel): 2 -> Install time (file:///C:/EiffelDev/Src/library) Installing [time (file:///C:/EiffelDev/Src/library)] -> successfully installed.
To make development easier, you may want to edit/update the repositories.conf file, in order to put that file://... local repository on the top.> iron path
C:\Users\jfiat\Documents\Eiffel User Files\14.05\iron
and then edit "C:\Users\jfiat\Documents\Eiffel User Files\14.05\iron\repositories.conf"
--batch
flag ), you will be asked to choose which package you want to install. > iron install file:///C:/EiffelDev/Src/library/time
Of course, do not forget that local repository should be used only for code in progress, otherwise you should share that library and use it as a simple user. One of the goal of IRON is to encourage people sharing their libraries with other Eiffel users.
To build and share your own packages on an IRON server, you will need a user account on that IRON server which will host your packages.Please visit https://iron.eiffel.com/repository/account/?register to create a new account.
As usual, to see the available options, use: iron share --help
Example:
To build the gps_nmea package from your library c:\eiffel\library\gps_nmea\
:
iron share create --username <your_id> --password <your_password>
--repository https://iron.eiffel.com/14.05
--package "c:\eiffel\library\gps_nmea\package.iron" --package-name “gps_nmea”
This command will:
https://iron.eiffel.com/14.05
,c:\eiffel\library\gps_nmea
(i.e: you need to provide the package.iron file)Note:
iron share --help
for advanced usage (such as --index, --package-archive-source, ...).After adding such a package to the library, it is recommended that you go to the website, double check that the package was created they way you wanted it to be, and you can edit its information.Then, using the iron executable, install the package on your system, and go through the steps of using it in an Eiffel project, and correct any problems discovered, to verify that end users will be able to productively use your package.
It is also strongly encouraged to include (or provide a link to) documentation that orients the user to its use, and answers basic questions such as: What is the package? What motivated you to create it? What problem(s) does it address? Under what circumstances can the package be productively used? Under what circumstances should it not be used (if applicable)? And some basic examples of its use. If the package is complex, it can be very helpful to include a well-commented application that demonstrates intended reuse of the package in software.
Important note: having clear documentation that enables end users to easily learn how to use your package is a VITAL link in the ability to reuse software components as is so aptly described in Object‑Oriented Software Construction, 2nd Edition, in the Modular Understandability criterion:
“A method favors Modular Understandability if it helps produce software in which a human reader can understand each module without having to know the others, or, at worst, by having to examine only a few of the others.”
and the Self-Documentation Principle:
“The designer of a module should strive to make all information about the module part of the module itself.”
The point: reuse is only possible when end users can easily and quickly learn how to reuse software components available to them.
As many readers will know, the name "Eiffel" was chosen to reflect the elegance and soundness of constructing large, complex software systems, with simple, individual components, each of which is a unit by itself and has its own existence, and can be tested for integrity as a separate unit, but its role in the larger scheme of things is to be used as a "building block" for constructing high-integrity software systems. The picture on the front of the book Object‑Oriented Software Construction, 2nd Edition illustrates this.
This of course is intentionally meant as a direct parallel to the famous structure built by the architect and civil engineer Alexandre Gustave Eiffel. This structure was constructed with simple, individual components, each of which is a unit by itself and has its own existence, and can be tested for integrity as a separate unit, but its role in the larger scheme of things is to be used as a "building block" for constructing a high-integrity structure: the Eiffel Tower.
As a parallel to this, "IRON", as a name, was chosen to reflect the fact that the individual building blocks were themselves made from iron. In the Eiffel world, constructing a large complex software system is done with libraries of high-quality reusable components. Thus, the "building blocks" are made from iron, and software systems are made from those building blocks. Hence, IRON provides the "raw material" from which complex Eiffel systems are developed.
This documentation describes the version of iron released with EiffelStudio 14.05.More features are planned or are already under development: