ProjectChecker.st
author Claus Gittinger <cg@exept.de>
Sat, 30 Mar 2013 17:01:17 +0100
changeset 3167 56a8d17b6987
parent 3161 3f9f36f40778
child 3208 e8bdf898d7ac
child 3233 b80cfaa73cb4
permissions -rw-r--r--
class: ProjectChecker changed: #checkExtensionsListConsistency
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2797
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
     1
"
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
     2
 COPYRIGHT (c) 2006 by eXept Software AG
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
     3
              All Rights Reserved
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
     4
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
     5
 This software is furnished under a license and may be used
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
     6
 only in accordance with the terms of that license and with the
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
     8
 be provided or otherwise made available to, or used by, any
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
     9
 other person.  No title to or ownership of the software is
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
    10
 hereby transferred.
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
    11
"
2707
68860a7700c2 initial checkin
vrany
parents:
diff changeset
    12
"{ Package: 'stx:libbasic3' }"
68860a7700c2 initial checkin
vrany
parents:
diff changeset
    13
68860a7700c2 initial checkin
vrany
parents:
diff changeset
    14
Object subclass:#ProjectChecker
3148
2a6c8e1b5f69 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3116
diff changeset
    15
	instanceVariableNames:'package packageDef classes methods problems phase
2a6c8e1b5f69 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3116
diff changeset
    16
		checkExtensionsOnly'
2967
c5f1d6853ad1 changed: #checkClassListConsistency (class order)
vrany
parents: 2966
diff changeset
    17
	classVariableNames:''
c5f1d6853ad1 changed: #checkClassListConsistency (class order)
vrany
parents: 2966
diff changeset
    18
	poolDictionaries:''
c5f1d6853ad1 changed: #checkClassListConsistency (class order)
vrany
parents: 2966
diff changeset
    19
	category:'System-Support-Projects'
2707
68860a7700c2 initial checkin
vrany
parents:
diff changeset
    20
!
68860a7700c2 initial checkin
vrany
parents:
diff changeset
    21
2797
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
    22
!ProjectChecker class methodsFor:'documentation'!
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
    23
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
    24
copyright
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
    25
"
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
    26
 COPYRIGHT (c) 2006 by eXept Software AG
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
    27
              All Rights Reserved
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
    28
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
    29
 This software is furnished under a license and may be used
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
    30
 only in accordance with the terms of that license and with the
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
    31
 inclusion of the above copyright notice.   This software may not
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
    32
 be provided or otherwise made available to, or used by, any
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
    33
 other person.  No title to or ownership of the software is
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
    34
 hereby transferred.
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
    35
"
2707
68860a7700c2 initial checkin
vrany
parents:
diff changeset
    36
!
68860a7700c2 initial checkin
vrany
parents:
diff changeset
    37
68860a7700c2 initial checkin
vrany
parents:
diff changeset
    38
documentation
68860a7700c2 initial checkin
vrany
parents:
diff changeset
    39
"
68860a7700c2 initial checkin
vrany
parents:
diff changeset
    40
    A simple project checker that can search whole projects or individual
2853
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
    41
    classes or methods for various problems that may cause build problems such
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
    42
    as:
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
    43
        - inconsistent/messed up project definition class
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
    44
        - method code problems
2707
68860a7700c2 initial checkin
vrany
parents:
diff changeset
    45
68860a7700c2 initial checkin
vrany
parents:
diff changeset
    46
    NOTE: Not yet finished. This code is meant as a single central entry for all the
68860a7700c2 initial checkin
vrany
parents:
diff changeset
    47
    source code management tools like SCM Utilities, NewSystemBrowser ets. That code
2797
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
    48
    will be refactored later once this tool prooves itself useful and mature enough.
2707
68860a7700c2 initial checkin
vrany
parents:
diff changeset
    49
68860a7700c2 initial checkin
vrany
parents:
diff changeset
    50
    [author:]
68860a7700c2 initial checkin
vrany
parents:
diff changeset
    51
        Jan Vrany <jan.vrany@fit.cvut.cz>
68860a7700c2 initial checkin
vrany
parents:
diff changeset
    52
68860a7700c2 initial checkin
vrany
parents:
diff changeset
    53
    [instance variables:]
68860a7700c2 initial checkin
vrany
parents:
diff changeset
    54
68860a7700c2 initial checkin
vrany
parents:
diff changeset
    55
    [class variables:]
68860a7700c2 initial checkin
vrany
parents:
diff changeset
    56
68860a7700c2 initial checkin
vrany
parents:
diff changeset
    57
    [see also:]
