My Dolphin 5 Environment

By: Steve Waring
Home Pages: Journal Dolphinharbor
Created: 20021010
Last Update: 20021031

Article overview

I was a hard core image saver ... in Dolphin 4 I kept the same image for 6 months. That was by far the longest I had gone without freshening up. Two factors contributed to this, I thought that Dolphin 5 was just around the corner for 6 months, and I had hacked in Donald MacQueen's refactoring browser shell and various other goodies ... rebuilding the image would have been an effort. I also used STS so I had large version histories of all my packages.

A taste of image building ... I was was a Dolphin 5 beta tester and for most of that time I continued to develop primarily in Dolphin 4, and test in Dolphin 5. I came up with a script that saved my packages out of Dolphin4 into a various Dolphin 5 hierarchies. I could start up a fresh Dolphin 5 image, install my packages, and test away. It was nice to not have *every* package installed. It was nice to not have to look after an image.

I liked the taste ... and I have been a converted image builder for the past 6 months.

My Working Pattern

The files and folders:

Building a new image:

When I start a new image, the first package I install contains a number of classes which I use to quickly configure a new image. I have a class, "SWStartup", which has class side methods which run various scripts, and install other packages. For example it:

Doing all this is simply a matter of opening a browser on this class, selecting one class method, and "doit".

I still save images, but only as a convenience, and I save my packages out more frequently than I save the image. I try to keep my images in a state so that I can rebuild, and be back to where I was in a couple of minutes. To ensure that I dont write over package changes, I only save one image, and if I work and make changes in a second image, I will rebuild the first. I have found that I rarely keep an image for more than a week before rebuilding.

IDEExtensions

Most of the modifications that I make to an image are part of my IDEExtensions.

The modifications I currently make are;

Browser class pane

Browser Method Source

Workspace

Package Browser

Most of the commands are self explanatory, some of the source is included at the bottom of the article. A couple that may not be obvious:

Source Control

In Dolphin 5 I have not been using STS except when I need to do a source comparison. I have been using a freeware versioning system that allows me to check in my package directories into a RCS based system. I typically do this manually each day. I only needed to look back into this a couple of times, but it is handy to have.

I use Ian Bartholomew's Chunk Browser and if needed, I can find (recent) previous versions of methods. What I thought I would miss most not using STS, is having full version history of my methods, however in practice I find that I have rarely needed it, and when I do, the source is in my current change log.

Handy Methods/Scripts

The following two methods (of my SWStartup class) switch on and off a notification that a method has been replaced. I use this when filing in code to make sure I know when base methods are being replaced.

doMethodUpdatedOn

SourceManager default fileInFrom: '!CompilationResult methodsFor! fireSystemUpdateEvent self isNew ifFalse: [Transcript display: ''methodUpdated ''; display: oldMethod; cr]. self method methodClass environment trigger: (self isNew ifTrue: [#methodAdded:] ifFalse: [#methodUpdated:]) with: self! ! !CompilationResult categoriesFor: #fireSystemUpdateEvent!public! !' readStream
doMethodUpdatedOff

SourceManager default fileInFrom: '!CompilationResult methodsFor! fireSystemUpdateEvent self method methodClass environment trigger: (self isNew ifTrue: [#methodAdded:] ifFalse: [#methodUpdated:]) with: self! ! !CompilationResult categoriesFor: #fireSystemUpdateEvent!public! !' readStream

I have an IDEExtension which inserts "Transcript trace" into the current method. (I have sound turned off on my development machine, so "Sound beep" isnt an option)

TranscriptShell>>trace
| sender string |
#swAdded.

sender := Processor activeProcess topFrame sender.
string := 'Transcript trace: ' , sender method printString , ' from: ' , sender sender method printString.
self nextPutAll: string; cr

The IDEExtension which inserts the above method send.

SmalltalkWorkspace>>swInsertTrace

#swAdded.

^self
replaceSelection: '
"==="
Transcript trace.
"==="
'

To find package dependencies (ie packages that have the selected package as a direct prerequisite)

PackageSelector>>swInspectDependents
| selected |
#swAdded.
selected := self packages first.
^(PackageManager current packages select: [:each |
each prerequisites includes: selected]) inspect

The extension below, which works on a multiple selection of packages, shows the root prerequisites of that selection. I use this for quickly building "install" packages, using the root packages as manual prerequisites

PackageSelector>>swInspectRoots
| roots |
#swAdded.
roots := self packages copy asOrderedCollection.
self packages do: [:each |
roots := roots difference: each allPrerequisites].
roots inspect

The following method is a script that searches through the files in my Microsoft SDK\includes directory, opening my default editor on any matches. I use this via an IDEExtension.

SWUStartup(class)>>searchSDKFor: aString
"Search through the SDK Include directory for aString. - Open any hits using the default 'open' application, prompting if more than 1 hits are found - Set the search string into the Clipboard for the 'open' application to use"
| searchString sdkDirectory paths progress |
sdkDirectory := 'C:\Program Files\Microsoft SDK\Include\'.
searchString := '*' , aString , '*'.
Clipboard current setText: aString.
"collect the paths so we can search the win* files first"
paths := SortedCollection new.
File for: '*.h' in: sdkDirectory do: [:each | paths add: each path].
File for: '*.idl' in: sdkDirectory do: [:each | paths add: each path].

progress := ProgressDialog create: ProgressDialog defaultView operation: [:progressIndicator |
paths asOrderedCollection reverse keysAndValuesDo: [:i :each | | fs contents |
progressIndicator value: i * 100 // paths size.
[fs := FileStream read: each text: true.
contents := fs contents] ensure: [fs close].
(contents notNil and: [searchString match: contents ignoreCase: false])ifTrue: [
ShellLibrary default shellOpen: each.
(MessageBox confirm: 'Keep Searching?')
ifFalse: [progress exit;cancel]]]].
^progress showModal

Feedback

If you have any IDEExtensions or Environment modifications that you find useful, I would be interested in hearing about them. Please email me

Changes

20021031 Fixed bug in SWUStartup(class)>>searchSDKFor: aString script

Copyright Steve Waring 2002.