<br><br><div class="gmail_quote">On Thu, May 6, 2010 at 7:06 AM, Andreas Raab <span dir="ltr">&lt;<a href="mailto:andreas.raab@gmx.de">andreas.raab@gmx.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi -<br>
<br>
I&#39;ve been trying to wet my feet with Metacello a little by writing a ConfigurationOfWebClient and in the process I&#39;ve come across various things that I don&#39;t understand or don&#39;t know how to express. The configuration itself can be found here:<br>

<br>
        <a href="http://www.squeaksource.com/MetacelloRepository" target="_blank">http://www.squeaksource.com/MetacelloRepository</a><br>
<br>
Here are the questions I&#39;m having:<br>
<br>
1) #includes: vs. #requires:<br>
What is the difference between #includes: and #requires:? They sound entirely interchangeable, in particular after reading the tutorial which states:<br>
<br>
        &quot;When you use the #includes: directive, you are not only specifying that the listed packages should be loaded when the parent package is loaded, but that the #included: packages should be loaded _before_ any packages that require the parent package.&quot;<br>

<br>
I would expect that precise behavior for required packages, i.e., if Foo requires: Bar then Bar is loaded before Foo if some other package requires: Foo. What am I missing?<br>
<br>
2) Why is HelpSystem not loaded?<br>
In my configuration, baseline specifies that HelpSystem is required for WebClient-Help:<br>
<br>
                &quot;Documentation doesn&#39;t require Core/Tests, but HelpSystem&quot;<br>
                spec package: &#39;WebClient-Help&#39; with:[spec requires: &#39;HelpSystem&#39;].<br>
<br>
                spec project: &#39;HelpSystem&#39; with:[<br>
                        spec<br>
                                className: &#39;ConfigurationOfHelpSystem&#39;;<br>
                                repository: &#39;<a href="http://www.squeaksource.com/MetacelloRepository" target="_blank">http://www.squeaksource.com/MetacelloRepository</a>&#39;<br>
                ].<br>
<br>
However, when executed, Metacello goes through the motions but doesn&#39;t actually *load* any version of HelpSystem (I can see it &#39;fetch&#39; the packages but not load them). It even calls the postLoadDoIt on it (which fails since nothing was loaded). What am I doing wrong?<br>

<br></blockquote><div><br>Hi Andreas, I am not sure, but did you try setting also the file:<br><br>     &quot;Documentation doesn&#39;t require Core/Tests, but HelpSystem&quot;<br>
                spec package: &#39;WebClient-Help&#39; with:[spec requires: 
&#39;HelpSystem&#39;].<br>
<br>
                spec project: &#39;HelpSystem&#39; with:[<br>
                        spec<br>
                                className: &#39;ConfigurationOfHelpSystem&#39;;<br>
                                repository: &#39;<a href="http://www.squeaksource.com/MetacelloRepository" target="_blank">http://www.squeaksource.com/MetacelloRepository</a>&#39;;<br>                               file:  &#39;ConfigurationOfHelpSystem&#39;;<br>

                ].<br><br><br>I saw in your final version you added a version: &#39;1.1&#39; and I saw you put a comment saying that&#39;s a Metacello bug. It&#39;s weird since version: shouldn&#39;t be necessary there.<br>
<br>You should put it in the version.<br><br>spec <br>            package: &#39;WebClient-Core&#39; with: &#39;WebClient-Core-ar.16&#39;;<br>            package: &#39;WebClient-Tests&#39; with: &#39;WebClient-Tests-ar.7&#39;;<br>
            package: &#39;WebClient-Help&#39; with: &#39;WebClient-Help-ar.5&#39;;<br>            package: &#39;WebClient-HTTP&#39; with: &#39;WebClient-HTTP-ar.1&#39;.<br>spec<br>            project: &#39;HelpSystem&#39; with: &#39;1.1&#39;.<br>
<br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
3) When exactly is HelpSystem loaded?<br>
<br>
What I&#39;m wondering about in the above is that HelpSystem should only be loaded if WebClient-Help is being loaded. Is this implicitly part of specifying a &#39;project&#39; instead of a &#39;package&#39;? Or is there some other way of specifying that?<br>

