author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Tue, 14 Feb 2012 17:06:02 +0000 | |
branch | jv |
changeset 3022 | d678b271a3f9 |
parent 3020 | 240c299584af |
child 3023 | ed74806df5bc |
permissions | -rw-r--r-- |
3012 | 1 |
" |
2 |
COPYRIGHT (c) 2006 by eXept Software AG |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
2707 | 12 |
"{ Package: 'stx:libbasic3' }" |
13 |
||
14 |
Object subclass:#ProjectChecker |
|
15 |
instanceVariableNames:'package packageDef classes methods problems' |
|
16 |
classVariableNames:'' |
|
17 |
poolDictionaries:'' |
|
18 |
category:'System-Support-Projects' |
|
19 |
! |
|
20 |
||
21 |
Object subclass:#Problem |
|
22 |
instanceVariableNames:'label description severity data' |
|
23 |
classVariableNames:'' |
|
24 |
poolDictionaries:'' |
|
25 |
privateIn:ProjectChecker |
|
26 |
! |
|
27 |
||
28 |
!ProjectChecker class methodsFor:'documentation'! |
|
29 |
||
3012 | 30 |
copyright |
31 |
" |
|
32 |
COPYRIGHT (c) 2006 by eXept Software AG |
|
33 |
All Rights Reserved |
|
34 |
||
35 |
This software is furnished under a license and may be used |
|
36 |
only in accordance with the terms of that license and with the |
|
37 |
inclusion of the above copyright notice. This software may not |
|
38 |
be provided or otherwise made available to, or used by, any |
|
39 |
other person. No title to or ownership of the software is |
|
40 |
hereby transferred. |
|
41 |
" |
|
42 |
! |
|
43 |
||
2707 | 44 |
documentation |
45 |
" |
|
46 |
A simple project checker that can search whole projects or individual |
|
47 |
classes or methods for various problems. TBW... |
|
48 |
||
49 |
NOTE: Not yet finished. This code is meant as a single central entry for all the |
|
50 |
source code management tools like SCM Utilities, NewSystemBrowser ets. That code |
|
3019 | 51 |
will be refactored later once this tool prooves itself useful and mature enough. |
2707 | 52 |
|
53 |
[author:] |
|
54 |
Jan Vrany <jan.vrany@fit.cvut.cz> |
|
55 |
||
56 |
[instance variables:] |
|
57 |
||
58 |
[class variables:] |
|
59 |
||
60 |
[see also:] |
|
61 |
||
62 |
" |
|
63 |
! |
|
64 |
||
65 |
examples |
|
66 |
||
67 |
" |
|
68 |
ProjectChecker check: 'stx:libbasic' |
|
3019 | 69 |
ProjectChecker check: 'stx:libtool' |
70 |
ProjectChecker check: 'stx:libbasic3' |
|
2707 | 71 |
" |
72 |
! ! |
|
73 |
||
74 |
!ProjectChecker class methodsFor:'checking'! |
|
75 |
||
76 |
check: package |
|
77 |
||
78 |
^self new check: package |
|
79 |
||
80 |
"Created: / 11-01-2012 / 16:46:38 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
81 |
! ! |
|
82 |
||
83 |
!ProjectChecker methodsFor:'accessing'! |
|
84 |
||
3019 | 85 |
classes: aCollection |
86 |
classes := aCollection. |
|
87 |
||
88 |
"Created: / 13-02-2012 / 17:06:31 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
89 |
! |
|
90 |
||
91 |
methods |
|
92 |
^ methods |
|
93 |
! |
|
94 |
||
95 |
methods:something |
|
96 |
methods := something. |
|
97 |
! |
|
98 |
||
2707 | 99 |
package |
100 |
^ package |
|
101 |
! |
|
102 |
||
103 |
package:packageId |
|
104 |
package := packageId. |
|
3018
9eb47024eba1
added #problems to ProjectChecker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
105 |
! |
9eb47024eba1
added #problems to ProjectChecker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
106 |
|
9eb47024eba1
added #problems to ProjectChecker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
107 |
problems |
9eb47024eba1
added #problems to ProjectChecker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3012
diff
changeset
|
108 |
^ problems |
2707 | 109 |
! ! |
110 |
||
111 |
!ProjectChecker methodsFor:'checking'! |
|
112 |
||
113 |
check |
|
114 |
||
3020
240c299584af
Improvements in project checker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3019
diff
changeset
|
115 |
packageDef := ProjectDefinition definitionClassForPackage: package. |
240c299584af
Improvements in project checker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3019
diff
changeset
|
116 |
packageDef isNil ifTrue:[ |
240c299584af
Improvements in project checker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3019
diff
changeset
|
117 |
self problem: 'Project definition class for package %1 does not exist (no further checks performed)' |
240c299584af
Improvements in project checker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3019
diff
changeset
|
118 |
description: nil |
240c299584af
Improvements in project checker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3019
diff
changeset
|
119 |
severity: #error. |
240c299584af
Improvements in project checker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3019
diff
changeset
|
120 |
^self |
240c299584af
Improvements in project checker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3019
diff
changeset
|
121 |
]. |
240c299584af
Improvements in project checker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3019
diff
changeset
|
122 |
|
2707 | 123 |
self |
124 |
checkPackage; |
|
125 |
checkClasses; |
|
126 |
checkMethods |
|
127 |
||
128 |
"Created: / 11-01-2012 / 16:47:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
129 |
! |
|
130 |
||
131 |
check: package |
|
132 |
||
133 |
self package: package. |
|
134 |
self check. |
|
135 |
||
136 |
"Created: / 11-01-2012 / 16:47:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
137 |
! ! |
|
138 |
||
139 |
!ProjectChecker methodsFor:'checks-individual'! |
|
140 |
||
141 |
checkClassListConsistency |
|
142 |
"Checks whether all classes listed in #classNamesAndAttributes are present |
|
143 |
and if all present classes are listed" |
|
144 |
||
145 |
|classesInImage classesInDescription missingPools onlyInImage onlyInDescription| |
|
146 |
"WARNING: Copy/paste of ProjectDefinition>>validateDescription" |
|
147 |
||
148 |
classesInImage := Smalltalk allClasses select:[:cls | (cls package = self package) and:[cls isPrivate not]]. |
|
149 |
"/ classesInDescription := self classes asIdentitySet. |
|
150 |
classesInDescription := IdentitySet new. |
|
151 |
((packageDef compiled_classNamesForPlatform:(OperatingSystem platformName)) |
|
152 |
, (packageDef compiled_classNames_common) |
|
153 |
, (packageDef autoloaded_classNames)) do:[:nm | |
|
154 |
|cls| |
|
155 |
||
156 |
cls := Smalltalk at:nm asSymbol. |
|
157 |
cls isNil ifTrue:[ |
|
158 |
self problem: 'Missing class ', nm |
|
159 |
description: 'A class is listed in project definition but not present in the system' |
|
160 |
severity: #error |
|
161 |
] ifFalse:[ |
|
162 |
classesInDescription add:cls. |
|
163 |
]. |
|
164 |
]. |
|
165 |
||
166 |
missingPools := Set new. |
|
167 |
classesInDescription do:[:eachClass | |
|
168 |
eachClass sharedPoolNames do:[:eachPoolName | |
|
169 |
|pool| |
|
170 |
||
171 |
pool := eachClass nameSpace classNamed:eachPoolName. |
|
172 |
pool isNil ifTrue:[ |
|
173 |
eachClass nameSpace ~~ Smalltalk ifTrue:[ |
|
174 |
pool := Smalltalk classNamed:eachPoolName. |
|
175 |
] |
|
176 |
]. |
|
177 |
pool isNil ifTrue:[ |
|
178 |
self |
|
179 |
problem:'Missing pool: ',eachPoolName |
|
180 |
description: ('Class %1 uses a pool named %2 but it does not exists' bindWith: eachClass with: pool) |
|
181 |
severity: #error data: eachClass. |
|
182 |
missingPools add:eachPoolName. |
|
183 |
] ifFalse:[ |
|
184 |
pool isSharedPool ifFalse:[ |
|
185 |
self |
|
186 |
problem:'Missing pool: ',eachPoolName |
|
187 |
description: ('Class %1 uses a pool named %2 but it is not actually a shared pool.' bindWith: eachClass with: pool) |
|
188 |
severity: #error data: eachClass. |
|
189 |
missingPools add:eachPoolName. |
|
190 |
]. |
|
191 |
]. |
|
192 |
]. |
|
193 |
]. |
|
194 |
||
195 |
classesInImage ~= classesInDescription ifTrue:[ |
|
196 |
onlyInImage := (classesInImage reject:[:cls | classesInDescription includes:cls]). |
|
197 |
onlyInImage do:[:cls| |
|
198 |
self problem: ('Class %1 not listed in project definition' bindWith: cls) |
|
199 |
description: 'The class %1 not listed in project definition''s #classNamesAndAttributes, therefore it won''t be compiler nor autoladed next time you compile/load project.' |
|
200 |
severity: #error data: cls. |
|
201 |
]. |
|
202 |
onlyInDescription := (classesInDescription reject:[:cls | classesInImage includes:cls]). |
|
203 |
onlyInDescription do:[:cls| |
|
204 |
self problem: ('Class %1 is listed in project definition but not present in the system' bindWith: cls) |
|
205 |
description: 'The class %1 list in project definition''s but not present in the system. This leads to uncompilable package as build files may be incorrectly generated.' |
|
206 |
severity: #error data: cls. |
|
207 |
]. |
|
208 |
]. |
|
209 |
||
210 |
"Created: / 11-01-2012 / 17:14:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2718 | 211 |
! |
212 |
||
3020
240c299584af
Improvements in project checker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3019
diff
changeset
|
213 |
checkClassesListedInProjectDefinition: classesToCheck |
240c299584af
Improvements in project checker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3019
diff
changeset
|
214 |
|
240c299584af
Improvements in project checker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3019
diff
changeset
|
215 |
| classNamesListed | |
240c299584af
Improvements in project checker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3019
diff
changeset
|
216 |
|
240c299584af
Improvements in project checker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3019
diff
changeset
|
217 |
classNamesListed := packageDef classNames. |
240c299584af
Improvements in project checker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3019
diff
changeset
|
218 |
|
240c299584af
Improvements in project checker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3019
diff
changeset
|
219 |
classesToCheck do:[:class| |
240c299584af
Improvements in project checker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3019
diff
changeset
|
220 |
(class isPrivate not and:[(classNamesListed includes: class name) not]) ifTrue:[ |
240c299584af
Improvements in project checker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3019
diff
changeset
|
221 |
self problem: ('Class %1 not listed in project definition' bindWith: class) |
240c299584af
Improvements in project checker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3019
diff
changeset
|
222 |
description: 'The class %1 not listed in project definition''s #classNamesAndAttributes, therefore it won''t be compiler nor autoladed next time you compile/load project.' |
240c299584af
Improvements in project checker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3019
diff
changeset
|
223 |
severity: #error data: class. |
240c299584af
Improvements in project checker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3019
diff
changeset
|
224 |
] |
240c299584af
Improvements in project checker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3019
diff
changeset
|
225 |
]. |
240c299584af
Improvements in project checker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3019
diff
changeset
|
226 |
|
240c299584af
Improvements in project checker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3019
diff
changeset
|
227 |
"Created: / 13-02-2012 / 18:18:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
240c299584af
Improvements in project checker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3019
diff
changeset
|
228 |
! |
240c299584af
Improvements in project checker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3019
diff
changeset
|
229 |
|
2718 | 230 |
checkExtensionsListConsistency |
231 |
"Checks whether all extensions listed in #extensionMethodNames are present |
|
232 |
and if all extension methods are listed" |
|
233 |
||
234 |
| extensionsListed extensionsPresent | |
|
235 |
||
236 |
extensionsListed := OrderedCollection new. |
|
237 |
packageDef extensionMethodNames pairWiseDo:[:cls :sel| |
|
238 |
extensionsListed add: (Array with: cls with: sel) |
|
239 |
]. |
|
240 |
extensionsPresent := OrderedCollection new. |
|
241 |
packageDef searchForExtensions do:[:each| |
|
242 |
extensionsPresent add: (Array with: each mclass name with: each selector) |
|
243 |
]. |
|
244 |
||
245 |
(extensionsListed \ extensionsPresent) do:[:clsAndSel| |
|
246 |
self problem: ('Missing %1>>%2 extension method' bindWith: clsAndSel first with: clsAndSel second) |
|
247 |
description: ('An extension method %1>>%2 is listed in #extensionMethodNames but not present in image' bindWith: clsAndSel first with: clsAndSel second) |
|
248 |
severity: #warning data: clsAndSel. |
|
249 |
]. |
|
250 |
||
251 |
(extensionsPresent \ extensionsListed) do:[:clsAndSel| |
|
252 |
self problem: ('%1>>%2 extension method not in list' bindWith: clsAndSel first with: clsAndSel second) |
|
253 |
description: ('An extension method %1>>%2 present in image but not listed in #extensionMethodNames' bindWith: clsAndSel first with: clsAndSel second) |
|
254 |
severity: #warning data: clsAndSel. |
|
255 |
]. |
|
256 |
||
257 |
"Created: / 12-01-2012 / 12:31:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
258 |
! |
|
259 |
||
260 |
checkExtensionsPrerequisites |
|
261 |
"Checks whether packages of all extensions method classes are listed |
|
262 |
in package prerequisites" |
|
263 |
||
264 |
packageDef searchForExtensions do:[:mthd| |
|
265 |
(packageDef preRequisites includes: mthd mclass package) ifFalse:[ |
|
266 |
self problem: ('%3 required by extension method but not in prerequisites' bindWith: mthd mclass package) |
|
267 |
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) |
|
268 |
severity: #error data: mthd |
|
269 |
]. |
|
270 |
] |
|
271 |
||
272 |
"Created: / 12-01-2012 / 12:41:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3020
240c299584af
Improvements in project checker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3019
diff
changeset
|
273 |
! |
240c299584af
Improvements in project checker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3019
diff
changeset
|
274 |
|
240c299584af
Improvements in project checker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3019
diff
changeset
|
275 |
checkForMethodsInNoProject: classesToCheck |
240c299584af
Improvements in project checker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3019
diff
changeset
|
276 |
| checker | |
240c299584af
Improvements in project checker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3019
diff
changeset
|
277 |
|
240c299584af
Improvements in project checker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3019
diff
changeset
|
278 |
checker := [:cls| |
240c299584af
Improvements in project checker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3019
diff
changeset
|
279 |
cls selectorsAndMethodsDo:[:sel :mth| |
240c299584af
Improvements in project checker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3019
diff
changeset
|
280 |
(mth package isNil or:[mth package == PackageId noProjectID]) ifTrue:[ |
240c299584af
Improvements in project checker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3019
diff
changeset
|
281 |
self problem: ('Unpackaged method %1 >> %2' bindWith: mth mclass with: sel) |
240c299584af
Improvements in project checker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3019
diff
changeset
|
282 |
description: 'The class belongs to ''no package'' and therefore won'' be commited. All methods should belong to a package.' |
240c299584af
Improvements in project checker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3019
diff
changeset
|
283 |
severity: #error data: mth. |
240c299584af
Improvements in project checker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3019
diff
changeset
|
284 |
] |
240c299584af
Improvements in project checker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3019
diff
changeset
|
285 |
] |
240c299584af
Improvements in project checker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3019
diff
changeset
|
286 |
]. |
240c299584af
Improvements in project checker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3019
diff
changeset
|
287 |
|
240c299584af
Improvements in project checker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3019
diff
changeset
|
288 |
classesToCheck do:[:class| |
240c299584af
Improvements in project checker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3019
diff
changeset
|
289 |
checker value: class theMetaclass. |
240c299584af
Improvements in project checker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3019
diff
changeset
|
290 |
checker value: class theNonMetaclass. |
240c299584af
Improvements in project checker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3019
diff
changeset
|
291 |
|
240c299584af
Improvements in project checker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3019
diff
changeset
|
292 |
] |
240c299584af
Improvements in project checker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3019
diff
changeset
|
293 |
|
240c299584af
Improvements in project checker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3019
diff
changeset
|
294 |
"Created: / 13-02-2012 / 18:18:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2707 | 295 |
! ! |
296 |
||
297 |
!ProjectChecker methodsFor:'checks-private'! |
|
298 |
||
299 |
checkClasses |
|
3020
240c299584af
Improvements in project checker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3019
diff
changeset
|
300 |
|
240c299584af
Improvements in project checker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3019
diff
changeset
|
301 |
classes notNil ifTrue:[ |
240c299584af
Improvements in project checker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3019
diff
changeset
|
302 |
self checkClasses: classes |
240c299584af
Improvements in project checker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3019
diff
changeset
|
303 |
] ifFalse:[ |
240c299584af
Improvements in project checker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3019
diff
changeset
|
304 |
self checkClasses: (Smalltalk allClasses select:[:cls | (cls package = self package)]). |
240c299584af
Improvements in project checker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3019
diff
changeset
|
305 |
]. |
2707 | 306 |
|
307 |
"Created: / 11-01-2012 / 16:55:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
308 |
! |
|
309 |
||
3020
240c299584af
Improvements in project checker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3019
diff
changeset
|
310 |
checkClasses: classesToCheck |
240c299584af
Improvements in project checker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3019
diff
changeset
|
311 |
|
240c299584af
Improvements in project checker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3019
diff
changeset
|
312 |
self checkClassesListedInProjectDefinition: classesToCheck. |
240c299584af
Improvements in project checker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3019
diff
changeset
|
313 |
self checkForMethodsInNoProject: classesToCheck. |
240c299584af
Improvements in project checker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3019
diff
changeset
|
314 |
|
240c299584af
Improvements in project checker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3019
diff
changeset
|
315 |
"Created: / 13-02-2012 / 18:18:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
240c299584af
Improvements in project checker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3019
diff
changeset
|
316 |
! |
240c299584af
Improvements in project checker
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3019
diff
changeset
|
317 |
|
2707 | 318 |
checkMethods |
319 |
"Not yet implemented" |
|
320 |
||
321 |
"Created: / 11-01-2012 / 16:55:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
322 |
! |
|
323 |
||
324 |
checkPackage |
|
325 |
||
2716
9a74597bcd4b
Do not use annotations as stc crashes when compiling them
vrany
parents:
2707
diff
changeset
|
326 |
self checkClassListConsistency. |
2718 | 327 |
self checkExtensionsListConsistency. |
328 |
self checkExtensionsPrerequisites. |
|
329 |
||
2716
9a74597bcd4b
Do not use annotations as stc crashes when compiling them
vrany
parents:
2707
diff
changeset
|
330 |
"add more here..." |
2707 | 331 |
|
332 |
"Created: / 11-01-2012 / 16:55:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
333 |
! ! |
|
334 |
||
335 |
!ProjectChecker methodsFor:'reporting'! |
|
336 |
||
337 |
problem: label description: description severity: severity |
|
338 |
"Reports a problem" |
|
339 |
||
340 |
^self problem: label description: description severity: severity data: nil |
|
341 |
||
342 |
"Created: / 11-01-2012 / 17:24:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
343 |
! |
|
344 |
||
345 |
problem: label description: description severity: severity data: data |
|
346 |
"Reports a problem" |
|
347 |
||
348 |
problems isNil ifTrue:[problems := OrderedCollection new]. |
|
349 |
problems add: |
|
350 |
(Problem new |
|
351 |
label: label; |
|
352 |
description: description; |
|
353 |
severity: severity; |
|
354 |
data: data) |
|
355 |
||
356 |
"Created: / 11-01-2012 / 17:17:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
357 |
! ! |
|
358 |
||
359 |
!ProjectChecker::Problem methodsFor:'accessing'! |
|
360 |
||
361 |
data |
|
362 |
^ data |
|
363 |
! |
|
364 |
||
365 |
data:something |
|
366 |
data := something. |
|
367 |
! |
|
368 |
||
369 |
description |
|
370 |
^ description |
|
371 |
! |
|
372 |
||
373 |
description:something |
|
374 |
description := something. |
|
375 |
! |
|
376 |
||
377 |
label |
|
378 |
^ label |
|
379 |
! |
|
380 |
||
381 |
label:something |
|
382 |
label := something. |
|
383 |
! |
|
384 |
||
385 |
severity |
|
386 |
^ severity |
|
387 |
! |
|
388 |
||
389 |
severity:something |
|
390 |
severity := something. |
|
391 |
! ! |
|
392 |
||
2718 | 393 |
!ProjectChecker::Problem methodsFor:'printing & storing'! |
394 |
||
3022
d678b271a3f9
added displayString to an issue
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3020
diff
changeset
|
395 |
displayString |
d678b271a3f9
added displayString to an issue
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3020
diff
changeset
|
396 |
^self label |
d678b271a3f9
added displayString to an issue
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3020
diff
changeset
|
397 |
|
d678b271a3f9
added displayString to an issue
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3020
diff
changeset
|
398 |
"Created: / 14-02-2012 / 17:02:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
d678b271a3f9
added displayString to an issue
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3020
diff
changeset
|
399 |
! |
d678b271a3f9
added displayString to an issue
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3020
diff
changeset
|
400 |
|
2718 | 401 |
printOn:aStream |
402 |
"append a printed representation if the receiver to the argument, aStream" |
|
403 |
||
404 |
super printOn:aStream. |
|
405 |
aStream nextPut:$(. |
|
406 |
severity printOn:aStream. |
|
407 |
aStream nextPut:$:; space. |
|
408 |
label printOn:aStream. |
|
409 |
aStream nextPut:$). |
|
410 |
||
411 |
"Modified: / 12-01-2012 / 13:09:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
412 |
! ! |
|
413 |
||
2707 | 414 |
!ProjectChecker class methodsFor:'documentation'! |
415 |
||
416 |
version |
|
3022
d678b271a3f9
added displayString to an issue
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3020
diff
changeset
|
417 |
^ '$Id: ProjectChecker.st 1885 2012-02-14 17:06:02Z vranyj1 $' |
2707 | 418 |
! |
419 |
||
420 |
version_CVS |
|
3011
1997ff6e7e55
trunk branched into /branches/jv
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2718
diff
changeset
|
421 |
^ '§Header: /cvs/stx/stx/libbasic3/ProjectChecker.st,v 1.3 2012/01/12 13:12:35 vrany Exp §' |
3012 | 422 |
! |
423 |
||
424 |
version_SVN |
|
3022
d678b271a3f9
added displayString to an issue
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3020
diff
changeset
|
425 |
^ '$Id: ProjectChecker.st 1885 2012-02-14 17:06:02Z vranyj1 $' |
3012 | 426 |
! ! |