2853
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
    58
        Tools::ProjectCheckerBrowser
2707
68860a7700c2 initial checkin
vrany
parents:
diff changeset
    59
68860a7700c2 initial checkin
vrany
parents:
diff changeset
    60
"
68860a7700c2 initial checkin
vrany
parents:
diff changeset
    61
!
68860a7700c2 initial checkin
vrany
parents:
diff changeset
    62
68860a7700c2 initial checkin
vrany
parents:
diff changeset
    63
examples
68860a7700c2 initial checkin
vrany
parents:
diff changeset
    64
68860a7700c2 initial checkin
vrany
parents:
diff changeset
    65
    "
68860a7700c2 initial checkin
vrany
parents:
diff changeset
    66
        ProjectChecker check: 'stx:libbasic'
2797
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
    67
        ProjectChecker check: 'stx:libtool'
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
    68
        ProjectChecker check: 'stx:libbasic3'
2707
68860a7700c2 initial checkin
vrany
parents:
diff changeset
    69
    "
68860a7700c2 initial checkin
vrany
parents:
diff changeset
    70
! !
68860a7700c2 initial checkin
vrany
parents:
diff changeset
    71
2853
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
    72
!ProjectChecker class methodsFor:'instance creation'!
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
    73
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
    74
forPackage: packageId
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
    75
    ^self new
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
    76
        package: packageId;
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
    77
        yourself.
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
    78
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
    79
    "Created: / 25-07-2012 / 18:00:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2910
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
    80
!
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
    81
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
    82
new
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
    83
    "return an initialized instance"
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
    84
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
    85
    ^ self basicNew initialize.
2853
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
    86
! !
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
    87
2707
68860a7700c2 initial checkin
vrany
parents:
diff changeset
    88
!ProjectChecker class methodsFor:'checking'!
68860a7700c2 initial checkin
vrany
parents:
diff changeset
    89
68860a7700c2 initial checkin
vrany
parents:
diff changeset
    90
check: package
68860a7700c2 initial checkin
vrany
parents:
diff changeset
    91
68860a7700c2 initial checkin
vrany
parents:
diff changeset
    92
    ^self new check: package
68860a7700c2 initial checkin
vrany
parents:
diff changeset
    93
68860a7700c2 initial checkin
vrany
parents:
diff changeset
    94
    "Created: / 11-01-2012 / 16:46:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
68860a7700c2 initial checkin
vrany
parents:
diff changeset
    95
! !
68860a7700c2 initial checkin
vrany
parents:
diff changeset
    96
68860a7700c2 initial checkin
vrany
parents:
diff changeset
    97
!ProjectChecker methodsFor:'accessing'!
68860a7700c2 initial checkin
vrany
parents:
diff changeset
    98
3148
2a6c8e1b5f69 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3116
diff changeset
    99
checkExtensionsOnly:aBoolean
2a6c8e1b5f69 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3116
diff changeset
   100
    checkExtensionsOnly := aBoolean.
2a6c8e1b5f69 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3116
diff changeset
   101
!
2a6c8e1b5f69 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3116
diff changeset
   102
2797
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   103
classes: aCollection
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   104
    classes := aCollection.
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   105
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   106
    "Created: / 13-02-2012 / 17:06:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   107
!
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   108
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   109
methods
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   110
    ^ methods
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   111
!
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   112
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   113
methods:something
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   114
    methods := something.
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   115
!
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   116
2707
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   117
package
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   118
    ^ package
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   119
!
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   120
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   121
package:packageId
2853
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   122
    package := packageId asSymbol.
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   123
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   124
    "Modified: / 11-04-2012 / 16:00:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2797
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   125
!
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   126
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   127
problems
2853
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   128
    ^ problems
2797
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   129
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   130
    "Modified: / 23-02-2012 / 15:14:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2707
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   131
! !
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   132
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   133
!ProjectChecker methodsFor:'checking'!
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   134
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   135
check
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   136
2910
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   137
    problems removeAll.
2797
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   138
    packageDef := ProjectDefinition definitionClassForPackage: package.
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   139
    packageDef isNil ifTrue:[
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   140
        self addProblem: 
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   141
            (ProjectProblem newProjectDefinitionDoesNotExist package: package).
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   142
        ^self    
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   143
    ].
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   144
3148
2a6c8e1b5f69 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3116
diff changeset
   145
    ActivityNotification raiseRequestWith:self errorString:'Checking package...'.
2a6c8e1b5f69 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3116
diff changeset
   146
    self checkPackage.
