I have been trying to parse the docs around artifact configuration and got hung up on the following.

artifacts {
  archives myJar
}

Cause: No signature of method: org.gradle.api.internal.artifacts.dsl.DefaultArtifactHandler.archives() is applicable for argument types: ...

I'm not using the java plugin and I didn't realize "archives" was the name of a configuration and was pulling my hair out before I realized archives was actually the name of a configuration not a property or method of artifacts. So adding
configurations {
  archives
}
fixed the error.

To further confuse the issue I was trying to upload dlls rather than jar files so I thought I might be able to do
artifacts {
  file 'bin\log4net.dll'
  artifact name: 'log4net.dll'
}
and other stuff like that.

The error makes sense in hindsight I guess. But this also raises a few other interesting questions.
Is possible to attach non-archive artifacts?
How are gradle configurations mapped to ivy configurations?
can gradle support extra properties? http://ant.apache.org/ivy/history/trunk/concept.html#extra

I was thinking it might be less confusing if artifacts were actually specified in the configuration's configuration rather than in a separate section. And perhaps archive would mean read artifact info from the archive task and artifact might mean a here is the ivy info find file via publish pattern as ivy does (although I don't really like how Ivy does this either and found ivy publications -> file location a bit confusing also). Something like the following perhaps:

configuration {
  archives {
     artifacts {
        archive myJar
        artifact name: 'blah', culture: 'en-US'
     }
   }
}





---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email


Reply via email to