[Glass] Export/Import source code - fileIn or Monticello

Dale Henrichs via Glass glass at lists.gemtalksystems.com
Wed Nov 15 11:43:11 PST 2017



On 11/8/17 12:03 AM, Marten Feldtmann via Glass wrote:
>
> I'm now working on a procedure to upgradie my running servers to newer 
> Gemstone versions - and one point I'm fighting with is:
>
> * How do I file out /export and file in all that source code.
>
> The file out part is a simple one:
>
> ClassOrganizer new fileOutClasses: arrayOfClasses on: aGsFile
>
> But how do I file in that stuff ? The method above sets the sourcecode 
> format to utf8, but the file-in methods mention, that they can not 
> handle utf-8 code yet (at least in Jade in a Workspace).
>
> Another possibility would be to write/read a Monticello package - how 
> is this done in a simple way, so some kind of:
>
> xyz storeMonticelloPackageNamed: #nameOfMonticello on: aStream
>
> and of course loading it from a file ?
>
Marten,

I think your best bet is to use Monticello packages ... To specify which 
classes and methods are in a Monticello package, you decide on a package 
name, say 'MyApplication-Core'. For each of your application classes you 
set the category of the class to the package name.
For extensions methods that are in classes (in Gobals for example) you 
put the methods in a protocol named for the package: 
'*MyApplication-Core' (leading asterisk causes the methods in that 
protocol to be included in the package).

Here are the tODE commands you would use to perform all of the operations:

   mc create MyApplication-Core                                         
     # create package
   mr create filetree://$GS_HOME/shared/repos/ MyApplication             
             # create repository
   cls category MyApplication-Core <list-of-MyApplication-classes>    
                     # add classes to package
   method protocol accessing *MyApplication-Core 
<list-of-ext-methods>              # add extension methods to package
   mc save MyApplication-Core MyApplication-Core-mf.1 \
                filetree://$GS_HOME/shared/repos/ MyApplication \
                `my commit message`                                     
            # save the package to the repository
   mc load MyApplication-Core filetree://$GS_HOME/shared/repos/ 
MyApplication    # load the package into the image

There are also equivalent commands sprinkled throughout the tODE GUI, 
but I know that you don't use tODE.

You could choose to use the following batch command to execute the tODE 
commands from the bash command line:

devKitCommandLine todeIt GsSqueak_test<< EOF ... tode commands EOF

devKitCommandLine todeIt <stone-name><< EOF

EOF If you don't want to either of those options, then it is possible 
write Smalltalk code using the tODE API that is used to implement the 
above commands --- extracting the Smalltalk API for you is more work 
than I can take on right now ... Dale

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gemtalksystems.com/mailman/private/glass/attachments/20171115/9ea22fe0/attachment.html>


More information about the Glass mailing list