100 '.prj' files ..." |
100 '.prj' files ..." |
101 |
101 |
102 "/ collect project info while scanning all classes |
102 "/ collect project info while scanning all classes |
103 "/ and methods ... |
103 "/ and methods ... |
104 |
104 |
105 |packages anyUnloaded| |
|
106 |
|
107 packages := Dictionary new. |
|
108 |
|
109 AllProjects isNil ifTrue:[ |
105 AllProjects isNil ifTrue:[ |
110 AllProjects := OrderedCollection new. |
106 AllProjects := IdentitySet new. |
111 ] ifFalse:[ |
107 ]. |
112 AllProjects do:[:p | packages at:p package asSymbol put:p]. |
108 |
113 ]. |
109 AllProjects add:SystemProject. |
|
110 AllProjects add:CurrentProject. |
|
111 |
114 "/ Smalltalk allClassesDo:[:aClass | |
112 "/ Smalltalk allClassesDo:[:aClass | |
115 "/ |packageID prj classFilename pkgInfo revInfo |
113 "/ |packageID prj classFilename pkgInfo revInfo |
116 "/ repositoryPath dir module lib nm| |
114 "/ repositoryPath dir module lib nm| |
117 "/ |
115 "/ |
118 "/ aClass isMeta ifFalse:[ |
116 "/ aClass isMeta ifFalse:[ |
273 "Modified: / 16.10.1999 / 13:10:37 / cg" |
271 "Modified: / 16.10.1999 / 13:10:37 / cg" |
274 ! |
272 ! |
275 |
273 |
276 initialize |
274 initialize |
277 SystemProject isNil ifTrue:[ |
275 SystemProject isNil ifTrue:[ |
278 NextSequential := 1. |
276 self initializeSystemProject. |
279 SystemProject := self new name:'default'. |
|
280 SystemProject package:(OperatingSystem getLoginName , ':NoProject'). |
|
281 SystemProject defaultNameSpace:Smalltalk. |
|
282 SystemProject comment:'A default (dummy) project. |
|
283 Will be made the current project in case no real project is ever activated.'. |
|
284 |
|
285 false ifTrue:[ |
|
286 " |
|
287 the SystemProject does not keep a record if changes, |
|
288 but instead depends on the changes file - recording anything there. |
|
289 " |
|
290 SystemProject changeSet:nil. |
|
291 ]. |
|
292 ChangeSet notNil ifTrue:[ |
|
293 SystemProject changeSet:ChangeSet new |
|
294 ]. |
|
295 self changed:#defaultProject |
|
296 ]. |
277 ]. |
297 |
278 |
298 CurrentProject := SystemProject. |
279 CurrentProject := SystemProject. |
299 AllProjects := nil. |
280 AllProjects := nil. |
300 "/ now done lazy ... |
281 self initKnownProjects. |
301 "/ self initKnownProjects. |
|
302 |
282 |
303 " |
283 " |
304 SystemProject := nil. |
284 SystemProject := nil. |
305 Project initialize |
285 Project initialize |
306 " |
286 " |
307 ! |
287 ! |
308 |
288 |
|
289 initializeSystemProject |
|
290 NextSequential := 1. |
|
291 SystemProject := self new name:'default'. |
|
292 "/ SystemProject package:(OperatingSystem getLoginName , ':NoProject') asSymbol. |
|
293 SystemProject package:#'__NoProject__'. |
|
294 SystemProject defaultNameSpace:Smalltalk. |
|
295 SystemProject comment:'A default (dummy) project. |
|
296 Is used as the current project in case no real project is ever activated. |
|
297 Please do never save/checkin this project; instead, move classes & methods |
|
298 into a concrete, real project and save that one in regular intervals. |
|
299 Use this as a `scratch project''. |
|
300 '. |
|
301 |
|
302 "/ no longer - changes are always remembered in some project |
|
303 false ifTrue:[ |
|
304 " |
|
305 the SystemProject does not keep a record if changes, |
|
306 but instead depends on the changes file - recording anything there. |
|
307 " |
|
308 SystemProject changeSet:nil. |
|
309 ]. |
|
310 ChangeSet notNil ifTrue:[ |
|
311 SystemProject changeSet:ChangeSet new |
|
312 ]. |
|
313 self changed:#defaultProject |
|
314 ! |
|
315 |
309 reinitKnownProjects |
316 reinitKnownProjects |
310 "rescan the image for projects" |
317 "rescan the image for projects" |
311 |
318 |
312 AllProjects := nil. |
319 AllProjects := nil. |
313 self initKnownProjects |
320 self initKnownProjects |
393 "retrieve the named project; return nil if not known" |
400 "retrieve the named project; return nil if not known" |
394 |
401 |
395 ^ self knownProjects detect:[:p | p name = aProjectName] ifNone:nil. |
402 ^ self knownProjects detect:[:p | p name = aProjectName] ifNone:nil. |
396 |
403 |
397 " |
404 " |
398 Project projectNamed:'libbasic' |
405 Project projectNamed:'stx' |
|
406 Project projectNamed:'default' |
399 " |
407 " |
400 ! |
408 ! |
401 |
409 |
402 projectWithId:aPackageId |
410 projectWithId:aPackageId |
403 "retrieve the project with a particular id; return nil if not known" |
411 "retrieve the project with a particular id; return nil if not known" |
404 |
412 |
405 ^ self knownProjects detect:[:p | p package = aPackageId] ifNone:nil. |
413 ^ self knownProjects detect:[:p | p package = aPackageId] ifNone:nil. |
406 |
414 |
407 " |
415 " |
408 Project projectWithId:#'stx:libbasic' |
416 Project projectWithId:#'stx:libbasic' |
|
417 Project projectWithId:'__NoProject__' |
409 " |
418 " |
410 ! |
419 ! |
411 |
420 |
412 setDefaultProject |
421 setDefaultProject |
413 "set the currently active project to be the SystemDEfault project" |
422 "set the currently active project to be the SystemDEfault project" |