Added new check to ProjectChecker. jv
authorJan Vrany <jan.vrany@fit.cvut.cz>
Sat, 05 Oct 2013 12:51:21 +0100
branchjv
changeset 3407 989191014bcd
parent 3406 33fed6e45d2a
child 3409 2f35547d8d1e
Added new check to ProjectChecker. For each compiled class, check that it's superclass package's project definition exists. If it does not, the whole package will likely fail to compile as required package could not be compiled nor loaded.
Make.proto
ProjectChecker.st
ProjectProblem.st
abbrev.stc
bc.mak
libbasic3.rc
--- a/Make.proto	Fri Sep 27 23:47:49 2013 +0100
+++ b/Make.proto	Sat Oct 05 12:51:21 2013 +0100
@@ -148,7 +148,7 @@
 $(OUTDIR)Change.$(O) Change.$(H): Change.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)ChangeDeltaInformation.$(O) ChangeDeltaInformation.$(H): ChangeDeltaInformation.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)ChangeNotificationParameter.$(O) ChangeNotificationParameter.$(H): ChangeNotificationParameter.st $(INCLUDE_TOP)/stx/libbasic/Array.$(H) $(INCLUDE_TOP)/stx/libbasic/ArrayedCollection.$(H) $(INCLUDE_TOP)/stx/libbasic/SequenceableCollection.$(H) $(INCLUDE_TOP)/stx/libbasic/Collection.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
-$(OUTDIR)ChangeSet.$(O) ChangeSet.$(H): ChangeSet.st $(INCLUDE_TOP)/stx/libbasic/OrderedCollection.$(H) $(INCLUDE_TOP)/stx/libbasic/SequenceableCollection.$(H) $(INCLUDE_TOP)/stx/libbasic/Collection.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libbasic/SmalltalkChunkFileSourceWriter.$(H) $(INCLUDE_TOP)/stx/libbasic/AbstractSourceFileWriter.$(H) $(INCLUDE_TOP)/stx/libbasic/Error.$(H) $(INCLUDE_TOP)/stx/libbasic/Exception.$(H) $(INCLUDE_TOP)/stx/libbasic/GenericException.$(H) $(STCHDR)
+$(OUTDIR)ChangeSet.$(O) ChangeSet.$(H): ChangeSet.st $(INCLUDE_TOP)/stx/libbasic/OrderedCollection.$(H) $(INCLUDE_TOP)/stx/libbasic/SequenceableCollection.$(H) $(INCLUDE_TOP)/stx/libbasic/Collection.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libbasic/Error.$(H) $(INCLUDE_TOP)/stx/libbasic/Exception.$(H) $(INCLUDE_TOP)/stx/libbasic/GenericException.$(H) $(INCLUDE_TOP)/stx/libbasic/SmalltalkChunkFileSourceWriter.$(H) $(INCLUDE_TOP)/stx/libbasic/AbstractSourceFileWriter.$(H) $(STCHDR)
 $(OUTDIR)ChangeSetDiff.$(O) ChangeSetDiff.$(H): ChangeSetDiff.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)ChangeSetDiffComponent.$(O) ChangeSetDiffComponent.$(H): ChangeSetDiffComponent.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)ClassOrganizer.$(O) ClassOrganizer.$(H): ClassOrganizer.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
@@ -184,7 +184,7 @@
 $(OUTDIR)MethodChangeNotificationParameter.$(O) MethodChangeNotificationParameter.$(H): MethodChangeNotificationParameter.st $(INCLUDE_TOP)/stx/libbasic3/ChangeNotificationParameter.$(H) $(INCLUDE_TOP)/stx/libbasic/Array.$(H) $(INCLUDE_TOP)/stx/libbasic/ArrayedCollection.$(H) $(INCLUDE_TOP)/stx/libbasic/SequenceableCollection.$(H) $(INCLUDE_TOP)/stx/libbasic/Collection.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)NameSpaceCreationChange.$(O) NameSpaceCreationChange.$(H): NameSpaceCreationChange.st $(INCLUDE_TOP)/stx/libbasic3/Change.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)OtherChange.$(O) OtherChange.$(H): OtherChange.st $(INCLUDE_TOP)/stx/libbasic3/Change.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
