BeeProjectSourceWriter.st
branchjv
changeset 4381 5f0582aa5462
parent 4377 cbf86fdee06c
child 4573 ba0441fba5fe
--- a/BeeProjectSourceWriter.st	Tue Oct 30 14:59:25 2018 +0000
+++ b/BeeProjectSourceWriter.st	Mon Nov 05 20:52:42 2018 +0000
@@ -14,7 +14,7 @@
 "{ NameSpace: Smalltalk }"
 
 BeeProjectWriter subclass:#BeeProjectSourceWriter
-	instanceVariableNames:'porter'
+	instanceVariableNames:'porter classesToInitialize'
 	classVariableNames:''
 	poolDictionaries:''
 	category:'Kernel-Classes-Support'
@@ -68,6 +68,7 @@
 !BeeProjectSourceWriter methodsFor:'source writing'!
 
 fileOutClasses: classes on: stream
+
     stream nextPutAll: '"**** Class definitions ****"!!'; cr.
 
     classes topologicalSort:[:a :b | b isSubclassOf:a].
@@ -78,6 +79,8 @@
         ].
     ].  
 
+    classesToInitialize := classes select:[ :each | each class methodDictionary includesKey:#initialize ].
+
     [
         classes do:[:class |
             self activityNotification:'exporting ', class name,'...'.
@@ -110,7 +113,7 @@
     ].
 
     "Created: / 14-04-2015 / 13:47:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 29-10-2018 / 15:50:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 30-10-2018 / 15:49:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 fileOutExtensions: methods on:stream
@@ -121,7 +124,7 @@
 
         method := request method.
         source := request source.
-        source := porter port: method.
+        source := porter portMethod: method source: source.
         request proceedWith: source.         
     ] do:[
         methods do:[:eachMethod |
@@ -130,7 +133,25 @@
         ]
     ]
 
-    "Modified: / 26-10-2018 / 11:44:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 30-10-2018 / 15:49:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+fileOutFooterOn:aStresm
+    classesToInitialize notEmptyOrNil ifTrue:[ 
+        | classMap |
+
+        classMap := Dictionary new.
+        porter collectClassRewritesFrom: (classesToInitialize collect:[:e|e name]) into: classMap. 
+        aStresm nextPutAll: '"**** Initializing ****"!!'; cr.
+        classesToInitialize do:[:each | 
+            | name |
+
+            name := classMap at: each name ifAbsent:[ each name ].
+            aStresm nextPutAll: name; nextPutAll: ' initialize!!'; cr.
+        ].
+    ].
+
+    "Created: / 30-10-2018 / 15:36:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 fileOutHeaderOn: aStream