common/SCMAbstractFileoutLikeTask.st
changeset 381 3dde2b867931
parent 362 a2b08403cfa8
child 387 ebec1ef28839
--- a/common/SCMAbstractFileoutLikeTask.st	Fri Feb 21 22:08:09 2014 +0000
+++ b/common/SCMAbstractFileoutLikeTask.st	Sun Feb 23 20:03:07 2014 +0000
@@ -64,6 +64,7 @@
 !
 
 filesToGenerate
+    self error: 'Should not be sent'.
     ^ self packageDefinition fileNamesToGenerate keys
 
     "
@@ -72,14 +73,26 @@
             buildSupportFiles"
 
     "Created: / 27-11-2009 / 11:29:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 17-11-2010 / 14:08:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 22-02-2014 / 22:31:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+filesToGenerateFor: package
+    ^ package definition fileNamesToGenerate keys
+
+    "
+        SVN::CommitTask new
+            package: #stx:libsvn;
+            buildSupportFiles"
+
+    "Created: / 22-02-2014 / 22:31:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 packageDefinition
-
+    self error: 'Should not be sent'.
     ^self package definition
 
     "Created: / 27-11-2009 / 11:27:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 21-02-2014 / 22:53:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 suppresBuildSupportFiles
@@ -109,15 +122,22 @@
 !SCMAbstractFileoutLikeTask methodsFor:'executing - private'!
 
 doAddNewContainers