<br>
I guess really the question here is what entities get loaded implicitly simply by declaring them (packages for sure, any others?) and what entities need to be &#39;required&#39; in order to be loaded?<br>
<br></blockquote><div><br>If you don&#39;t define groups in your configuration, it will load by default all the declarations: packages and projects. <br><br>If you want to change that, you can add to your conf something like this:<br>
<br>spec<br>            group: &#39;default&#39; with: #(&#39;Core&#39; );<br>            group: &#39;Core&#39; with: #( &#39;WebClient-Core&#39; &quot;...&quot;);<br>            group: &#39;Tests&#39; with: #( &#39;WebClient-Tests&#39; &quot;...&quot;);<br>
            &quot;.....&quot;<br>            yourself.<br><br>With that, when you call &quot;load&quot; it will only load Core. Then,  you can do this:<br><br>(ConfigurationOfWebClient project version: &#39;1.0&#39;) load: &#39;Test&#39;<br>
or<br>(ConfigurationOfWebClient project version: &#39;1.0&#39;) load: &#39;WebClient-Core&#39;<br>or<br>(ConfigurationOfWebClient project version: &#39;1.0&#39;) load: {&#39;WebClient-Core&#39; &#39;WebClient-HTTP&#39;}.<br>
<br>The parameter to load: can be a package name, a group or an an array of them.<br><br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

4) How does one define dependencies that differ based on platform?<br>
<br>
In WebClient, the WebClient-HTTP package requires WebClient-Core and -only for: #pharo- also WebClient-Pharo. How does one express that there&#39;s an additional dependency for WebClient-HTTP that only exists for: #pharo? The config currently specifies:<br>

<br>
        spec for: #common do:[<br>
                &quot; ... &quot;<br>
                spec package: &#39;WebClient-HTTP&#39; with:[spec requires: &#39;WebClient-Core&#39;].<br>
                &quot; ... &quot;<br>
        ].<br>
<br>
        spec for: #pharo do:[<br>
                &quot;Just the fact it exists; no requirements here&quot;<br>
                spec package: &#39;WebClient-Pharo&#39;.<br>
        ].<br>
<br></blockquote><div><br><br>The only thing that comes to my mind now is to do:<br><br><br>  spec for: #common do:[<br>
                &quot; ... &quot;<br>
                spec package: &#39;WebClient-HTTP&#39; with:[spec requires: 
&#39;WebClient-Core&#39;].<br>
                &quot; ... &quot;<br>
        ].<br>
<br>
        spec for: #pharo do:[<br>
                spec package: &#39;WebClient-HTTP&#39; with:[spec requires: {
&#39;WebClient-Core&#39; &#39;WebClient-Pharo&#39;} ].<br>
        <br>].<br>
<br><br><br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Which means that WebClient-Pharo will be loaded on Pharo by default but it&#39;s missing the fact that WebClient-Pharo is in fact a requirement for WebClient-HTTP (but only on that platform). How is that best expressed?<br>

<br>
5) Bootstrapping Metacello?<br>
<br>
I found that most of the ConfigurationsOfXXX include some code to &#39;bootstrap&#39; Metacello in some form. There appear to be variants on the code; is there a &quot;canonical bootstrap method&quot; that should be used?<br>

<br>
6) A standard Configuration template?<br>
<br>
The Metacello tutorial is very useful as far as the configuration goes but it falls short of getting into the details of what it means to provide a &#39;working&#39; configuration. Testing the configuration isn&#39;t covered (is there a way to get back to a &#39;clean&#39; state?); bootstrapping isn&#39;t covered; the meaning of #isMetacelloConfig, #metacelloVesion:loads:, #lastMetacelloVersionLoad and several other -seemingly random- methods that can be found on most -but not all- of the configurations. There is no indication on what these do, if they&#39;re required, recommended, or optional. Is there some &#39;standard&#39; Configuration template that people can use to avoid guessing about which parts of the boilerplate to copy from some other configuration?<br>

<br>
That&#39;s it for now. Thanks for any insights on any of these issues.<br>
<br>
Cheers,<br><font color="#888888">
  - Andreas<br>
<br>
</font></blockquote></div><br>