2a6c8e1b5f69 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3116
diff changeset
   147
    (checkExtensionsOnly ? false) ifFalse:[
2a6c8e1b5f69 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3116
diff changeset
   148
        ActivityNotification raiseRequestWith:self errorString:'Checking classes...'.
2a6c8e1b5f69 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3116
diff changeset
   149
        self checkClasses.
2a6c8e1b5f69 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3116
diff changeset
   150
    ].
2a6c8e1b5f69 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3116
diff changeset
   151
    ActivityNotification raiseRequestWith:self errorString:'Checking methods...'.
2a6c8e1b5f69 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3116
diff changeset
   152
    self checkMethods.
2707
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   153
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   154
    "Created: / 11-01-2012 / 16:47:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   155
!
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   156
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   157
check: package
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   158
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   159
    self package: package.
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   160
    self check.
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   161
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   162
    "Created: / 11-01-2012 / 16:47:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   163
! !
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   164
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   165
!ProjectChecker methodsFor:'checks-individual'!
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   166
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   167
checkClassListConsistency
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   168
    "Checks whether all classes listed in #classNamesAndAttributes are present
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   169
    and if all present classes are listed"
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   170
2910
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   171
    |classesInImage classesInDescription classesInDescriptionChecked onlyInDescription|
2707
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   172
    "WARNING: Copy/paste of ProjectDefinition>>validateDescription"
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   173
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   174
    classesInImage := Smalltalk allClasses select:[:cls | (cls package = self package) and:[cls isPrivate not]].
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   175
    "/ classesInDescription := self classes asIdentitySet.
2910
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   176
    classesInDescription := OrderedCollection new.
2967
c5f1d6853ad1 changed: #checkClassListConsistency (class order)
vrany
parents: 2966
diff changeset
   177
    ( (packageDef compiled_classNames_common)
c5f1d6853ad1 changed: #checkClassListConsistency (class order)
vrany
parents: 2966
diff changeset
   178
    , (packageDef compiled_classNamesForPlatform:(OperatingSystem platformName))
2707
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   179
    , (packageDef autoloaded_classNames)) do:[:nm |
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   180
        |cls|
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   181
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   182
        cls := Smalltalk at:nm asSymbol.
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   183
        cls isNil ifTrue:[
2797
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   184
            self addProblem: 
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   185
                (ProjectProblem newClassListedButDoesNotExist className: nm)
2707
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   186
        ] ifFalse:[
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   187
            classesInDescription add:cls.
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   188
        ].
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   189
    ].
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   190
2910
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   191
    classesInDescriptionChecked := OrderedCollection new.
