Author:jfiat

Date:2014-05-19T20:10:34.000000Z


git-svn-id: https://svn.eiffel.com/eiffel-org/trunk@1370 abb3cda0-5349-4a8f-a601-0c33ac3a8c38
This commit is contained in:
vwheeler
2014-06-01 17:08:27 +00:00
parent 497d85b5db
commit 077caee92b

View File

@@ -4,154 +4,147 @@
[[Property:uuid|17d54aa0-3d7f-4993-2ad6-423bd0cedd44]]
{{ReviewRequested}}
'''This documentation has to be updated for 14.05 which brings nice addition'''
=Purpose=
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.
{{definition|IRON|a package management solution based on repositories.}}
==Purpose==
IRON provides an easy-to-use facility for using and sharing libraries of quality Eiffel components, automating many of the tasks involved.
===Empowering Teams of Developers===
To configure Eiffel projects, programmers write "ECFs" (Eiffel Configuration Files -- Microsoft Visual Studio users can think of "solution files").
One application of ECFs is to support libraries installed in different places on the different computers used by the team. Prior to IRON, the solution was to use environment variables. A typical style is this ECF extract:
:<library name="presentation" location="$FSD_EIFFEL\presentation\presentation.ecf"/>
:<library name="awts" location="$LIBRARIES\Eiffel\AWTS\library\awts_library.ecf"/>
:<library name="cot" location="$LIB_COT\cot.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:
* Install the library from an IRON server.
* For any program that uses the library, include in the project's ECF a reference to the library's location <i>in the server</i>, rather than its physical location.
That's all! In the above example, the paths to the libraries, in the project, then become something like:
:<nowiki>http://iron.eiffel.com/13.11/crystal_clear_research/lib/presentation/presentation.ecf</nowiki>
:<nowiki>http://iron.eiffel.com/13.11/crystal_clear_research/lib/awts/awts.ecf</nowiki>
:<nowiki>http://iron.eiffel.com/13.11/crystal_clear_research/lib/cot/cot.ecf</nowiki>
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.
In some cases, for example for backups, the physical location of the library may matter. Then it suffices to use a single environment variable: ISE_IRON_PATH.
==Origin of the Name IRON==
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 ''[[uuid:496983ef-b86e-772e-16b9-39b37ef80e37|Object&#8209;Oriented&nbsp;Software&nbsp;Construction,&nbsp;2nd&nbsp;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.
==Package Repository vs Library Repository==
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. Sometimes libraries also need to 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.
=Package Repository vs Library Repository=
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.
{{Definition|package|a downloadable unit of software from an IRON repository that contains one or more Eiffel libraries and their related files.}}
==What Is IRON?==
IRON 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 (http://iron.eiffel.com) and a default repository is added automatically by the iron executable, based on the version of EiffelStudio that installed the iron executable. Example: http://iron.eiffel.com/13.11 .
=Application to .ecf files=
: 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:
* Install the related package from an IRON repository.
* And for any project that uses the library, include an IRON uri in the related ECF.
** an IRON uri has the form: <code>iron:package-name:relative-path-to-file.ecf</code>
** as you can see, no more environment variable, and only a relative path from the root of the package. This simplifies a lot the referencing, and package/library management. No need to know where are located the installed files on the local machine.
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: <code> iron path ...</code>
:{| class="wikitable"
|-
! Command
! Result
! Example
|-
| <code>iron path</code>
| Base directory of IRON (~ IRON_PATH variable)
| C:\Users\jfiat\Documents\Eiffel User Files\14.05\iron
|-
| <code>iron path base</code>
| location of installed package <code>base</code>
| C:\Users\jfiat\Documents\Eiffel User Files\14.05\iron\packages\base
|-
| <code>iron path xml</code>
| location of installed package <code>xml</code>
| C:\Users\jfiat\Documents\Eiffel User Files\14.05\iron\packages\xml
|}
Notes:
* It is possible to override the default location of IRON installation directory, by setting the environment variable <code>IRON_PATH</code> or <code>ISE_IRON_PATH</code>.
* In the scope of the .ecf file, the IRON_PATH variable is always set: to default path or to the value of environment variable IRON_PATH.
* In addition to the IRON way to reference library, it is also possible to use the absolute URL in the repository, see advanced usage for more details.
<nowiki>https://iron.eiffel.com/14.05/com.eiffel/library/base/base.ecf</nowiki>
<nowiki>https://iron.eiffel.com/14.05/com.eiffel/library/text/parser/xml/parser/xml_parser.ecf</nowiki>
<nowiki>https://iron.eiffel.com/14.05/others/dummy/src/foo/bar.ecf</nowiki>
But this implies putting the version in the url (i.e 14.05), or you could set ISE_LIBRARY to <nowiki>https://iron.eiffel.com/14.05/com.eiffel</nowiki>
= IRON client tool =
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 (<nowiki>example: https://iron.eiffel.com/14.05</nowiki> ).
The IRON facility consists of three parts:
* A default server at http://iron.eiffel.com/ (provides the web api and web interface for the repositories that are stored there; you can add other IRON servers as they become available).
* A default repository at <nowiki>https://iron.eiffel.com/14.05</nowiki> (provides the web API and web interface for the repositories that are stored there; you can add other IRON servers as they become available).
* The iron executable utility on the local machine (installed with EiffelStudio, the program that interacts with the web api).
* The '''iron''' executable utility on the local machine (installed with EiffelStudio, the program that interacts with the repositories).
* Within EiffelStudio and the Eiffel compiler, is the ability to read and use IRON references from the Eiffel Configuration File (.ECF). (This integration will be expanded in future EiffelStudio releases.)
==How to Use IRON==
1.
(Optional) Create an IRON path environment variable on your system: either ISE_IRON_PATH or IRON_PATH. Set its value to the location you have designated for the IRON package repository on your local system. If the path does not already exist, it will be created by the local IRON executable. Example:
:Variable name: ISE_IRON_PATH
:Variable value: E:\Dev\Libraries\Eiffel\iron\
If you do not define one of these environment variables, the location used is:
:<My_Documents>\Eiffel User Files\<EiffelStudio_Version>\iron\
2.
* Within EiffelStudio and the Eiffel compiler, is the ability to read and use IRON references from the Eiffel Configuration File (.ecf). The '''Project settings''' tool, and '''Add Library' dialog also provides support for IRON packages.
=How to Use IRON=
== Install wanted Eiffel packages ==
Using the EiffelStudio command prompt (installed with EiffelStudio), execute the IRON command to install the packages you want to use:
:iron install <package_name>
iron install <package_name>
(This step may be automated in EiffelStudio in the future.)
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.
== Add reference to install package libraries ==
Simply add the library with IRON uri <code>iron:package-name:relative-path-to-file.ecf</code>, 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:
3.
Project Settings -> <target_name> -> Groups -> Libraries
If the package is simply an Eiffel library with its own .ECF file, then in each Eiffel project that uses that library, under
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.
:Project Settings -> <target_name> -> Groups -> Libraries
* The default and recommended location for a IRON package library is the IRON uri:
iron:package-name:relative-path-to-file.ecf
right-click Libraries and add a library with the "Location" value referencing the .ECF file for that library. You can use one of three methods for this -- all behave identically:
:a. The recommended method is to use the IRON server's path to the .ECF file. Example:
* It is also possible to use the absolute URL in the IRON repository such as:
<nowiki>https://iron.eiffel.com/14.05/com.eiffel/library/base/base.ecf</nowiki>
:::<nowiki>http://iron.eiffel.com/13.11/com.eiffel/library/base/base.ecf</nowiki>
* And an other solution, would be to use the <code>IRON_PATH</code> environment variable to locate the install libraries, such as:
$IRON_PATH\packages\base\base.ecf
::In this case, EiffelStudio will discover where the local IRON library is installed, and will compile with the local library files.
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.
:b. Set your ISE_LIBRARY environment variable to
== External dependencies ==
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.
:::<nowiki>http://iron.eiffel.com/13.11/com.eiffel</nowiki>
== Optional ==
If you do not define one of these environment variables, the location used is:
By default the base directory for IRON is under <code><Eiffel User Files>/<EiffelStudio_Version>/iron</code> , but it is possible to overwrite this value by setting the environment variable <code>IRON_PATH</code> (or <code>ISE_IRON_PATH</code>). Note that if the physical location does not exists, the local '''iron''' executable will create it.
::and ensure your .ECF file points to a library with location
Setting IRON_PATH, can be a way to setup different development environments (with different registered repositories, ...)
:::$ISE_LIBRARY\library\base\base.ecf
=How to Get Information About IRON Packages=
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 servers base address: https://iron.eiffel.com/ .
::(remove other references to a “base” library if they exist).
* This page lists the repository versions available.
* Select the version that matches the version of EiffelStudio you have installed.
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.
:c. Use the traditional local path to the library's .ECF file. Examples:
If you click the “Package list” or “All packages” link, it takes you to a list of packages available under that version.
:::E:\Dev\Libraries\Eiffel\iron\packages\base\base.ecf
::or
:::$ISE_IRON_PATH\packages\base\base.ecf
::or
:::"C:\Users\user_name\Documents\Eiffel User Files\13.11\iron\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.
4.
If the package has some other way of linking it with your Eiffel projects, e.g. to a .LIB file or to an external .DLL, then instructions for this should be provided within the package.
==How to Get Information About IRON Packages==
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 servers base address:
:http://iron.eiffel.com/
This page lists the repository versions available. Select the version that matches the version of EiffelStudio you have installed. Example: clicking on version 13.11 takes you to
:http://iron.eiffel.com/repository/13.11/
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
== Search/filter==
To filter this list, you can use the search window. You can specify search criteria in this format <code>:criterion:search_string</code>
Criteria available:
:{| class="wikitable"
|-
! Criterion
@@ -169,55 +162,40 @@ Criteria available:
| 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.
If a criterion is omitted, “name” is used by default.
== Associated paths ==
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
Operators available: or, and, not (example: name:er and not name:parser)
Given that the servers 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
Finally, when you have found the package you want, click on its title, and the page displayed will contain detailed information about the package. One of the important bits of 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:
Both will cause your project to compile with the same EiffelBase library provided by this IRON repository, provided you previously issued the following command on your system:
:'''Associated URIs'''
::* /13.11/com.eiffel/library/base
::* /13.11/com.eiffel/library/data_structure/adt/base
Given that the servers HTTP address is (in this example) <nowiki>http://iron.eiffel.com</nowiki>, 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:
:<nowiki>http://iron.eiffel.com/13.11/com.eiffel/library/base/base.ecf</nowiki>
or
:<nowiki>http://iron.eiffel.com/13.11/com.eiffel/library/data_structure/adt/base/base.ecf</nowiki>
Both will cause your project to compile with the same EiffelBase library provided by this IRON repository, provided you previously issued the command
:> iron install base
or
:> iron install <nowiki>http://iron.eiffel.com/13.11/com.eiffel/library/base</nowiki>
on your system.
==Using IRON from the Command Line==
> 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 <code>iron:base:base.ecf</code>.
=Using IRON from the Command Line=
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/.
===Quick Help from the Command Line===
:> 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.
==Quick Help from the Command Line==
*<code>iron help</code>
:lists the actions that are available.
*<code>iron <action> --help</code>
: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 Summary===
==Action Summary==
:{| class="wikitable"
|-
@@ -250,103 +228,175 @@ displays detailed usage syntax for the action specified. Note that most of the
|}
===Examples===
==Examples==
Update cached iron repository information:
:> iron update
Display information about the api_wrapper package:
:> iron info api_wrapper
===Update cached iron repository information===
<code> iron update
</code>
===Display information about package===
:For instance for the '''api_wrapper''' package:
<code> iron info api_wrapper
</code>
:If the package is installed, the installation path will also be displayed.
Search for a package by name, ID or URI (package IDs and URIs are displayed by the "info" action) (future releases will enable searching by other criteria as well, such as by tags [i.e. keywords]):
:> iron search base
List available packages:
:> iron list
Install a package:
:> iron install base
:or
:> iron install <nowiki>http://iron.eiffel.com/13.11/com.eiffel/library/base</nowiki>
===Search for a package by name, ID or URI===
:(package IDs and URIs are displayed by the "info" action) (future releases will enable searching by other criteria as well, such as by tags [i.e. keywords]):
<code> iron search base
</code>
===List available packages===
<code> iron list
</code>
===List installed packages===
<code> iron list --installed
</code>
===Install a package===
<code> iron install base
</code>
(or <nowiki>iron install https://iron.eiffel.com/14.05/com.eiffel/library/base</nowiki>)
:(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”.)
List installed packages:
:> iron list --installed
Uninstall a package:
:> iron remove base
===Uninstall a package===
<code> iron remove base
</code>
===Advanced Usage===
===Install all available packages===
<code> iron install --all
</code>
===Uninstall all installed packages===
<code> iron remove --all
</code>
====Managing Multiple Repositories====
It is possible to have more than one IRON repository server registered. Examples:
:> iron repository --list
:> iron repository --add &nbsp;&nbsp;iron73 &nbsp;&nbsp;<nowiki>http://iron.eiffel.com/7.3</nowiki>
:> iron repository --add &nbsp;&nbsp;custom &nbsp;&nbsp;<nowiki>http://custom.example.com/13.11</nowiki>
:> iron repository --remove &nbsp;&nbsp;iron73
=Advanced Usage=
==Managing Multiple Repositories==
Note: upon the release of EiffelStudio 14.05, the <respository_name> argument will be removed. Thus, the syntax for these examples will become:
It is possible to have more than one IRON repository server registered.
Examples:
iron repository --list
iron repository --add <nowiki>https://iron.eiffel.com/14.05</nowiki>
iron repository --add <nowiki>https://custom.example.com/14.05</nowiki>
iron repository --add C:\eiffel\my_repository
iron repository --remove <nowiki>https://custom.example.com/14.05</nowiki>
:> iron repository --list
:> iron repository --add &nbsp;&nbsp;<nowiki>http://iron.eiffel.com/7.3</nowiki>
:> iron repository --add &nbsp;&nbsp;<nowiki>http://custom.example.com/13.11</nowiki>
:> iron repository --remove &nbsp;&nbsp;<nowiki>http://iron.eiffel.com/7.3</nowiki>
=====Multiple-Repository Name Conflict Resolution=====
===Multiple-Repository Name Conflict Resolution===
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:
:* use the iron executable to remove and add repositories to re-sequence them, or
:* delete the repositories.conf file and use the iron executable to add them again in the sequence you want them.
:* edit the file repositories.conf with a plain text editor in the directory indicated by your IRON_PATH (or ISE_IRON_PATH) environment variable (or <code><Eiffel User Files>/<EiffelStudio_Version>/iron/</code> 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.)
:* edit the file repositories.conf with a plain text editor such as NOTEPAD in the directory indicated by your ISE_IRON_PATH (or IRON_PATH) environment variable (or <My_Documents>\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.)
==Building a package==
An IRON package has to provide, at its root, a file <code>package.iron</code>. 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
copyright: 1984-2013 Eiffel Software and others
link<nowiki>[doc]</nowiki>: "Documentation" http://eiffelroom.com/
link<nowiki>[source]</nowiki>: "Subversion" https://svn.eiffel.com/eiffelstudio/trunk/Src/library/base
link<nowiki>[license]</nowiki>: http://www.eiffel.com/licensing/forum.txt
maps: /com.eiffel/library/data_structure/adt/base
end
Note: online version at https://svn.eiffel.com/eiffelstudio/trunk/Src/library/base/package.iron .
====Sharing Your Packages====
Only the name of the package is required for now, but the section "project" list the various available .ecf projects, and the section "note" contains the title, description, tags, ... information.
The tag under the '''note''' section is free, and for now, only '''title, description, tags, link<nowiki>[...]</nowiki>, and maps''' have semantic. For now the others are simply stored and never displayed, but the server will be improved later to support for more meta data.
To build and share your own packages, you will need a user account on the IRON server which will host your packages. Please visit http://iron.eiffel.com/repository/account/?register to create a new account.
As usual, use
:> iron share --help
to see the options available.
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 <code>compile_library</code> 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 <code>compile_library</code> tool relies on <code>finish_freezing -library</code> and thus process the <code>Makefile-win.SH or Makefile.SH</code>.
==Using your own IRON packages locally==
There are various ways to use your own Eiffel package libraries:
* Using local location as it was currently done before 14.05 (i.e relative or absolute path, and eventually using an environment variable...).
* Sharing the package on an IRON server, and then install it from that server:
** The default https://iron.eiffel.com/ is the recommended server
** But it is possible to host your own server easily. (server how-to documentation will be provided soon).
* And there is another solution: local repository.
Local repositories rely heavily on the <code>package.iron</code> files. So if a folder is registered as iron repository, internally iron will search this folder recursively for package.iron files.
Example on Windows:
<code>iron repository --add %ISE_LIBRARY%\library</code>
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"
*However, unless you are using the iron tool in batch mode ( <code>--batch</code> flag ), you will be asked to choose which package you want to install.
*You can also use the EiffelStudio "Add Library" dialog via the "Iron" tab, to install, uninstall the various packages.
*And last solution, you can use the full url as:
> 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.
==Sharing Your Packages==
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:
<code> iron share --help</code>
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 <nowiki>http://iron.eiffel.com/13.11</nowiki> --package-archive-source “c:\eiffel\library\gps_nmea” --name “gps_nmea” --description “GPS library that parses NMEA strings (a common GPS output format)” --index “/library/gps/nmea”
To build the '''gps_nmea''' package from your library <code>c:\eiffel\library\gps_nmea\</code> :
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:
:* create a new package named “gps_nmea” on iron repository “<nowiki>http://iron.eiffel.com/13.11</nowiki>”,
:* using the local folder “c:\eiffel\library\gps_nmea\” as the source code for the package, then
:* associate this package with URI “<nowiki>http://iron.eiffel.com/13.11/library/gps/nmea</nowiki>”.
With the release of EiffelStudio 14.05, there will additionally be a --title option to enable you to attach a formal title to the package. Example: --title “GPS NMEA Parsing Library”.
* create a new package named '''gps_nmea''' on iron repository '''https://iron.eiffel.com/14.05''',
* using the local package '''c:\eiffel\library\gps_nmea''' (i.e: you need to provide the package.iron file)
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 edit its information, such as adding tags (keywords to help others find your library), a link to documentation, a link to applicable source code, etc. 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.
Note:
* the --package-name is for now required, even if the package.iron already provides such information.
* see the <code>iron share --help</code> 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.
@@ -360,21 +410,23 @@ and the Self-Documentation Principle:
The point: reuse is only possible when end users can easily and quickly learn how to reuse software components available to them.
=Origin of the Name IRON=
==Planned Enhancements==
The version of iron published at the release of EiffelStudio 7.3 was a first implementation, it covers the basic operations, but more features are planned or are already under development:
:* additional metadata to describe the package
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 ''[[uuid:496983ef-b86e-772e-16b9-39b37ef80e37|Object&#8209;Oriented&nbsp;Software&nbsp;Construction,&nbsp;2nd&nbsp;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.
=Planned Enhancements=
This documentation describes the version of iron released with EiffelStudio 14.05.
More features are planned or are already under development:
:* the ability to analyze the contents of the package, to extract information related to its .ECF file(s)
:* improved search facilities
:* a way of ensuring that the package compiles under the specified version of EiffelStudio
:* support for test suite
:* detection and actions related to package dependencies
:* package versioning
:* ability to upgrade of packages already installed
:* post-installation operations
:* support for test suite
:* stronger iron support in compiler (e.g. auto installation)
:* extended post-installation operations
:* more features that users may request or suggest.