[squeak-dev] Loading in-memory Project file

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

[squeak-dev] Loading in-memory Project file

Ian Trudel-2
Hello all,

I have seen that a new Release Builder for 3.11 has been added to the
trunk by Andreas. We have been talking that it would be interesting to
be able to modify the main project for the trunk image. I did some
code to load a project file into a class variable (to make sure it is
in a change set/monticello package).

However, I would like to know how to load a project file in memory.
That is without having to resave the file on disk and load it again.
Or, I'd be interested to know if there is a way to save and load
in-memory (without files at all).

My idea is to write a task in Release Builder to load the project,
enter it and remove all other projects. By the way, what's the
difference between Project removeAllButCurrent versus Smalltalk
zapAllOtherProjects? Which should be used?

Regards,
Ian
--
http://mecenia.blogspot.com/

Reply | Threaded
Open this post in threaded view
|

[squeak-dev] Re: Loading in-memory Project file

Andreas.Raab
Ian Trudel wrote:
> I have seen that a new Release Builder for 3.11 has been added to the
> trunk by Andreas. We have been talking that it would be interesting to
> be able to modify the main project for the trunk image. I did some
> code to load a project file into a class variable (to make sure it is
> in a change set/monticello package).

Just a small correction: The Release Builder had always been there. For
some unexplicable reason I didn't add it to the original configuration
and I only noticed it when I added ShoutCore.

> However, I would like to know how to load a project file in memory.
> That is without having to resave the file on disk and load it again.
> Or, I'd be interested to know if there is a way to save and load
> in-memory (without files at all).

Try this:

        "Create new project on disk"
        Project current
                exportSegmentFileName: 'test.pr'
                directory: FileDirectory default.

        "Load data back into memory"
        data := (FileDirectory default readOnlyFileNamed: 'test.pr')
                binary contentsOfEntireFile.

        "Create stream from data"
        stream := MultiByteBinaryOrTextStream with: data.
        stream reset.

        "Load and Enter project"
        ProjectLoading
                openName: nil
                stream: stream
                fromDirectory: nil
                withProjectView: nil.

> My idea is to write a task in Release Builder to load the project,
> enter it and remove all other projects.

Sounds great.

Cheers,
   - Andreas

Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Loading in-memory Project file

Bert Freudenberg
In reply to this post by Ian Trudel-2

On 22.08.2009, at 22:19, Ian Trudel wrote:

> Hello all,
>
> I have seen that a new Release Builder for 3.11 has been added to the
> trunk by Andreas. We have been talking that it would be interesting to
> be able to modify the main project for the trunk image. I did some
> code to load a project file into a class variable (to make sure it is
> in a change set/monticello package).

Contents of class variables is not preserved in either change sets or  
mc packages.

> However, I would like to know how to load a project file in memory.
> That is without having to resave the file on disk and load it again.
> Or, I'd be interested to know if there is a way to save and load
> in-memory (without files at all).

Not sure what you mean by "load in memory". Why would you want to do  
that?

> My idea is to write a task in Release Builder to load the project,
> enter it and remove all other projects. By the way, what's the
> difference between Project removeAllButCurrent versus Smalltalk
> zapAllOtherProjects? Which should be used?


No idea.

- Bert -



Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Loading in-memory Project file

Ian Trudel-2
2009/8/22 Bert Freudenberg <[hidden email]>:
> Contents of class variables is not preserved in either change sets or mc
> packages.

Ooops, that's not what I meant. I have actually wrote a method to
generate a class method on the fly to return the content of the file,
which is converted to Base64 MIME.

> Not sure what you mean by "load in memory". Why would you want to do that?

Andreas did answer my question perfectly. =)

>> My idea is to write a task in Release Builder to load the project,
>> enter it and remove all other projects. By the way, what's the
>> difference between Project removeAllButCurrent versus Smalltalk
>> zapAllOtherProjects? Which should be used?
>
>
> No idea.

Then I will use Project removeAllButCurrent. The other one seems to do
a lot more work and I am not sure of what it implies.


Ian.
--
http://mecenia.blogspot.com/

Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Loading in-memory Project file

Ian Trudel-2
In reply to this post by Bert Freudenberg
2009/8/22 Bert Freudenberg <[hidden email]>:
> Not sure what you mean by "load in memory". Why would you want to do that?

The initial idea is to allow the community to provide fixes or
improvements on the main project in the trunk. We cannot send
separated files on the Monticello repository as far as I understand.

For example, I have suggested to write something about the license in
the "About this image" window. I simply add the text, save the project
file. Then the code load the project into a class method but at that
point, why would we save the file back on disk to load it again? It's
slow and so many things can go wrong. I think it's better to load data
from memory.

Ian.
--
http://mecenia.blogspot.com/

Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Loading in-memory Project file

Bert Freudenberg

On 22.08.2009, at 22:55, Ian Trudel wrote:

> 2009/8/22 Bert Freudenberg <[hidden email]>:
>> Not sure what you mean by "load in memory". Why would you want to  
>> do that?
>
> The initial idea is to allow the community to provide fixes or
> improvements on the main project in the trunk. We cannot send
> separated files on the Monticello repository as far as I understand.
>
> For example, I have suggested to write something about the license in
> the "About this image" window. I simply add the text, save the project
> file. Then the code load the project into a class method but at that
> point, why would we save the file back on disk to load it again? It's
> slow and so many things can go wrong. I think it's better to load data
> from memory.


Okay. That makes sense.

- Bert -



Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Loading in-memory Project file

Ian Trudel-2
By the way, Andreas, which ReleaseBuilder subclass do you intend to
use for the trunk?

Ian.
--
http://mecenia.blogspot.com/

Reply | Threaded
Open this post in threaded view
|

[squeak-dev] Re: Loading in-memory Project file

Andreas.Raab
Ian Trudel wrote:
> By the way, Andreas, which ReleaseBuilder subclass do you intend to
> use for the trunk?

Good question. In particular in light of recent discussions. Perhaps
just place it in a set of "ReleaseUtilities" for now?

Cheers,
   - Andreas

Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Re: Loading in-memory Project file

Ian Trudel-2
2009/8/23 Andreas Raab <[hidden email]>:
> Ian Trudel wrote:
>>
>> By the way, Andreas, which ReleaseBuilder subclass do you intend to
>> use for the trunk?
>
> Good question. In particular in light of recent discussions. Perhaps just
> place it in a set of "ReleaseUtilities" for now?

I am not against using an helper class for now but it will most likely
lead to maintenance work later. There is already a lot of things to
clean in Squeak image. I think that it would be important to develop
good habits, where the future of Squeak won't have so much things to
fix or refactor.

Ian.
--
http://mecenia.blogspot.com/