2707
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   192
    classesInDescription do:[:eachClass |
2910
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   193
        (classesInDescriptionChecked includes: eachClass) ifTrue:[
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   194
                    self addProblem: 
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   195
                        (ProjectProblem newClassListedMultipleTimes
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   196
                            className: eachClass name)
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   197
        ].
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   198
2707
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   199
        eachClass sharedPoolNames do:[:eachPoolName |
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   200
            |pool|
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   201
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   202
            pool := eachClass nameSpace classNamed:eachPoolName.
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   203
            pool isNil ifTrue:[
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   204
                eachClass nameSpace ~~ Smalltalk ifTrue:[
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   205
                    pool := Smalltalk classNamed:eachPoolName.
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   206
                ]
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   207
            ].
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   208
            pool isNil ifTrue:[
2797
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   209
                self addProblem: 
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   210
                    (ProjectProblem newClassUsesPoolButItDoesNotExist
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   211
                        className: eachClass name;
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   212
                        poolName: eachPoolName).
2707
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   213
            ] ifFalse:[
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   214
                pool isSharedPool ifFalse:[
2797
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   215
                    self addProblem: 
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   216
                        (ProjectProblem newClassUsesPoolButItIsNotASharedPool
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   217
                            className: eachClass name;
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   218
                            poolName: eachPoolName).                
2707
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   219
                ].
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   220
            ].
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   221
        ].
2910
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   222
2966
bf5ea36104cd Fix in #checkClassListConsistency - care about classes with nil superclass (Autoload/Object)
vrany
parents: 2965
diff changeset
   223
        (eachClass superclass notNil "/Care about classes with nil superclass - Object & Autoload
bf5ea36104cd Fix in #checkClassListConsistency - care about classes with nil superclass (Autoload/Object)
vrany
parents: 2965
diff changeset
   224
            and:[eachClass superclass package == eachClass package]) ifTrue:[
2910
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   225
            (classesInDescriptionChecked includes: eachClass superclass) ifFalse:[
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   226
                self addProblem:
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   227
                    (ProjectProblem newClassListedBeforeItsSuperclass
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   228
                        className: eachClass name;
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   229
                        superClassName: eachClass superclass name)
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   230
            ].
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   231
        ].
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   232
        eachClass sharedPools do:[:eachPool|
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   233
            eachPool package == eachClass package ifTrue:[
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   234
                (classesInDescriptionChecked includes: eachPool) ifFalse:[
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   235
                    self addProblem:
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   236
                        (ProjectProblem newClassListedBeforeItsPool
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   237
                            className: eachClass name;
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   238
                            poolName: eachPool name)
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   239
                ].
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   240
            ].
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   241
        ].
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   242
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   243
        classesInDescriptionChecked add: eachClass.
2707
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   244
    ].
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   245
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   246
    classesInImage ~= classesInDescription ifTrue:[
2856
a1cee28488c0 changed: #checkClassListConsistency - do not warn about not-listed classes twice
vrany
parents: 2853
diff changeset
   247
        "This is done later in checkClassesListedInProjectDefinition:"
a1cee28488c0 changed: #checkClassListConsistency - do not warn about not-listed classes twice
vrany
parents: 2853
diff changeset
   248
"/        onlyInImage := (classesInImage reject:[:cls | classesInDescription includes:cls]).
a1cee28488c0 changed: #checkClassListConsistency - do not warn about not-listed classes twice
vrany
parents: 2853
diff changeset
   249
"/        onlyInImage do:[:cls|
a1cee28488c0 changed: #checkClassListConsistency - do not warn about not-listed classes twice
vrany
parents: 2853
diff changeset
   250
"/            self addProblem: 
a1cee28488c0 changed: #checkClassListConsistency - do not warn about not-listed classes twice
vrany
parents: 2853
diff changeset
   251
"/                (ProjectProblem newClassNotListed className: cls name).
a1cee28488c0 changed: #checkClassListConsistency - do not warn about not-listed classes twice
vrany
parents: 2853
diff changeset
   252
"/        ].
2707
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   253
        onlyInDescription := (classesInDescription reject:[:cls | classesInImage includes:cls]).
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   254
        onlyInDescription do:[:cls|
2797
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   255
            self addProblem: 
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   256
                (ProjectProblem newClassListedButDoesNotExist className: cls name)
2707
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   257
        ].
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   258
    ].
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   259
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   260
    "Created: / 11-01-2012 / 17:14:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2967
c5f1d6853ad1 changed: #checkClassListConsistency (class order)
vrany
parents: 2966
diff changeset
   261
    "Modified: / 31-10-2012 / 17:40:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2718
vrany
parents: 2716
diff changeset
   262
!
vrany
parents: 2716
diff changeset
   263
2910
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   264
checkClassesForMethodsInNoProject:classesToCheck 
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   265
    | checker |
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   266
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   267
    checker := [:cls | 
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   268
        cls 
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   269
            selectorsAndMethodsDo:[:sel :mth | 
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   270
                (mth package isNil or:[ mth package == PackageId noProjectID ]) ifTrue:[
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   271
                    "Sigh, special hack for Expecco"
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   272
                    ((cls name = 'Expecco::AbstractApplication class' and:[ sel = 'flags' ]) or:[
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   273
                     (cls name = 'Expecco::Browser class' and:[ sel = 'flags' ])]) ifFalse:[
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   274
                        self addProblem:(ProjectProblem newMethodInNoPackage className:cls name
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   275
                                    selector:sel).
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   276
                    ]
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   277
                ]
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   278
            ]
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   279
    ].
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   280
    classesToCheck do:[:class | 
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   281
        checker value:class theMetaclass.
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   282
        checker value:class theNonMetaclass.
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   283
    ]
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   284
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   285
    "Created: / 13-02-2012 / 18:18:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   286
!
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   287
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   288
checkClassesForNonQualifiedSharedPools: classesToCheck 
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   289
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   290
    classesToCheck do:[:cls|
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   291
        cls sharedPoolNames do:[:poolName|
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   292
            (Smalltalk at: poolName asSymbol) isNil ifTrue:[
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   293
                | ns |
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   294
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   295
                ns := cls nameSpace.
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   296
                (ns ~~ Smalltalk and:[(ns at: poolName asSymbol) notNil]) ifTrue:[
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   297
                    self addProblem:
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   298
                        (ProjectProblem newClassUsesPoolButItIsNotASharedPool
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   299
                                className: cls name;
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   300
                                poolName: poolName)
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   301
                ]
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   302
            ]
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   303
        ]
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   304
    ].
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   305
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   306
    "Created: / 13-09-2012 / 16:34:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   307
