2798
|
1 |
"
|
|
2 |
COPYRIGHT (c) 2006 by eXept Software AG
|
2911
|
3 |
All Rights Reserved
|
2798
|
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 |
"
|
|
12 |
"{ Package: 'stx:libbasic3' }"
|
|
13 |
|
|
14 |
Object subclass:#ProjectProblem
|
2854
|
15 |
instanceVariableNames:'package fixes'
|
2798
|
16 |
classVariableNames:''
|
|
17 |
poolDictionaries:''
|
|
18 |
category:'System-Support-Projects'
|
|
19 |
!
|
|
20 |
|
|
21 |
ProjectProblem subclass:#ClassProblem
|
|
22 |
instanceVariableNames:'className'
|
|
23 |
classVariableNames:''
|
|
24 |
poolDictionaries:''
|
|
25 |
privateIn:ProjectProblem
|
|
26 |
!
|
|
27 |
|
3160
|
28 |
ProjectProblem::ClassProblem subclass:#InconsistentProjectDefinition
|
|
29 |
instanceVariableNames:''
|
2798
|
30 |
classVariableNames:''
|
|
31 |
poolDictionaries:''
|
|
32 |
privateIn:ProjectProblem
|
|
33 |
!
|
|
34 |
|
3160
|
35 |
ProjectProblem::InconsistentProjectDefinition subclass:#ClassListedButDoesNotExist
|
2798
|
36 |
instanceVariableNames:''
|
|
37 |
classVariableNames:''
|
|
38 |
poolDictionaries:''
|
|
39 |
privateIn:ProjectProblem
|
|
40 |
!
|
|
41 |
|
3160
|
42 |
ProjectProblem::InconsistentProjectDefinition subclass:#ClassListedMultipleTimes
|
2911
|
43 |
instanceVariableNames:''
|
|
44 |
classVariableNames:''
|
|
45 |
poolDictionaries:''
|
|
46 |
privateIn:ProjectProblem
|
|
47 |
!
|
|
48 |
|
3160
|
49 |
ProjectProblem::InconsistentProjectDefinition subclass:#ClassNotListed
|
2911
|
50 |
instanceVariableNames:''
|
|
51 |
classVariableNames:''
|
|
52 |
poolDictionaries:''
|
|
53 |
privateIn:ProjectProblem
|
|
54 |
!
|
|
55 |
|
3160
|
56 |
ProjectProblem::InconsistentProjectDefinition subclass:#ClassListedBeforeItsPool
|
2798
|
57 |
instanceVariableNames:'poolName'
|
|
58 |
classVariableNames:''
|
|
59 |
poolDictionaries:''
|
|
60 |
privateIn:ProjectProblem
|
|
61 |
!
|
|
62 |
|
2911
|
63 |
ProjectProblem::ClassProblem subclass:#ClassUsesPoolProblem
|
2798
|
64 |
instanceVariableNames:'poolName'
|
|
65 |
classVariableNames:''
|
|
66 |
poolDictionaries:''
|
|
67 |
privateIn:ProjectProblem
|
|
68 |
!
|
|
69 |
|
2911
|
70 |
ProjectProblem::ClassUsesPoolProblem subclass:#ClassUsesPoolButItIsNotASharedPool
|
|
71 |
instanceVariableNames:''
|
|
72 |
classVariableNames:''
|
|
73 |
poolDictionaries:''
|
|
74 |
privateIn:ProjectProblem
|
|
75 |
!
|
|
76 |
|
|
77 |
ProjectProblem::ClassUsesPoolProblem subclass:#ClassUsesPoolInNamespaceButNamespaceIsNotDefined
|
|
78 |
instanceVariableNames:''
|
|
79 |
classVariableNames:''
|
|
80 |
poolDictionaries:''
|
|
81 |
privateIn:ProjectProblem
|
|
82 |
!
|
|
83 |
|
|
84 |
ProjectProblem::ClassUsesPoolProblem subclass:#ClassUsesPoolButItDoesNotExist
|
|
85 |
instanceVariableNames:''
|
|
86 |
classVariableNames:''
|
|
87 |
poolDictionaries:''
|
|
88 |
privateIn:ProjectProblem
|
|
89 |
!
|
|
90 |
|
2854
|
91 |
ProjectProblem::ClassProblem subclass:#MethodProblem
|
|
92 |
instanceVariableNames:'selector'
|
2798
|
93 |
classVariableNames:''
|
|
94 |
poolDictionaries:''
|
|
95 |
privateIn:ProjectProblem
|
|
96 |
!
|
|
97 |
|
3166
|
98 |
ProjectProblem::MethodProblem subclass:#ExtensionMethodListedButInDifferentPackage
|
|
99 |
instanceVariableNames:''
|
|
100 |
classVariableNames:''
|
|
101 |
poolDictionaries:''
|
|
102 |
privateIn:ProjectProblem
|
|
103 |
!
|
|
104 |
|
2798
|
105 |
ProjectProblem::MethodProblem subclass:#ExtensionMethodNotListed
|
|
106 |
instanceVariableNames:''
|
|
107 |
classVariableNames:''
|
|
108 |
poolDictionaries:''
|
|
109 |
privateIn:ProjectProblem
|
|
110 |
!
|
|
111 |
|
3166
|
112 |
ProjectProblem::MethodProblem subclass:#ExtensionMethodsClassDoesNotExist
|
|
113 |
instanceVariableNames:''
|
|
114 |
classVariableNames:''
|
|
115 |
poolDictionaries:''
|
|
116 |
privateIn:ProjectProblem
|
|
117 |
!
|
|
118 |
|
3160
|
119 |
ProjectProblem::InconsistentProjectDefinition subclass:#ClassListedBeforeItsSuperclass
|
|
120 |
instanceVariableNames:'superClassName'
|
|
121 |
classVariableNames:''
|
|
122 |
poolDictionaries:''
|
|
123 |
privateIn:ProjectProblem
|
|
124 |
!
|
|
125 |
|
2854
|
126 |
ProjectProblem::MethodProblem subclass:#MethodCompilabilityIssue
|
|
127 |
instanceVariableNames:'errors warnings'
|
|
128 |
classVariableNames:''
|
|
129 |
poolDictionaries:''
|
|
130 |
privateIn:ProjectProblem
|
|
131 |
!
|
|
132 |
|
|
133 |
Object subclass:#Error
|
|
134 |
instanceVariableNames:'message startPosition endPosition'
|
|
135 |
classVariableNames:''
|
|
136 |
poolDictionaries:''
|
|
137 |
privateIn:ProjectProblem::MethodCompilabilityIssue
|
|
138 |
!
|
|
139 |
|
|
140 |
Object subclass:#Warning
|
|
141 |
instanceVariableNames:'message startPosition endPosition'
|
|
142 |
classVariableNames:''
|
|
143 |
poolDictionaries:''
|
|
144 |
privateIn:ProjectProblem::MethodCompilabilityIssue
|
|
145 |
!
|
|
146 |
|
2798
|
147 |
ProjectProblem::MethodProblem subclass:#MethodInNoPackage
|
|
148 |
instanceVariableNames:''
|
|
149 |
classVariableNames:''
|
|
150 |
poolDictionaries:''
|
|
151 |
privateIn:ProjectProblem
|
|
152 |
!
|
|
153 |
|
|
154 |
ProjectProblem::MethodProblem subclass:#ExtensionMethodListedButDoesNotExist
|
|
155 |
instanceVariableNames:''
|
|
156 |
classVariableNames:''
|
|
157 |
poolDictionaries:''
|
|
158 |
privateIn:ProjectProblem
|
|
159 |
!
|
|
160 |
|
2854
|
161 |
ProjectProblem::MethodProblem subclass:#MethodSourceCorrupted
|
|
162 |
instanceVariableNames:''
|
|
163 |
classVariableNames:''
|
|
164 |
poolDictionaries:''
|
|
165 |
privateIn:ProjectProblem
|
|
166 |
!
|
|
167 |
|
|
168 |
ProjectProblem::MethodProblem subclass:#MethodSourceNotAvailable
|
|
169 |
instanceVariableNames:''
|
|
170 |
classVariableNames:''
|
|
171 |
poolDictionaries:''
|
|
172 |
privateIn:ProjectProblem
|
|
173 |
!
|
|
174 |
|
2798
|
175 |
ProjectProblem subclass:#ProjectDefinitionDoesNotExist
|
|
176 |
instanceVariableNames:''
|
|
177 |
classVariableNames:''
|
|
178 |
poolDictionaries:''
|
|
179 |
privateIn:ProjectProblem
|
|
180 |
!
|
|
181 |
|
|
182 |
!ProjectProblem class methodsFor:'documentation'!
|
|
183 |
|
|
184 |
copyright
|
|
185 |
"
|
|
186 |
COPYRIGHT (c) 2006 by eXept Software AG
|
2911
|
187 |
All Rights Reserved
|
2798
|
188 |
|
|
189 |
This software is furnished under a license and may be used
|
|
190 |
only in accordance with the terms of that license and with the
|
|
191 |
inclusion of the above copyright notice. This software may not
|
|
192 |
be provided or otherwise made available to, or used by, any
|
|
193 |
other person. No title to or ownership of the software is
|
|
194 |
hereby transferred.
|
|
195 |
"
|
|
196 |
! !
|
|
197 |
|
|
198 |
!ProjectProblem class methodsFor:'instance creation'!
|
|
199 |
|
2911
|
200 |
newClassListedBeforeItsPool
|
|
201 |
|
|
202 |
^ClassListedBeforeItsPool new
|
|
203 |
|
|
204 |
"Created: / 13-09-2012 / 17:13:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
205 |
!
|
|
206 |
|
|
207 |
newClassListedBeforeItsSuperclass
|
|
208 |
|
|
209 |
^ClassListedBeforeItsSuperclass new
|
|
210 |
|
|
211 |
"Created: / 13-09-2012 / 17:13:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
212 |
!
|
|
213 |
|
2798
|
214 |
newClassListedButDoesNotExist
|
|
215 |
|
|
216 |
^ClassListedButDoesNotExist new
|
|
217 |
|
|
218 |
"Created: / 23-02-2012 / 13:18:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
219 |
!
|
|
220 |
|
2911
|
221 |
newClassListedMultipleTimes
|
|
222 |
|
|
223 |
^ClassListedMultipleTimes new
|
|
224 |
|
|
225 |
"Created: / 13-09-2012 / 17:40:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
226 |
!
|
|
227 |
|
2798
|
228 |
newClassNotListed
|
|
229 |
|
|
230 |
^ClassNotListed new
|
|
231 |
|
|
232 |
"Created: / 23-02-2012 / 13:59:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
233 |
!
|
|
234 |
|
|
235 |
newClassUsesPoolButItDoesNotExist
|
|
236 |
|
|
237 |
^ClassUsesPoolButItDoesNotExist new
|
|
238 |
|
|
239 |
"Created: / 23-02-2012 / 13:37:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
240 |
!
|
|
241 |
|
|
242 |
newClassUsesPoolButItIsNotASharedPool
|
|
243 |
|
|
244 |
^ClassUsesPoolButItIsNotASharedPool new
|
|
245 |
|
|
246 |
"Created: / 23-02-2012 / 13:48:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
247 |
!
|
|
248 |
|
2911
|
249 |
newClassUsesPoolInNamespaceButNamespaceIsNotDefined
|
|
250 |
|
|
251 |
^ClassUsesPoolInNamespaceButNamespaceIsNotDefined new
|
|
252 |
|
|
253 |
"Created: / 13-09-2012 / 16:40:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
254 |
!
|
|
255 |
|
2798
|
256 |
newExtensionMethodListedButDoesNotExist
|
|
257 |
|
|
258 |
^ExtensionMethodListedButDoesNotExist new
|
|
259 |
|
|
260 |
"Created: / 23-02-2012 / 14:26:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
261 |
!
|
|
262 |
|
3166
|
263 |
newExtensionMethodListedButInDifferentPackage
|
|
264 |
|
|
265 |
^ExtensionMethodListedButInDifferentPackage new
|
|
266 |
!
|
|
267 |
|
2798
|
268 |
newExtensionMethodNotListed
|
|
269 |
|
|
270 |
^ExtensionMethodNotListed new
|
|
271 |
|
|
272 |
"Created: / 23-02-2012 / 14:27:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
273 |
!
|
|
274 |
|
3166
|
275 |
newExtensionMethodsClassDoesNotExist
|
|
276 |
|
|
277 |
^ExtensionMethodsClassDoesNotExist new
|
|
278 |
!
|
|
279 |
|
2854
|
280 |
newMethodCompilabilityIssue
|
|
281 |
|
|
282 |
^MethodCompilabilityIssue new
|
|
283 |
|
|
284 |
"Created: / 11-04-2012 / 15:34:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
285 |
!
|
|
286 |
|
2798
|
287 |
newMethodInNoPackage
|
|
288 |
|
|
289 |
^MethodInNoPackage new
|
|
290 |
|
|
291 |
"Created: / 23-02-2012 / 14:27:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
292 |
!
|
|
293 |
|
2854
|
294 |
newMethodSourceCorrupted
|
|
295 |
|
|
296 |
^MethodSourceCorrupted new
|
|
297 |
|
|
298 |
"Created: / 11-04-2012 / 12:35:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
299 |
!
|
|
300 |
|
|
301 |
newMethodSourceNotAvailable
|
|
302 |
|
|
303 |
^MethodSourceNotAvailable new
|
|
304 |
|
|
305 |
"Created: / 11-04-2012 / 12:31:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
306 |
!
|
|
307 |
|
2798
|
308 |
newProjectDefinitionDoesNotExist
|
|
309 |
|
|
310 |
^ProjectDefinitionDoesNotExist new
|
|
311 |
|
|
312 |
"Created: / 23-02-2012 / 13:08:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
313 |
! !
|
|
314 |
|
|
315 |
!ProjectProblem methodsFor:'accessing'!
|
|
316 |
|
|
317 |
description
|
|
318 |
"Return a (HTML) describing the problem."
|
|
319 |
|
|
320 |
^self subclassResponsibility
|
|
321 |
|
|
322 |
"Created: / 23-02-2012 / 13:04:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
323 |
!
|
|
324 |
|
2854
|
325 |
descriptionAndFixes
|
|
326 |
"Return a (HTML) describing the problem plus possible fixes."
|
|
327 |
|
3169
|
328 |
|descriptionText fixes|
|
|
329 |
|
|
330 |
(self alreadyFixed) ifTrue:[^ 'Already fixed.'].
|
|
331 |
|
|
332 |
descriptionText := self description.
|
|
333 |
|
|
334 |
"/ don't use cached fixes (after a fix, the problem may return an empty fix list)
|
|
335 |
fixes := self fixes.
|
|
336 |
fixes isEmpty ifTrue:[ ^ descriptionText ].
|
2854
|
337 |
|
|
338 |
^String streamContents:[:html |
|
3169
|
339 |
html nextPutAll: descriptionText.
|
2798
|
340 |
|
3169
|
341 |
html nextPutAll: '<br><br>'.
|
|
342 |
fixes size == 1 ifTrue:[
|
|
343 |
html nextPutLine: 'Possible fix:'.
|
|
344 |
] ifFalse:[
|
|
345 |
html nextPutLine: 'Possible fixes:'.
|
|
346 |
].
|
|
347 |
html nextPutLine:'<ul>'.
|
|
348 |
fixes withIndexDo:[:fix :index|
|
|
349 |
html
|
|
350 |
nextPutAll:'<li><a action="doit: self application doFix: ';
|
|
351 |
nextPutAll: index printString;
|
|
352 |
nextPutAll:'">';
|
|
353 |
nextPutAll: fix first;
|
|
354 |
nextPutAll:'</a></li>'.
|
|
355 |
].
|
|
356 |
html nextPutLine:'</ul>'.
|
2854
|
357 |
].
|
2798
|
358 |
|
2854
|
359 |
"Created: / 26-07-2012 / 09:46:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
360 |
!
|
|
361 |
|
|
362 |
fixes
|
|
363 |
"Return (possibly empty) list of actions that
|
|
364 |
the user may take to fix/investigate the problem.
|
|
365 |
Returned value should be list of pairs (label, action block).
|
|
366 |
To be overriden in subclasses.
|
|
367 |
|
|
368 |
The list should be an array of pairs ( fix label , fix block ).
|
|
369 |
Fix block should return true, if the fix was successful,
|
|
370 |
false otherwise"
|
|
371 |
|
|
372 |
^#()
|
|
373 |
|
|
374 |
"Created: / 26-07-2012 / 09:46:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
2798
|
375 |
!
|
|
376 |
|
|
377 |
label
|
|
378 |
"Return the label (possibly instance if a Text) shortly describing the problem"
|
|
379 |
|
|
380 |
^self subclassResponsibility
|
|
381 |
|
|
382 |
"Created: / 23-02-2012 / 13:03:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
383 |
!
|
|
384 |
|
|
385 |
package
|
|
386 |
^ package
|
|
387 |
!
|
|
388 |
|
|
389 |
package:aSymbol
|
2854
|
390 |
package := aSymbol asSymbol.
|
|
391 |
|
|
392 |
"Modified: / 11-04-2012 / 16:00:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
2798
|
393 |
!
|
|
394 |
|
|
395 |
packageDefinitionClass
|
|
396 |
^ProjectDefinition definitionClassForPackage: package
|
|
397 |
|
|
398 |
"Created: / 23-02-2012 / 13:26:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
399 |
!
|
|
400 |
|
|
401 |
severity
|
|
402 |
"Return a severity - one of #error, #warning, #info"
|
|
403 |
|
2911
|
404 |
^#warning "/by default
|
2798
|
405 |
|
|
406 |
"Created: / 23-02-2012 / 13:09:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
407 |
! !
|
|
408 |
|
2854
|
409 |
!ProjectProblem methodsFor:'fixing'!
|
|
410 |
|
3169
|
411 |
alreadyFixed
|
|
412 |
^ false
|
|
413 |
!
|
|
414 |
|
2854
|
415 |
doFix: index
|
|
416 |
self initializeFixes.
|
3169
|
417 |
^ (fixes at: index) second value
|
2854
|
418 |
|
|
419 |
"Created: / 26-07-2012 / 10:07:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
420 |
! !
|
|
421 |
|
|
422 |
!ProjectProblem methodsFor:'initialization'!
|
|
423 |
|
|
424 |
initializeFixes
|
|
425 |
|
|
426 |
fixes isNil ifTrue:[
|
2911
|
427 |
fixes := self fixes
|
2854
|
428 |
].
|
|
429 |
|
|
430 |
"/ super initialize. -- commented since inherited method does nothing
|
|
431 |
|
|
432 |
"Created: / 26-07-2012 / 09:54:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
433 |
! !
|
|
434 |
|
2798
|
435 |
!ProjectProblem methodsFor:'printing & storing'!
|
|
436 |
|
|
437 |
displayString
|
3169
|
438 |
|lbl|
|
|
439 |
|
|
440 |
lbl := self label.
|
3225
|
441 |
self alreadyFixed ifTrue:[^ (lbl string,' (already fixed)') allItalic].
|
3169
|
442 |
^ lbl
|
2798
|
443 |
|
|
444 |
"Created: / 14-02-2012 / 17:02:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
445 |
!
|
|
446 |
|
|
447 |
printOn:aStream
|
|
448 |
"append a printed representation if the receiver to the argument, aStream"
|
|
449 |
|
|
450 |
super printOn:aStream.
|
|
451 |
aStream nextPut:$(.
|
|
452 |
self severity printOn:aStream.
|
|
453 |
aStream nextPut:$:; space.
|
|
454 |
self label printOn:aStream.
|
|
455 |
aStream nextPut:$).
|
|
456 |
|
|
457 |
"Modified: / 23-02-2012 / 16:49:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
458 |
! !
|
|
459 |
|
|
460 |
!ProjectProblem methodsFor:'utilities-HTML'!
|
|
461 |
|
|
462 |
linkToClass: classOrclassName
|
2854
|
463 |
| className |
|
2798
|
464 |
|
|
465 |
className := classOrclassName isBehavior
|
2911
|
466 |
ifTrue: [classOrclassName storeString]
|
|
467 |
ifFalse:[classOrclassName].
|
2798
|
468 |
|
|
469 |
^'<A INFO="Click to browse class" ACTION="doit: UserPreferences current systemBrowserClass openInClass:%1"><CODE>%1</CODE></A>'
|
2911
|
470 |
bindWith: className
|
2798
|
471 |
|
|
472 |
"Created: / 23-02-2012 / 13:44:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
473 |
!
|
|
474 |
|
|
475 |
linkToClass: classOrclassName selector: selector
|
2854
|
476 |
^self linkToClass: classOrclassName selector: selector omitClassName: false
|
|
477 |
|
|
478 |
"Created: / 23-02-2012 / 13:45:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
479 |
!
|
|
480 |
|
|
481 |
linkToClass: classOrclassName selector: selector omitClassName: omitClassName
|
2798
|
482 |
|
|
483 |
| className |
|
|
484 |
className := classOrclassName isBehavior
|
2911
|
485 |
ifTrue: [classOrclassName name]
|
|
486 |
ifFalse:[classOrclassName].
|
2854
|
487 |
^omitClassName ifTrue:[
|
2911
|
488 |
'<A INFO="Click to browse method" ACTION="doit: UserPreferences current systemBrowserClass openInClass:%1 selector: %2"><CODE>#%3</CODE></A>'
|
|
489 |
bindWith: className
|
|
490 |
with: selector storeString
|
|
491 |
with: selector
|
2854
|
492 |
] ifFalse:[
|
2911
|
493 |
'<A INFO="Click to browse method" ACTION="doit: UserPreferences current systemBrowserClass openInClass:%1 selector: %2"><CODE>%1>>%3</CODE></A>'
|
|
494 |
bindWith: className
|
|
495 |
with: selector storeString
|
|
496 |
with: selector
|
2854
|
497 |
]
|
2798
|
498 |
|
2854
|
499 |
"Created: / 26-07-2012 / 10:26:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
2798
|
500 |
! !
|
|
501 |
|
|
502 |
!ProjectProblem::ClassProblem methodsFor:'accessing'!
|
|
503 |
|
|
504 |
className
|
|
505 |
^ className
|
|
506 |
!
|
|
507 |
|
|
508 |
className:something
|
|
509 |
className := something.
|
2854
|
510 |
!
|
|
511 |
|
|
512 |
klass
|
|
513 |
"Return the class which is subject of the problem"
|
2911
|
514 |
|
3143
|
515 |
"/ | class |
|
|
516 |
"/
|
|
517 |
"/ (className endsWith: ' class') ifTrue:[
|
|
518 |
"/ class := Smalltalk at: (className copyTo: className size - 6) asSymbol.
|
|
519 |
"/ class := class theMetaclass.
|
|
520 |
"/ ] ifFalse:[
|
|
521 |
"/ class := Smalltalk at: className asSymbol
|
|
522 |
"/ ].
|
|
523 |
"/ ^class
|
2854
|
524 |
|
3143
|
525 |
"/ the above is exactly:
|
3154
|
526 |
^ Smalltalk classNamed:className
|
2854
|
527 |
|
|
528 |
"Created: / 26-07-2012 / 10:21:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
2798
|
529 |
! !
|
|
530 |
|
3198
|
531 |
!ProjectProblem::ClassProblem methodsFor:'fixing'!
|
|
532 |
|
|
533 |
doUpdateAllProjectDefinitions
|
|
534 |
"full update the project definition class;
|
|
535 |
will do a rescan to add all missing items"
|
|
536 |
|
|
537 |
| def |
|
|
538 |
|
|
539 |
def := self packageDefinitionClass.
|
|
540 |
def isNil ifTrue:[ ^ false ].
|
|
541 |
|
|
542 |
def
|
|
543 |
updateMethodsCodeUsingCompiler:Compiler
|
|
544 |
ignoreOldDefinition:false.
|
|
545 |
|
|
546 |
UserNotification notify: ('Project definitions updated. Do not forget to check in build support files!!').
|
|
547 |
^true
|
|
548 |
! !
|
|
549 |
|
3160
|
550 |
!ProjectProblem::InconsistentProjectDefinition methodsFor:'fixes'!
|
2911
|
551 |
|
3160
|
552 |
fixes
|
2911
|
553 |
|
3160
|
554 |
^Array
|
3198
|
555 |
with: (Array with: 'Full update of the project definitions (rescan)' with: [ self doUpdateAllProjectDefinitions ])
|
2911
|
556 |
! !
|
|
557 |
|
|
558 |
!ProjectProblem::ClassListedButDoesNotExist methodsFor:'accessing'!
|
|
559 |
|
3160
|
560 |
severity
|
|
561 |
"Return a severity - one of #error, #warning, #info"
|
|
562 |
|
|
563 |
^#error
|
|
564 |
|
|
565 |
"Created: / 11-04-2012 / 12:48:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
566 |
! !
|
|
567 |
|
|
568 |
!ProjectProblem::ClassListedButDoesNotExist methodsFor:'accessing-description'!
|
|
569 |
|
2911
|
570 |
description
|
|
571 |
"Return a (HTML) describing the problem."
|
|
572 |
^
|
3147
|
573 |
'A class (<code>%1</code>) is listed in the project definition but
|
|
574 |
not present in the system.
|
2911
|
575 |
|
|
576 |
You should either create it or remove it from %2.'
|
|
577 |
bindWith: className with: (self linkToClass: self packageDefinitionClass class selector: #classNamesAndAttributes)
|
|
578 |
|
|
579 |
"Modified: / 28-02-2012 / 22:23:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
580 |
!
|
|
581 |
|
|
582 |
label
|
3160
|
583 |
^'Missing class: ', className allBold
|
2911
|
584 |
|
|
585 |
"Modified: / 23-02-2012 / 13:20:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
586 |
! !
|
|
587 |
|
3160
|
588 |
!ProjectProblem::ClassListedMultipleTimes methodsFor:'accessing-description'!
|
2911
|
589 |
|
|
590 |
description
|
|
591 |
"Return a (HTML) describing the problem."
|
|
592 |
|
|
593 |
^
|
|
594 |
'A class %1 is listed more than once in %2.
|
|
595 |
|
|
596 |
Such package will fail to compile, as linker will complain
|
3147
|
597 |
about multiple definitions of the same symbols. Make sure each
|
2911
|
598 |
class is listed only once.
|
|
599 |
'
|
|
600 |
bindWith: (self linkToClass: className)
|
3154
|
601 |
with: (self linkToClass: self packageDefinitionClass class selector: #extensionMethodNames)
|
2911
|
602 |
|
|
603 |
"Modified: / 13-09-2012 / 17:40:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
604 |
!
|
|
605 |
|
|
606 |
label
|
|
607 |
"Return the label (possibly instance if a Text) shortly describing the problem"
|
|
608 |
|
3160
|
609 |
^'Class %1 listed multiple times in project definition "%2"' bindWith: className allBold with:self packageDefinitionClass
|
2911
|
610 |
|
|
611 |
"Modified: / 23-02-2012 / 13:34:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
612 |
! !
|
|
613 |
|
3160
|
614 |
!ProjectProblem::ClassNotListed methodsFor:'accessing-description'!
|
2798
|
615 |
|
|
616 |
description
|
|
617 |
"Return a (HTML) describing the problem."
|
|
618 |
|
|
619 |
^
|
3147
|
620 |
'Class %1 is not listed in project definition (%2).
|
|
621 |
<br>The class won''t be compiled and - if some other class dependents on it - the whole package will fail to compile
|
2854
|
622 |
at all.'
|
|
623 |
bindWith: (self linkToClass: className)
|
|
624 |
with: (self linkToClass: self packageDefinitionClass class selector: #classNamesAndAttributes omitClassName: true)
|
|
625 |
|
|
626 |
"Modified: / 26-07-2012 / 10:27:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
627 |
!
|
|
628 |
|
3143
|
629 |
label
|
|
630 |
"Return the label (possibly instance if a Text) shortly describing the problem"
|
|
631 |
|
3160
|
632 |
^'Class %1 not listed in project definition "%2"' bindWith: className allBold with:self packageDefinitionClass
|
3143
|
633 |
|
|
634 |
"Modified: / 23-02-2012 / 13:55:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
635 |
! !
|
|
636 |
|
|
637 |
!ProjectProblem::ClassNotListed methodsFor:'fixing'!
|
|
638 |
|
2854
|
639 |
doIncludeInProject
|
|
640 |
"Include subject class in project definition. Return false if
|
|
641 |
fix fails, true otherwise"
|
2798
|
642 |
|
3160
|
643 |
^ self doIncludeInProjectAsAutoloaded:false
|
2854
|
644 |
!
|
2798
|
645 |
|
2854
|
646 |
doIncludeInProjectAsAutoloaded
|
|
647 |
"Include subject class in project definition. Return false if
|
|
648 |
fix fails, true otherwise"
|
3160
|
649 |
|
|
650 |
^ self doIncludeInProjectAsAutoloaded:true
|
|
651 |
!
|
|
652 |
|
|
653 |
doIncludeInProjectAsAutoloaded:asAutoloaded
|
|
654 |
"Include subject class in project definition. Return false if
|
|
655 |
fix fails, true otherwise"
|
|
656 |
|
2854
|
657 |
| def cls |
|
3160
|
658 |
|
2854
|
659 |
def := self packageDefinitionClass.
|
|
660 |
def isNil ifTrue:[ ^ false ].
|
|
661 |
cls := self klass.
|
|
662 |
cls isNil ifTrue:[ ^ false ].
|
3160
|
663 |
asAutoloaded ifTrue:[
|
|
664 |
def makeClassesAutoloaded:(Array with: cls) usingCompiler: nil.
|
|
665 |
] ifFalse:[
|
|
666 |
def includeClasses:(Array with: cls) usingCompiler: nil.
|
|
667 |
].
|
3144
|
668 |
UserNotification notify: ('Class added. Do not forget to check in build support files!!' bindWith: className).
|
2854
|
669 |
^true
|
|
670 |
|
|
671 |
"Created: / 26-07-2012 / 10:41:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
672 |
!
|
|
673 |
|
|
674 |
fixes
|
|
675 |
|
2911
|
676 |
^Array
|
3200
|
677 |
with: (Array with: 'Add class to project' with: [ self doIncludeInProject ])
|
|
678 |
with: (Array with: 'Add class to project as autoloaded' with: [ self doIncludeInProjectAsAutoloaded ])
|
3198
|
679 |
with: (Array with: 'Full update of the project definitions (rescan)' with: [ self doUpdateAllProjectDefinitions ])
|
2854
|
680 |
|
|
681 |
"Created: / 26-07-2012 / 10:41:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
2798
|
682 |
! !
|
|
683 |
|
2911
|
684 |
!ProjectProblem::ClassListedBeforeItsPool methodsFor:'accessing'!
|
2798
|
685 |
|
3160
|
686 |
poolName
|
|
687 |
^ poolName
|
|
688 |
!
|
|
689 |
|
|
690 |
poolName:something
|
|
691 |
poolName := something.
|
|
692 |
! !
|
|
693 |
|
|
694 |
!ProjectProblem::ClassListedBeforeItsPool methodsFor:'accessing-description'!
|
|
695 |
|
2798
|
696 |
description
|
|
697 |
"Return a (HTML) describing the problem."
|
|
698 |
|
|
699 |
^
|
3154
|
700 |
'Class %2 is listed in project definition (%1) before one of its pools (%3).
|
|
701 |
<br>Such class will fail to compile (if the package is being stc-compiled)
|
|
702 |
and load (if the package is being loaded from source).
|
3147
|
703 |
<br>Make sure class (%3) is listed before (%2).
|
2798
|
704 |
|
2911
|
705 |
'
|
|
706 |
bindWith: (self linkToClass: self packageDefinitionClass class selector: #classNamesAndAttributes omitClassName: true)
|
|
707 |
with: (self linkToClass: className)
|
|
708 |
with: (self linkToClass: poolName)
|
2798
|
709 |
|
2912
|
710 |
"Modified: / 13-09-2012 / 18:29:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
2798
|
711 |
!
|
|
712 |
|
|
713 |
label
|
|
714 |
"Return the label (possibly instance if a Text) shortly describing the problem"
|
|
715 |
|
3160
|
716 |
^'Class %1 listed in project definition "%2" before one of its pools' bindWith: className allBold with:self packageDefinitionClass
|
2911
|
717 |
|
|
718 |
"Modified: / 13-09-2012 / 17:36:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
719 |
! !
|
|
720 |
|
|
721 |
!ProjectProblem::ClassUsesPoolProblem methodsFor:'accessing'!
|
|
722 |
|
2798
|
723 |
poolName
|
|
724 |
^ poolName
|
|
725 |
!
|
|
726 |
|
|
727 |
poolName:something
|
|
728 |
poolName := something.
|
|
729 |
! !
|
|
730 |
|
3160
|
731 |
!ProjectProblem::ClassUsesPoolButItIsNotASharedPool methodsFor:'accessing-description'!
|
2798
|
732 |
|
|
733 |
description
|
|
734 |
"Return a (HTML) describing the problem."
|
|
735 |
|
|
736 |
^
|
3147
|
737 |
'A class %1 uses pool %2 but it does not exist.
|
2798
|
738 |
|
3154
|
739 |
The pool should be removed from the class definition;
|
3147
|
740 |
otherwise the package won''t compile due to a missing class.'
|
2911
|
741 |
bindWith: (self linkToClass: className)
|
3154
|
742 |
with: (self linkToClass: poolName)
|
2798
|
743 |
|
|
744 |
"Modified: / 23-02-2012 / 13:48:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
745 |
!
|
|
746 |
|
|
747 |
label
|
|
748 |
"Return the label (possibly instance if a Text) shortly describing the problem"
|
|
749 |
|
3160
|
750 |
^'Used pool %1 is not a SharedPool' bindWith: className allBold
|
2798
|
751 |
|
|
752 |
"Modified: / 23-02-2012 / 13:40:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
2911
|
753 |
! !
|
|
754 |
|
3160
|
755 |
!ProjectProblem::ClassUsesPoolInNamespaceButNamespaceIsNotDefined methodsFor:'accessing-description'!
|
2911
|
756 |
|
|
757 |
description
|
|
758 |
"Return a (HTML) describing the problem."
|
|
759 |
|
|
760 |
^
|
3147
|
761 |
'A class %1 uses pool %2 from same namespace as the class,
|
|
762 |
but the namespace is not explicitly named in the shared pools definition.
|
2911
|
763 |
|
|
764 |
Due to a bug in stc, such code will fail to compile. A pool definition
|
3147
|
765 |
must contain a fully qualified class name including namespace.'
|
2911
|
766 |
bindWith: (self linkToClass: className)
|
3154
|
767 |
with: (self linkToClass: poolName)
|
2911
|
768 |
|
|
769 |
"Modified: / 13-09-2012 / 16:32:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
2798
|
770 |
!
|
|
771 |
|
2911
|
772 |
label
|
|
773 |
"Return the label (possibly instance if a Text) shortly describing the problem"
|
|
774 |
|
3160
|
775 |
^ 'Missing namespace prefix in shared pools definition of %1' bindWith: className allBold
|
2911
|
776 |
|
|
777 |
"Modified: / 13-09-2012 / 16:28:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
778 |
! !
|
|
779 |
|
3160
|
780 |
!ProjectProblem::ClassUsesPoolButItDoesNotExist methodsFor:'accessing-description'!
|
2911
|
781 |
|
|
782 |
description
|
|
783 |
"Return a (HTML) describing the problem."
|
|
784 |
|
|
785 |
^
|
3147
|
786 |
'A class %1 uses pool %2 but it does not exist.
|
2911
|
787 |
|
3154
|
788 |
The pool should be removed from the class definition;
|
3147
|
789 |
otherwise the package won''t compile due to a missing class.'
|
2911
|
790 |
bindWith: (self linkToClass: className) with: poolName
|
|
791 |
|
|
792 |
"Modified: / 13-09-2012 / 16:24:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
2798
|
793 |
!
|
|
794 |
|
2911
|
795 |
label
|
|
796 |
"Return the label (possibly instance if a Text) shortly describing the problem"
|
|
797 |
|
3160
|
798 |
^'Missing pool: ' , className allBold
|
2911
|
799 |
|
|
800 |
"Modified: / 23-02-2012 / 13:34:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
2798
|
801 |
! !
|
|
802 |
|
|
803 |
!ProjectProblem::MethodProblem methodsFor:'accessing'!
|
|
804 |
|
|
805 |
className:something selector: sel
|
|
806 |
className := something.
|
|
807 |
selector := sel
|
|
808 |
|
|
809 |
"Created: / 23-02-2012 / 14:17:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
810 |
!
|
|
811 |
|
2854
|
812 |
method
|
|
813 |
| class |
|
|
814 |
|
|
815 |
class := self klass.
|
3166
|
816 |
class isNil ifTrue:[ ^ nil ].
|
2854
|
817 |
^class compiledMethodAt: selector
|
|
818 |
|
|
819 |
"Created: / 26-07-2012 / 10:09:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
820 |
!
|
|
821 |
|
|
822 |
method: method
|
|
823 |
|
|
824 |
self className: method mclass name selector: method selector
|
|
825 |
|
|
826 |
"Created: / 11-04-2012 / 12:32:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
827 |
!
|
|
828 |
|
2798
|
829 |
selector
|
|
830 |
^ selector
|
|
831 |
!
|
|
832 |
|
|
833 |
selector:something
|
|
834 |
selector := something.
|
|
835 |
! !
|
|
836 |
|
3204
|
837 |
!ProjectProblem::MethodProblem methodsFor:'fixes'!
|
|
838 |
|
|
839 |
doRemoveMethodFromExtensionsList
|
|
840 |
"update the extension method info in the project definition.
|
|
841 |
Return false if fix fails, true otherwise"
|
|
842 |
|
|
843 |
| def mthd |
|
|
844 |
|
|
845 |
def := self packageDefinitionClass.
|
|
846 |
def isNil ifTrue:[ ^ false ].
|
|
847 |
mthd := self method.
|
|
848 |
mthd isNil ifTrue:[ ^ false ].
|
|
849 |
|
|
850 |
def excludeMethods:(Array with:mthd) usingCompiler:nil.
|
|
851 |
UserNotification notify: ('ProjectDefinition updated. Do not forget to check it in!!').
|
|
852 |
^true
|
|
853 |
!
|
|
854 |
|
|
855 |
doRemoveNamedMethodFromExtensionsList
|
|
856 |
"update the extension method info in the project definition.
|
|
857 |
Return false if fix fails, true otherwise"
|
|
858 |
|
|
859 |
| def |
|
|
860 |
|
|
861 |
def := self packageDefinitionClass.
|
|
862 |
def isNil ifTrue:[ ^ false ].
|
|
863 |
|
|
864 |
def excludeMethodFor:selector inClassNamed:className usingCompiler:nil.
|
|
865 |
UserNotification notify: ('ProjectDefinition updated. Do not forget to check it in!!').
|
|
866 |
^true
|
|
867 |
! !
|
|
868 |
|
2798
|
869 |
!ProjectProblem::MethodProblem methodsFor:'utilities-HTML'!
|
|
870 |
|
|
871 |
linkToMethod
|
|
872 |
|
|
873 |
^self linkToClass: className selector: selector
|
|
874 |
|
|
875 |
"Created: / 23-02-2012 / 14:21:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
876 |
! !
|
|
877 |
|
3166
|
878 |
!ProjectProblem::ExtensionMethodListedButInDifferentPackage methodsFor:'accessing-description'!
|
|
879 |
|
|
880 |
description
|
|
881 |
"Return a (HTML) describing the problem."
|
|
882 |
|
3168
|
883 |
|mthd text|
|
3166
|
884 |
|
3168
|
885 |
(mthd := self method) isNil ifTrue:[ ^ 'Method removed.' ].
|
3169
|
886 |
|
3168
|
887 |
mthd package = mthd mclass package ifTrue:[
|
|
888 |
text :=
|
|
889 |
'Method %1 listed in %3 but is in its classes package (%4).
|
|
890 |
Maybe the method used to be an extension but is now a proper part of the class.
|
|
891 |
|
3169
|
892 |
It is recommended to remove the method name from the extensions list (%3).'
|
3168
|
893 |
] ifFalse:[
|
|
894 |
text :=
|
|
895 |
'Method %1 listed in %3 but is in a different package (%4).
|
3166
|
896 |
The package will compile but may fail to (auto)load from sources.
|
|
897 |
|
3169
|
898 |
It is recommended to either remove the method name from the extensions list (%3)
|
3166
|
899 |
or move the method it to the correct package.'
|
3168
|
900 |
].
|
|
901 |
^ text
|
|
902 |
bindWith: (self linkToClass: (Smalltalk classNamed: className) selector: selector) "className"
|
|
903 |
with: selector
|
|
904 |
with: (self linkToClass: self packageDefinitionClass class selector: #extensionMethodNames)
|
|
905 |
with: mthd package
|
3166
|
906 |
|
|
907 |
"Modified: / 23-02-2012 / 15:18:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
908 |
!
|
|
909 |
|
|
910 |
label
|
|
911 |
"Return the label (possibly instance if a Text) shortly describing the problem"
|
|
912 |
|
3168
|
913 |
|mthd text|
|
|
914 |
|
|
915 |
text := 'Extension method %1 >> %2 listed but in different package'.
|
|
916 |
|
|
917 |
(mthd := self method) notNil ifTrue:[
|
|
918 |
mthd package = mthd mclass package ifTrue:[
|
|
919 |
text := 'Extension method %1 >> %2 listed but in classes package'
|
|
920 |
]
|
|
921 |
].
|
|
922 |
^ text
|
3166
|
923 |
bindWith: className allBold
|
|
924 |
with: selector allBold
|
|
925 |
|
|
926 |
"Modified: / 23-02-2012 / 14:22:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
927 |
! !
|
|
928 |
|
|
929 |
!ProjectProblem::ExtensionMethodListedButInDifferentPackage methodsFor:'fixes'!
|
|
930 |
|
3169
|
931 |
alreadyFixed
|
|
932 |
|mthd|
|
|
933 |
|
|
934 |
(self packageDefinitionClass extensionMethods includes:self method) ifFalse:[^ true].
|
|
935 |
^ ((mthd := self method) notNil
|
|
936 |
and:[ mthd package = package ])
|
|
937 |
!
|
|
938 |
|
3166
|
939 |
doMoveMethodToProject
|
|
940 |
self method package:package
|
|
941 |
!
|
|
942 |
|
|
943 |
fixes
|
3168
|
944 |
|mthd|
|
|
945 |
|
|
946 |
(mthd := self method) isNil ifTrue:[ ^ #() ].
|
3166
|
947 |
|
3169
|
948 |
"/ mthd package = mthd mclass package ifTrue:[
|
|
949 |
"/ ^Array
|
|
950 |
"/ with: (Array with: 'Remove from the extensionMethodNames list' with: [ self doRemoveMethodFromExtensionsList ])
|
|
951 |
"/ ].
|
|
952 |
"/
|
3166
|
953 |
^Array
|
3169
|
954 |
with: (Array with: 'Remove from the extensionMethodNames list' with: [ self doRemoveMethodFromExtensionsList ])
|
3166
|
955 |
with: (Array with: 'Move method into package' with: [ self doMoveMethodToProject ])
|
|
956 |
|
|
957 |
"Created: / 26-07-2012 / 10:41:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
958 |
! !
|
|
959 |
|
3160
|
960 |
!ProjectProblem::ExtensionMethodNotListed methodsFor:'accessing-description'!
|
2798
|
961 |
|
|
962 |
description
|
|
963 |
"Return a (HTML) describing the problem."
|
|
964 |
|
3154
|
965 |
^'Method %1 is not listed in %2.
|
3143
|
966 |
<br>It should either be listed in the project definition, or moved to the owning classes package'
|
2798
|
967 |
bindWith: (self linkToMethod)
|
3169
|
968 |
with: (self linkToClass: self packageDefinitionClass class selector: #extensionMethodNames)
|
2798
|
969 |
|
|
970 |
"Modified: / 23-02-2012 / 14:34:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
971 |
!
|
|
972 |
|
|
973 |
label
|
|
974 |
"Return the label (possibly instance if a Text) shortly describing the problem"
|
|
975 |
|
3160
|
976 |
^'Extension method %1 >> %2 not listed in project definition "%3"' bindWith: className allBold with: selector allBold with:self packageDefinitionClass
|
2798
|
977 |
|
|
978 |
"Modified: / 23-02-2012 / 14:22:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
979 |
! !
|
|
980 |
|
3143
|
981 |
!ProjectProblem::ExtensionMethodNotListed methodsFor:'fixing'!
|
|
982 |
|
3169
|
983 |
alreadyFixed
|
|
984 |
^ (self packageDefinitionClass extensionMethods includes:self method)
|
|
985 |
!
|
|
986 |
|
3143
|
987 |
doMoveToClassesPackage
|
3154
|
988 |
"move the extension method to the owning classes package.
|
3143
|
989 |
Return false if fix fails, true otherwise"
|
|
990 |
|
|
991 |
| cls mthd |
|
|
992 |
|
|
993 |
cls := self klass.
|
|
994 |
cls isNil ifTrue:[ ^ false ].
|
|
995 |
mthd := cls compiledMethodAt:selector.
|
|
996 |
mthd package:(cls package).
|
|
997 |
UserNotification notify: ('Do not forget to check in the method''s package (or class) ("%1")!!' bindWith:cls package).
|
|
998 |
^true
|
|
999 |
!
|
|
1000 |
|
|
1001 |
doUpdateExtensionMethodsInProject
|
3154
|
1002 |
"update the extension method info in the project definition.
|
3143
|
1003 |
Return false if fix fails, true otherwise"
|
|
1004 |
|
3169
|
1005 |
| def mthd |
|
3143
|
1006 |
|
|
1007 |
def := self packageDefinitionClass.
|
|
1008 |
def isNil ifTrue:[ ^ false ].
|
3169
|
1009 |
mthd := self method.
|
|
1010 |
mthd isNil ifTrue:[ ^ false ].
|
|
1011 |
|
|
1012 |
def includeMethods:(Array with:mthd) usingCompiler:nil.
|
3143
|
1013 |
UserNotification notify: ('ProjectDefinition updated. Do not forget to check it in!!').
|
|
1014 |
^true
|
|
1015 |
!
|
|
1016 |
|
|
1017 |
fixes
|
|
1018 |
^Array
|
3200
|
1019 |
with: (Array with: 'Add method to project' with: [ self doUpdateExtensionMethodsInProject ])
|
3169
|
1020 |
with: (Array with: 'Move to classes package' with: [ self doMoveToClassesPackage ])
|
3198
|
1021 |
with: (Array with: 'Full update of the project definitions (rescan)' with: [ self doUpdateAllProjectDefinitions ])
|
3143
|
1022 |
! !
|
|
1023 |
|
3166
|
1024 |
!ProjectProblem::ExtensionMethodsClassDoesNotExist methodsFor:'accessing-description'!
|
|
1025 |
|
|
1026 |
description
|
|
1027 |
"Return a (HTML) describing the problem."
|
|
1028 |
|
|
1029 |
^'Method %1 >> %2 listed in %3 but class does not exist.
|
|
1030 |
The package will compile but may fail to (auto)load from sources.
|
|
1031 |
|
|
1032 |
It is recommended to remove the method from the list (%3).'
|
|
1033 |
bindWith: className
|
|
1034 |
with: selector
|
|
1035 |
with: (self linkToClass: self packageDefinitionClass class selector: #extensionMethodNames)
|
|
1036 |
!
|
|
1037 |
|
|
1038 |
label
|
|
1039 |
"Return the label (possibly instance if a Text) shortly describing the problem"
|
|
1040 |
|
|
1041 |
^'Extension method %1 >> %2 listed but class not existing'
|
|
1042 |
bindWith: className allBold
|
|
1043 |
with: selector allBold
|
|
1044 |
|
|
1045 |
"Modified: / 23-02-2012 / 14:22:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
1046 |
! !
|
|
1047 |
|
3204
|
1048 |
!ProjectProblem::ExtensionMethodsClassDoesNotExist methodsFor:'fixes'!
|
|
1049 |
|
|
1050 |
fixes
|
|
1051 |
^Array
|
|
1052 |
with: (Array with: 'Remove from the extensionMethodNames list' with: [ self doRemoveNamedMethodFromExtensionsList ])
|
|
1053 |
|
|
1054 |
"Created: / 26-07-2012 / 10:41:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
1055 |
! !
|
|
1056 |
|
3160
|
1057 |
!ProjectProblem::ClassListedBeforeItsSuperclass methodsFor:'accessing'!
|
|
1058 |
|
|
1059 |
superClassName
|
|
1060 |
^ superClassName
|
|
1061 |
!
|
|
1062 |
|
|
1063 |
superClassName:something
|
|
1064 |
superClassName := something.
|
|
1065 |
! !
|
|
1066 |
|
|
1067 |
!ProjectProblem::ClassListedBeforeItsSuperclass methodsFor:'accessing-description'!
|
|
1068 |
|
|
1069 |
description
|
|
1070 |
"Return a (HTML) describing the problem."
|
|
1071 |
|
|
1072 |
^
|
3166
|
1073 |
'Class %2 is listed in project definition (%1) before its superclass %3.
|
3170
|
1074 |
<br>The package can be stc-compiled
|
|
1075 |
(because the generated makefile compiles in correct order)
|
3171
|
1076 |
but the class may fail to load from source.
|
3160
|
1077 |
<br>Make sure %3 is listed before %2.
|
|
1078 |
|
|
1079 |
'
|
|
1080 |
bindWith: (self linkToClass: self packageDefinitionClass class selector: #classNamesAndAttributes omitClassName: true)
|
|
1081 |
with: (self linkToClass: className)
|
|
1082 |
with: (self linkToClass: superClassName)
|
|
1083 |
|
|
1084 |
"Modified: / 13-09-2012 / 18:29:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
1085 |
!
|
|
1086 |
|
|
1087 |
label
|
|
1088 |
"Return the label (possibly instance if a Text) shortly describing the problem"
|
|
1089 |
|
|
1090 |
^'Class %1 listed in project definition "%2" before its superclass' bindWith: className allBold with:self packageDefinitionClass
|
|
1091 |
|
|
1092 |
"Modified: / 13-09-2012 / 17:36:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
1093 |
! !
|
|
1094 |
|
2854
|
1095 |
!ProjectProblem::MethodCompilabilityIssue methodsFor:'accessing'!
|
|
1096 |
|
3160
|
1097 |
severity
|
|
1098 |
^ errors notNil ifTrue:[#error] ifFalse:[#warning]
|
|
1099 |
|
|
1100 |
"Modified: / 11-04-2012 / 15:40:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
1101 |
! !
|
|
1102 |
|
|
1103 |
!ProjectProblem::MethodCompilabilityIssue methodsFor:'accessing-description'!
|
|
1104 |
|
2854
|
1105 |
description
|
|
1106 |
"Return a (HTML) describing the problem."
|
|
1107 |
|
|
1108 |
| issuePrinter |
|
|
1109 |
|
|
1110 |
issuePrinter := [:stream :issue|
|
3154
|
1111 |
stream nextPutAll:'<li>'.
|
|
1112 |
issue descriptionOn: stream.
|
|
1113 |
stream nextPutAll:'</li>'.
|
|
1114 |
stream cr.
|
2854
|
1115 |
].
|
|
1116 |
|
|
1117 |
^ String streamContents:[:s|
|
3154
|
1118 |
s
|
|
1119 |
nextPutAll: 'The following problems have been found in ';
|
|
1120 |
nextPutAll: self linkToMethod;
|
|
1121 |
nextPutAll: ':'; cr;
|
|
1122 |
nextPutAll: '<ul>'.
|
|
1123 |
errors ? #() do:[:issue|issuePrinter value: s value: issue].
|
|
1124 |
warnings ? #() do:[:issue|issuePrinter value: s value: issue].
|
|
1125 |
s
|
|
1126 |
nextPutAll: '</ul>'.
|
2854
|
1127 |
|
3154
|
1128 |
errors notNil ifTrue:[
|
|
1129 |
s nextPutAll:
|
3147
|
1130 |
'STC won''t compile such code, therefore you must fix it before committing'
|
3154
|
1131 |
].
|
2854
|
1132 |
]
|
|
1133 |
|
|
1134 |
"Modified: / 11-04-2012 / 15:51:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
1135 |
!
|
|
1136 |
|
|
1137 |
label
|
|
1138 |
"Return the label (possibly instance if a Text) shortly describing the problem"
|
|
1139 |
|
3160
|
1140 |
^ (errors notNil
|
|
1141 |
ifTrue:[ 'Uncompilable method %1 >> %2' ]
|
|
1142 |
ifFalse:[ 'Warnings for method %1 >> %2' ]) bindWith: className allBold with: selector allBold
|
|
1143 |
|
2854
|
1144 |
|
|
1145 |
"Modified: / 11-04-2012 / 16:04:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
1146 |
! !
|
|
1147 |
|
|
1148 |
!ProjectProblem::MethodCompilabilityIssue methodsFor:'error handling'!
|
|
1149 |
|
3162
|
1150 |
addError:aMessage from: position to: endPos
|
|
1151 |
errors isNil ifTrue:[ errors := OrderedCollection new].
|
|
1152 |
errors add: (Error message: aMessage from: position to: endPos)
|
|
1153 |
!
|
|
1154 |
|
|
1155 |
addWarning:aMessage from: position to: endPos
|
|
1156 |
warnings isNil ifTrue:[ warnings := OrderedCollection new].
|
|
1157 |
warnings add: (Warning message: aMessage from: position to: endPos)
|
|
1158 |
!
|
|
1159 |
|
2854
|
1160 |
correctableError:aMessage position:position to:endPos from:aCompiler
|
|
1161 |
"error notification during fileIn.
|
|
1162 |
This is sent by the compiler/evaluator if it detects errors."
|
|
1163 |
|
|
1164 |
self error:aMessage position:position to:endPos from:aCompiler.
|
|
1165 |
^ false. "/ no correction
|
|
1166 |
|
|
1167 |
"Created: / 30-07-1999 / 18:11:15 / cg"
|
|
1168 |
"Modified: / 02-11-2010 / 12:58:54 / cg"
|
|
1169 |
!
|
|
1170 |
|
|
1171 |
correctableSelectorWarning:aMessage position:position to:endPos from:aCompiler
|
|
1172 |
"warning notification during fileIn.
|
|
1173 |
This is sent by the compiler/evaluator if it detects errors."
|
|
1174 |
|
|
1175 |
self warning:aMessage position:position to:endPos from:aCompiler.
|
|
1176 |
^ false. "/ no correction
|
|
1177 |
|
|
1178 |
"Modified: / 02-11-2010 / 12:59:04 / cg"
|
|
1179 |
!
|
|
1180 |
|
|
1181 |
correctableWarning:aMessage position:position to:endPos from:aCompiler
|
|
1182 |
"error notification during fileIn.
|
|
1183 |
This is sent by the compiler/evaluator if it detects errors."
|
|
1184 |
|
|
1185 |
self warning:aMessage position:position to:endPos from:aCompiler.
|
|
1186 |
^ false
|
|
1187 |
|
|
1188 |
"Created: / 02-11-2010 / 13:29:40 / cg"
|
|
1189 |
!
|
|
1190 |
|
|
1191 |
error:aMessage position:position to:endPos from:aCompiler
|
|
1192 |
"error notification during fileIn.
|
|
1193 |
This is sent by the compiler/evaluator if it detects errors."
|
|
1194 |
|
2911
|
1195 |
"Argh!!!!!!!! If its an ignorable error, why signal error!!!!!! Bad design,
|
|
1196 |
even worse workaround. Sigh."
|
3162
|
1197 |
(thisContext findNextContextWithSelector:#ignorableParseError: or:nil or:nil) notNil
|
|
1198 |
"/ thisContext sender sender sender sender selector == #ignorableParseError:
|
|
1199 |
ifTrue:[ ^ self ].
|
2911
|
1200 |
|
3162
|
1201 |
self addError:aMessage from: position to: endPos
|
2854
|
1202 |
|
|
1203 |
"Created: / 30-07-1999 / 18:10:30 / cg"
|
2911
|
1204 |
"Modified: / 10-09-2012 / 11:32:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
2854
|
1205 |
!
|
|
1206 |
|
|
1207 |
unusedVariableWarning:aMessage position:position to:endPos from:aCompiler
|
|
1208 |
"warning notification during fileIn.
|
|
1209 |
This is sent by the compiler/evaluator if it detects errors."
|
|
1210 |
|
|
1211 |
^ self warning:aMessage position:position to:endPos from:aCompiler
|
|
1212 |
!
|
|
1213 |
|
|
1214 |
warning:aMessage position:position to:endPos from:aCompiler
|
|
1215 |
"warning notification during fileIn - ignore it.
|
|
1216 |
This is sent by the compiler/evaluator if it detects errors."
|
|
1217 |
|
2911
|
1218 |
"/ No, do not show warnings now, too many false positives
|
2854
|
1219 |
"/ warnings isNil ifTrue:[ warnings := OrderedCollection new].
|
|
1220 |
"/ warnings add: (Warning message: aMessage from: position to: endPos).
|
|
1221 |
|
|
1222 |
"Created: / 30-07-1999 / 18:11:05 / cg"
|
|
1223 |
"Modified (comment): / 12-04-2012 / 18:19:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
1224 |
! !
|
|
1225 |
|
|
1226 |
!ProjectProblem::MethodCompilabilityIssue methodsFor:'queries'!
|
|
1227 |
|
|
1228 |
hasIssue
|
|
1229 |
^ (errors ? warnings) notNil
|
|
1230 |
|
|
1231 |
"Created: / 11-04-2012 / 15:43:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
1232 |
! !
|
|
1233 |
|
|
1234 |
!ProjectProblem::MethodCompilabilityIssue::Error class methodsFor:'instance creation'!
|
|
1235 |
|
|
1236 |
message: message from: startPosition to: endPosition
|
|
1237 |
|
|
1238 |
^self new
|
2911
|
1239 |
message: message;
|
|
1240 |
startPosition: startPosition;
|
|
1241 |
endPosition: endPosition;
|
|
1242 |
yourself.
|
2854
|
1243 |
|
|
1244 |
"Created: / 11-04-2012 / 15:38:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
1245 |
! !
|
|
1246 |
|
|
1247 |
!ProjectProblem::MethodCompilabilityIssue::Error methodsFor:'accessing'!
|
|
1248 |
|
|
1249 |
endPosition
|
|
1250 |
^ endPosition
|
|
1251 |
!
|
|
1252 |
|
|
1253 |
endPosition:something
|
|
1254 |
endPosition := something.
|
|
1255 |
!
|
|
1256 |
|
|
1257 |
message
|
|
1258 |
^ message
|
|
1259 |
!
|
|
1260 |
|
|
1261 |
message:something
|
|
1262 |
message := something.
|
|
1263 |
!
|
|
1264 |
|
|
1265 |
startPosition
|
|
1266 |
^ startPosition
|
|
1267 |
!
|
|
1268 |
|
|
1269 |
startPosition:something
|
|
1270 |
startPosition := something.
|
|
1271 |
! !
|
|
1272 |
|
3160
|
1273 |
!ProjectProblem::MethodCompilabilityIssue::Error methodsFor:'accessing-description'!
|
|
1274 |
|
|
1275 |
descriptionOn: stream
|
|
1276 |
|
|
1277 |
stream nextPutAll: message; space; nextPutAll:'(error)'
|
|
1278 |
|
|
1279 |
"Created: / 11-04-2012 / 15:52:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
1280 |
! !
|
|
1281 |
|
2854
|
1282 |
!ProjectProblem::MethodCompilabilityIssue::Warning class methodsFor:'instance creation'!
|
|
1283 |
|
|
1284 |
message: message from: startPosition to: endPosition
|
|
1285 |
|
|
1286 |
^self new
|
2911
|
1287 |
message: message;
|
|
1288 |
startPosition: startPosition;
|
|
1289 |
endPosition: endPosition;
|
|
1290 |
yourself.
|
2854
|
1291 |
|
|
1292 |
"Created: / 11-04-2012 / 15:38:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
1293 |
! !
|
|
1294 |
|
|
1295 |
!ProjectProblem::MethodCompilabilityIssue::Warning methodsFor:'accessing'!
|
|
1296 |
|
|
1297 |
endPosition
|
|
1298 |
^ endPosition
|
|
1299 |
!
|
|
1300 |
|
|
1301 |
endPosition:something
|
|
1302 |
endPosition := something.
|
|
1303 |
!
|
|
1304 |
|
|
1305 |
message
|
|
1306 |
^ message
|
|
1307 |
!
|
|
1308 |
|
|
1309 |
message:something
|
|
1310 |
message := something.
|
|
1311 |
!
|
|
1312 |
|
|
1313 |
startPosition
|
|
1314 |
^ startPosition
|
|
1315 |
!
|
|
1316 |
|
|
1317 |
startPosition:something
|
|
1318 |
startPosition := something.
|
|
1319 |
! !
|
|
1320 |
|
3160
|
1321 |
!ProjectProblem::MethodCompilabilityIssue::Warning methodsFor:'accessing-description'!
|
2798
|
1322 |
|
3160
|
1323 |
descriptionOn: stream
|
2798
|
1324 |
|
3160
|
1325 |
stream nextPutAll: message; space"/; nextPutAll:'(warning)'
|
2798
|
1326 |
|
3160
|
1327 |
"Created: / 11-04-2012 / 15:52:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
1328 |
! !
|
|
1329 |
|
|
1330 |
!ProjectProblem::MethodInNoPackage methodsFor:'accessing'!
|
2798
|
1331 |
|
2854
|
1332 |
fixes
|
|
1333 |
|
|
1334 |
^Array with:
|
2911
|
1335 |
(Array with: 'Move method to package ', package
|
|
1336 |
with: [
|
|
1337 |
| m |
|
2854
|
1338 |
|
2911
|
1339 |
m := self method.
|
|
1340 |
m notNil ifTrue:[
|
|
1341 |
m package: package.
|
|
1342 |
true
|
|
1343 |
] ifFalse:[
|
|
1344 |
false
|
|
1345 |
]
|
|
1346 |
])
|
2854
|
1347 |
|
|
1348 |
"Created: / 26-07-2012 / 09:53:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
3160
|
1349 |
! !
|
|
1350 |
|
|
1351 |
!ProjectProblem::MethodInNoPackage methodsFor:'accessing-description'!
|
|
1352 |
|
3217
|
1353 |
alreadyFixed
|
|
1354 |
^ (self method package ~= PackageId noProjectID)
|
|
1355 |
!
|
|
1356 |
|
3160
|
1357 |
description
|
|
1358 |
"Return a (HTML) describing the problem."
|
|
1359 |
|
|
1360 |
^
|
|
1361 |
'Method %1 does not belong to any package. Such methods
|
|
1362 |
are not committed and will be lost when you restart/recompile.
|
3342
|
1363 |
Especially, it will not be included when you generate a compiled class library.
|
|
1364 |
However, it will be kept in the changes file, so it is not completely lost.
|
|
1365 |
The method should be moved to some package, %2 maybe?'
|
3160
|
1366 |
bindWith: (self linkToMethod)
|
3342
|
1367 |
with: package
|
3160
|
1368 |
|
|
1369 |
"Modified: / 23-02-2012 / 14:21:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
2854
|
1370 |
!
|
|
1371 |
|
2798
|
1372 |
label
|
|
1373 |
"Return the label (possibly instance if a Text) shortly describing the problem"
|
|
1374 |
|
3160
|
1375 |
^'Unpackaged method %1 >> %2' bindWith: className allBold with: selector allBold
|
2798
|
1376 |
|
|
1377 |
"Modified: / 23-02-2012 / 14:19:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
1378 |
! !
|
|
1379 |
|
3160
|
1380 |
!ProjectProblem::ExtensionMethodListedButDoesNotExist methodsFor:'accessing-description'!
|
2798
|
1381 |
|
|
1382 |
description
|
|
1383 |
"Return a (HTML) describing the problem."
|
|
1384 |
|
3166
|
1385 |
^'Method %1 listed in %3 but does not exist.
|
|
1386 |
The package will compile but may fail to (auto)load from sources.
|
2798
|
1387 |
|
3166
|
1388 |
It is recommended to remove the method from the list (%3).'
|
|
1389 |
bindWith: (self linkToClass: (Smalltalk classNamed: className) selector: selector) "className"
|
|
1390 |
with: selector
|
|
1391 |
with: (self linkToClass: self packageDefinitionClass class selector: #extensionMethodNames)
|
2798
|
1392 |
|
|
1393 |
"Modified: / 23-02-2012 / 15:18:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
1394 |
!
|
|
1395 |
|
|
1396 |
label
|
|
1397 |
"Return the label (possibly instance if a Text) shortly describing the problem"
|
|
1398 |
|
3160
|
1399 |
^'Extension method %1 >> %2 listed but not existing' bindWith: className allBold with: selector allBold
|
2798
|
1400 |
|
|
1401 |
"Modified: / 23-02-2012 / 14:22:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
1402 |
! !
|
|
1403 |
|
3204
|
1404 |
!ProjectProblem::ExtensionMethodListedButDoesNotExist methodsFor:'fixes'!
|
|
1405 |
|
|
1406 |
fixes
|
|
1407 |
^Array
|
|
1408 |
with: (Array with: 'Remove from the extensionMethodNames list' with: [ self doRemoveNamedMethodFromExtensionsList ])
|
|
1409 |
|
|
1410 |
"Created: / 26-07-2012 / 10:41:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
1411 |
! !
|
|
1412 |
|
2854
|
1413 |
!ProjectProblem::MethodSourceCorrupted methodsFor:'accessing'!
|
|
1414 |
|
3160
|
1415 |
severity
|
|
1416 |
"Return a severity - one of #error, #warning, #info"
|
|
1417 |
|
|
1418 |
^#error
|
|
1419 |
|
|
1420 |
"Created: / 11-04-2012 / 12:47:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
1421 |
! !
|
|
1422 |
|
|
1423 |
!ProjectProblem::MethodSourceCorrupted methodsFor:'accessing-description'!
|
|
1424 |
|
2854
|
1425 |
description
|
|
1426 |
"Return a (HTML) describing the problem."
|
|
1427 |
|
|
1428 |
^
|
|
1429 |
'Source code for %1 is <b>corrupted</b>. This is likely because
|
|
1430 |
the binary class version does not match the source file. This may happen,
|
3147
|
1431 |
for instance, if you compile a class library and then edit the .st file,
|
|
1432 |
or you have checked out from the SCM over the existing source code.
|
|
1433 |
<BR>Be very careful with checkin or fileOut, and check for currupt source code.
|
|
1434 |
<BR>It is recommended to leave ST/X, restore the old source or compile a system
|
|
1435 |
based on the current source, restart ST/X, reapply the chages and commit then.'
|
2911
|
1436 |
bindWith: (self linkToMethod)
|
3154
|
1437 |
with: package
|
2854
|
1438 |
|
|
1439 |
"Modified: / 11-04-2012 / 12:47:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
1440 |
!
|
|
1441 |
|
|
1442 |
label
|
|
1443 |
"Return the label (possibly instance if a Text) shortly describing the problem"
|
|
1444 |
|
3160
|
1445 |
^ 'Corrupted source code for %1 >> %2' bindWith: className allBold with: selector allBold
|
2854
|
1446 |
|
|
1447 |
"Modified: / 11-04-2012 / 12:42:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
3160
|
1448 |
! !
|
|
1449 |
|
|
1450 |
!ProjectProblem::MethodSourceNotAvailable methodsFor:'accessing'!
|
2854
|
1451 |
|
|
1452 |
severity
|
|
1453 |
"Return a severity - one of #error, #warning, #info"
|
|
1454 |
|
|
1455 |
^#error
|
|
1456 |
|
3160
|
1457 |
"Created: / 11-04-2012 / 12:47:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
2854
|
1458 |
! !
|
|
1459 |
|
3160
|
1460 |
!ProjectProblem::MethodSourceNotAvailable methodsFor:'accessing-description'!
|
2854
|
1461 |
|
|
1462 |
description
|
|
1463 |
"Return a (HTML) describing the problem."
|
|
1464 |
|
|
1465 |
^
|
3147
|
1466 |
'Source code for %1 is not available. Check your package path
|
2854
|
1467 |
and/or source code management settings.
|
|
1468 |
'
|
2911
|
1469 |
bindWith: (self linkToMethod)
|
3154
|
1470 |
with: package
|
2854
|
1471 |
|
|
1472 |
"Modified: / 11-04-2012 / 12:44:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
1473 |
!
|
|
1474 |
|
|
1475 |
label
|
|
1476 |
"Return the label (possibly instance if a Text) shortly describing the problem"
|
|
1477 |
|
3160
|
1478 |
^ 'Unavailable source code for %1 >> %2' bindWith: className allBold with: selector allBold
|
2854
|
1479 |
|
|
1480 |
"Modified: / 11-04-2012 / 12:41:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
3160
|
1481 |
! !
|
|
1482 |
|
|
1483 |
!ProjectProblem::ProjectDefinitionDoesNotExist methodsFor:'accessing'!
|
2854
|
1484 |
|
|
1485 |
severity
|
|
1486 |
"Return a severity - one of #error, #warning, #info"
|
|
1487 |
|
|
1488 |
^#error
|
|
1489 |
|
3160
|
1490 |
"Created: / 11-04-2012 / 12:48:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
2854
|
1491 |
! !
|
|
1492 |
|
3160
|
1493 |
!ProjectProblem::ProjectDefinitionDoesNotExist methodsFor:'accessing-description'!
|
2798
|
1494 |
|
|
1495 |
description
|
|
1496 |
"Return a (HTML) describing the problem."
|
|
1497 |
|
3152
|
1498 |
package = 'stx' ifTrue:[
|
3198
|
1499 |
^
|
3154
|
1500 |
'Move your code to another package.
|
3198
|
1501 |
<br>The package name "stx" is reserveed for exept''s ST/X development.'
|
3152
|
1502 |
].
|
|
1503 |
|
2798
|
1504 |
^
|
3152
|
1505 |
'A project definition class for package "%1" does not exist.
|
|
1506 |
<br>Project definition classes keep the meta information of a package,
|
|
1507 |
such as contents and build parameters.
|
3198
|
1508 |
You <b>must</b> create it, otherwise package management won''t work,
|
|
1509 |
and the package cannot be compiled to a binary dll.'
|
3152
|
1510 |
bindWith: package
|
2798
|
1511 |
|
|
1512 |
"Modified: / 23-02-2012 / 13:29:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
1513 |
!
|
|
1514 |
|
|
1515 |
label
|
3152
|
1516 |
^'Project definition class for "%1" does not exist' bindWith: package
|
2798
|
1517 |
|
|
1518 |
"Modified: / 23-02-2012 / 13:21:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
1519 |
! !
|
|
1520 |
|
3152
|
1521 |
!ProjectProblem::ProjectDefinitionDoesNotExist methodsFor:'fixing'!
|
|
1522 |
|
3225
|
1523 |
alreadyFixed
|
|
1524 |
^ (ProjectDefinition definitionClassForPackage:package) notNil
|
|
1525 |
!
|
|
1526 |
|
3152
|
1527 |
doCreateAs:whatType
|
3198
|
1528 |
|prjDef|
|
|
1529 |
|
|
1530 |
prjDef := ProjectDefinition
|
|
1531 |
definitionClassForPackage:package
|
|
1532 |
projectType: whatType
|
|
1533 |
createIfAbsent:true.
|
|
1534 |
|
|
1535 |
prjDef
|
|
1536 |
updateMethodsCodeUsingCompiler:Compiler
|
|
1537 |
ignoreOldDefinition:true
|
3152
|
1538 |
!
|
|
1539 |
|
|
1540 |
doCreateAsGUIApplication
|
|
1541 |
self doCreateAs:ProjectDefinition guiApplicationType
|
|
1542 |
!
|
|
1543 |
|
|
1544 |
doCreateAsLibrary
|
|
1545 |
self doCreateAs:ProjectDefinition libraryType
|
|
1546 |
!
|
|
1547 |
|
|
1548 |
doCreateAsNonGUIApplication
|
|
1549 |
self doCreateAs:ProjectDefinition nonGuiApplicationType
|
|
1550 |
!
|
|
1551 |
|
|
1552 |
fixes
|
|
1553 |
package = 'stx' ifTrue:[ ^ #() ].
|
|
1554 |
|
3154
|
1555 |
^ Array
|
|
1556 |
with: (Array with:'Create as Library' with:[ self doCreateAsLibrary ] )
|
|
1557 |
with: (Array with:'Create as GUI Application' with:[ self doCreateAsGUIApplication ] )
|
|
1558 |
with: (Array with:'Create as non-GUI Application' with:[ self doCreateAsNonGUIApplication ] )
|
3152
|
1559 |
! !
|
|
1560 |
|
2798
|
1561 |
!ProjectProblem class methodsFor:'documentation'!
|
|
1562 |
|
2912
|
1563 |
version
|
3342
|
1564 |
^ '$Header: /cvs/stx/stx/libbasic3/ProjectProblem.st,v 1.23 2013-07-10 14:48:49 cg Exp $'
|
2912
|
1565 |
!
|
|
1566 |
|
|
1567 |
version_CVS
|
3342
|
1568 |
^ '$Header: /cvs/stx/stx/libbasic3/ProjectProblem.st,v 1.23 2013-07-10 14:48:49 cg Exp $'
|
2912
|
1569 |
!
|
|
1570 |
|
2854
|
1571 |
version_SVN
|
3342
|
1572 |
^ '$Id: ProjectProblem.st,v 1.23 2013-07-10 14:48:49 cg Exp $'
|
2798
|
1573 |
! !
|
3160
|
1574 |
|