Hi guys, This is more for my benefit, but here is roughly how I’m currently using modules and trees to maintain separate projects that aren’t in the main Self objects tree. This is just text, I should do this properly with pics and/or video, but here ’tis:
A very short guide to creating a Self project, for example developing the Self webserver.
First, clone the Self tree from the Github repo:
git clone git@github.com:russellallen/self.git
Next, set the environment variable SELF_WORKING_DIR to the objects folder of the main Self tree (ie a clone of the Github repo). For example:
export SELF_WORKING_DIR=/home/russell/self/objects
Then, create a git repo for your new project and cd to it:
git init myproj cd myproj
(or create a new project on Github and clone it)
Then, build a new working snapshot from the main tree:
Self -f /home/russell/self/objects/worldbuilder.self
If you want to use the Self development UI (which is recommended) then choose yes to the question "Load UI2 (Morphic)? (y/N)"
When you are at the Self prompt, start the GUI with:
"Self 0" desktop open
You now need to register the directory your Git repository is working with as a tree to place your code in. In a shell, do:
modules init registerTree: 'mytree' At: '/full/path/to/myproj'.
Now, when you create a new object and mark it as belonging to a module, you can set the module as belonging to your tree.
modules myModule tree: 'mytree'
At this point everything should work as expected, ie when you write out modules they should go to the appropriate directory.
If you choose to save your snapshot, you can save it to the existing working directory (ie .../myproj)
You can rebuild using the same steps, eg:
export SELF_WORKING_DIR=/home/russell/self/objects cd /home/russell/myproj Self -f /home/russell/self/objects/worldbuilder.self "Self 0" modules init registerTree: 'mytree' At: '/home/russell/myproj' "Self 1" bootstrap read: 'myModule' InTree: 'mytree'
Cheers, Russell
As a follow up, I’ve pushed a change to the worldBuilder.self startup script which adds a new flag, -b (for ‘base’) pointing to the base (i.e. a replacement for SELF_WORKING_DIR). This makes the procedure:
mkdir self ; cd self ; git clone git@github.com:russellallen/self.git ; cd .. git init myproj ; cd myproj Self -f path/to/self/objects/worldbuilder.self -b path/to/self/objects
Nice and simple :) Russell
On 15 Jan 2016, at 5:47 PM, Russell Allen mail@russell-allen.com [self-interest] self-interest@yahoogroups.com wrote:
Hi guys, This is more for my benefit, but here is roughly how I’m currently using modules and trees to maintain separate projects that aren’t in the main Self objects tree. This is just text, I should do this properly with pics and/or video, but here ’tis:
A very short guide to creating a Self project, for example developing the Self webserver.
First, clone the Self tree from the Github repo:
git clone git@github.com:russellallen/self.git
Next, set the environment variable SELF_WORKING_DIR to the objects folder of the main Self tree (ie a clone of the Github repo). For example:
export SELF_WORKING_DIR=/home/russell/self/objects
Then, create a git repo for your new project and cd to it:
git init myproj cd myproj
(or create a new project on Github and clone it)
Then, build a new working snapshot from the main tree:
Self -f /home/russell/self/objects/worldbuilder.self
If you want to use the Self development UI (which is recommended) then choose yes to the question "Load UI2 (Morphic)? (y/N)"
When you are at the Self prompt, start the GUI with:
"Self 0" desktop open
You now need to register the directory your Git repository is working with as a tree to place your code in. In a shell, do:
modules init registerTree: 'mytree' At: '/full/path/to/myproj'.
Now, when you create a new object and mark it as belonging to a module, you can set the module as belonging to your tree.
modules myModule tree: 'mytree'
At this point everything should work as expected, ie when you write out modules they should go to the appropriate directory.
If you choose to save your snapshot, you can save it to the existing working directory (ie .../myproj)
You can rebuild using the same steps, eg:
export SELF_WORKING_DIR=/home/russell/self/objects cd /home/russell/myproj Self -f /home/russell/self/objects/worldbuilder.self "Self 0" modules init registerTree: 'mytree' At: '/home/russell/myproj' "Self 1" bootstrap read: 'myModule' InTree: 'mytree'
Cheers, Russell
self-interest@lists.selflanguage.org