!
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   308
2797
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   309
checkClassesListedInProjectDefinition: classesToCheck
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   310
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   311
    | classNamesListed |
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   312
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   313
    classNamesListed := packageDef classNames.
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   314
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   315
    classesToCheck do:[:class|
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   316
        (class isPrivate not and:[(classNamesListed includes: class name) not]) ifTrue:[
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   317
            self addProblem: 
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   318
                (ProjectProblem newClassNotListed className: class name).
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   319
        ]
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   320
    ].
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   321
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   322
    "Created: / 13-02-2012 / 18:18:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   323
!
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   324
2718
vrany
parents: 2716
diff changeset
   325
checkExtensionsListConsistency
vrany
parents: 2716
diff changeset
   326
    "Checks whether all extensions listed in #extensionMethodNames are present
vrany
parents: 2716
diff changeset
   327
    and if all extension methods are listed"
vrany
parents: 2716
diff changeset
   328
vrany
parents: 2716
diff changeset
   329
    | extensionsListed extensionsPresent |
vrany
parents: 2716
diff changeset
   330
vrany
parents: 2716
diff changeset
   331
    extensionsListed := OrderedCollection new.
vrany
parents: 2716
diff changeset
   332
    packageDef extensionMethodNames pairWiseDo:[:cls :sel|
vrany
parents: 2716
diff changeset
   333
        extensionsListed add: (Array with: cls with: sel)
vrany
parents: 2716
diff changeset
   334
    ].
vrany
parents: 2716
diff changeset
   335
    extensionsPresent := OrderedCollection new.
vrany
parents: 2716
diff changeset
   336
    packageDef searchForExtensions do:[:each|
2910
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   337
        "JV@2012-09-07: Do not take Java methods into an account, they
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   338
         should not be listed in extensionMethodNames.
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   339
         They are loaded lazily by JavaClassReader and if listed here,
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   340
         they would cause an error if the package is loaded from source.
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   341
         Sort of a HACK, indeed"
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   342
        each mclass isJavaClass ifFalse:[
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   343
            extensionsPresent add: (Array with: each mclass name with: each selector)
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   344
        ].
2718
vrany
parents: 2716
diff changeset
   345
    ].
vrany
parents: 2716
diff changeset
   346
vrany
parents: 2716
diff changeset
   347
    (extensionsListed \ extensionsPresent) do:[:clsAndSel|
3167
56a8d17b6987 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
   348
        |cls clsName selector|
56a8d17b6987 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
   349
56a8d17b6987 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
   350
        clsName := clsAndSel first.
56a8d17b6987 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
   351
        selector := clsAndSel second.
56a8d17b6987 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
   352
        (cls := Smalltalk classNamed: clsName) isNil ifTrue:[
56a8d17b6987 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
   353
            self addProblem: 
56a8d17b6987 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
   354
                (ProjectProblem newExtensionMethodsClassDoesNotExist
56a8d17b6987 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
   355
                    className: clsName selector: selector).                            
56a8d17b6987 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
   356
        ] ifFalse:[
56a8d17b6987 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
   357
            (cls compiledMethodAt:selector) isNil ifTrue:[
56a8d17b6987 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
   358
                self addProblem: 
56a8d17b6987 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
   359
                    (ProjectProblem newExtensionMethodListedButDoesNotExist
56a8d17b6987 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
   360
                        className: clsName selector: selector). 
56a8d17b6987 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
   361
            ] ifFalse:[
56a8d17b6987 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
   362
                self addProblem: 
56a8d17b6987 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
   363
                    (ProjectProblem newExtensionMethodListedButInDifferentPackage
56a8d17b6987 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
   364
                        className: clsName selector: selector). 
56a8d17b6987 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
   365
            ]
56a8d17b6987 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
   366
        ]
2718
vrany
parents: 2716
diff changeset
   367
    ].
vrany
parents: 2716
diff changeset
   368
vrany
parents: 2716
diff changeset
   369
    (extensionsPresent \ extensionsListed) do:[:clsAndSel|
2797
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   370
         self addProblem: 
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   371
            (ProjectProblem newExtensionMethodNotListed
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   372
                className: clsAndSel first selector: clsAndSel second).                            
2718
vrany
parents: 2716
diff changeset
   373
    ].
vrany
parents: 2716
diff changeset
   374
vrany
parents: 2716
diff changeset
   375
    "Created: / 12-01-2012 / 12:31:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
vrany
parents: 2716
diff changeset
   376
!
vrany
parents: 2716
diff changeset
   377
vrany
parents: 2716
diff changeset
   378
