MCStxMczWriter.st
author Jan Vrany <jan.vrany@labware.com>
Tue, 11 Jul 2023 12:13:27 +0100
branchjv
changeset 1173 e3dd2050492e
parent 1166 e9b369305a8d
permissions -rw-r--r--
Update class category to match package name if it does not This is needed because in Squeak / Pharo world package membership is defined by (class) category prefix. This is soo annoying...
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1166
e9b369305a8d Transform snapshot just before loading into / just after creating from
Jan Vrany <jan.vrany@labware.com>
parents: 1002
diff changeset
     1
"
e9b369305a8d Transform snapshot just before loading into / just after creating from
Jan Vrany <jan.vrany@labware.com>
parents: 1002
diff changeset
     2
COPYRIGHT (c) 2023 LabWare
e9b369305a8d Transform snapshot just before loading into / just after creating from
Jan Vrany <jan.vrany@labware.com>
parents: 1002
diff changeset
     3
"
738
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
"{ Package: 'stx:goodies/monticello' }"
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
996
ab948c69360b Transfrom snapshot using MCStXSnapshotPostReadTransformation after reading .mcz
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 847
diff changeset
     6
"{ NameSpace: Smalltalk }"
ab948c69360b Transfrom snapshot using MCStXSnapshotPostReadTransformation after reading .mcz
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 847
diff changeset
     7
738
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
MCMczWriter subclass:#MCStxMczWriter
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
	instanceVariableNames:''
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
	classVariableNames:''
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
	poolDictionaries:''
743
a43cc4d9b6dc option to save st/x extra stuff in the mcz
Claus Gittinger <cg@exept.de>
parents: 738
diff changeset
    12
	category:'SCM-Monticello-St/X Storing'
738
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
!
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
!MCStxMczWriter class methodsFor:'documentation'!
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
1166
e9b369305a8d Transform snapshot just before loading into / just after creating from
Jan Vrany <jan.vrany@labware.com>
parents: 1002
diff changeset
    17
copyright
e9b369305a8d Transform snapshot just before loading into / just after creating from
Jan Vrany <jan.vrany@labware.com>
parents: 1002
diff changeset
    18
"
e9b369305a8d Transform snapshot just before loading into / just after creating from
Jan Vrany <jan.vrany@labware.com>
parents: 1002
diff changeset
    19
COPYRIGHT (c) 2023 LabWare
e9b369305a8d Transform snapshot just before loading into / just after creating from
Jan Vrany <jan.vrany@labware.com>
parents: 1002
diff changeset
    20
e9b369305a8d Transform snapshot just before loading into / just after creating from
Jan Vrany <jan.vrany@labware.com>
parents: 1002
diff changeset
    21
e9b369305a8d Transform snapshot just before loading into / just after creating from
Jan Vrany <jan.vrany@labware.com>
parents: 1002
diff changeset
    22
"
e9b369305a8d Transform snapshot just before loading into / just after creating from
Jan Vrany <jan.vrany@labware.com>
parents: 1002
diff changeset
    23
!
e9b369305a8d Transform snapshot just before loading into / just after creating from
Jan Vrany <jan.vrany@labware.com>
parents: 1002
diff changeset
    24
738
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
documentation
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
"
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
    redefined to add some more stuff to the mcz archive:
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
    - package pragma to the source code.
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
    - stx subdirectory (optional), containing required support files for building
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
          plus resource files.
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
    - stx.bin subdirectory (optional), containing a precompiled binary dll as per architecture.
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
"
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
! !
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
996
ab948c69360b Transfrom snapshot using MCStXSnapshotPostReadTransformation after reading .mcz
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 847
diff changeset
    36
!MCStxMczWriter class methodsFor:'as yet unclassified'!
ab948c69360b Transfrom snapshot using MCStXSnapshotPostReadTransformation after reading .mcz
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 847
diff changeset
    37
ab948c69360b Transfrom snapshot using MCStXSnapshotPostReadTransformation after reading .mcz
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 847
diff changeset
    38
readerClass
ab948c69360b Transfrom snapshot using MCStXSnapshotPostReadTransformation after reading .mcz
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 847
diff changeset
    39
    ^ MCStXMczReader
ab948c69360b Transfrom snapshot using MCStXSnapshotPostReadTransformation after reading .mcz
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 847
diff changeset
    40
ab948c69360b Transfrom snapshot using MCStXSnapshotPostReadTransformation after reading .mcz
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 847
diff changeset
    41
    "Created: / 10-05-2015 / 05:46:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ab948c69360b Transfrom snapshot using MCStXSnapshotPostReadTransformation after reading .mcz
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 847
diff changeset
    42
! !
ab948c69360b Transfrom snapshot using MCStXSnapshotPostReadTransformation after reading .mcz
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 847
diff changeset
    43
738
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
!MCStxMczWriter methodsFor:'accessing'!
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
snapshotWriterClass
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
        ^ MCStxStWriter
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
! !
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
771
cfb9eb763bc2 class: MCStxMczWriter
Claus Gittinger <cg@exept.de>
parents: 769
diff changeset
    50
!MCStxMczWriter methodsFor:'serializing'!
cfb9eb763bc2 class: MCStxMczWriter
Claus Gittinger <cg@exept.de>
parents: 769
diff changeset
    51
cfb9eb763bc2 class: MCStxMczWriter
Claus Gittinger <cg@exept.de>
parents: 769
diff changeset
    52
serializeDefinitions:definitions
cfb9eb763bc2 class: MCStxMczWriter
Claus Gittinger <cg@exept.de>
parents: 769
diff changeset
    53
    |string|
cfb9eb763bc2 class: MCStxMczWriter
Claus Gittinger <cg@exept.de>
parents: 769
diff changeset
    54
cfb9eb763bc2 class: MCStxMczWriter
Claus Gittinger <cg@exept.de>
parents: 769
diff changeset
    55
    string := super serializeDefinitions:definitions.
cfb9eb763bc2 class: MCStxMczWriter
Claus Gittinger <cg@exept.de>
parents: 769
diff changeset
    56
    string isWideString ifTrue:[
cfb9eb763bc2 class: MCStxMczWriter
Claus Gittinger <cg@exept.de>
parents: 769
diff changeset
    57
        ^ string utf8Encoded
cfb9eb763bc2 class: MCStxMczWriter
Claus Gittinger <cg@exept.de>
parents: 769
diff changeset
    58
    ].
cfb9eb763bc2 class: MCStxMczWriter
Claus Gittinger <cg@exept.de>
parents: 769
diff changeset
    59
    ^ string
847
3426cc8e79d9 More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 771
diff changeset
    60
!
3426cc8e79d9 More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 771
diff changeset
    61
3426cc8e79d9 More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 771
diff changeset
    62
serializePackageStX:aPackage
3426cc8e79d9 More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 771
diff changeset
    63
    ^ '(name ''', aPackage packageInfo projectDefinition package , ''')'
3426cc8e79d9 More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 771
diff changeset
    64
3426cc8e79d9 More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 771
diff changeset
    65
    "Created: / 29-05-2013 / 01:49:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
771
cfb9eb763bc2 class: MCStxMczWriter
Claus Gittinger <cg@exept.de>
parents: 769
diff changeset
    66
! !
cfb9eb763bc2 class: MCStxMczWriter
Claus Gittinger <cg@exept.de>
parents: 769
diff changeset
    67
738
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
!MCStxMczWriter methodsFor:'visiting'!
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
writeBuildSupportFiles:aVersion for:aProjectDefinition
769
6a647dbd3630 class: MCStxMczWriter
Claus Gittinger <cg@exept.de>
parents: 759
diff changeset
    71
    Error handle:[:ex |
6a647dbd3630 class: MCStxMczWriter
Claus Gittinger <cg@exept.de>
parents: 759
diff changeset
    72
        Dialog information:('Cannot write build support files because:\\',ex description,'\\Writing source files only.') withCRs.
6a647dbd3630 class: MCStxMczWriter
Claus Gittinger <cg@exept.de>
parents: 759
diff changeset
    73
        ^ self
6a647dbd3630 class: MCStxMczWriter
Claus Gittinger <cg@exept.de>
parents: 759
diff changeset
    74
    ] do:[
6a647dbd3630 class: MCStxMczWriter
Claus Gittinger <cg@exept.de>
parents: 759
diff changeset
    75
        aProjectDefinition forEachFileNameAndGeneratedContentsDo:[:file :contents |
6a647dbd3630 class: MCStxMczWriter
Claus Gittinger <cg@exept.de>
parents: 759
diff changeset
    76
            self addString: contents at: 'snapshot.stx/', file.
6a647dbd3630 class: MCStxMczWriter
Claus Gittinger <cg@exept.de>
parents: 759
diff changeset
    77
        ].
6a647dbd3630 class: MCStxMczWriter
Claus Gittinger <cg@exept.de>
parents: 759
diff changeset
    78
    ]
738
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    79
!
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    80
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
writeIndividualSourceFiles:aVersion for:aProjectDefinition
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
    "individual source files for dll compilation"
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    84
    aProjectDefinition classNames do:[:eachClassName |
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    85
        |cls fileName source|
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
        cls := Smalltalk classNamed:eachClassName.
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
        cls isNil ifTrue:[
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    89
            Transcript showCR:'class missing: ',eachClassName
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    90
        ] ifFalse:[
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    91
            cls autoload.
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    92
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    93
            fileName := (Smalltalk fileNameForClass:cls),'.st'.
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    94
            source := String streamContents:[:s | cls fileOutOn:s withTimeStamp:false].
743
a43cc4d9b6dc option to save st/x extra stuff in the mcz
Claus Gittinger <cg@exept.de>
parents: 738
diff changeset
    95
            self addString: source at: 'snapshot.stx/', fileName.                               
738
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    96
        ]
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    97
    ].
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    98
!
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    99
847
3426cc8e79d9 More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 771
diff changeset
   100
writePackage: aPackage
3426cc8e79d9 More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 771
diff changeset
   101
    super writePackage: aPackage.
3426cc8e79d9 More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 771
diff changeset
   102
    aPackage isStXPackage ifTrue:[
3426cc8e79d9 More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 771
diff changeset
   103
        self writePackageStX:aPackage
3426cc8e79d9 More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 771
diff changeset
   104
    ]
3426cc8e79d9 More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 771
diff changeset
   105
3426cc8e79d9 More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 771
diff changeset
   106
    "Created: / 29-05-2013 / 01:48:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
3426cc8e79d9 More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 771
diff changeset
   107
!
3426cc8e79d9 More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 771
diff changeset
   108
3426cc8e79d9 More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 771
diff changeset
   109
writePackageStX:aPackage 
3426cc8e79d9 More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 771
diff changeset
   110
    self addString:(self serializePackageStX:aPackage) at:'package.stx'
3426cc8e79d9 More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 771
diff changeset
   111
3426cc8e79d9 More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 771
diff changeset
   112
    "Created: / 29-05-2013 / 01:48:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
3426cc8e79d9 More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 771
diff changeset
   113
!
3426cc8e79d9 More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 771
diff changeset
   114
738
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   115
writeResourceFiles:aVersion for:aProjectDefinition
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   116
    "language translations kept in externalfiles"
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   117
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   118
    |dir rsrcDir|
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   119
769
6a647dbd3630 class: MCStxMczWriter
Claus Gittinger <cg@exept.de>
parents: 759
diff changeset
   120
    dir := aProjectDefinition projectDirectory.
6a647dbd3630 class: MCStxMczWriter
Claus Gittinger <cg@exept.de>
parents: 759
diff changeset
   121
    dir isNil ifTrue:[
6a647dbd3630 class: MCStxMczWriter
Claus Gittinger <cg@exept.de>
parents: 759
diff changeset
   122
        "/ no directory - no resource files
6a647dbd3630 class: MCStxMczWriter
Claus Gittinger <cg@exept.de>
parents: 759
diff changeset
   123
        ^  self.
6a647dbd3630 class: MCStxMczWriter
Claus Gittinger <cg@exept.de>
parents: 759
diff changeset
   124
    ].
6a647dbd3630 class: MCStxMczWriter
Claus Gittinger <cg@exept.de>
parents: 759
diff changeset
   125
    (rsrcDir := dir asFilename / 'resources') exists ifTrue:[
738
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   126
        rsrcDir recursiveDirectoryContentsDo:[:relFn |
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   127
            (rsrcDir construct:relFn) isDirectory ifFalse:[
743
a43cc4d9b6dc option to save st/x extra stuff in the mcz
Claus Gittinger <cg@exept.de>
parents: 738
diff changeset
   128
                self addString: ((rsrcDir construct:relFn) contentsOfEntireFile) at: 'snapshot.stx/resources/', relFn.
738
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   129
            ]            
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   130
        ].
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   131
    ].
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   132
!
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   133
1166
e9b369305a8d Transform snapshot just before loading into / just after creating from
Jan Vrany <jan.vrany@labware.com>
parents: 1002
diff changeset
   134
writeSnapshot: snapshot  forVersion: aVersion
e9b369305a8d Transform snapshot just before loading into / just after creating from
Jan Vrany <jan.vrany@labware.com>
parents: 1002
diff changeset
   135
    | source |
759
fc131485692e class: MCStxMczWriter
Claus Gittinger <cg@exept.de>
parents: 743
diff changeset
   136
fc131485692e class: MCStxMczWriter
Claus Gittinger <cg@exept.de>
parents: 743
diff changeset
   137
    source := 
fc131485692e class: MCStxMczWriter
Claus Gittinger <cg@exept.de>
parents: 743
diff changeset
   138
        ('"{ Package: ''%1'' }" !!\\' withCRs bindWith:aVersion package name)
847
3426cc8e79d9 More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 771
diff changeset
   139
        ,  (self serializeDefinitions: snapshot definitions).
759
fc131485692e class: MCStxMczWriter
Claus Gittinger <cg@exept.de>
parents: 743
diff changeset
   140
fc131485692e class: MCStxMczWriter
Claus Gittinger <cg@exept.de>
parents: 743
diff changeset
   141
    self addString: source at: 'snapshot/source.', self snapshotWriterClass extension.
1000
dbc3a47007d6 Do not include #monticelloSmalltalkXExtensionMethodCategories method when St/X extras are NOT included
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 996
diff changeset
   142
    "/ CG: I think, we can comment the following (or is it compatible?)
847
3426cc8e79d9 More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 771
diff changeset
   143
3426cc8e79d9 More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 771
diff changeset
   144
    "/ JV: 
3426cc8e79d9 More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 771
diff changeset
   145
    "/ NO, DON'T DO IT!! snapshot.bin is THE ONLY thing that Pharo/Squeak reads.
3426cc8e79d9 More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 771
diff changeset
   146
    "/ It does not care about snapshot/source.st, actually
3426cc8e79d9 More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 771
diff changeset
   147
    self addString: (self serializeInBinary: snapshot) at: 'snapshot.bin'
3426cc8e79d9 More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 771
diff changeset
   148
1000
dbc3a47007d6 Do not include #monticelloSmalltalkXExtensionMethodCategories method when St/X extras are NOT included
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 996
diff changeset
   149
    "Modified (comment): / 31-07-2015 / 08:59:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1166
e9b369305a8d Transform snapshot just before loading into / just after creating from
Jan Vrany <jan.vrany@labware.com>
parents: 1002
diff changeset
   150
    "Modified: / 23-03-2023 / 14:11:26 / Jan Vrany <jan.vrany@labware.com>"
738
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   151
!
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   152
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   153
writeVersion: aVersion
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   154
    |packageID prjDef|
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   155
743
a43cc4d9b6dc option to save st/x extra stuff in the mcz
Claus Gittinger <cg@exept.de>
parents: 738
diff changeset
   156
    super writeVersion: aVersion.
738
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   157
1002
54b4906215ca Introduced MCSnapshotOptions for more fine-graned control over contents of .mcz
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1000
diff changeset
   158
    aVersion snapshot options includeExtrasForSTX ifTrue:[
743
a43cc4d9b6dc option to save st/x extra stuff in the mcz
Claus Gittinger <cg@exept.de>
parents: 738
diff changeset
   159
        "/ ST/X specific stuff here.
738
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   160
743
a43cc4d9b6dc option to save st/x extra stuff in the mcz
Claus Gittinger <cg@exept.de>
parents: 738
diff changeset
   161
        packageID := aVersion package name.
a43cc4d9b6dc option to save st/x extra stuff in the mcz
Claus Gittinger <cg@exept.de>
parents: 738
diff changeset
   162
        prjDef := ProjectDefinition definitionClassForPackage:packageID.
a43cc4d9b6dc option to save st/x extra stuff in the mcz
Claus Gittinger <cg@exept.de>
parents: 738
diff changeset
   163
        prjDef isNil ifTrue:[
a43cc4d9b6dc option to save st/x extra stuff in the mcz
Claus Gittinger <cg@exept.de>
parents: 738
diff changeset
   164
            "/ not a project definition mcz - simply skip
a43cc4d9b6dc option to save st/x extra stuff in the mcz
Claus Gittinger <cg@exept.de>
parents: 738
diff changeset
   165
            Transcript show:'No projectDefinition for ',packageID, ' generated simple source only'.
a43cc4d9b6dc option to save st/x extra stuff in the mcz
Claus Gittinger <cg@exept.de>
parents: 738
diff changeset
   166
        ] ifFalse:[
a43cc4d9b6dc option to save st/x extra stuff in the mcz
Claus Gittinger <cg@exept.de>
parents: 738
diff changeset
   167
            "/ additional support files for recompilation...
a43cc4d9b6dc option to save st/x extra stuff in the mcz
Claus Gittinger <cg@exept.de>
parents: 738
diff changeset
   168
            self writeIndividualSourceFiles: aVersion for: prjDef.
a43cc4d9b6dc option to save st/x extra stuff in the mcz
Claus Gittinger <cg@exept.de>
parents: 738
diff changeset
   169
            self writeBuildSupportFiles: aVersion for: prjDef.
a43cc4d9b6dc option to save st/x extra stuff in the mcz
Claus Gittinger <cg@exept.de>
parents: 738
diff changeset
   170
            self writeResourceFiles: aVersion for: prjDef.
a43cc4d9b6dc option to save st/x extra stuff in the mcz
Claus Gittinger <cg@exept.de>
parents: 738
diff changeset
   171
        ]
738
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   172
    ]
1002
54b4906215ca Introduced MCSnapshotOptions for more fine-graned control over contents of .mcz
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1000
diff changeset
   173
54b4906215ca Introduced MCSnapshotOptions for more fine-graned control over contents of .mcz
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1000
diff changeset
   174
    "Modified: / 07-09-2015 / 15:28:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
738
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   175
! !
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   176
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   177
!MCStxMczWriter class methodsFor:'documentation'!
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   178
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   179
version
847
3426cc8e79d9 More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 771
diff changeset
   180
    ^ '$Header: /cvs/stx/stx/goodies/monticello/MCStxMczWriter.st,v 1.6 2013-05-29 11:47:31 vrany Exp $'
738
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   181
!
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   182
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   183
version_CVS
847
3426cc8e79d9 More support Squeak/Pharo interoperability - part 1:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 771
diff changeset
   184
    ^ '$Header: /cvs/stx/stx/goodies/monticello/MCStxMczWriter.st,v 1.6 2013-05-29 11:47:31 vrany Exp $'
1000
dbc3a47007d6 Do not include #monticelloSmalltalkXExtensionMethodCategories method when St/X extras are NOT included
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 996
diff changeset
   185
!
dbc3a47007d6 Do not include #monticelloSmalltalkXExtensionMethodCategories method when St/X extras are NOT included
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 996
diff changeset
   186
dbc3a47007d6 Do not include #monticelloSmalltalkXExtensionMethodCategories method when St/X extras are NOT included
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 996
diff changeset
   187
version_HG
dbc3a47007d6 Do not include #monticelloSmalltalkXExtensionMethodCategories method when St/X extras are NOT included
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 996
diff changeset
   188
dbc3a47007d6 Do not include #monticelloSmalltalkXExtensionMethodCategories method when St/X extras are NOT included
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 996
diff changeset
   189
    ^ '$Changeset: <not expanded> $'
738
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   190
! !
85d0afcc16e3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   191