compile" vs CONF = "runtime-> compilation (*)" ...">

Ivy Plus Symbol

Depending on ivy,

Q1. What's the difference between

CONF = "runtime-> compile"

vs

CONF = "runtime-> compilation (*)"

What does a wildcard do with extra brackets?

Q2.

What does the following do?

CONF = "compile-> compilation (*)"

Isn't that cyclic / self-dependency? What is the point of displaying the config for yourself?

+4
source share
2 answers

Brackets are a backup :

starting from 1.3, the backup mechanism can be used if you are not sure that the dependency will have the required conf. You can specify ivy that you need one configuration, but if it is missing, use another one. The syntax for specifying this adds a backup conf between the brackets immediately after the required conf. For instance,

test->runtime(default)
means that in the test configuration the module
runtime
conf dependencies are required, but if it does not exist, it will use default
instead of this. If by default conf do not exist, then this will be considered an error. Please note that * wildcard can be used as backup conf.

For Question2: conf is always read as follows:

 ConfFromThisFile -> ConfFromDependency 

So,

 compile->compile 

displays the compile configuration depending on the compile configuration of this file. This is not a cycle. The bracket indicates: If compile does not exist depending, use * .

See the ivy document configuration configuration section for dependencies .

+3
source

This syntax is for returning dependencies. runtime->compile means that the runtime configuration depends on the compilation configuration. A compilation configuration must be present, or Ivy will report an error. However, runtime->compile(*) will first try to configure the configuration to satisfy the dependencies. But if compilation does not exist, it will try to use all other configurations. See the Ivy docs Configurations section for more information.

Based on this, compile->compile(*) indicates that any (all?) Configurations are needed for compilation. I assume that compile->(*) not a valid syntax, so the extra compile ensures that fallback is used, since compile not defined until the completion of the XML configuration stanza.

Please note that the documentation is not visible if (*) means "any" or "all" configurations. Thus, I'm not sure that Ivy will stop in the first configuration, which matches all the dependencies (if any), or if it introduces all the other configurations in the union.

+1
source

Source: https://habr.com/ru/post/1432345/


All Articles