checkExtensionsPrerequisites
vrany
parents: 2716
diff changeset
   379
    "Checks whether packages of all extensions method classes are listed
vrany
parents: 2716
diff changeset
   380
     in package prerequisites"
vrany
parents: 2716
diff changeset
   381
3116
9ddba2316fec class: ProjectChecker
Stefan Vogel <sv@exept.de>
parents: 2976
diff changeset
   382
    |preRequisites|
9ddba2316fec class: ProjectChecker
Stefan Vogel <sv@exept.de>
parents: 2976
diff changeset
   383
9ddba2316fec class: ProjectChecker
Stefan Vogel <sv@exept.de>
parents: 2976
diff changeset
   384
    preRequisites := packageDef effectivePreRequisites.
2718
vrany
parents: 2716
diff changeset
   385
    packageDef searchForExtensions do:[:mthd|
3116
9ddba2316fec class: ProjectChecker
Stefan Vogel <sv@exept.de>
parents: 2976
diff changeset
   386
        (preRequisites includes: mthd mclass package) ifFalse:[
2797
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   387
"/            self problem: ('%3 required by extension method but not in prerequisites' bindWith: mthd mclass package)
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   388
"/                 description: ('An extension method %1>>%2 extends class in package %3 but the package is not listed in package''s prerequisited. This leads into missing methods and strange bugs when application is compiled and run!!' bindWith: mthd class with: mthd selector with: mthd class package)
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   389
"/                 severity: #error data: mthd
2718
vrany
parents: 2716
diff changeset
   390
         ].
vrany
parents: 2716
diff changeset
   391
    ]
vrany
parents: 2716
diff changeset
   392
vrany
parents: 2716
diff changeset
   393
    "Created: / 12-01-2012 / 12:41:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2797
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   394
!
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   395
2853
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   396
checkMethodCodingStyle: method
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   397
    "Checks for various coding style violations such as 'self halt' or
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   398
     improper indentation :-)"
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   399
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   400
    "To be implemented"
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   401
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   402
    "Created: / 11-04-2012 / 12:38:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   403
!
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   404
3161
3f9f36f40778 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3148
diff changeset
   405
checkMethodSTCCompilability1: method into: problemIssue
2853
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   406
    "Checks is the method can be compiled by STC based on Parser error/warnings"
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   407
3161
3f9f36f40778 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3148
diff changeset
   408
    | lang compiler |
3f9f36f40778 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3148
diff changeset
   409
2853
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   410
    lang := method programmingLanguage.
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   411
    lang isSmalltalk ifFalse:[ ^ self ].
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   412
3161
3f9f36f40778 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3148
diff changeset
   413
    compiler := lang compilerClass new.
3f9f36f40778 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3148
diff changeset
   414
    compiler
2853
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   415
        compile:method source
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   416
        forClass:method mclass
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   417
        inCategory:'others'
3161
3f9f36f40778 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3148
diff changeset
   418
        notifying:problemIssue
2853
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   419
        install:false
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   420
        skipIfSame:false
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   421
        silent:false
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   422
        foldConstants:true
3161
3f9f36f40778 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3148
diff changeset
   423
        ifFail:[ ].
3f9f36f40778 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3148
diff changeset
   424
3f9f36f40778 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3148
diff changeset
   425
    compiler usedGlobals do:[:nm | 
3f9f36f40778 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3148
diff changeset
   426
        (nm startsWith:Smalltalk undeclaredPrefix) ifTrue:[
3f9f36f40778 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3148
diff changeset
   427
            problemIssue 
3f9f36f40778 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3148
diff changeset
   428
                addWarning:'Contains unresolved reference to: ',(nm copyFrom:(Smalltalk undeclaredPrefix size + 1))
3f9f36f40778 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3148
diff changeset
   429
                from:0 to:0
3f9f36f40778 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3148
diff changeset
   430
        ]
3f9f36f40778 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3148
diff changeset
   431
    ].
2853
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   432
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   433
    "Created: / 11-04-2012 / 15:31:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   434
!
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   435
3161
3f9f36f40778 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3148
diff changeset
   436
checkMethodSTCCompilability2: method into: problemIssue
2853
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   437
    "Checks is the method can be compiled by STC based on selected lint rules"
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   438
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   439
    "Not yet implemented"
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   440
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   441
    "Created: / 11-04-2012 / 15:54:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   442
