OK so here's a followup. It looks like the resolver can't figure out the [conf] 
either. I've got the following resolver with the following ivy:publish:

    <filesystem name="local-bin-conf">
      <artifact pattern="${local.bin.dir}\[conf]\[artifact].[ext]"/>
      <ivy pattern="${local.bin.dir}\[type]\[module].[ext]"/>
    </filesystem>




    <ivy:publish resolver="local-bin-conf"
                 conf="binaries"
                 module="${ant.project.name}"
                 artifactspattern="bin\binaries\[artifact].[ext]"
                 revision="${build.revision}"
                 overwrite="true"
                 srcivypattern="ivy.xml"
                 status="${build.status}"
                 update="true"/>


Instead of publishing to ${local.bin.dir}\binaries\[artifact].[ext] as I would 
expect when publishing the binaries conf, it publishes to 
${local.bin.dir}\default\[artifact].[ext], as if it were using the default 
configuration. Despite this, the correct artifacts were published (the artifact 
was published iff it was in the binaries conf)

When I change the ivy:publish artifactspattern to bin\[conf]\[artifact].[ext] 
and build my code to bin\default\[artifact].[ext], the publish continues with 
this behavior, so in both ivy:publish and in the resolver, [conf] is resolving 
to 'default', even though it's demonstrated by the artifacts that were 
published that at least some part of the Ivy system is using 'binaries'

Is there something I don't understand here, or could this be bug?

Thanks

From: Obendorf, Keston
Sent: Thursday, September 15, 2011 3:02 PM
To: 'ivy-user@ant.apache.org'
Subject: [conf] in artifactspattern

Is it possible to use [conf] in the artifactspattern for ivy:publish?

A little bit of background, our product needs to be compiled a little 
differently for creating different installers, and so what happens is we just 
rebuild those binaries with a different Configuration which defines a 
conditional compilation symbol (Our code is in .Net). This creates multiple 
binaries with the same name, but with different code inside. We build these to 
bin\binaries, bin\external_binaries, etc., depending on the configuration.

So for our Ivy files, I was thinking that we could separate these as different 
Ivy conf's. With that decided, publishing the binaries will require [conf] in 
the artifactspattern:
    <ivy:publish resolver="local-bin"
                 conf="binaries"
                 module="${ant.project.name}"
                 artifactspattern="bin\[conf]\[artifact].[ext]"
                 revision="${build.revision}"
                 overwrite="true"
                 srcivypattern="ivy.xml"
                 status="${build.status}"
                 update="true"/>

When I run this task, I fail to publish anything:

impossible to publish artifacts for cevt#Kernel;0: java.io.IOException: missing 
artifact cevt.ssa#Kernel;0!SSA.dll

However, if I replace [conf] with an explicit name, it publishes fine.

    <ivy:publish resolver="local-bin"
                 conf="binaries"
                 module="${ant.project.name}"
                 artifactspattern="bin\binaries\[artifact].[ext]"
                 revision="${build.revision}"
                 overwrite="true"
                 srcivypattern="ivy.xml"
                 status="${build.status}"
                 update="true"/>


In the Ivy documentation it mentions that which properties are available can 
depend on what operation you are doing. Am I right in assuming [conf] is not 
available in ivy:publish artifactspattern?


Also, here's the resolver, if it matters to the question:

    <filesystem name="local-bin">
      <artifact pattern="${local.bin.dir}\[artifact].[ext]" />
      <ivy pattern="${local.bin.dir}\ivy\[module].[ext]"/>
    </filesystem>


And the relevant parts of the ivy file.

<ivy-module version="1.0">
  <info organisation="cevt.ssa" module="Kernel"/>
  <configurations>
    <conf name="binaries" description="Includes all of the .dll files" />
      ......
  </configurations>
  <publications>
    <artifact name="SSA" type="dll" conf="binaries" ext="dll" />
      ......
  </publications>
</ivy-module>

Reply via email to