-$(OUTDIR)PerforceSourceCodeManager.$(O) PerforceSourceCodeManager.$(H): PerforceSourceCodeManager.st $(INCLUDE_TOP)/stx/libbasic3/AbstractSourceCodeManager.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libbasic/ProceedableError.$(H) $(INCLUDE_TOP)/stx/libbasic/Error.$(H) $(INCLUDE_TOP)/stx/libbasic/Exception.$(H) $(INCLUDE_TOP)/stx/libbasic/GenericException.$(H) $(INCLUDE_TOP)/stx/libbasic3/VersionInfo.$(H) $(STCHDR)
+$(OUTDIR)PerforceSourceCodeManager.$(O) PerforceSourceCodeManager.$(H): PerforceSourceCodeManager.st $(INCLUDE_TOP)/stx/libbasic3/AbstractSourceCodeManager.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libbasic3/VersionInfo.$(H) $(INCLUDE_TOP)/stx/libbasic/ProceedableError.$(H) $(INCLUDE_TOP)/stx/libbasic/Error.$(H) $(INCLUDE_TOP)/stx/libbasic/Exception.$(H) $(INCLUDE_TOP)/stx/libbasic/GenericException.$(H) $(STCHDR)
 $(OUTDIR)SVNVersionInfo.$(O) SVNVersionInfo.$(H): SVNVersionInfo.st $(INCLUDE_TOP)/stx/libbasic3/VersionInfo.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)SourceCodeManagerUtilitiesForContainerBasedManagers.$(O) SourceCodeManagerUtilitiesForContainerBasedManagers.$(H): SourceCodeManagerUtilitiesForContainerBasedManagers.st $(INCLUDE_TOP)/stx/libbasic3/SourceCodeManagerUtilities.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)SourceCodeManagerUtilitiesForWorkspaceBasedManagers.$(O) SourceCodeManagerUtilitiesForWorkspaceBasedManagers.$(H): SourceCodeManagerUtilitiesForWorkspaceBasedManagers.st $(INCLUDE_TOP)/stx/libbasic3/SourceCodeManagerUtilities.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
--- a/ProjectChecker.st	Fri Sep 27 23:47:49 2013 +0100
+++ b/ProjectChecker.st	Sat Oct 05 12:51:21 2013 +0100
@@ -273,15 +273,23 @@
                     | superDef superNm |
 
                     superDef := ProjectDefinition definitionClassForPackage: cls superclass package.
