On 23/11/2012, at 11:16 PM, Luke Daley wrote: > > On 23/11/2012, at 10:44 AM, Szczepan Faber wrote: > >>> * When the group or version for the project is not specified, publishing >>> should probably fail. >> >> +1 It's a user error to me. > > It depends. > > What about a simple HTTP upload? My project makes a file, that I want to > publish to a HTTP server. Let's say it's a zip of documentation. I know > nothing about maven/ivy artifact managers etc. > > Two options: > > 1. Publishing as we speak of it is about this world of artifacts and artifact > repositories etc, and other operations (such as a simple HTTP put) are > something else > 2. Only fail if that particular publish operation (e.g. Ivy publish) doesn't > have some data it requires.
I meant option 2, for Ivy and Maven publication, and specifically where group and/or version have not been provided. It might also turn out that HTTP upload is just HTTP upload and not publishing. Let's see. > > >>> * When running 'gradle publish' with no outgoing repositories of the >>> appropriate type defined, we should probably log a warning to let you know >>> that you've forgotten to do this. > > This couldn't be a general thing. We could do it a finer level though. For > example, if you apply the 'ivy-publish' plugin, but there are no > PublishToIvyRepository tasks in the project, then an action on the “publish” > lifecycle task could throw a warning. Right. The check (and suggested resolution) would probably be specific to each publication type. > >> Where is it published if there are no right outgoing repos? > > Nowhere. The “publish” lifecycle task will run, but it won't be depending on > any real publish tasks. > >>> * When running 'gradle publish' and there are unused repositories defined >>> (e.g. I've applied the maven-publish plugin but defined an ivy repository), >>> we should probably log a warning to let you know that the repository isn't >>> going to be used. >> >> +1 I think. If it is not used it should not be in the build script. > > This is going to be hard to do, impossible I think. > > 1. How do you determine “unused”? Just because I've applied the ivy-publish > plugin but there is a maven repository doesn't really mean it's unused. Unused would be if it is literally not used for publishing, e.g. nothing tries to turn it into an ArtifactPublisher. > 2. Where does this logic go? A variant on #1, you can't have a plugin assume > that if there is a repository of a different type than it knows about in > publishing.repositories that it is “unused” It would go in the publishing plugin. -- Adam Murdoch Gradle Co-founder http://www.gradle.org VP of Engineering, Gradleware Inc. - Gradle Training, Support, Consulting http://www.gradleware.com
