ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Stevenson <lostintheshuffl...@gmail.com>
Subject Publish task not consistently respecting extra attributes
Date Tue, 18 Dec 2012 23:42:25 GMT
Hi, thanks in advance for the help!  (or at least reading this)

I'm having difficulties with the Publish task.  The task is correctly using
the value of an extra attribute/token value as defined in the src ivy
pattern when it does its internal deliver task of the ivy file, but then
ignoring the value of that attribute/token when retrieving the resolved Ivy
file for publishing.

Here is a simplified case.  I have a C# .NET project that produces a .dll
(no dependencies), and publishes that .dll to a file system repository.

Short version:
I define an extra attribute e:folderItegRev on my Ivy file, and set it
using an ant property set to the value "101."
I call ivy:publish with:
 srcivypattern="${ivy.basedir}/bin/Release/[module](-[folderItegRev])-ivy.xml"
The internal publish task delivers ivy file
as " [...]\PublishTest\bin\Release\PublishTest-101-ivy.xml" as expected,
but fails to publish the ivy file, apparently looking for
"[...]\PublishTest\bin\Release\PublishTest-ivy.xml," which is not what was
delivered (missing the "101").

Long version, with code:
Ivy file (ivy.xml):
-----------------------

<ivy-module version="2.0" xmlns:e="http://ant.apache.org/ivy/extra">
    <info organisation="Personal" module="PublishTest"
e:folderItegRev="${folder.itegrev}"/>
<configurations>
<conf name="Primary" visibility="public"/>
</configurations>
<publications>
<artifact name="PublishTest" ext="dll" type="dll" conf="Primary"
e:folderItegRev="${folder.itegrev}"/>
</publications>
</ivy-module>


Ivy settings (ivysettings.xml):
-----------------------------------------

<ivysettings>
<settings defaultResolver="localRepo"/>
<resolvers>
<filesystem name="localRepo">
<ivy
pattern="${ivy.home}/localRepo/[organization]/[module]/[folderItegRev]/[revision]/[type]s/[module]-ivy.xml"
/>
<artifact
pattern="${ivy.home}/localRepo/[organization]/[module]/[folderItegRev]/[revision]/[type]s/[module](-[classifier])-[revision].[ext]"
/>
</filesystem>
</resolvers>
</ivysettings>


Ant build file (build.xml):
------------------

<project default="build" xmlns:dn="antlib:org.apache.ant.dotnet"
xmlns:ivy="antlib:org.apache.ivy.ant">
<property name="folder.itegrev" value="101"/>
 <target name="build">
<ivy:configure file="ivysettings.xml" />
<ivy:resolve conf="Primary" />
<dn:msbuild buildfile="${basedir}/${ivy.module}.csproj">
<property name="Configuration" value="Release" />
<property name="BuildProjectReferences" value="false"/>
<property name="WarningLevel" value="4"/>
</dn:msbuild>
<ivy:publish
resolver="localRepo"
artifactspattern="${ivy.basedir}/bin/Release/[artifact].[ext]"
srcivypattern="${ivy.basedir}/bin/Release/[module](-[folderItegRev])-ivy.xml"
conf="Primary"
/>
</target>
</project>


My build works successfully and ivy:publish is called.  The deliver task
delivers the resolved Ivy file as expected, including the folderItegRev
value:

[ivy:publish] :: delivering :: Personal#PublishTest;working@computer ::
20121218161637 :: integration :: Tue Dec 18 16:16:37 MST 2012
[ivy:publish] options = status=integration pubdate=Tue Dec 18 16:16:37 MST
2012 validate=true resolveDynamicRevisions=true merge=true resolveId=null
pubBranch=null
[ivy:publish] delivering ivy file to
[...]\PublishTest\bin\Release\PublishTest-101-ivy.xml
[ivy:publish] deliver done (16ms)


Note that the delivered Ivy file is "PublishTest-101-ivy.xml," including
the [folderItegRev] value, as expected.  But when the publish is called an
IllegalArgumentException is thrown that the ivy file to publish was not
found:

BUILD FAILED
[...]\PublishTest\build.xml:17: impossible to publish artifacts for
Personal#PublishTest;working@computer: java.lang.IllegalArgumentException:
ivy file to publish not found for Personal#PublishTest;working@computer:
call deliver before ([...]\PublishTest\bin\Release\PublishTest-ivy.xml)


I've tried explicitly calling <ivy:deliver /> prior to publish, and it
again works as expected, but the publish does not.  I've tried manually
calling <ivy:info /> prior to publish, thinking it might update a necessary
property that publish is not setting... no luck.

I'm about ready to go spelunking through the source, but thought I'd ask
the experts first.  Thanks again!

-Chris

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message