A Question about Metacello's #repository:
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. 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') ] Obviously not a remote http repository. But also not an absolute path, since I do not know where the user placed the files. 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 ? Thanks, Sven
2015-11-17 15:12 GMT+01:00 Sven Van Caekenberghe <sven@stfx.eu>:
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.
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') ]
Obviously not a remote http repository. But also not an absolute path, since I do not know where the user placed the files. 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 ?
I'm not sure it can be done that way. Loading from a local repository can be done on the command line, by using Metacello directly with a local path. This is what I do for projects where the repository is cloned before the start of Pharo. Thierry
Thanks,
Sven
On 17 Nov 2015, at 15:30, Thierry Goubier <thierry.goubier@gmail.com> wrote:
2015-11-17 15:12 GMT+01:00 Sven Van Caekenberghe <sven@stfx.eu>: 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.
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') ]
Obviously not a remote http repository. But also not an absolute path, since I do not know where the user placed the files. 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 ?
I'm not sure it can be done that way.
Loading from a local repository can be done on the command line, by using Metacello directly with a local path. This is what I do for projects where the repository is cloned before the start of Pharo.
How do you do that ? "Loading from a local repository can be done on the command line, by using Metacello directly with a local path." Suppose I have a repository that contains both my Configuration and my code (except for the dependencies), let's say at $WORKDIR/repository. $ pharo Pharo.image config $WORKDIR/repository/ ConfigurationOfMyProject --install How do I tell ConfigurationOfMyProject to load its code from $WORKDIR/repository ? Maybe this is really simple and I just don't see it ?
Thierry
Thanks,
Sven
2015-11-17 15:37 GMT+01:00 Sven Van Caekenberghe <sven@stfx.eu>:
On 17 Nov 2015, at 15:30, Thierry Goubier <thierry.goubier@gmail.com> wrote:
2015-11-17 15:12 GMT+01:00 Sven Van Caekenberghe <sven@stfx.eu>: 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.
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') ]
Obviously not a remote http repository. But also not an absolute path, since I do not know where the user placed the files. 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 ?
I'm not sure it can be done that way.
Loading from a local repository can be done on the command line, by using Metacello directly with a local path. This is what I do for projects where the repository is cloned before the start of Pharo.
How do you do that ?
"Loading from a local repository can be done on the command line, by using Metacello directly with a local path."
Suppose I have a repository that contains both my Configuration and my code (except for the dependencies), let's say at $WORKDIR/repository.
$ pharo Pharo.image config $WORKDIR/repository/ ConfigurationOfMyProject --install
$ pharo Pharo.image eval --save Metacello new configuration: \'MyProject\'\; repository: \'$WORKDIR/repository\'\; load (Not sure about the way to designate just a file repository for Metacello)
How do I tell ConfigurationOfMyProject to load its code from $WORKDIR/repository ? Maybe this is really simple and I just don't see it ?
Maybe there is a simpler way than the one I use. Thierry
Thierry
Thanks,
Sven
On 17 Nov 2015, at 15:44, Thierry Goubier <thierry.goubier@gmail.com> wrote:
2015-11-17 15:37 GMT+01:00 Sven Van Caekenberghe <sven@stfx.eu>:
On 17 Nov 2015, at 15:30, Thierry Goubier <thierry.goubier@gmail.com> wrote:
2015-11-17 15:12 GMT+01:00 Sven Van Caekenberghe <sven@stfx.eu>: 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.
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') ]
Obviously not a remote http repository. But also not an absolute path, since I do not know where the user placed the files. 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 ?
I'm not sure it can be done that way.
Loading from a local repository can be done on the command line, by using Metacello directly with a local path. This is what I do for projects where the repository is cloned before the start of Pharo.
How do you do that ?
"Loading from a local repository can be done on the command line, by using Metacello directly with a local path."
Suppose I have a repository that contains both my Configuration and my code (except for the dependencies), let's say at $WORKDIR/repository.
$ pharo Pharo.image config $WORKDIR/repository/ ConfigurationOfMyProject --install
$ pharo Pharo.image eval --save Metacello new configuration: \'MyProject\'\; repository: \'$WORKDIR/repository\'\; load
(Not sure about the way to designate just a file repository for Metacello)
Yes, but that is basically the same as what I was doing. It loads the Metacello configuration from the directory and invokes load. The question is, how can I specify in the configuration that it has to load its own code from the same repo (which I cannot know absolutely when writing the configuration).
How do I tell ConfigurationOfMyProject to load its code from $WORKDIR/repository ? Maybe this is really simple and I just don't see it ?
Maybe there is a simpler way than the one I use.
Thierry
Thierry
Thanks,
Sven
2015-11-17 16:21 GMT+01:00 Sven Van Caekenberghe <sven@stfx.eu>:
On 17 Nov 2015, at 15:44, Thierry Goubier <thierry.goubier@gmail.com> wrote:
2015-11-17 15:37 GMT+01:00 Sven Van Caekenberghe <sven@stfx.eu>:
On 17 Nov 2015, at 15:30, Thierry Goubier <thierry.goubier@gmail.com> wrote:
2015-11-17 15:12 GMT+01:00 Sven Van Caekenberghe <sven@stfx.eu>: 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.
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') ]
Obviously not a remote http repository. But also not an absolute path, since I do not know where the user placed the files. 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 ?
I'm not sure it can be done that way.
Loading from a local repository can be done on the command line, by using Metacello directly with a local path. This is what I do for projects where the repository is cloned before the start of Pharo.
How do you do that ?
"Loading from a local repository can be done on the command line, by using Metacello directly with a local path."
Suppose I have a repository that contains both my Configuration and my code (except for the dependencies), let's say at $WORKDIR/repository.
$ pharo Pharo.image config $WORKDIR/repository/ ConfigurationOfMyProject --install
$ pharo Pharo.image eval --save Metacello new configuration: \'MyProject\'\; repository: \'$WORKDIR/repository\'\; load
(Not sure about the way to designate just a file repository for Metacello)
Yes, but that is basically the same as what I was doing. It loads the Metacello configuration from the directory and invokes load. The question is, how can I specify in the configuration that it has to load its own code from the same repo (which I cannot know absolutely when writing the configuration).
I think I asked Dale about that once, and I now consider that it can't be
done. Thierry
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...
Hi Dale, Thanks for the elaborate answer. Yes, I think that BaselineOf is what I was looking for, I will experiment with it. I do suspect that a Baseline can only be loaded using the Metacello API, not using the Pharo config handler which seems to fall back to Gofer. Sven
On 17 Nov 2015, at 20:08, Dale Henrichs <dale.henrichs@gemtalksystems.com> wrote:
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...
On 11/17/15 1:34 PM, Sven Van Caekenberghe wrote:
Hi Dale,
Thanks for the elaborate answer.
Yes, I think that BaselineOf is what I was looking for, I will experiment with it.
I do suspect that a Baseline can only be loaded using the Metacello API, not using the Pharo config handler which seems to fall back to Gofer.
The Metacello Scripting API should be used for all loads ... I know that does not always happen in Pharo, but that doesn't change the fact that the Metacello API _should_ be used:) Also make sure that you've loaded the latest Metacello into Pharo[1], because there are definitely bugs that have been fixed In Metacello that haven't made into Pharo ... Dale [1] https://github.com/dalehenrich/metacello-work#pharo30-pharo40-and-pharo50
On 18 Nov 2015, at 00:30, Dale Henrichs <dale.henrichs@gemtalksystems.com> wrote:
On 11/17/15 1:34 PM, Sven Van Caekenberghe wrote:
Hi Dale,
Thanks for the elaborate answer.
Yes, I think that BaselineOf is what I was looking for, I will experiment with it.
I do suspect that a Baseline can only be loaded using the Metacello API, not using the Pharo config handler which seems to fall back to Gofer.
The Metacello Scripting API should be used for all loads ... I know that does not always happen in Pharo, but that doesn't change the fact that the Metacello API _should_ be used:)
Yes, we should have a look at that.
Also make sure that you've loaded the latest Metacello into Pharo[1], because there are definitely bugs that have been fixed In Metacello that haven't made into Pharo ...
I just don't know when the last sync to place, the baseline stuff seemed to work OK.
Dale
[1] https://github.com/dalehenrich/metacello-work#pharo30-pharo40-and-pharo50
On 11/19/2015 02:49 AM, Sven Van Caekenberghe wrote:
On 18 Nov 2015, at 00:30, Dale Henrichs <dale.henrichs@gemtalksystems.com> wrote:
On 11/17/15 1:34 PM, Sven Van Caekenberghe wrote:
Hi Dale,
Thanks for the elaborate answer.
Yes, I think that BaselineOf is what I was looking for, I will experiment with it.
I do suspect that a Baseline can only be loaded using the Metacello API, not using the Pharo config handler which seems to fall back to Gofer.
The Metacello Scripting API should be used for all loads ... I know that does not always happen in Pharo, but that doesn't change the fact that the Metacello API _should_ be used:) Yes, we should have a look at that.
Also make sure that you've loaded the latest Metacello into Pharo[1], because there are definitely bugs that have been fixed In Metacello that haven't made into Pharo ... I just don't know when the last sync to place, the baseline stuff seemed to work OK.
I'm not sure as well:) The most recent sets of bugfixes[1][2][3] over the last year or so tend to be for fairly isolated problems or platform ports. The mainline functionality has been pretty stable for a couple years now. Dale [1] https://github.com/dalehenrich/metacello-work/issues?q=milestone%3A1.0.0-bet... [2] https://github.com/dalehenrich/metacello-work/issues?q=milestone%3A1.0.0-bet... [3] https://github.com/dalehenrich/metacello-work/issues?q=milestone%3A1.0.0-bet...
On 17 Nov 2015, at 22:34, Sven Van Caekenberghe <sven@stfx.eu> wrote:
Hi Dale,
Thanks for the elaborate answer.
Yes, I think that BaselineOf is what I was looking for, I will experiment with it.
I tried the following and it worked perfectly: $ git clone https://github.com/dalehenrich/sample.git And the in a Pharo 4 image: | repo | repo := (FileLocator imageDirectory / 'sample' / 'repository') resolve asUrl scheme: #filetree; printString. Metacello new baseline: 'Sample'; repository: repo; load. Like you said this is limited to the top level project that you load, but that would seem like the most common use case.
I do suspect that a Baseline can only be loaded using the Metacello API, not using the Pharo config handler which seems to fall back to Gofer.
Sven
On 17 Nov 2015, at 20:08, Dale Henrichs <dale.henrichs@gemtalksystems.com> wrote:
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...
participants (3)
-
Dale Henrichs -
Sven Van Caekenberghe -
Thierry Goubier