Details
-
Type:
Bug
-
Status:
Open
-
Resolution: Unresolved
-
Affects Version/s: 1.0-milestone-3
-
Fix Version/s: None
Description
In ivy's world, the configuration of a dependency is always more complex than a single word and will be a long expression.
The common and widely used one is that :
conf="compile->compile(*),master(*);runtime->runtime(*)"/>
For example, in the ivy file of easymock 3.0:
<dependencies> <dependency org="cglib" name="cglib-nodep" rev="2.2" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/> <dependency org="org.objenesis" name="objenesis" rev="1.2" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/> <dependency org="junit" name="junit" rev="4.8.1" force="true" conf="test->runtime(*),master(*)"/> </dependencies>
And also testng 6.1
<dependencies> <dependency org="ant" name="ant" rev="1.6.5" force="true" conf="optional->compile(*),master(*)"/> <dependency org="junit" name="junit" rev="3.8.1" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/> <dependency org="org.beanshell" name="bsh" rev="2.0b4" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/> <dependency org="com.google.inject" name="guice" rev="2.0" force="true" conf="provided->compile(*),provided(*),runtime(*),master(*)"/> <dependency org="com.beust" name="jcommander" rev="1.12" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/> <dependency org="org.yaml" name="snakeyaml" rev="1.6" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/> </dependencies>
We can see that almost even configuration is not simple like "compile" or "runtime", but a complex expression.This feature is a important, powerful and widely used in ivy's world.
But in gradle's configuration, this configuration expression is not supported!! In gradle, it only supports a single word of configuration like "compile" or "runtime".Otherwise gradle will fail and report that the configuration (like 'compile,runtime') is not a valid configuration!
I checked the code of gradle and found the reason, in class DefaultIvyDependencyResolver :
private ResolveOptions createResolveOptions(Configuration configuration) { ResolveOptions resolveOptions = new ResolveOptions(); resolveOptions.setDownload(false); resolveOptions.setConfs(WrapUtil.toArray(configuration.getName())); return resolveOptions; }
Be care to this line
resolveOptions.setConfs(WrapUtil.toArray(configuration.getName()));
In this method, the configuration name will be directly passed to ivy resolveOptions by a simply wrap from a String to a String[]. So when the configuration is 'compile,runtime', I expect that the ivy will handle two configurations as String[]{"compile", "runtime"} , but in fact gradle will pass a String["compile,runtime"] to ivy.
As a old ivy user, I feel very disappointed and regretful for this issue, because it is really very powerful and important.
I hope in the next release ASAP gradle will support some similar expression like
compile(*),master(*)
Activity
| Field | Original Value | New Value |
|---|---|---|
| Description |
In ivy's world, the configuration of a dependency is always more complex than a single word and will be a long expression.
The common and widely used one is that : conf="compile->compile(*),master(*);runtime->runtime(*)"/> For example, in the ivy file of easymock 3.0: <dependencies> <dependency org="cglib" name="cglib-nodep" rev="2.2" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/> <dependency org="org.objenesis" name="objenesis" rev="1.2" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/> <dependency org="junit" name="junit" rev="4.8.1" force="true" conf="test->runtime(*),master(*)"/> </dependencies> And also testng 6.1 <dependencies> <dependency org="ant" name="ant" rev="1.6.5" force="true" conf="optional->compile(*),master(*)"/> <dependency org="junit" name="junit" rev="3.8.1" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/> <dependency org="org.beanshell" name="bsh" rev="2.0b4" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/> <dependency org="com.google.inject" name="guice" rev="2.0" force="true" conf="provided->compile(*),provided(*),runtime(*),master(*)"/> <dependency org="com.beust" name="jcommander" rev="1.12" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/> <dependency org="org.yaml" name="snakeyaml" rev="1.6" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/> </dependencies> We can see that almost even configuration is not simple like "compile" or "runtime", but a complex expression.This feature is a important, powerful and widely used in ivy's world. But in gradle's configuration, this configuration expression is not supported!! In gradle, it only supports a single word of configuration like "compile" or "runtime".Otherwise gradle will fail and report that the configuration (like 'compile,runtime') is not a valid configuration! I checked the code of gradle and found the reason, in class DefaultIvyDependencyResolver : private ResolveOptions createResolveOptions(Configuration configuration) { ResolveOptions resolveOptions = new ResolveOptions(); resolveOptions.setDownload(false); resolveOptions.setConfs(WrapUtil.toArray(configuration.getName())); return resolveOptions; } Be care to this line "resolveOptions.setConfs(WrapUtil.toArray(configuration.getName()));". In this method, the configuration name will be directly passed to ivy resolveOptions by a simply wrap from a String to a String[]. So when the configuration is 'compile,runtime', I expect that the ivy will handle two configurations as String[]{"compile", "runtime"} , but in fact gradle will pass a String["compile,runtime"] to ivy. As a old ivy user, I feel very disappointed and regretful for this issue, because it is really very powerful and important. I hope gradle will support some similar expression like 'compile(*),master(*)' in the next release ASAP. |
In ivy's world, the configuration of a dependency is always more complex than a single word and will be a long expression.
The common and widely used one is that : {code} conf="compile->compile(*),master(*);runtime->runtime(*)"/> {code} For example, in the ivy file of easymock 3.0: {code} <dependencies> <dependency org="cglib" name="cglib-nodep" rev="2.2" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/> <dependency org="org.objenesis" name="objenesis" rev="1.2" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/> <dependency org="junit" name="junit" rev="4.8.1" force="true" conf="test->runtime(*),master(*)"/> </dependencies> {code} And also testng 6.1 {code} <dependencies> <dependency org="ant" name="ant" rev="1.6.5" force="true" conf="optional->compile(*),master(*)"/> <dependency org="junit" name="junit" rev="3.8.1" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/> <dependency org="org.beanshell" name="bsh" rev="2.0b4" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/> <dependency org="com.google.inject" name="guice" rev="2.0" force="true" conf="provided->compile(*),provided(*),runtime(*),master(*)"/> <dependency org="com.beust" name="jcommander" rev="1.12" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/> <dependency org="org.yaml" name="snakeyaml" rev="1.6" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/> </dependencies> {code} We can see that almost even configuration is not simple like "compile" or "runtime", but a complex expression.This feature is a important, powerful and widely used in ivy's world. But in gradle's configuration, this configuration expression is not supported!! In gradle, it only supports a single word of configuration like "compile" or "runtime".Otherwise gradle will fail and report that the configuration (like 'compile,runtime') is not a valid configuration! I checked the code of gradle and found the reason, in class DefaultIvyDependencyResolver : {code} private ResolveOptions createResolveOptions(Configuration configuration) { ResolveOptions resolveOptions = new ResolveOptions(); resolveOptions.setDownload(false); resolveOptions.setConfs(WrapUtil.toArray(configuration.getName())); return resolveOptions; } {code} Be care to this line {code}resolveOptions.setConfs(WrapUtil.toArray(configuration.getName()));{code} In this method, the configuration name will be directly passed to ivy resolveOptions by a simply wrap from a String to a String[]. So when the configuration is 'compile,runtime', I expect that the ivy will handle two configurations as String[]{"compile", "runtime"} , but in fact gradle will pass a String["compile,runtime"] to ivy. As a old ivy user, I feel very disappointed and regretful for this issue, because it is really very powerful and important. I hope in the next release ASAP gradle will support some similar expression like {code}compile(*),master(*){code} |
| Workflow | jira [ 13005 ] | jira with pivotal tracker [ 14408 ] |
| Workflow | jira with pivotal tracker [ 14408 ] | jira with pivotal tracker (no resolved, only closed) [ 16274 ] |
| Workflow | jira with pivotal tracker (no resolved, only closed) [ 16274 ] | Copy of jira with pivotal tracker (no closed, only resolved) [ 18948 ] |
the
is that "( * )"