+    packages do:[:each | self doAddNewContainersFor: each ]
+
+    "Created: / 11-04-2008 / 10:58:53 / Jan Vrany <vranyj1@fel.cvut.cz>"
+    "Modified: / 19-08-2009 / 14:00:26 / Jan Vrany <vranyj1@fel.cvut.cz>"
+    "Modified: / 22-02-2014 / 22:49:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+doAddNewContainersFor: package
     | wcroot containers |
 
     ActivityNotification notify:'Adding new containers'.
     containers := 
         self isSelectiveFileoutTask 
             ifTrue:[#()] 
-            ifFalse:[self containersToFileOut].
-    wcroot := self temporaryWorkingCopyRoot.
-
+            ifFalse:[self containersToFileOutFor: package].
+    wcroot := package temporaryWorkingCopyRoot.
     containers do:[:nm|
         | entry |
 
@@ -125,18 +145,24 @@
         entry track.
     ]
 
-    "Created: / 11-04-2008 / 10:58:53 / Jan Vrany <vranyj1@fel.cvut.cz>"
-    "Modified: / 19-08-2009 / 14:00:26 / Jan Vrany <vranyj1@fel.cvut.cz>"
-    "Modified: / 15-11-2012 / 00:14:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Created: / 22-02-2014 / 22:49:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 doCompileCopyrightMethods
+    packages do:[:package | self doCompileCopyrightMethodsFor: package ]
+
+    "Modified: / 16-08-2009 / 12:59:50 / Jan Vrany <vranyj1@fel.cvut.cz>"
+    "Created: / 08-04-2010 / 14:31:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 21-02-2014 / 23:00:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+doCompileCopyrightMethodsFor: package
     | klasses source |
 
-    (self packageDefinition class includesSelector: #copyright) ifFalse:[^self].
+    (package definition class includesSelector: #copyright) ifFalse:[^self].
     ActivityNotification notify:'Compiling #copyright methods...'.
-    klasses := self classesToFileOut asArray.
-    source := (self packageDefinition class compiledMethodAt: #copyright) source.
+    klasses := (self classesToFileOutFor: package) asArray.
+    source := (package definition class compiledMethodAt: #copyright) source.
 
     klasses 
         withIndexDo:[:cls :index | 
@@ -146,31 +172,34 @@
                 ifTrue:[
                     metaCls compile:source classified:'documentation'.
                     (metaCls compiledMethodAt:#copyright) 
-                        setPackage:self package name asSymbol
+                        setPackage:package name asSymbol
                     ].
             ProgressNotification newException
                 messageText: ('Compiling %1 (%2)' bindWith:#copyright
                                                       with:cls nameWithoutPrefix);
                 parameter: (100 / klasses size) * index;
                 raiseRequest.
-
         ]
 
-    "Modified: / 16-08-2009 / 12:59:50 / Jan Vrany <vranyj1@fel.cvut.cz>"
-    "Created: / 08-04-2010 / 14:31:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 30-06-2013 / 12:44:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Created: / 21-02-2014 / 22:59:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 doCompileVersionMethods
-    self doCompileVersionMethodsIn: self classesToFileOut asArray.
+    packages do:[:each | 
+        | klasses |
+
+        klasses := self classesToFileOutFor: each.
+        self doCompileVersionMethodsFor: each in: klasses asArray.  
+    ].
 
     "Created: / 09-10-2013 / 11:57:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified (format): / 21-02-2014 / 23:05:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-doCompileVersionMethodsIn: klasses
+doCompileVersionMethodsFor: package in: klasses
     | versionMethodName|
 
-    versionMethodName := self package manager nameOfVersionMethodInClasses.
+    versionMethodName := package manager nameOfVersionMethodInClasses.
     ActivityNotification notify:'Compiling #version methods...'.
     klasses 
         withIndexDo:[:cls :index | 
@@ -184,12 +213,12 @@
                 "or:[ ((cls perform:versionMethodName asSymbol) startsWith:'$Id') not ]") 
                     ifTrue:[
                         metaCls compile:(metaCls 
-                                    versionMethodTemplateForSourceCodeManager:self package manager)
+                                    versionMethodTemplateForSourceCodeManager:package manager)
                             classified:'documentation'.
                         (metaCls compiledMethodAt:versionMethodName) 
-                            setPackage:self package name asSymbol
+                            setPackage:package name asSymbol
                     ].
-            self package manager utilities ensureCorrectVersionMethodsInClass: cls usingManager: self package manager.
+            package manager utilities ensureCorrectVersionMethodsInClass: cls usingManager: package manager.
             ^ ProgressNotification newException
                 messageText: ('Compiling %1 (%2)' bindWith:versionMethodName
                                                       with:cls nameWithoutPrefix);
@@ -197,22 +226,22 @@
                 raiseRequest     
         ].
 
-    self extensionMethodsToFileOut notEmpty ifTrue:[
+    (self extensionMethodsToFileOutFor: package) notEmpty ifTrue:[
         | def |
 
         "TODO: Not programming language aware..."
-        ((def := self packageDefinition) class includesSelector: self package manager nameOfVersionMethodForExtensions) ifFalse:[
+        ((def := package definition) class includesSelector: package manager nameOfVersionMethodForExtensions) ifFalse:[
             def class 
                 compile:
-                    (self package manager versionMethodTemplateForSmalltalkFor:self package manager nameOfVersionMethodForExtensions)
+                    (package manager versionMethodTemplateForSmalltalkFor:package manager nameOfVersionMethodForExtensions)
                 classified: #documentation.
-            (def class compiledMethodAt:self package manager nameOfVersionMethodForExtensions) 
-                setPackage:self package name asSymbol
+            (def class compiledMethodAt:package manager nameOfVersionMethodForExtensions) 
+                setPackage:package name asSymbol
 
         ]
     ]
 
-    "Created: / 09-10-2013 / 11:57:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Created: / 21-02-2014 / 23:01:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 doFileOut
@@ -241,12 +270,20 @@
 !
 
 doFileOutPackageClasses
+    packages do:[:each | self doFileOutPackageClassesFor: each ]
+
+    "Created: / 11-04-2008 / 10:58:16 / Jan Vrany <vranyj1@fel.cvut.cz>"
+    "Modified: / 19-08-2009 / 13:44:00 / Jan Vrany <vranyj1@fel.cvut.cz>"
+    "Modified: / 22-02-2014 / 22:48:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+doFileOutPackageClassesFor: package
     |klasses|
 
     suppressClasses == true ifTrue:[^self].
 
     ActivityNotification notify:'Filing out package classes'.
-    klasses := self classesToFileOut asArray.
+    klasses := (self classesToFileOutFor: package) asArray.
     klasses 
         withIndexDo:[:cls :index | 
             |clsStream|
@@ -255,37 +292,53 @@
                 parameter: (100 / klasses size) * index;
                 raiseRequest.
 
-            (self shouldFileOutClass:cls) ifTrue:[self package fileOutClass: cls]
+            (self shouldFileOutClass:cls) ifTrue:[package fileOutClass: cls]
         ].
 
-    "Created: / 11-04-2008 / 10:58:16 / Jan Vrany <vranyj1@fel.cvut.cz>"
-    "Modified: / 19-08-2009 / 13:44:00 / Jan Vrany <vranyj1@fel.cvut.cz>"
-    "Modified: / 30-06-2013 / 00:16:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Created: / 21-02-2014 / 23:09:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 doFileOutPackageExtensions
-
-    suppressExtensions == true ifTrue:[^self].
-
-    self extensionMethodsToFileOut isEmpty ifTrue:[^self].
-    self package fileOutExtensions: self extensionMethodsToFileOut
+    packages do:[:each | self doFileOutPackageExtensionsFor: each ]
 
     "Modified: / 07-04-2008 / 08:37:25 / janfrog"
     "Created: / 11-04-2008 / 10:58:36 / Jan Vrany <vranyj1@fel.cvut.cz>"
     "Modified: / 14-05-2009 / 13:37:40 / Jan Vrany <vranyj1@fel.cvut.cz>"
-    "Modified: / 07-10-2012 / 10:56:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 21-02-2014 / 23:10:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+doFileOutPackageExtensionsFor: package
+    | extensions |
+
+    suppressExtensions == true ifTrue:[^self].
+
+    extensions := self extensionMethodsToFileOutFor: package.
+    extensions notEmpty ifTrue:[
+        package fileOutExtensions: extensions.
+    ]
+
+    "Created: / 21-02-2014 / 23:10:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 22-02-2014 / 23:04:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 doInitStateVariables
-    packageClassesChanged := self package classesHasChanged.
-    packageExtensionsChanged := self package extensionsHasChanged.
+    packageClassesChanged := packages contains:[:each| each classesHasChanged ].
+    packageExtensionsChanged := packages contains:[:each| each extensionsHasChanged ].
 
     "Created: / 17-06-2009 / 10:17:04 / Jan Vrany <vranyj1@fel.cvut.cz>"
     "Modified: / 13-08-2009 / 10:18:37 / Jan Vrany <vranyj1@fel.cvut.cz>"
-    "Modified: / 06-10-2012 / 23:28:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 21-02-2014 / 23:11:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 doRemoveOldContainers
+    packages do:[:each | self doRemoveOldContainersFor: each ]
+
+    "Created: / 11-04-2008 / 11:00:27 / Jan Vrany <vranyj1@fel.cvut.cz>"
+    "Modified: / 19-08-2009 / 15:03:51 / Jan Vrany <vranyj1@fel.cvut.cz>"
+    "Modified (format): / 21-02-2014 / 23:12:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+doRemoveOldContainersFor: package
     | wcroot containers containersToKeep containersToDelete |
 
     self isSelectiveFileoutTask ifTrue:[
@@ -293,9 +346,9 @@
     ].
     ActivityNotification notify:'Removing old containers'.
     wcroot := package temporaryWorkingCopyRoot.
-    containers := self package containers.
+    containers := package containers.
 
-    containersToKeep := self package containersToKeep.
+    containersToKeep := package containersToKeep.
     containersToDelete := containers \ containersToKeep.
     "/ Fix for issue #26: Java extension files are removed.
     "/ Filter out all Java extension containers which are for classes which
@@ -317,31 +370,26 @@
         entry remove
     ]
 
-    "Created: / 11-04-2008 / 11:00:27 / Jan Vrany <vranyj1@fel.cvut.cz>"
-    "Modified: / 19-08-2009 / 15:03:51 / Jan Vrany <vranyj1@fel.cvut.cz>"
-    "Modified: / 29-11-2013 / 17:56:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Created: / 21-02-2014 / 23:12:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-doRenameContainerForClassNamed: new using: renames language: lang
+doRenameContainerForClassNamed: new for: package using: renames language: lang
 
     | wcroot old oldC oldE newC newE |
     old := renames at: new.
     (renames includesKey: old) ifTrue:[
-        self doRenameContainerForClassNamed: old using: renames language: lang.
+        self doRenameContainerForClassNamed: old for: package using: renames language: lang.
     ].
     wcroot := package temporaryWorkingCopyRoot.
-    oldC := self package containerNameForClassNamed: old language: lang .
-    newC := self package containerNameForClassNamed: new language: lang .
+    oldC := package containerNameForClassNamed: old language: lang .
+    newC := package containerNameForClassNamed: new language: lang .
     (oldE := wcroot / oldC) exists ifTrue:[
         packageClassesChanged := true.
         newE := wcroot / newC.
         oldE moveTo: newE.
     ].
 
-    "Created: / 11-04-2008 / 11:00:27 / Jan Vrany <vranyj1@fel.cvut.cz>"
-    "Modified: / 19-08-2009 / 15:03:51 / Jan Vrany <vranyj1@fel.cvut.cz>"
-    "Created: / 06-08-2011 / 21:33:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 21-11-2012 / 00:43:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Created: / 21-02-2014 / 23:13:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 doRenameContainers
@@ -353,25 +401,36 @@
                 chg isClassRenameChange ifTrue:[
                     renames at: chg className put: chg oldName.
                 ]].
-    self classesToFileOut do:[:cls|
-        (renames includesKey: cls name) ifTrue:[
-            self doRenameContainerForClassNamed: cls name using: renames language: cls programmingLanguage.
-        ]        
-    ]
+    packages do:[:each |
+        (self classesToFileOutFor: each) do:[:cls|
+            (renames includesKey: cls name) ifTrue:[
+                self doRenameContainerForClassNamed: cls name for: each using: renames language: cls programmingLanguage.
+            ]        
+        ]
+    ].
 
     "Created: / 11-04-2008 / 11:00:27 / Jan Vrany <vranyj1@fel.cvut.cz>"
     "Modified: / 19-08-2009 / 15:03:51 / Jan Vrany <vranyj1@fel.cvut.cz>"
     "Created: / 06-08-2011 / 21:13:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 21-02-2014 / 23:15:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 doUpdateBuildSupportFiles
+    packages do:[:each | self doUpdateBuildSupportFilesFor: each ]
+
+    "Created: / 20-06-2009 / 16:01:16 / Jan Vrany <vranyj1@fel.cvut.cz>"
+    "Modified: / 21-06-2009 / 15:18:17 / Jan Vrany <vranyj1@fel.cvut.cz>"
+    "Modified: / 21-02-2014 / 23:16:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+doUpdateBuildSupportFilesFor: package
     |pkgDef|
 
     suppresBuildSupportFiles == true ifTrue:[
         ^self.
     ].
 
-    pkgDef := self package definition.
+    pkgDef := package definition.
 
     (self isSelectiveFileoutTask and:[packageClassesChanged not and:[(classes includes: pkgDef) not]]) ifTrue:[
         ^self.
@@ -380,20 +439,20 @@
     ActivityNotification notify:'Updating build files'.
     "First, generate files into a temporary files - so originals
      are not destroyed when something goes wrong."
-    self filesToGenerate do:[:supportFileName | 
+    (self filesToGenerateFor: package) do:[:supportFileName | 
         | supportFile |
 
-        supportFile := self temporaryWorkingCopyRoot / (supportFileName , '.tmp').
+        supportFile := package temporaryWorkingCopyRoot / (supportFileName , '.tmp').
         (packageClassesChanged or:[ supportFile exists not ]) ifTrue:[
             ActivityNotification notify:'Updating ' , supportFileName.
             supportFile directory exists ifFalse: [supportFile directory makeDirectory].
             supportFile writingFileDo:[:s|
-                    s nextPutAll:(self for: pkgDef generateFile:supportFileName)
+                    s nextPutAll:(self for: package generateFile:supportFileName)
             ]
         ]
     ].
     "Now, copy them over the old files"
-    self filesToGenerate do:[:supportFileName |
+    (self filesToGenerateFor: package) do:[:supportFileName |
         | supportFile supportFileTmp |
 
         supportFile := package temporaryWorkingCopyRoot / supportFileName.
@@ -403,9 +462,8 @@
         supportFile track.
     ].
 
-    "Created: / 20-06-2009 / 16:01:16 / Jan Vrany <vranyj1@fel.cvut.cz>"
-    "Modified: / 21-06-2009 / 15:18:17 / Jan Vrany <vranyj1@fel.cvut.cz>"
-    "Modified: / 12-01-2013 / 13:54:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Created: / 21-02-2014 / 23:16:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 22-02-2014 / 22:47:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 doUpdateCode
@@ -421,13 +479,21 @@
 !
 
 doUpdateProjectDefinition
+    packages do:[:each | self doUpdateProjectDefinitionFor: each ]
+
+    "Created: / 11-04-2008 / 11:01:06 / Jan Vrany <vranyj1@fel.cvut.cz>"
+    "Modified: / 13-08-2009 / 09:13:14 / Jan Vrany <vranyj1@fel.cvut.cz>"
+    "Modified: / 21-02-2014 / 23:17:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+doUpdateProjectDefinitionFor: package
     | prjClass classesSpec classNamesAndAttributesMap |
 
     (packageClassesChanged | packageExtensionsChanged) ifFalse:[
         ^ self
     ].
     ActivityNotification notify:'Updating project definition'.
-    prjClass := ProjectDefinition definitionClassForPackage:self package name createIfAbsent:true.
+    prjClass := ProjectDefinition definitionClassForPackage: package name createIfAbsent:true.
 
     "/Update classlist beforehand - to care about order and removals...
     classNamesAndAttributesMap := Dictionary new.
@@ -453,15 +519,14 @@
             ignoreOldDefinition: false
     ]
 
-    "Created: / 11-04-2008 / 11:01:06 / Jan Vrany <vranyj1@fel.cvut.cz>"
-    "Modified: / 13-08-2009 / 09:13:14 / Jan Vrany <vranyj1@fel.cvut.cz>"
-    "Modified: / 19-03-2013 / 10:35:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Created: / 21-02-2014 / 23:17:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !SCMAbstractFileoutLikeTask methodsFor:'private'!
 
 classesToFileOut
 
+    self shouldNotImplement.
     suppressClasses == true ifTrue:[^#()].
 
     ^ self package classesFiltered:
@@ -470,15 +535,34 @@
 
     "Created: / 23-03-2009 / 12:08:24 / Jan Vrany <vranyj1@fel.cvut.cz>"
     "Modified: / 11-06-2009 / 18:17:38 / Jan Vrany <vranyj1@fel.cvut.cz>"
-    "Modified: / 06-10-2012 / 23:28:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 22-02-2014 / 22:51:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+classesToFileOutFor: package
+
+    suppressClasses == true ifTrue:[^#()].
+
+    ^ package classesFiltered:
+            [:class |
+            class isLoaded and: [ classes isNil or: [ classes includes: class ] ] ]
+
+    "Created: / 21-02-2014 / 22:59:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 22-02-2014 / 22:19:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 containersToFileOut
+    self shouldNotImplement
+
+    "Created: / 14-05-2009 / 11:35:05 / Jan Vrany <vranyj1@fel.cvut.cz>"
+    "Modified: / 22-02-2014 / 22:50:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+containersToFileOutFor: package
     | containers extensions |
 
-    containers := self classesToFileOut
+    containers := (self classesToFileOutFor: package)
                 collect: [:class | package containerNameForClass: class ].
-    (extensions := self extensionMethodsToFileOut) notEmpty ifTrue:[
+    (extensions := (self extensionMethodsToFileOutFor: package)) notEmpty ifTrue:[
         | languages extensionsNonJava extensionsJava |
 
         extensionsNonJava := extensions reject:[:m | m mclass programmingLanguage isJava].
@@ -496,42 +580,49 @@
     ].
     ^ containers
 
-    "Created: / 14-05-2009 / 11:35:05 / Jan Vrany <vranyj1@fel.cvut.cz>"
-    "Modified: / 24-09-2013 / 12:32:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Created: / 22-02-2014 / 22:49:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 extensionMethodsToFileOut
+   self error: 'Should no longer be sent'.          
     ^ self package extensionsFiltered:
             [:mth |
             extensionMethods isNil or: [ extensionMethods includes: mth ] ]
 
     "Created: / 14-05-2009 / 11:32:01 / Jan Vrany <vranyj1@fel.cvut.cz>"
-    "Modified: / 06-10-2012 / 23:28:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 22-02-2014 / 22:19:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-for: def generateFile: file
+extensionMethodsToFileOutFor: package
+    ^package extensionsFiltered:
+            [:mth |
+            extensionMethods isNil or: [ extensionMethods includes: mth ] ]
 
-    | contents savedClassFilenames |
+    "Created: / 21-02-2014 / 23:03:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 22-02-2014 / 22:20:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
 
-        
+for: package generateFile: file
+    | def contents savedClassFilenames |
+
+    def := package definition.
     file ~= 'abbrev.stc' ifTrue:[^def generateFile: file].
 
     "Yet another kludge to trick Smalltalk>>fileNameForClass:, sigh"
-
     savedClassFilenames := Dictionary new.
     (def searchForClasses reject:[:e|e owningClass notNil]) do:
         [:cls|
         savedClassFilenames 
             at: cls
             put: cls getClassFilename.
-        cls setClassFilename: (self package containerNameForClass: cls)].
+        cls setClassFilename: (package containerNameForClass: cls)].
     contents := def generateFile: file.
     savedClassFilenames keysAndValuesDo:
         [:cls :classFileName|
         cls setClassFilename: classFileName].
     ^contents
 
-    "Modified: / 19-11-2012 / 23:01:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 22-02-2014 / 22:47:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 shouldFileOutClass: class
@@ -570,11 +661,11 @@
 
 shouldFileOutMethod: mth
 
-    ^mth package = package name and:
-        [mth getSourcePosition isNil]
+    ^ (packages contains:[:p | mth package = p name ]) 
+        and: [mth getSourcePosition isNil]
 
     "Created: / 24-06-2009 / 19:07:27 / Jan Vrany <vranyj1@fel.cvut.cz>"
-    "Modified (comment): / 15-11-2012 / 00:36:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 21-02-2014 / 22:53:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !SCMAbstractFileoutLikeTask methodsFor:'queries'!