ant - Using a configuration intersection in ivy -
i thankful help.
we use ant\ivy manage our dependencies. , want download minimum quantity of modules: needed build. try use configuration intersection, got not expecting ivy behavior.
https://ant.apache.org/ivy/history/latest-milestone/ivyfile/dependency.html
since 2.1 possible define dependencies on configurations intersection. configuration intersection defined using '+' sign separate configuration (eg 'a+b' means intersection of configuration 'a' , 'b'). in case artifacts , dependencies defined in both configurations in dependency part of master configuration defining dependency on configuration intersection.
configuration intersections can used when specifying confs resolve.
build.xml file:
<project xmlns:ivy="antlib:org.apache.ivy.ant" xmlns:e="http://ant.apache.org/ivy/extra" name="test" default="get"> <target name="get" description="-->downloads artifacts , prepare it"> <ivy:resolve file="ivy.xml" conf="${conf}" /> </target> </project>
ivy file:
<?xml version="1.0" encoding="utf-8"?> <ivy-module version="2.0" xmlns:e="http://ant.apache.org/ivy/extra"> <info module="test" organisation="main" revision="1.0"/> <configurations> <conf name="release" e:axis="download_type" /> <conf name="dev" e:axis="download_type" /> <conf name="client" e:axis="product"/> <conf name="server" e:axis="product"/> </configurations> <dependencies> <dependency org="main" name="zlib" branch="trunk" rev="1.2.8.+" conf="dev->*;client->*"/> </dependencies> </ivy-module>
case 1:
ant -dconf="dev+server"
case 2:
ant -dconf="server+dev"
i expect results same in first , second case: zlib shouldn't downloaded, because intersection of "dev" , "server" confs nothing. get:
- in case 1: zlib not dowloaded
- in case 2: zlib dowloaded
where misunderstanding?
thanks
ps. version of ivy 2.4.0
Comments
Post a Comment