On 07/02/2013, at 4:08 AM, Rene Groeschke wrote:
> Hey Devs,
>
> in our current implementation of the DistributionPlugin we can rename
> the name of a distribution:
>
> apply plugin:'distribution'
>
> distributions {
> custom{
> name = 'someOtherName'
> }
> }
>
> The used Container here is DistributionContainer which extends
> NamedDomainObjectContainer<Distribution> where Distribution implements
> the "Named" interface.
>
> The problem here is, that we modify the name property whihch should be
> constant for the life of the object (quote from the Named javadoc)
>
> Let's say I want to modifiy some more properties of my custom
> distribution by adding this snippet later to build file:
>
>
> distributions {
> custom{
> someOtherProp = 'someOtherValue'
> }
> }
>
> This now breaks the build as gradle tries to create a new Distribution
> instead of referencing the already created one because we changed the
> name which should be constant.
>
> I think we need to change the property to something like 'id' or
> 'distributionName' to avoid the problems we're just facing now. I favour
> 'id' as distributionName seems a bit redundant in this scope:
>
> distributions {
> custom{
> distributionName = 'someDistributionName'
> }
> }
>
> thoughts?
We should. It's planned for the next story. I called it 'baseName' in the spec,
but we could call it something else.
--
Adam Murdoch
Gradle Co-founder
http://www.gradle.org
VP of Engineering, Gradleware Inc. - Gradle Training, Support, Consulting
http://www.gradleware.com