Export/Import source code - fileIn or Monticello

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

Export/Import source code - fileIn or Monticello

GLASS mailing list

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


_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: Export/Import source code - fileIn or Monticello

GLASS mailing list



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

_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: Export/Import source code - fileIn or Monticello

GLASS mailing list
I realized that i had typos in the tODE script and a bug (or two). First
here's the corrected script:

   mc create MyApplication-Core     # create package
   mr create filetree://$GS_HOME/shared/repos/MyApplication # create
repository
   cls category MyApplication-Core MyClass                        # add
classes to package
   method protocol *MyApplication-Core Object>>className         # 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

now for the bugs...

first you have to create the `$GS_HOME/shared/repos/MyApplication`
directory before using it in the `mr create` command ...

The second bug was that the second line continuation `\` is not handled
correctly ...

Dale

On 11/15/17 11:43 AM, Dale Henrichs wrote:

> 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

_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass