MCStxMczWriter.st
changeset 847 3426cc8e79d9
parent 771 cfb9eb763bc2
child 996 ab948c69360b
--- a/MCStxMczWriter.st	Wed May 29 13:47:24 2013 +0200
+++ b/MCStxMczWriter.st	Wed May 29 13:47:31 2013 +0200
@@ -36,6 +36,12 @@
         ^ string utf8Encoded
     ].
     ^ string
+!
+
+serializePackageStX:aPackage
+    ^ '(name ''', aPackage packageInfo projectDefinition package , ''')'
+
+    "Created: / 29-05-2013 / 01:49:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !MCStxMczWriter methodsFor:'visiting'!
@@ -70,6 +76,21 @@
     ].
 !
 
+writePackage: aPackage
+    super writePackage: aPackage.
+    aPackage isStXPackage ifTrue:[
+        self writePackageStX:aPackage
+    ]
+
+    "Created: / 29-05-2013 / 01:48:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+writePackageStX:aPackage 
+    self addString:(self serializePackageStX:aPackage) at:'package.stx'
+
+    "Created: / 29-05-2013 / 01:48:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 writeResourceFiles:aVersion for:aProjectDefinition
     "language translations kept in externalfiles"
 
@@ -90,15 +111,22 @@
 !
 
 writeSnapshot: aSnapshot  forVersion: aVersion
-    |source|
+    | source snapshot |
 
+    snapshot := MCStXSnapshotPreWriteTransformation transform: aSnapshot.
     source := 
         ('"{ Package: ''%1'' }" !!\\' withCRs bindWith:aVersion package name)
-        ,  (self serializeDefinitions: aSnapshot definitions).
+        ,  (self serializeDefinitions: snapshot definitions).
 
     self addString: source at: 'snapshot/source.', self snapshotWriterClass extension.
     "/ I whink, we can comment the following (or is it compatible?)
-    self addString: (self serializeInBinary: aSnapshot) at: 'snapshot.bin'
+
+    "/ JV: 
+    "/ NO, DON'T DO IT!! snapshot.bin is THE ONLY thing that Pharo/Squeak reads.
+    "/ It does not care about snapshot/source.st, actually
+    self addString: (self serializeInBinary: snapshot) at: 'snapshot.bin'
+
+    "Modified (comment): / 29-05-2013 / 12:06:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 writeVersion: aVersion
@@ -126,10 +154,10 @@
 !MCStxMczWriter class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/goodies/monticello/MCStxMczWriter.st,v 1.5 2013-03-28 16:23:21 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/goodies/monticello/MCStxMczWriter.st,v 1.6 2013-05-29 11:47:31 vrany Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/goodies/monticello/MCStxMczWriter.st,v 1.5 2013-03-28 16:23:21 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/goodies/monticello/MCStxMczWriter.st,v 1.6 2013-05-29 11:47:31 vrany Exp $'
 ! !