!
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   443
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   444
checkMethodSTCCompilability: method
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   445
    "Checks is the method can be compiled by STC (since STC won't compile
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   446
     everything bytecode compiler/jit compiler does, sigh"
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   447
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   448
    | issue |
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   449
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   450
    "No need to check the method if the class is autoloaded"
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   451
    (packageDef autoloaded_classNames includes: method mclass theNonMetaclass name) ifTrue:[
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   452
        ^ self
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   453
    ].
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   454
    
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   455
    issue := ProjectProblem newMethodCompilabilityIssue.
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   456
    issue method: method.
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   457
    self checkMethodSTCCompilability1: method into: issue.
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   458
    self checkMethodSTCCompilability2: method into: issue.
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   459
    issue hasIssue ifTrue:[
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   460
        self addProblem: issue
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   461
    ]
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   462
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   463
    "Created: / 11-04-2012 / 12:37:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   464
!
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   465
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   466
checkMethodSourceCode: method
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   467
    "Checks, whether method's source code is both
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   468
     available and parseable. Return true if the code
2966
bf5ea36104cd Fix in #checkClassListConsistency - care about classes with nil superclass (Autoload/Object)
vrany
parents: 2965
diff changeset
   469
     is syntactically correct, false otherwise"
2853
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   470
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   471
    | source |
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   472
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   473
    [    
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   474
        source := method source.
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   475
    ] on: Error do:[
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   476
        self addProblem:
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   477
            (ProjectProblem newMethodSourceNotAvailable method: method).
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   478
        ^false
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   479
    ].
2913
041df7e717bc changed: #checkMethodSourceCode:
vrany
parents: 2910
diff changeset
   480
    method programmingLanguage isSmalltalk ifFalse:[ ^ false ].
041df7e717bc changed: #checkMethodSourceCode:
vrany
parents: 2910
diff changeset
   481
2853
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   482
    [
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   483
        (Parser parseMethod: method source) == #Error ifTrue:[
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   484
            self addProblem:
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   485
                (ProjectProblem newMethodSourceCorrupted method: method).
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   486
            ^false.
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   487
        ]
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   488
    ] on: Error do:[
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   489
        self addProblem:
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   490
            (ProjectProblem newMethodSourceCorrupted method: method).
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   491
        ^false.
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   492
    ].
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   493
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   494
    ^true
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   495
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   496
    "Created: / 11-04-2012 / 12:29:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2707
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   497
! !
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   498
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   499
!ProjectChecker methodsFor:'checks-private'!
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   500
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   501
checkClasses
2976
16589df4f00d class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 2967
diff changeset
   502
    |myPackage|
2797
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   503
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   504
    classes notNil ifTrue:[
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   505
        self checkClasses: classes
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   506
    ] ifFalse:[
2976
16589df4f00d class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 2967
diff changeset
   507
        myPackage := self package.
16589df4f00d class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 2967
diff changeset
   508
        self checkClasses: (Smalltalk allClasses select:[:cls | (cls package = myPackage)]).
2797
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   509
    ].
2707
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   510
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   511
    "Created: / 11-01-2012 / 16:55:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   512
!
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   513
2797
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   514
checkClasses: classesToCheck
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   515
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   516
    self checkClassesListedInProjectDefinition: classesToCheck.
2910
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   517
    self checkClassesForMethodsInNoProject:classesToCheck.
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   518
    self checkClassesForNonQualifiedSharedPools:classesToCheck.
2797
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   519
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   520
    "Created: / 13-02-2012 / 18:18:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   521
!
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   522
2853
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   523
checkMethod: method
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   524
    (self checkMethodSourceCode: method) ifTrue:[
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   525
        "/OK, method's source is OK, perform further checks
3148
2a6c8e1b5f69 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3116
diff changeset
   526
        ActivityNotification raiseRequestWith:self errorString:'Checking stc compilability...'.
2853
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   527
        self checkMethodSTCCompilability: method.
3148
2a6c8e1b5f69 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3116
diff changeset
   528
        ActivityNotification raiseRequestWith:self errorString:'Checking coding style...'.
2853
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   529
        self checkMethodCodingStyle: method.
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   530
    ]
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   531
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   532
    "Created: / 11-04-2012 / 12:27:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   533
