ProjectProblem.st
changeset 3449 f56d3fc6a39d
parent 3431 731fc5928190
child 3488 9a9a7d10aff1
equal deleted inserted replaced
3448:d29b78ce59ee 3449:f56d3fc6a39d
    30 	classVariableNames:''
    30 	classVariableNames:''
    31 	poolDictionaries:''
    31 	poolDictionaries:''
    32 	privateIn:ProjectProblem
    32 	privateIn:ProjectProblem
    33 !
    33 !
    34 
    34 
       
    35 ProjectProblem::InconsistentProjectDefinition subclass:#ClassListedBeforeItsPool
       
    36 	instanceVariableNames:'poolName'
       
    37 	classVariableNames:''
       
    38 	poolDictionaries:''
       
    39 	privateIn:ProjectProblem
       
    40 !
       
    41 
       
    42 ProjectProblem::InconsistentProjectDefinition subclass:#ClassListedBeforeItsSuperclass
       
    43 	instanceVariableNames:'superClassName'
       
    44 	classVariableNames:''
       
    45 	poolDictionaries:''
       
    46 	privateIn:ProjectProblem
       
    47 !
       
    48 
    35 ProjectProblem::InconsistentProjectDefinition subclass:#ClassListedButDoesNotExist
    49 ProjectProblem::InconsistentProjectDefinition subclass:#ClassListedButDoesNotExist
    36 	instanceVariableNames:''
    50 	instanceVariableNames:''
    37 	classVariableNames:''
    51 	classVariableNames:''
    38 	poolDictionaries:''
    52 	poolDictionaries:''
    39 	privateIn:ProjectProblem
    53 	privateIn:ProjectProblem
    51 	classVariableNames:''
    65 	classVariableNames:''
    52 	poolDictionaries:''
    66 	poolDictionaries:''
    53 	privateIn:ProjectProblem
    67 	privateIn:ProjectProblem
    54 !
    68 !
    55 
    69 
    56 ProjectProblem::InconsistentProjectDefinition subclass:#ClassListedBeforeItsPool
    70 ProjectProblem::InconsistentProjectDefinition subclass:#ClassIsCompiledButSuperclassIsAutoloaded
    57 	instanceVariableNames:'poolName'
    71 	instanceVariableNames:''
    58 	classVariableNames:''
    72 	classVariableNames:''
    59 	poolDictionaries:''
    73 	poolDictionaries:''
    60 	privateIn:ProjectProblem
    74 	privateIn:ProjectProblem
    61 !
    75 !
    62 
    76 
   114 	classVariableNames:''
   128 	classVariableNames:''
   115 	poolDictionaries:''
   129 	poolDictionaries:''
   116 	privateIn:ProjectProblem
   130 	privateIn:ProjectProblem
   117 !
   131 !
   118 
   132 
   119 ProjectProblem::InconsistentProjectDefinition subclass:#ClassListedBeforeItsSuperclass
   133 ProjectProblem::InconsistentProjectDefinition subclass:#ClassIsCompiledButSuperclassProjectDefinitionIsMissing
   120 	instanceVariableNames:'superClassName'
   134 	instanceVariableNames:''
   121 	classVariableNames:''
   135 	classVariableNames:''
   122 	poolDictionaries:''
   136 	poolDictionaries:''
   123 	privateIn:ProjectProblem
   137 	privateIn:ProjectProblem
   124 !
   138 !
   125 
   139 
   206         ProjectChecker ProjectDefinition
   220         ProjectChecker ProjectDefinition
   207 "
   221 "
   208 ! !
   222 ! !
   209 
   223 
   210 !ProjectProblem class methodsFor:'instance creation'!
   224 !ProjectProblem class methodsFor:'instance creation'!
       
   225 
       
   226 newClassIsCompiledButSuperclassIsAutoloaded
       
   227 
       
   228     ^ClassIsCompiledButSuperclassIsAutoloaded new
       
   229 
       
   230     "Created: / 20-09-2013 / 11:18:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   231 !
       
   232 
       
   233 newClassIsCompiledButSuperclassProjectDefinitionIsMissing
       
   234 
       
   235     ^ClassIsCompiledButSuperclassProjectDefinitionIsMissing new
       
   236 
       
   237     "Created: / 05-10-2013 / 12:43:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   238 !
   211 
   239 
   212 newClassListedBeforeItsPool
   240 newClassListedBeforeItsPool
   213 
   241 
   214     ^ClassListedBeforeItsPool new
   242     ^ClassListedBeforeItsPool new
   215 
   243 
   577 
   605 
   578     ^Array
   606     ^Array
   579         with: (Array with: 'Full update of the project definitions (rescan)' with: [ self doUpdateAllProjectDefinitions ])
   607         with: (Array with: 'Full update of the project definitions (rescan)' with: [ self doUpdateAllProjectDefinitions ])
   580 ! !
   608 ! !
   581 
   609 
       
   610 !ProjectProblem::ClassListedBeforeItsPool methodsFor:'accessing'!
       
   611 
       
   612 poolName
       
   613     ^ poolName
       
   614 !
       
   615 
       
   616 poolName:something
       
   617     poolName := something.
       
   618 ! !
       
   619 
       
   620 !ProjectProblem::ClassListedBeforeItsPool methodsFor:'accessing-description'!
       
   621 
       
   622 description
       
   623     "Return a (HTML) describing the problem."
       
   624 
       
   625     ^
       
   626 'Class %2 is listed in project definition (%1) before one of its pools (%3).
       
   627 <br>Such class will fail to compile (if the package is being stc-compiled)
       
   628 and load (if the package is being loaded from source).
       
   629 <br>Make sure class (%3) is listed before (%2).
       
   630 
       
   631 '
       
   632 bindWith: (self linkToClass: self packageDefinitionClass class selector: #classNamesAndAttributes omitClassName: true)
       
   633     with: (self linkToClass: className)
       
   634     with: (self linkToClass: poolName)
       
   635 
       
   636     "Modified: / 13-09-2012 / 18:29:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   637 !
       
   638 
       
   639 label
       
   640     "Return the label (possibly instance if a Text) shortly describing the problem"
       
   641 
       
   642     ^'Class %1 listed in project definition "%2" before one of its pools' bindWith: className allBold with:self packageDefinitionClass
       
   643 
       
   644     "Modified: / 13-09-2012 / 17:36:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   645 ! !
       
   646 
       
   647 !ProjectProblem::ClassListedBeforeItsSuperclass methodsFor:'accessing'!
       
   648 
       
   649 superClassName
       
   650     ^ superClassName
       
   651 !
       
   652 
       
   653 superClassName:something
       
   654     superClassName := something.
       
   655 ! !
       
   656 
       
   657 !ProjectProblem::ClassListedBeforeItsSuperclass methodsFor:'accessing-description'!
       
   658 
       
   659 description
       
   660     "Return a (HTML) describing the problem."
       
   661 
       
   662     ^
       
   663 'Class %2 is listed in project definition (%1) before its superclass %3.
       
   664 <br>The package can be stc-compiled 
       
   665 (because the generated makefile compiles in correct order)
       
   666 but the class may fail to load from source.
       
   667 <br>Make sure %3 is listed before %2.
       
   668 
       
   669 '
       
   670 bindWith: (self linkToClass: self packageDefinitionClass class selector: #classNamesAndAttributes omitClassName: true)
       
   671     with: (self linkToClass: className)
       
   672     with: (self linkToClass: superClassName)
       
   673 
       
   674     "Modified: / 13-09-2012 / 18:29:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   675 !
       
   676 
       
   677 label
       
   678     "Return the label (possibly instance if a Text) shortly describing the problem"
       
   679 
       
   680     ^'Class %1 listed in project definition "%2" before its superclass' bindWith: className allBold with:self packageDefinitionClass 
       
   681 
       
   682     "Modified: / 13-09-2012 / 17:36:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   683 ! !
       
   684 
   582 !ProjectProblem::ClassListedButDoesNotExist methodsFor:'accessing'!
   685 !ProjectProblem::ClassListedButDoesNotExist methodsFor:'accessing'!
   583 
   686 
   584 severity
   687 severity
   585     "Return a severity - one of #error, #warning, #info"
   688     "Return a severity - one of #error, #warning, #info"
   586 
   689 
   703         with: (Array with: 'Full update of the project definitions (rescan)' with: [ self doUpdateAllProjectDefinitions ])
   806         with: (Array with: 'Full update of the project definitions (rescan)' with: [ self doUpdateAllProjectDefinitions ])
   704 
   807 
   705     "Created: / 26-07-2012 / 10:41:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   808     "Created: / 26-07-2012 / 10:41:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   706 ! !
   809 ! !
   707 
   810 
   708 !ProjectProblem::ClassListedBeforeItsPool methodsFor:'accessing'!
   811 !ProjectProblem::ClassIsCompiledButSuperclassIsAutoloaded methodsFor:'accessing'!
   709 
       
   710 poolName
       
   711     ^ poolName
       
   712 !
       
   713 
       
   714 poolName:something
       
   715     poolName := something.
       
   716 ! !
       
   717 
       
   718 !ProjectProblem::ClassListedBeforeItsPool methodsFor:'accessing-description'!
       
   719 
   812 
   720 description
   813 description
   721     "Return a (HTML) describing the problem."
   814     "Return a (HTML) describing the problem."
   722 
   815 
   723     ^
   816     ^
   724 'Class %2 is listed in project definition (%1) before one of its pools (%3).
   817 'Class %1 is compiled (i.e., not autoloaded) but its superclass %1 is
   725 <br>Such class will fail to compile (if the package is being stc-compiled)
   818 is autoloaded. Such class won''t compile because of missing superclass .H/.STH file.
   726 and load (if the package is being loaded from source).
   819 To fix it, either make %1 autoloaded ot make %2 compiled.'
   727 <br>Make sure class (%3) is listed before (%2).
   820 bindWith: (self linkToClass: className)
   728 
   821     with: (self linkToClass: (Smalltalk at: className) superclass name)
   729 '
   822 
   730 bindWith: (self linkToClass: self packageDefinitionClass class selector: #classNamesAndAttributes omitClassName: true)
   823     "Modified: / 20-09-2013 / 11:04:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   731     with: (self linkToClass: className)
       
   732     with: (self linkToClass: poolName)
       
   733 
       
   734     "Modified: / 13-09-2012 / 18:29:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   735 !
   824 !
   736 
   825 
   737 label
   826 label
   738     "Return the label (possibly instance if a Text) shortly describing the problem"
   827     "Return the label (possibly instance if a Text) shortly describing the problem"
   739 
   828 
   740     ^'Class %1 listed in project definition "%2" before one of its pools' bindWith: className allBold with:self packageDefinitionClass
   829     ^ 'Class ', className , ' is compiled but its superclass is autoloaded'
   741 
   830 
   742     "Modified: / 13-09-2012 / 17:36:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   831     "Modified: / 20-09-2013 / 11:00:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   832 ! !
       
   833 
       
   834 !ProjectProblem::ClassIsCompiledButSuperclassIsAutoloaded methodsFor:'fixing'!
       
   835 
       
   836 doIncludeInProjectAsAutoloaded
       
   837     "Include subject class in project definition. Return false if
       
   838      fix fails, true otherwise"
       
   839 
       
   840     ^ self doIncludeInProjectAsAutoloaded:true
       
   841 !
       
   842 
       
   843 doIncludeInProjectAsAutoloaded:asAutoloaded
       
   844     "Include subject class in project definition. Return false if
       
   845      fix fails, true otherwise"
       
   846 
       
   847     | def cls |
       
   848 
       
   849     def := self packageDefinitionClass.
       
   850     def isNil ifTrue:[ ^ false ].
       
   851     cls := self klass.
       
   852     cls isNil ifTrue:[ ^ false ].
       
   853     asAutoloaded ifTrue:[
       
   854         def makeClassesAutoloaded:(Array with: cls) usingCompiler: nil.
       
   855     ] ifFalse:[
       
   856         def includeClasses:(Array with: cls) usingCompiler: nil.
       
   857     ].
       
   858     UserNotification notify: ('Class added. Do not forget to check in build support files!!' bindWith: className).
       
   859     ^true
       
   860 
       
   861     "Created: / 26-07-2012 / 10:41:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   862 !
       
   863 
       
   864 fixes
       
   865 
       
   866     ^Array
       
   867         with: (Array with: 'Add class ', className , ' to project as autoloaded' with: [ self doIncludeInProjectAsAutoloaded ])
       
   868 
       
   869     "Created: / 26-07-2012 / 10:41:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   870     "Modified: / 20-09-2013 / 11:06:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   743 ! !
   871 ! !
   744 
   872 
   745 !ProjectProblem::ClassUsesPoolProblem methodsFor:'accessing'!
   873 !ProjectProblem::ClassUsesPoolProblem methodsFor:'accessing'!
   746 
   874 
   747 poolName
   875 poolName
  1076         with: (Array with: 'Remove from the extensionMethodNames list' with: [ self doRemoveNamedMethodFromExtensionsList ])    
  1204         with: (Array with: 'Remove from the extensionMethodNames list' with: [ self doRemoveNamedMethodFromExtensionsList ])    
  1077 
  1205 
  1078     "Created: / 26-07-2012 / 10:41:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1206     "Created: / 26-07-2012 / 10:41:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1079 ! !
  1207 ! !
  1080 
  1208 
  1081 !ProjectProblem::ClassListedBeforeItsSuperclass methodsFor:'accessing'!
  1209 !ProjectProblem::ClassIsCompiledButSuperclassProjectDefinitionIsMissing methodsFor:'accessing'!
  1082 
       
  1083 superClassName
       
  1084     ^ superClassName
       
  1085 !
       
  1086 
       
  1087 superClassName:something
       
  1088     superClassName := something.
       
  1089 ! !
       
  1090 
       
  1091 !ProjectProblem::ClassListedBeforeItsSuperclass methodsFor:'accessing-description'!
       
  1092 
  1210 
  1093 description
  1211 description
  1094     "Return a (HTML) describing the problem."
  1212     "Return a (HTML) describing the problem."
  1095 
  1213 
  1096     ^
  1214     ^
  1097 'Class %2 is listed in project definition (%1) before its superclass %3.
  1215 'Class %1 is compiled (i.e., not autoloaded) but its superclass''s package 
  1098 <br>The package can be stc-compiled 
  1216 definition is missing. Such class won''t compile because superclass''s package
  1099 (because the generated makefile compiles in correct order)
  1217 will be likely missing.'
  1100 but the class may fail to load from source.
  1218 bindWith: (self linkToClass: className)
  1101 <br>Make sure %3 is listed before %2.
  1219     with: (self linkToClass: (Smalltalk at: className) superclass name)
  1102 
  1220 
  1103 '
  1221     "Modified: / 05-10-2013 / 12:43:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1104 bindWith: (self linkToClass: self packageDefinitionClass class selector: #classNamesAndAttributes omitClassName: true)
       
  1105     with: (self linkToClass: className)
       
  1106     with: (self linkToClass: superClassName)
       
  1107 
       
  1108     "Modified: / 13-09-2012 / 18:29:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
  1109 !
  1222 !
  1110 
  1223 
  1111 label
  1224 label
  1112     "Return the label (possibly instance if a Text) shortly describing the problem"
  1225     "Return the label (possibly instance if a Text) shortly describing the problem"
  1113 
  1226 
  1114     ^'Class %1 listed in project definition "%2" before its superclass' bindWith: className allBold with:self packageDefinitionClass 
  1227     ^ 'Class ', className , ' is compiled but its superclass''s package definition is missing'
  1115 
  1228 
  1116     "Modified: / 13-09-2012 / 17:36:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1229     "Modified: / 05-10-2013 / 12:41:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1117 ! !
  1230 ! !
  1118 
  1231 
  1119 !ProjectProblem::MethodCompilabilityIssue methodsFor:'accessing'!
  1232 !ProjectProblem::MethodCompilabilityIssue methodsFor:'accessing'!
  1120 
  1233 
  1121 severity
  1234 severity
  1373 ! !
  1486 ! !
  1374 
  1487 
  1375 !ProjectProblem::MethodInNoPackage methodsFor:'accessing-description'!
  1488 !ProjectProblem::MethodInNoPackage methodsFor:'accessing-description'!
  1376 
  1489 
  1377 alreadyFixed
  1490 alreadyFixed
  1378     ^ (self method package ~= PackageId noProjectID)        
  1491     | m |
       
  1492 
       
  1493     "/ One may "fix" the problem by actually removing the method. 
       
  1494     "/ In this case, consired problem as "fixed".
       
  1495     m :=  self method.
       
  1496     ^ m isNil or:[self method package ~= PackageId noProjectID]
       
  1497 
       
  1498     "Modified (format): / 19-12-2013 / 15:38:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1379 !
  1499 !
  1380 
  1500 
  1381 description
  1501 description
  1382     "Return a (HTML) describing the problem."
  1502     "Return a (HTML) describing the problem."
  1383 
  1503 
  1583 ! !
  1703 ! !
  1584 
  1704 
  1585 !ProjectProblem class methodsFor:'documentation'!
  1705 !ProjectProblem class methodsFor:'documentation'!
  1586 
  1706 
  1587 version
  1707 version
  1588     ^ '$Header: /cvs/stx/stx/libbasic3/ProjectProblem.st,v 1.26 2014-01-13 13:12:55 cg Exp $'
  1708     ^ '$Header: /cvs/stx/stx/libbasic3/ProjectProblem.st,v 1.27 2014-02-05 17:52:02 cg Exp $'
  1589 !
  1709 !
  1590 
  1710 
  1591 version_CVS
  1711 version_CVS
  1592     ^ '$Header: /cvs/stx/stx/libbasic3/ProjectProblem.st,v 1.26 2014-01-13 13:12:55 cg Exp $'
  1712     ^ '$Header: /cvs/stx/stx/libbasic3/ProjectProblem.st,v 1.27 2014-02-05 17:52:02 cg Exp $'
  1593 !
  1713 !
  1594 
  1714 
  1595 version_SVN
  1715 version_SVN
  1596     ^ '$Id: ProjectProblem.st,v 1.26 2014-01-13 13:12:55 cg Exp $'
  1716     ^ '$Id: ProjectProblem.st,v 1.27 2014-02-05 17:52:02 cg Exp $'
  1597 ! !
  1717 ! !
  1598 
  1718