merged from 19.05

git-svn-id: https://svn.eiffel.com/eiffel-org/trunk@2228 abb3cda0-5349-4a8f-a601-0c33ac3a8c38
This commit is contained in:
jfiat
2019-12-28 20:03:38 +00:00
parent 539829febe
commit 4e06893808
22 changed files with 696 additions and 596 deletions

View File

@@ -1,4 +1,7 @@
[[Property:title|IFELL]]
[[Property:link_title|Free Eiffel Library License]]
[[Property:modification_date|Wed, 18 Sep 2019 08:13:12 GMT]]
[[Property:publication_date|Wed, 11 Sep 2019 01:54:10 GMT]]
[[Property:title|Eiffel Software Free Eiffel Library License (IFELL)]]
[[Property:weight|4]]
[[Property:uuid|34079f13-741d-a937-e492-9ccfe235efeb]]
This license describes the terms applicable to the open-source EiffelBase libraries. For the EiffelStudio and other libraries license terms, please refer to the Eiffel Software end-user license.
@@ -11,7 +14,7 @@ We hope that others will be inspired by this example to release their own reusab
==Preamble==
(This Preamble is not part of the license.)
EiffelBase is one of the principal contributions of Eiffel: a library of fundamental structures and algorithms covering the basics of computing, and resulting from a "Linnaean" effort at a general-purpose taxonomy of computing structures. We believe that EiffelBase is one of the most carefully designed and extensively used libraries in the object-oriented industry. The library and its design principles are described in detail in the book [http://www.eiffel.com/services/training/books.html ''Reusable Software: The Base Object-Oriented Component Libraries'' ] .
EiffelBase is one of the principal contributions of Eiffel: a library of fundamental structures and algorithms covering the basics of computing, and resulting from a "Linnaean" effort at a general-purpose taxonomy of computing structures. We believe that EiffelBase is one of the most carefully designed and extensively used libraries in the object-oriented industry. The library and its design principles are described in detail in the book [[Reusable_Software-_The_Base_Object-Oriented_Component_Libraries|"Reusable Software: The Base Object-Oriented Component Libraries" ]] .
EiffelBase is at the center of Eiffel Software's Eiffel and has been among the major factors attracting users to the technology. In spite of this competitive advantage, Eiffel Software officially announced in June of 1998 that it would release the library to the public in source form, under the terms of the license below. There are two main reasons for this initiative:
* As the software industry seems poised to adopt the idea of reusable components, we feel that EiffelBase provides an ideal basis and are happy to contribute it to the community.
@@ -65,7 +68,7 @@ This is the official license text.
'''4.'''If you produce new classes based on the Library or extending the Library, you are encouraged, but not required, to make them available in the same way.
'''5.''' If you use the Library (2.1) in source or object form for producing software that you distribute, you are encouraged, but not required, to include the following mention (or its translation into the language of the rest of the distribution, if other than English) in the documentation of your software, including textual documentation as well as online documentation such as "About..." entries:
* ''This product includes EiffelBase software from Interactive Software Engineering, used according to the terms of the Eiffel Software Free Eiffel Library License (IFELL). ''See [http://eiffel.com/ http://eiffel.com] and, for the license terms, [http://eiffel.com/products/base/license.html http://eiffel.com/products/base/license.html] .
* ''This product includes EiffelBase software from Interactive Software Engineering, used according to the terms of the Eiffel Software Free Eiffel Library License (IFELL). ''See [https://eiffel.com/ https://eiffel.com] and, for the license terms, [https://www.eiffel.com/eiffelstudio/licensing/ https://www.eiffel.com/eiffelstudio/licensing/] .
'''6.''' If you distribute the source code of part or all of the Library (2.2) you must:
@@ -73,7 +76,7 @@ This is the official license text.
* Retain, in the distributed version, the entire copyright notice of these classes.
* If you need to make any modification to the classes, mark those modifications clearly in the class texts.
* <span id="valid_eiffel"></span> Ensure that the text remains valid Eiffel. Note that this license does not authorize you to distribute versions of the Library restated in other programming, analysis or design languages, except if mechanically translated from the source form by an Eiffel compiler, in which case they fall under "object form". For any non-mechanical adaptation to other languages you must obtain authorization from Eiffel Software. "Valid Eiffel" includes the language described in the latest edition or printing of the book ''[[Eiffel: The Language]]'' (Prentice Hall), plus any changes or extensions that have been approved by the Nonprofit International Consortium for Eiffel (NICE) or have been accepted for discussion by the Language Committee of NICE, provided they are accepted by the reference implementation.
* <span id="obsolete_version"></span> If Eiffel Software releases a new version of the Library, you must, no later than six months after the release of that version, either: (A) update your distribution to the new version; (B) add the following notice to all files in your distribution:" ''This is an obsolete version of EiffelBase. The latest version is available from http://eiffel.com''"; or (C) cease distributing your version.
* <span id="obsolete_version"></span> If Eiffel Software releases a new version of the Library, you must, no later than six months after the release of that version, either: (A) update your distribution to the new version; (B) add the following notice to all files in your distribution:" ''This is an obsolete version of EiffelBase. The latest version is available from https://eiffel.com''"; or (C) cease distributing your version.
You may not charge any fee for the distribution of the Library (source or binary), although you may charge for software that includes the Library in whole or in part as per the other provisions of this Agreement.

View File

@@ -1,4 +1,7 @@
[[Property:title|Solutions]]
[[Property:modification_date|Sat, 05 Oct 2019 13:56:56 GMT]]
[[Property:publication_date|Sat, 05 Oct 2019 13:34:12 GMT]]
[[Property:link_title|Solutions and Libraries]]
[[Property:title|Solutions and Libraries]]
[[Property:description|Eiffel Solutions, Technologies, and Class Libraries]]
[[Property:weight|3]]
[[Property:uuid|0f0913fe-d71c-43d3-6c22-706c8ed5d4ad]]
@@ -7,6 +10,7 @@
In this book you will find information about the facilities provided by Eiffel for satisfying many software development needs.
This includes:
* The documentation for the Eiffel IRON repository
* The documentation for the Eiffel class libraries
** Tutorials and/or user guides
** Class references -- the library, cluster, and class views

View File

@@ -1,460 +1,464 @@
[[Property:title|IRON: Eiffel package repository]]
[[Property:link_title|IRON packages]]
[[Property:weight|0]]
[[Property:uuid|393EFF7D-49DF-472C-89CE-7E0970F1A96A]]
{{ReviewRequested}}
=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.}}
=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 executable 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.}}
=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:
<code>
<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"/>
</code>
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:
<nowiki><library name="base" location="iron:base:base.ecf" /></nowiki>
<nowiki><library name="xml_parser" location="iron:xml:parser/xml_parser.ecf" /></nowiki>
<nowiki><library name="foobar" location="iron:dummy:src/foo/bar.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.
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.
<code>
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
</code>
But this implies putting the version in the url (i.e 14.05), or you could set ISE_LIBRARY to <code>https://iron.eiffel.com/14.05/com.eiffel</code>
= 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 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 repositories).
* 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>
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:
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.
* The default and recommended location for a IRON package library is the IRON uri:
iron:package-name:relative-path-to-file.ecf
* 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>
* 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
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.
== 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.
== 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.
Setting IRON_PATH, can be a way to setup different development environments (with different registered repositories, ...)
=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 server's base address: https://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 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.
== 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
! 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.
== 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:
<code>
/14.05/com.eiffel/library/base
/14.05/com.eiffel/library/data_structure/adt/base
</code>
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:
<code>
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
</code>
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:
<code>
> iron install base
or
> iron install https://iron.eiffel.com/14.05/com.eiffel/library/base
</code>
'''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==
*<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==
:{| class="wikitable"
|-
! 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)
|}
==Examples==
===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]):
<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".)
===Uninstall a package===
<code> iron remove base
</code>
===Install all available packages===
<code> iron install --all
</code>
===Uninstall all installed packages===
<code> iron remove --all
</code>
=Advanced Usage=
==Managing Multiple Repositories==
It is possible to have more than one IRON repository server registered.
Examples:
<code>
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
</code>
===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" "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.)
==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:
<code>
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[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
</code>
Note: The package iron file for the Eiffel Base package is available online at <code>https://svn.eiffel.com/eiffelstudio/trunk/Src/library/base/package.iron</code> .
Current status:
* only the '''name of the package is required'''
* the section "project" list the various available .ecf projects
* the section "note" contains title, description, tags, ... informations. The formation is similar to Eiffel indexing note, and in addition it supports bracket in the name of note, such as in ''<nowiki>link[doc]</nowiki>''.
** The "link" declaration: <code>link[category]: "Optional Title" associated-url</code>
* The following notes have semantic that are processed by Iron: '''title, description, tags, link<nowiki>[..]</nowiki>, and maps''', for now mostly on the Iron server.
* It is possible to use any note name. Currently they are simply stored and never displayed. In the future, Iron may support additional semantic for those notes.
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 :
<code>
package cURL
setup
compile_library = Clib
...
</code>
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
<code lang="text">
> 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.
</code>
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.
<code>
> 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"
</code>
*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 <code>c:\eiffel\library\gps_nmea\</code> :
<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"
</code>
This command will:
* 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)
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.
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 ''[[uuid:496983ef-b86e-772e-16b9-39b37ef80e37|Object&#8209;Oriented&nbsp;Software&nbsp;Construction,&nbsp;2nd&nbsp;Edition]]'', in the Modular Understand-ability criterion:
:''''' "A method favors Modular Understand-ability 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.
=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.
=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)
:* 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 version
:* ability to upgrade of packages already installed
:* extended post-installation operations
:* more features that users may request or suggest.
[[Property:modification_date|Sat, 05 Oct 2019 14:14:29 GMT]]
[[Property:publication_date|Sat, 05 Oct 2019 13:54:59 GMT]]
[[Property:title|IRON: Eiffel package repository]]
[[Property:link_title|IRON Eiffel repository]]
[[Property:weight|-20]]
[[Property:uuid|393EFF7D-49DF-472C-89CE-7E0970F1A96A]]
{{Info|This is a repost of the original documentation as provided at [https://iron.eiffel.com/repository/doc/] }}
::Visit the [https://iron.eiffel.com/repository/|IRON package repository]
=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.}}
=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 executable 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.}}
=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:
<code>
<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"/>
</code>
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:
<nowiki><library name="base" location="iron:base:base.ecf" /></nowiki>
<nowiki><library name="xml_parser" location="iron:xml:parser/xml_parser.ecf" /></nowiki>
<nowiki><library name="foobar" location="iron:dummy:src/foo/bar.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.
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.
<code>
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
</code>
But this implies putting the version in the url (i.e 14.05), or you could set ISE_LIBRARY to <code>https://iron.eiffel.com/14.05/com.eiffel</code>
= 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 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 repositories).
* 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>
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:
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.
* The default and recommended location for a IRON package library is the IRON uri:
iron:package-name:relative-path-to-file.ecf
* 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>
* 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
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.
== 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.
== 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.
Setting IRON_PATH, can be a way to setup different development environments (with different registered repositories, ...)
=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 server's base address: https://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 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.
== 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
! 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.
== 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:
<code>
/14.05/com.eiffel/library/base
/14.05/com.eiffel/library/data_structure/adt/base
</code>
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:
<code>
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
</code>
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:
<code>
> iron install base
or
> iron install https://iron.eiffel.com/14.05/com.eiffel/library/base
</code>
'''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==
*<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==
:{| class="wikitable"
|-
! 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)
|}
==Examples==
===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]):
<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".)
===Uninstall a package===
<code> iron remove base
</code>
===Install all available packages===
<code> iron install --all
</code>
===Uninstall all installed packages===
<code> iron remove --all
</code>
=Advanced Usage=
==Managing Multiple Repositories==
It is possible to have more than one IRON repository server registered.
Examples:
<code>
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
</code>
===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" "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.)
==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:
<code>
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[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
</code>
Note: The package iron file for the Eiffel Base package is available online at <code>https://svn.eiffel.com/eiffelstudio/trunk/Src/library/base/package.iron</code> .
Current status:
* only the '''name of the package is required'''
* the section "project" list the various available .ecf projects
* the section "note" contains title, description, tags, ... informations. The formation is similar to Eiffel indexing note, and in addition it supports bracket in the name of note, such as in ''<nowiki>link[doc]</nowiki>''.
** The "link" declaration: <code>link[category]: "Optional Title" associated-url</code>
* The following notes have semantic that are processed by Iron: '''title, description, tags, link<nowiki>[..]</nowiki>, and maps''', for now mostly on the Iron server.
* It is possible to use any note name. Currently they are simply stored and never displayed. In the future, Iron may support additional semantic for those notes.
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 :
<code>
package cURL
setup
compile_library = Clib
...
</code>
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
<code lang="text">
> 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.
</code>
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.
<code>
> 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"
</code>
*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 <code>c:\eiffel\library\gps_nmea\</code> :
<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"
</code>
This command will:
* 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)
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.
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 ''[[uuid:496983ef-b86e-772e-16b9-39b37ef80e37|Object&#8209;Oriented&nbsp;Software&nbsp;Construction,&nbsp;2nd&nbsp;Edition]]'', in the Modular Understand-ability criterion:
:''''' "A method favors Modular Understand-ability 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.
=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.
=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)
:* 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 version
:* ability to upgrade of packages already installed
:* extended post-installation operations
:* more features that users may request or suggest.