!
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   534
2707
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   535
checkMethods
2853
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   536
    methods notEmptyOrNil ifTrue:[
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   537
        self checkMethods: methods.
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   538
        ^self.
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   539
    ].
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   540
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   541
    self checkMethods:
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   542
        (Iterator on:[:whatToDo|
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   543
            (classes notNil ifTrue:[classes] ifFalse:[Smalltalk allClasses]) do:[:cls|
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   544
                cls theNonMetaclass withAllPrivateClassesDo:[:each |
3148
2a6c8e1b5f69 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3116
diff changeset
   545
                    each instAndClassSelectorsAndMethodsDo:[:s :m | 
2a6c8e1b5f69 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3116
diff changeset
   546
                        m package = package ifTrue:[
2a6c8e1b5f69 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3116
diff changeset
   547
                            ((checkExtensionsOnly ? false) not
2a6c8e1b5f69 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3116
diff changeset
   548
                            or:[ m package ~~ cls package "isExtension" ]) ifTrue:[
2a6c8e1b5f69 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3116
diff changeset
   549
                                whatToDo value:m
2a6c8e1b5f69 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3116
diff changeset
   550
                            ]
2a6c8e1b5f69 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3116
diff changeset
   551
                        ]
2a6c8e1b5f69 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3116
diff changeset
   552
                    ]
2853
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   553
                ].
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   554
            ]
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   555
        ])
2707
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   556
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   557
    "Created: / 11-01-2012 / 16:55:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   558
!
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   559
2853
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   560
checkMethods: methodsToCheck
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   561
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   562
    methodsToCheck do:[:m|self checkMethod: m].
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   563
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   564
    "Created: / 11-04-2012 / 12:16:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   565
!
b28d27ac2c67 Initial version of project checker
vrany
parents: 2797
diff changeset
   566
2707
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   567
checkPackage
3148
2a6c8e1b5f69 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3116
diff changeset
   568
    (checkExtensionsOnly ? false) ifFalse:[
2a6c8e1b5f69 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3116
diff changeset
   569
        self checkClassListConsistency.
2a6c8e1b5f69 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3116
diff changeset
   570
    ].
2718
vrany
parents: 2716
diff changeset
   571
    self checkExtensionsListConsistency.
vrany
parents: 2716
diff changeset
   572
    self checkExtensionsPrerequisites.
vrany
parents: 2716
diff changeset
   573
2716
9a74597bcd4b Do not use annotations as stc crashes when compiling them
vrany
parents: 2707
diff changeset
   574
    "add more here..."
2707
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   575
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   576
    "Created: / 11-01-2012 / 16:55:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   577
! !
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   578
2910
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   579
!ProjectChecker methodsFor:'initialization'!
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   580
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   581
initialize
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   582
    "Invoked when a new instance is created."
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   583
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   584
    "/ please change as required (and remove this comment)
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   585
    "/ package := nil.
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   586
    "/ packageDef := nil.
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   587
    "/ classes := nil.
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   588
    "/ methods := nil.
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   589
    problems := List new.
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   590
    "/ phase := nil.
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   591
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   592
    "/ super initialize.   -- commented since inherited method does nothing
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   593
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   594
    "Modified: / 13-09-2012 / 17:24:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   595
! !
b603824e85d5 - new checks to ensure class list consistency
vrany
parents: 2856
diff changeset
   596
2707
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   597
!ProjectChecker methodsFor:'reporting'!
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   598
2797
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   599
addProblem: aProjectProblem
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   600
    aProjectProblem package: self package.
2707
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   601
    problems isNil ifTrue:[problems := OrderedCollection new].
2797
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   602
    problems add: aProjectProblem
2707
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   603
2797
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   604
    "Created: / 23-02-2012 / 13:10:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2718
vrany
parents: 2716
diff changeset
   605
! !
vrany
parents: 2716
diff changeset
   606
2707
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   607
!ProjectChecker class methodsFor:'documentation'!
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   608
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   609
version
3167
56a8d17b6987 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
   610
    ^ '$Header: /cvs/stx/stx/libbasic3/ProjectChecker.st,v 1.16 2013-03-30 16:01:17 cg Exp $'
56a8d17b6987 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
   611
!
56a8d17b6987 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
   612
56a8d17b6987 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
   613
version_CVS
56a8d17b6987 class: ProjectChecker
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
   614
    ^ '$Header: /cvs/stx/stx/libbasic3/ProjectChecker.st,v 1.16 2013-03-30 16:01:17 cg Exp $'
2707
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   615
!
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   616
2797
ab7cc3e21a2b Updated from SVN
vrany
parents: 2718
diff changeset
   617
version_SVN
2966
bf5ea36104cd Fix in #checkClassListConsistency - care about classes with nil superclass (Autoload/Object)
vrany
parents: 2965
diff changeset
   618
    ^ '§Id: ProjectChecker.st 1971 2012-09-27 19:37:25Z vranyj1 §'
2707
68860a7700c2 initial checkin
vrany
parents:
diff changeset
   619
! !
3116
9ddba2316fec class: ProjectChecker
Stefan Vogel <sv@exept.de>
parents: 2976
diff changeset
   620