-                    superNm := cls superclass name.
-                    superDef classNamesAndAttributesDo:[:clsnm2 :attributes2|
-                        clsnm2 == superNm ifTrue:[
-                            (attributes2 includes: #autoload) ifTrue:[
-                                problems add:
-                                    (ProjectProblem newClassIsCompiledButSuperclassIsAutoloaded
-                                        package: package;
-                                        className: clsnm;
-                                        yourself)
+                    superDef isNil ifTrue:[
+                        problems add:
+                            (ProjectProblem newClassIsCompiledButSuperclassProjectDefinitionIsMissing
+                                            package: package;
+                                            className: clsnm;
+                                            yourself)   
+                    ] ifFalse:[
+                        superNm := cls superclass name.
+                        superDef classNamesAndAttributesDo:[:clsnm2 :attributes2|
+                            clsnm2 == superNm ifTrue:[
+                                (attributes2 includes: #autoload) ifTrue:[
+                                    problems add:
+                                        (ProjectProblem newClassIsCompiledButSuperclassIsAutoloaded
+                                            package: package;
+                                            className: clsnm;
+                                            yourself)
+                                ].
                             ].
                         ].
                     ]
@@ -291,6 +299,7 @@
     ].
 
     "Created: / 20-09-2013 / 11:08:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 05-10-2013 / 12:45:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 checkClassesForMethodsInNoProject:classesToCheck 
--- a/ProjectProblem.st	Fri Sep 27 23:47:49 2013 +0100
+++ b/ProjectProblem.st	Sat Oct 05 12:51:21 2013 +0100
@@ -32,6 +32,13 @@
 	privateIn:ProjectProblem
 !
 
+ProjectProblem::InconsistentProjectDefinition subclass:#ClassListedBeforeItsPool
+	instanceVariableNames:'poolName'
+	classVariableNames:''
+	poolDictionaries:''
+	privateIn:ProjectProblem
+!
+
 ProjectProblem::InconsistentProjectDefinition subclass:#ClassListedBeforeItsSuperclass
 	instanceVariableNames:'superClassName'
 	classVariableNames:''
@@ -123,8 +130,8 @@
 	privateIn:ProjectProblem
 !
 
-ProjectProblem::InconsistentProjectDefinition subclass:#ClassListedBeforeItsPool
-	instanceVariableNames:'poolName'
+ProjectProblem::InconsistentProjectDefinition subclass:#ClassIsCompiledButSuperclassProjectDefinitionIsMissing
+	instanceVariableNames:''
 	classVariableNames:''
 	poolDictionaries:''
 	privateIn:ProjectProblem
@@ -211,6 +218,13 @@
     "Created: / 20-09-2013 / 11:18:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
+newClassIsCompiledButSuperclassProjectDefinitionIsMissing
+
+    ^ClassIsCompiledButSuperclassProjectDefinitionIsMissing new
+
+    "Created: / 05-10-2013 / 12:43:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 newClassListedBeforeItsPool
 
     ^ClassListedBeforeItsPool new
@@ -581,6 +595,43 @@
         with: (Array with: 'Full update of the project definitions (rescan)' with: [ self doUpdateAllProjectDefinitions ])
 ! !
 
+!ProjectProblem::ClassListedBeforeItsPool methodsFor:'accessing'!
+
+poolName
+    ^ poolName
+!
+
+poolName:something
+    poolName := something.
+! !
+
+!ProjectProblem::ClassListedBeforeItsPool methodsFor:'accessing-description'!
+
+description
+    "Return a (HTML) describing the problem."
+
+    ^
+'Class %2 is listed in project definition (%1) before one of its pools (%3).
+<br>Such class will fail to compile (if the package is being stc-compiled)
+and load (if the package is being loaded from source).
+<br>Make sure class (%3) is listed before (%2).
+
+'
+bindWith: (self linkToClass: self packageDefinitionClass class selector: #classNamesAndAttributes omitClassName: true)
+    with: (self linkToClass: className)
+    with: (self linkToClass: poolName)
+
+    "Modified: / 13-09-2012 / 18:29:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+label
+    "Return the label (possibly instance if a Text) shortly describing the problem"
+
+    ^'Class %1 listed in project definition "%2" before one of its pools' bindWith: className allBold with:self packageDefinitionClass
+
+    "Modified: / 13-09-2012 / 17:36:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !ProjectProblem::ClassListedBeforeItsSuperclass methodsFor:'accessing'!
 
 superClassName
@@ -1143,41 +1194,27 @@
     "Created: / 26-07-2012 / 10:41:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
-!ProjectProblem::ClassListedBeforeItsPool methodsFor:'accessing'!
-
-poolName
-    ^ poolName
-!
-
-poolName:something
-    poolName := something.
-! !
-
-!ProjectProblem::ClassListedBeforeItsPool methodsFor:'accessing-description'!
+!ProjectProblem::ClassIsCompiledButSuperclassProjectDefinitionIsMissing methodsFor:'accessing'!
 
 description
     "Return a (HTML) describing the problem."
 
     ^
-'Class %2 is listed in project definition (%1) before one of its pools (%3).
-<br>Such class will fail to compile (if the package is being stc-compiled)
-and load (if the package is being loaded from source).
-<br>Make sure class (%3) is listed before (%2).
+'Class %1 is compiled (i.e., not autoloaded) but its superclass''s package 
+definition is missing. Such class won''t compile because superclass''s package
+will be likely missing.'
+bindWith: (self linkToClass: className)
+    with: (self linkToClass: (Smalltalk at: className) superclass name)
 
-'
-bindWith: (self linkToClass: self packageDefinitionClass class selector: #classNamesAndAttributes omitClassName: true)
-    with: (self linkToClass: className)
-    with: (self linkToClass: poolName)
-
-    "Modified: / 13-09-2012 / 18:29:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 05-10-2013 / 12:43:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 label
     "Return the label (possibly instance if a Text) shortly describing the problem"
 
-    ^'Class %1 listed in project definition "%2" before one of its pools' bindWith: className allBold with:self packageDefinitionClass
+    ^ 'Class ', className , ' is compiled but its superclass''s package definition is missing'
 
-    "Modified: / 13-09-2012 / 17:36:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 05-10-2013 / 12:41:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !ProjectProblem::MethodCompilabilityIssue methodsFor:'accessing'!
--- a/abbrev.stc	Fri Sep 27 23:47:49 2013 +0100
+++ b/abbrev.stc	Sat Oct 05 12:51:21 2013 +0100
@@ -71,6 +71,6 @@
 ProjectProblem ProjectProblem stx:libbasic3 'System-Support-Projects' 0
 SourceCodeManagerUtilitiesForContainerBasedManagers SourceCodeManagerUtilitiesForContainerBasedManagers stx:libbasic3 'System-SourceCodeManagement' 0
 SourceCodeManagerUtilitiesForWorkspaceBasedManagers SourceCodeManagerUtilitiesForWorkspaceBasedManagers stx:libbasic3 'System-SourceCodeManagement' 0
-VisualAgeChunkFileSourceWriter VisualAgeChunkFileSourceWriter stx:libbasic3 'Kernel-Classes' 0
+VisualAgeChunkFileSourceWriter VisualAgeChunkFileSourceWriter stx:libbasic3 'Kernel-Classes-Support' 0
 TraitDefinitionChange TraitDefinitionChange stx:libbasic3 'System-Changes' 0
 TraitClassTraitDefinitionChange TraitClassTraitDefinitionChange stx:libbasic3 'System-Changes' 0
--- a/bc.mak	Fri Sep 27 23:47:49 2013 +0100
+++ b/bc.mak	Sat Oct 05 12:51:21 2013 +0100
@@ -75,7 +75,7 @@
 $(OUTDIR)Change.$(O) Change.$(H): Change.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)ChangeDeltaInformation.$(O) ChangeDeltaInformation.$(H): ChangeDeltaInformation.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)ChangeNotificationParameter.$(O) ChangeNotificationParameter.$(H): ChangeNotificationParameter.st $(INCLUDE_TOP)\stx\libbasic\Array.$(H) $(INCLUDE_TOP)\stx\libbasic\ArrayedCollection.$(H) $(INCLUDE_TOP)\stx\libbasic\SequenceableCollection.$(H) $(INCLUDE_TOP)\stx\libbasic\Collection.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
-$(OUTDIR)ChangeSet.$(O) ChangeSet.$(H): ChangeSet.st $(INCLUDE_TOP)\stx\libbasic\OrderedCollection.$(H) $(INCLUDE_TOP)\stx\libbasic\SequenceableCollection.$(H) $(INCLUDE_TOP)\stx\libbasic\Collection.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libbasic\SmalltalkChunkFileSourceWriter.$(H) $(INCLUDE_TOP)\stx\libbasic\AbstractSourceFileWriter.$(H) $(INCLUDE_TOP)\stx\libbasic\Error.$(H) $(INCLUDE_TOP)\stx\libbasic\Exception.$(H) $(INCLUDE_TOP)\stx\libbasic\GenericException.$(H) $(STCHDR)
+$(OUTDIR)ChangeSet.$(O) ChangeSet.$(H): ChangeSet.st $(INCLUDE_TOP)\stx\libbasic\OrderedCollection.$(H) $(INCLUDE_TOP)\stx\libbasic\SequenceableCollection.$(H) $(INCLUDE_TOP)\stx\libbasic\Collection.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libbasic\Error.$(H) $(INCLUDE_TOP)\stx\libbasic\Exception.$(H) $(INCLUDE_TOP)\stx\libbasic\GenericException.$(H) $(INCLUDE_TOP)\stx\libbasic\SmalltalkChunkFileSourceWriter.$(H) $(INCLUDE_TOP)\stx\libbasic\AbstractSourceFileWriter.$(H) $(STCHDR)
 $(OUTDIR)ChangeSetDiff.$(O) ChangeSetDiff.$(H): ChangeSetDiff.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)ChangeSetDiffComponent.$(O) ChangeSetDiffComponent.$(H): ChangeSetDiffComponent.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)ClassOrganizer.$(O) ClassOrganizer.$(H): ClassOrganizer.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
