I'm trying to come up with a sensibly way to model sources and Javadoc
artifacts in Ivy/Gradle. Some options:

1. Only list main artifacts in module descriptor, but additionally publish
sources and Javadoc artifacts with `-sources` and `-javadoc` classifiers.

In a way this is cheating, but on the other hand it works fairly well with
current Gradle. A regular module dependency will resolve to the module's
main artifacts (which is what one typically wants), and the IDE plugins will
successfully resolve and configure sources and Javadoc Jars for the artifact
that's named after the module (if any). However, for any other artifacts
sources and Javadoc Jars won't currently be configured successfully. See: 
http://forums.gradle.org/gradle/topics/eclipse_classpath_jars_and_source_attachments_from_ivy_dependencies
http://issues.gradle.org/browse/GRADLE-2320

2. List main, sources, and Javadoc artifacts in module descriptor, and
distinguish them by their artifact type.

This is what some public Ivy repos (e.g. SpringSource Enterprise Bundle
repo) seem to be doing. However, it doesn't work well with current Gradle.
The main problem is that without a good/easy way to declare a dependency
that resolves to all module artifacts but those of type `sources` and
`javadoc`, sources and Javadoc artifacts will show up in the wrong places
(e.g. compile class paths).

3. Have separate configurations for sources and Javadoc artifacts.

Either have one `sources` and `javadoc` configuration per module, or one
`sources` and `javadoc` configuration per other configuration in the module.
This solves the problem of accidentally bringing in sources and Javadoc
artifacts, and could be made to work with Gradle's IDE support. However, it
doesn't seem quite right to me, as conceptually sources and Javadoc
artifacts are closely related to their "main" artifact. Not sure if it
matters.

4. Have separate modules for sources and Javadoc artifacts.

Seems like the least desirable option to me, but mentioning it for
completeness.

Any opinions on which options make sense? Any other options that come to
mind? Do we need to support more than one option?

Cheers,
Peter



--
View this message in context: 
http://gradle.1045684.n5.nabble.com/Modelling-sources-and-Javadoc-artifacts-in-Ivy-Gradle-tp5711272.html
Sent from the gradle-dev mailing list archive at Nabble.com.

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

    http://xircles.codehaus.org/manage_email


Reply via email to