loadAll/Make.proto file generation
authorClaus Gittinger <cg@exept.de>
Wed, 22 Sep 1999 17:39:21 +0200
changeset 4789 72a61dc595ad
parent 4788 3dc29c8e6ca8
child 4790 38030fd8b681
loadAll/Make.proto file generation
Project.st
--- a/Project.st	Wed Sep 22 17:38:49 1999 +0200
+++ b/Project.st	Wed Sep 22 17:39:21 1999 +0200
@@ -611,6 +611,18 @@
     isLoaded := aBoolean
 !
 
+libraryName
+    "return the projects library name.
+     This is the name of a classLibrary, created from this project"
+
+    |nm|
+
+    nm := self name.
+    ^ nm copyFrom:(nm lastIndexOfAny:':/')+1
+
+"/    ^ (self name copyReplaceAll:$/ with:$_) replaceAll:$: with:$_
+!
+
 name
     "return the projects name.
      This is for the user only - shown in the projectViews label"
@@ -1410,7 +1422,7 @@
 "/
 "/ Automatically generated from project definition.
 "/ DO NOT MODIFY THIS fILE;
-"/ modify the .prj file instead, an regenerate this file
+"/ modify the .prj file instead, and regenerate this file
 "/ with the ProjectBrowser tool.
 "/
 
@@ -1446,7 +1458,7 @@
 
     out nextPutAll:') asOrderedCollection.
 
-(Smalltalk loadClassLibraryIfAbsent:''' , self name , ''') ifTrue:[
+(Smalltalk loadClassLibraryIfAbsent:''' , self libraryName , ''') ifTrue:[
     |handle loaded|
 
     handle := ObjectFileLoader loadedObjectHandles 
@@ -1609,7 +1621,7 @@
 
 # the name of your classLibrary:
 # ********** REQUIRED: CHECK the next line ***
-LIBNAME=' , self name , '
+LIBNAME=' , self libraryName , '
 
 
 # the next define suppresses installation of 
@@ -1931,10 +1943,14 @@
 addClass:classOrClassName conditionForInclusion:conditionBlock classFileName:fileName
     "add a class to the project"
 
-    |i|
+    |i clsName|
+
+    (clsName := classOrClassName) isBehavior ifTrue:[
+        clsName := classOrClassName name
+    ].
 
     i := ClassInfo new.
-    i className:classOrClassName.
+    i className:clsName.
     i classFileName:fileName.
     i conditionForInclusion:conditionBlock.
     self addClassInfo:i
@@ -1952,23 +1968,8 @@
     index := infoCollection findFirst:[:i | |nm1 nm2|
                                         nm1 := i className.
                                         nm2 := newInfo className.
-"/                                        (nm1 includes:$:) ifFalse:[
-"/                                            nm1 := self defaultNameSpace name , '::' , nm1
-"/                                        ].
-"/                                        (nm2 includes:$:) ifFalse:[
-"/                                            nm2 := self defaultNameSpace name , '::' , nm2
-"/                                        ].
                                         nm1 = nm2
                                       ].
-"/    "/ strip off nameSpace prefix, if its the same as
-"/    "/ the default ...
-"/
-"/    nm := newInfo className.
-"/    prefix := self defaultNameSpace name , '::'.
-"/    (nm startsWith:prefix) ifTrue:[
-"/        nm := nm copyFrom:(prefix size + 1).
-"/        newInfo className:nm asSymbol.
-"/    ].
     index ~~ 0 ifTrue:[
         infoCollection at:index put:newInfo
     ] ifFalse:[
@@ -2204,6 +2205,21 @@
     "Modified: 4.1.1997 / 16:51:18 / cg"
 !
 
+classInfoFor:aClassOrClassName
+    "return a classInfo for a particular class"
+
+    |classInfo clsName index|
+
+    (classInfo := self classInfo) isNil ifTrue:[^ nil].
+    (clsName := aClassOrClassName) isBehavior ifTrue:[
+        clsName := aClassOrClassName name
+    ].
+    ^ classInfo detect:[:i | i className = clsName] ifNone:nil.
+
+
+    "Modified: 4.1.1997 / 16:51:18 / cg"
+!
+
 classes
     "return a collection of classes belonging to that project.
      This excludes any private classes."
@@ -2602,6 +2618,6 @@
 !Project class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Project.st,v 1.102 1999-09-22 09:11:03 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Project.st,v 1.103 1999-09-22 15:39:21 cg Exp $'
 ! !
 Project initialize!