Sven, I've read through the follow-on messages to this post and I'm not quite sure I know what you are asking, so I will just reply here ... On 11/17/2015 06:12 AM, Sven Van Caekenberghe wrote:
Hi,
I have a question about the way repositories are specified in Metacello (i.e. by means on #repository:).
Say I use FileTree where the files come from a classic VCS or just from some archive. Using ZeroConf I can get an image+vm, etc. I can use the config command line handler to load the configuration from a local file directory (I haven't tried this yet, but I assume no scheme results in a MCDirectoryRepository). So far so good. Okay I'll put in some examples here to make sure that we're on the same page. First here's a linek[1] to the documentation for the various schemes that can be used as Metacello repository descriptions (the arg to the #repository: message).
If you want to use FileTree for your local repository then the repository description has the form: filtree://<full path to directory> For an MCDirectoryRepository, the repository description has the form: client://<full path to directory> or <full path to directory> [1] https://github.com/dalehenrich/metacello-work/blob/master/docs/MetacelloScri...
The question is, what do I put in as argument to #repository: in my baseline ?
baseline1: spec <version: '1-baseline'>
spec for: #common do: [ spec blessing: #baseline; repository: 'http://mc.stfx.eu/Neo'; package: 'Neo-Console-Core'; group: 'default' with: #('Neo-Console-Core'); group: 'Core' with: #('Neo-Console-Core') ]
Okay, the baseline1: above is from your ConfigurationOfNeo configuration, correct? Since you are referencing `http://mc.stfx.eu/Neo`, I assume that the primary repository is on http://mc.stfx.eu, correct? When you ask "what do I put in as argument to #repository: in my baseline?", I am confused ... Perhaps my assumptions are incorrect? I assume that the above came from a ConfigurationOfNeo and that the primary location is `http://mc.stfx.eu/Neo`.
Obviously not a remote http repository. But also not an absolute path, since I do not know where the user placed the files.
If the Neo project's primary repository is `http://mc.stfx.eu/Neo`, then how does the user get a local copy of the repository - filetree:// or client://?
Ideally, it should be possible to leave out repository and let it resolve to wherever the configuration was located. Can that be done ? Or is there another way to do this ?
The BaselineOf was invented to solve this particular problem and I will talk about github/git scenario, since the question of "how does the user get a local copy of the repository?" has a straightforward answer.... To start with let's use the Sample project[2] as an example and lets look how the project is specified in the BaselineOfSample>>baseline:[3]: baseline: spec <baseline> spec for: #'common' do: [ spec package: 'Sample-Core'. spec package: 'Sample-Tests' with: [ spec requires: 'Sample-Core' ]. spec group: 'default' with: #('Core'); group: 'Core' with: #('Sample-Core'); group: 'Tests' with: #('Sample-Tests') ] Note that there is no repository: specification .... which makes me think that this is the answer to the question that you are asking:
It should be possible to leave out repository and let it resolve to wherever the configuration was located.
A BaselineOf sets the internal repository: to the location where the BaselineOfSample spec was loaded from. So you use the following expression to load a BaselineOf into your image: Metacello new baseline: 'Sample'; repository: 'filetree://<fulll-path-to-directory>; load. Given that the user knows where she's cloned the https://github.com/dalehenrich/sample.git repository, then it is reasonable for the developer to know how to load the project from that location ... However, this is not a complete answer to the the overall problem ... For example a corollary to your question is:
How do I ensure that other projects that reference the Sample project load from my local clone?
So If you have a reference to the Sample project in another project, the reference is likely to look like the following: spec baseline: 'Sample'; repository: 'github://dalehenrich/sample:master/repository'; loads: 'Core'. Here we've got a reference to the github repo, but we'd like to use the local filetree:// clone. There is a Metacello Scripting API command that you can use to inform Metacello that the local filetree:// clone should be used: Metacello new baseline: 'Sample'; repository: 'filetree://<fulll-path-to-directory>; lock. Again we're using the full-path, but the developer is the one that knows a) the path to the local clone and b) whether or not the local clone should be used ... Now I will admit that having to remember and keep track of making sure that the `lock` expression get's run in each image, can be a bit difficult .... In tODE I've addressed this issue by creating a project entry object that is shared by "all images" and specifies not only the particulars of project locking but includes additional information about what how you want a particlar project loaded in "all images" (i.e., a specification for the `loads` expression as well) ... So I think I've addressed your question, but maybe I've completely missed your point:) Dale [2] https://github.com/dalehenrich/sample [3] https://github.com/dalehenrich/sample/blob/master/repository/BaselineOfSampl...