@@ -111,7 +111,7 @@
 $(OUTDIR)MethodChangeNotificationParameter.$(O) MethodChangeNotificationParameter.$(H): MethodChangeNotificationParameter.st $(INCLUDE_TOP)\stx\libbasic3\ChangeNotificationParameter.$(H) $(INCLUDE_TOP)\stx\libbasic\Array.$(H) $(INCLUDE_TOP)\stx\libbasic\ArrayedCollection.$(H) $(INCLUDE_TOP)\stx\libbasic\SequenceableCollection.$(H) $(INCLUDE_TOP)\stx\libbasic\Collection.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)NameSpaceCreationChange.$(O) NameSpaceCreationChange.$(H): NameSpaceCreationChange.st $(INCLUDE_TOP)\stx\libbasic3\Change.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)OtherChange.$(O) OtherChange.$(H): OtherChange.st $(INCLUDE_TOP)\stx\libbasic3\Change.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
-$(OUTDIR)PerforceSourceCodeManager.$(O) PerforceSourceCodeManager.$(H): PerforceSourceCodeManager.st $(INCLUDE_TOP)\stx\libbasic3\AbstractSourceCodeManager.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libbasic\ProceedableError.$(H) $(INCLUDE_TOP)\stx\libbasic\Error.$(H) $(INCLUDE_TOP)\stx\libbasic\Exception.$(H) $(INCLUDE_TOP)\stx\libbasic\GenericException.$(H) $(INCLUDE_TOP)\stx\libbasic3\VersionInfo.$(H) $(STCHDR)
+$(OUTDIR)PerforceSourceCodeManager.$(O) PerforceSourceCodeManager.$(H): PerforceSourceCodeManager.st $(INCLUDE_TOP)\stx\libbasic3\AbstractSourceCodeManager.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libbasic3\VersionInfo.$(H) $(INCLUDE_TOP)\stx\libbasic\ProceedableError.$(H) $(INCLUDE_TOP)\stx\libbasic\Error.$(H) $(INCLUDE_TOP)\stx\libbasic\Exception.$(H) $(INCLUDE_TOP)\stx\libbasic\GenericException.$(H) $(STCHDR)
 $(OUTDIR)SVNVersionInfo.$(O) SVNVersionInfo.$(H): SVNVersionInfo.st $(INCLUDE_TOP)\stx\libbasic3\VersionInfo.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)SourceCodeManagerUtilitiesForContainerBasedManagers.$(O) SourceCodeManagerUtilitiesForContainerBasedManagers.$(H): SourceCodeManagerUtilitiesForContainerBasedManagers.st $(INCLUDE_TOP)\stx\libbasic3\SourceCodeManagerUtilities.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)SourceCodeManagerUtilitiesForWorkspaceBasedManagers.$(O) SourceCodeManagerUtilitiesForWorkspaceBasedManagers.$(H): SourceCodeManagerUtilitiesForWorkspaceBasedManagers.st $(INCLUDE_TOP)\stx\libbasic3\SourceCodeManagerUtilities.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
--- a/libbasic3.rc	Fri Sep 27 23:47:49 2013 +0100
+++ b/libbasic3.rc	Sat Oct 05 12:51:21 2013 +0100
@@ -25,7 +25,7 @@
       VALUE "LegalCopyright", "Copyright Claus Gittinger 1988-2012\nCopyright eXept Software AG 1998-2012\0"
       VALUE "ProductName", "Smalltalk/X\0"
       VALUE "ProductVersion", "6.2.3.0\0"
-      VALUE "ProductDate", "Fri, 20 Sep 2013 10:33:34 GMT\0"
+      VALUE "ProductDate", "Sat, 05 Oct 2013 11:49:02 GMT\0"
     END
 
   END