Steve Appling wrote:
I would love to change this name. I did not come from an Ivy
background and have always felt this was awkward.
I have also always felt that using configurations to store paths and
to specify a distribution archive were two very different uses that
didn't belong together. I would like to see the archive part pulled
out into another concept.
I agree. I think we have 2 separate concepts here: a project has
dependencies, and a project has publications.
Dependencies are artifacts produced outside the project, which are used
by the project in some way, whether that is in the build script, or at
compile time, or execution time, or whatever.
Publications are artifacts produced by the project, and which are made
available as dependencies for other projects.
An artifact may be an archive, or an xsl file, or an image file, or a
license file, or a report, or some javadoc, or whatever. It's just a
file shared between projects.
To me, the core of configurations are named dependencies. I like:
dependencyNames {
compile
openAPI
}
dependencies {
compile 'commons-io:commons-io:1.4'
}
I think "paths" are a little too generic. And paths.compile.asPath
seems a little strange :)
I think we should merge what is currently configurations {} into what is
dependencies { }, as John has suggested.
I prefer the implicit creation. I really don't buy the typo argument
against it. I can't say I've ever had it happen in practise. Even if it
does, the problem lasts about as long as it takes for Gradle to get to
the compile task.
So, I think we should have something like:
dependencies {
compile { transitive = false } // what we have in configurations { }
compile {
transitive = false
dependency 'some-dep' // allow dependencies to be added
directly to a Configuration
dependency module('some-module') { ... }
}
compile 'some-dep' // this is simply a shortcut for compile {
dependency('some-dep') }
}
I would model the elements of the dependencies container as composite
dependencies, that is, each element is a Dependency to which other
Dependency instances can be added. We might call it DependencySet or
NamedDependency or CompositeDependency or DependencyConfiguration or
something. We could get rid of configuration inheritence by allowing
composite dependencies to be added to each other.
As for dependencies {}, I think we should also merge configurations { }
into artifacts { }, and rename it to publications { }
publications {
default {
artifact myJar
}
default myJar // this is a shortcut for default { artifact(myJar) }
}
Similar to Dependency, we would have a Publication type, and number of
implementations. One would be a single file. Another would be a
composite Publication to which other Publications can be added.
When a composite publication is published, the runtime dependencies to
be included in the dependency descriptor are specified by the
publications it contains. In the example above, when the 'default'
publication is published, we know from how myJar is built, that it needs
all the dependencies declared in the (incoming) 'runtime' dependency, so
we just copy the dependencies across to the publication.
Hans Dockter wrote:
I would love to have a better name for configurations. Initially I
just took this name from Ivy as I couldn't think of anything better.
Even with Ivy I guess it is not a perfect name. But in the context of
a build system it is really confusing.
Mostly configurations are classpaths, but not always (e.g. they may
contain distribution archives). Why not calling configurations paths?
paths {
compile "commons-io:commons-io:1.4"
}
paths.compile.files ...
Thoughts? Better names?
I know that this would be a pretty disruptive change. It would have
been much better to have done this earlier. But that's why we are
still pre 1.0.
- Hans
--
Hans Dockter
Gradle Project Manager
http://www.gradle.org
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email