Do not let `MCStXPackageInfo` to create package definition if it does not exist jv
authorJan Vrany <jan.vrany@labware.com>
Wed, 05 Aug 2020 16:06:12 +0100
branchjv
changeset 1113 a75ffa5304cc
parent 1112 f43763fa011b
child 1114 47360cc199f0
Do not let `MCStXPackageInfo` to create package definition if it does not exist
MCStXPackageInfo.st
--- a/MCStXPackageInfo.st	Mon Aug 10 12:45:43 2020 +0100
+++ b/MCStXPackageInfo.st	Wed Aug 05 16:06:12 2020 +0100
@@ -1,18 +1,32 @@
+"
+COPYRIGHT (c) 2020 LabWare
+"
 "{ Package: 'stx:goodies/monticello' }"
 
+"{ NameSpace: Smalltalk }"
+
 PackageInfo subclass:#MCStXPackageInfo
-	instanceVariableNames:'projectDefinition classes'
+	instanceVariableNames:'classes extensions'
 	classVariableNames:''
 	poolDictionaries:''
 	category:'SCM-Monticello-St/X support'
 !
 
+!MCStXPackageInfo class methodsFor:'documentation'!
+
+copyright
+"
+COPYRIGHT (c) 2020 LabWare
+
+
+"
+! !
 
 !MCStXPackageInfo methodsFor:'accessing'!
 
 classes
     classes isNil ifTrue:[
-        classes := self projectDefinition classes.
+        classes := ProjectDefinition searchForClassesWithProject: name.
         "/ cg: not true; the projectDefinition is part of the package; at least for st/x packages.
         "/ classes remove: self projectDefinition ifAbsent:[].
 
@@ -31,46 +45,36 @@
 
     "Created: / 23-08-2011 / 11:55:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Modified: / 02-12-2011 / 15:56:35 / cg"
+    "Modified: / 05-08-2020 / 15:53:27 / Jan Vrany <jan.vrany@labware.com>"
 !
 
 extensionMethods
-    self assert:(self projectDefinition hasAllExtensionsLoaded).
-
-    ^self projectDefinition extensionMethods
-        collect:[:mthd|
-            self assert:mthd notNil.
-            self
-                referenceForMethod: mthd selector
-                ofClass:mthd mclass
-        ]
+    extensions isNil ifTrue: [
+        extensions := (ProjectDefinition searchForExtensionsWithProject: name)  
+                        collect:[:mthd|
+                            self assert:mthd notNil.
+                            self
+                                referenceForMethod: mthd selector
+                                ofClass:mthd mclass
+                        ]
+    ].
+    ^ extensions
 
     "Created: / 23-08-2011 / 11:58:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Modified: / 27-08-2012 / 12:12:55 / cg"
-!
-
-projectDefinition
-
-    projectDefinition isNil ifTrue:[
-        projectDefinition := 
-            (LibraryDefinition
-                definitionClassForPackage: name
-                createIfAbsent: true 
-                projectType: nil)
-    ].
-    ^projectDefinition
-
-    "Created: / 23-08-2011 / 13:37:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 05-08-2020 / 15:55:10 / Jan Vrany <jan.vrany@labware.com>"
 !
 
 systemCategories
     | cats |
 
     cats := self classes collect:[:cls | cls category] as: Set.
-    cats remove: #'* Projects & Packages *'.
+    cats remove: #'* Projects & Packages *' ifAbsent: [].
     ^cats
 
     "Created: / 23-08-2011 / 13:45:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Modified: / 03-10-2014 / 02:23:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 05-08-2020 / 15:56:02 / Jan Vrany <jan.vrany@labware.com>"
 ! !
 
 !MCStXPackageInfo methodsFor:'testing'!
@@ -91,6 +95,11 @@
     ^ '$Header: /cvs/stx/stx/goodies/monticello/MCStXPackageInfo.st,v 1.8 2014-10-03 01:23:23 vrany Exp $'
 !
 
+version_HG
+
+    ^ '$Changeset: <not expanded> $'
+!
+
 version_MC
     ^ '$stx:goodies/monticello-cg.3 4e70fe70-f030-11e1-ac62-001f3bda2d09 2012-08-27T12:16:46 cg$'
 ! !