Ivy Chinese Reference Document (3)-Key Concepts (i)

Source: Internet
Author: User
Tags file system

Original English: http://ant.apache.org/ivy/history/2.1.0-rc1/concept.html

Split because the content is too long, here is the first part:

A. Dependent resolver

The dependency parser is the pluggable class used in Ivy:

* Discover dependencies in Ivy files

* Download Dependent Products

The concept of product download is very large: the product can be on the website, or on the local file system on your machine. Downloads are the behavior of fetching files from the warehouse to the Ivy cache.

Also, the parser's job is to find Ivy files and download artifacts, which can help implement different parsing strategies.

As you can see, the dependency parser may be considered the class that is responsible for describing the warehouse.

If you want to know which parsers are available in ivy, you can go to the corresponding configuration section.

Two. Module Configuration instructions

The module configuration is described in the terminology page and is used to use or build a module. Configuration is an important part of Ivy and needs more explanation.

When you define a way to use or build a module, you can define in this configuration which artifacts are released by the module, and you can also define which dependencies are needed in this configuration.

In addition, because dependencies in Ivy are expressed as modules rather than artifacts, it is important to be able to define dependent configurations in your defined modules. This is the configuration map.

If you just use a single module and don't want to worry about configuration, you can ignore them. They still exist, leaving Ivy unable to work without a configuration. But most of the time, if you don't define anything, Ivy assumes that your module's artifacts are released in all configurations and that all of the dependencies in all configurations are required. and works fine in a single module. But whenever you want to separate things within a module, or more control over what is released and through dependency resolution, configuration will meet most of your requirements.

For more information on how to define a module configuration, define which configuration to use to publish and define configuration mapping details, refer to the Ivy documentation. The configuration tutorial is a great place to teach you to learn more about this concept.

Three. Variable

In the process of configuration, Ivy allows the definition of ivy variables. Ivy variables can be considered similar to ant properties and are used in similar ways. In particular, use a property tag in the configuration file to load a property file containing Ivy variables and values.

However, the biggest difference between ant properties and ivy variables is that ivy variables can be overridden, but ant properties are not, and they are defined in different environments.

In fact, when the configuration is complete, all ant properties are imported into Ivy variables (if you call Ivy from Ant). This means that if you define an ant property after calling the configuration, it cannot be accessed as a Ivy variable. On the other hand, ivy variables cannot be exported to ant, all if you define Ivy variables in ivy, do not attempt to use them as ant properties.

To use the Ivy variable, you must follow the same syntax as the Ant property:

${variablename}

The variablename of this is the variable name

Finally, it is equally important to know the point in time when the variable is being placed. Brought in is as fast as possible. This means that when Ivy encounters a variable reference, if the variable is defined, it tries to substitute it. As a result, any subsequent changes to this variable will not affect the value that has been entered.

In addition, in an ant environment, a string of variables is set by default by the Ant property file loading mechanism (they are actually first loaded as ant properties and then imported as ivy variables, see ant Tasks), and even in the Ant property itself, as soon as it is loaded. Effectively making it impossible to overwrite certain variables simply by ivysettings.properties files. Some variables can therefore be overloaded only with ant properties.

In addition, it is also very important to understand the differences between ivy variables and Ivy model markers (pattern tokens). Please read the section of the pattern to understand what a pattern tag is.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.