create abbrev file added
authorClaus Gittinger <cg@exept.de>
Tue, 21 Mar 2000 20:49:47 +0100
changeset 5314 8a4b8d5726a5
parent 5313 b2f2253a90ca
child 5315 04052c5626bf
create abbrev file added
Project.st
--- a/Project.st	Tue Mar 21 14:00:28 2000 +0100
+++ b/Project.st	Tue Mar 21 20:49:47 2000 +0100
@@ -1880,6 +1880,59 @@
     ^ classes
 !
 
+createAbbrevFile
+    "creates a 'abbrev.stc' file, for autoloading classes."
+
+    |d f out in topName classes classInfo myPackage   
+     methodsFile prerequisitePackages transcript notEmpty|
+
+    classes := self classesInOrderFor:'generate ''abbrev.stc''-file.'.
+    classes isNil ifTrue:[^ self].
+
+    notEmpty := (classes size > 0).
+
+    transcript := Transcript current.
+    transcript showCR:'creating abbrev.stc file'.
+
+    d := directoryName asFilename.
+    f := d construct:'abbrev.stc'.
+
+    out := f writeStream.
+    out isNil ifTrue:[
+        self warn:'cannot create abbrev.stc'.
+        ^ self
+    ].
+
+    myPackage := self package.
+
+    notEmpty ifTrue:[
+        classes do:[:cls |
+            |clsInfo cond fileName|
+
+            clsInfo := self classInfoFor:cls.
+            cond := clsInfo conditionForInclusion.
+            (cond == #always or:[cond == #autoload]) ifTrue:[
+                fileName := clsInfo classFileName.
+                fileName isNil ifTrue:[
+                    fileName := cls nameWithoutNameSpacePrefix
+                ].
+                (fileName endsWith:'.st') ifTrue:[
+                    fileName := fileName copyWithoutLast:3
+                ].
+                out nextPutAll:cls name.
+                out space.
+                out nextPutAll:fileName.
+                out space.
+                out nextPutAll:cls package.
+                out space.
+                out nextPut:$'; nextPutAll:cls category; nextPut:$'.
+                out cr.
+            ]
+        ].
+    ].
+    out close
+!
+
 createLoadAllFile
     "creates a 'loadAll' file, which will load all classes
      of the project - this loadAll file is supposed to be located
@@ -3764,6 +3817,6 @@
 !Project class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Project.st,v 1.151 2000-03-03 15:40:11 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Project.st,v 1.152 2000-03-21 19:49:47 cg Exp $'
 ! !
 Project initialize!