diff -r d8e62525bfdf -r fa6d1f330010 Project.st --- a/Project.st Mon Feb 06 00:38:45 1995 +0100 +++ b/Project.st Mon Feb 06 01:22:02 1995 +0100 @@ -1,5 +1,5 @@ " - COPYRIGHT (c) 1990 by Claus Gittinger + COPYRIGHT (c) 1993 by Claus Gittinger All Rights Reserved This software is furnished under a license and may be used @@ -10,6 +10,8 @@ hereby transferred. " +'From Smalltalk/X, Version:2.10.4 on 5-feb-1995 at 11:58:37 pm'! + Object subclass:#Project instanceVariableNames:'name changeSet views properties packageName' classVariableNames:'CurrentProject SystemProject' @@ -21,7 +23,7 @@ COPYRIGHT (c) 1993 by Claus Gittinger All Rights Reserved -$Header: /cvs/stx/stx/libbasic/Project.st,v 1.12 1995-02-05 23:38:33 claus Exp $ +$Header: /cvs/stx/stx/libbasic/Project.st,v 1.13 1995-02-06 00:22:02 claus Exp $ '! !Project class methodsFor:'documentation'! @@ -42,7 +44,7 @@ version " -$Header: /cvs/stx/stx/libbasic/Project.st,v 1.12 1995-02-05 23:38:33 claus Exp $ +$Header: /cvs/stx/stx/libbasic/Project.st,v 1.13 1995-02-06 00:22:02 claus Exp $ " ! @@ -62,6 +64,27 @@ " ! ! +!Project class methodsFor:'initialization'! + +initialize + CurrentProject isNil ifTrue:[ + CurrentProject := SystemProject := self new name:'System'. + " + the SystemProject does not keep a record if changes, + but instead depends on the changes file - recording anything there. + " + SystemProject changeSet:nil. + ] + + "Project initialize" +! ! + +!Project class methodsFor:'instance creation'! + +new + ^ self basicNew initialize +! ! + !Project class methodsFor:'accessing'! current @@ -78,27 +101,6 @@ CurrentProject := aProject ! ! -!Project class methodsFor:'instance creation'! - -new - ^ self basicNew initialize -! ! - -!Project class methodsFor:'initialization'! - -initialize - CurrentProject isNil ifTrue:[ - CurrentProject := SystemProject := self new name:'System'. - " - the SystemProject does not keep a record if changes, - but instead depends on the changes file - recording anything there. - " - SystemProject changeSet:nil. - ] - - "Project initialize" -! ! - !Project class methodsFor:'changes management'! addMethodChange:aMethod in:aClass @@ -113,16 +115,6 @@ ] ! -addMethodCategoryChange:aMethod category:newCategory in:aClass - |p c| - - p := CurrentProject. - (p notNil - and:[(c := p changeSet) notNil]) ifTrue:[ - c addMethodCategoryChange:aMethod category:newCategory in:aClass - ] -! - currentProjectDirectory "return the name of the directory to use for fileOut. The returned name already includes a file-separator at the end, @@ -137,50 +129,34 @@ dirName := '.' ]. ^ dirName , Filename separator asString -! ! +! -!Project methodsFor:'initialization'! +addMethodCategoryChange:aMethod category:newCategory in:aClass + |p c| -initialize - views := (OrderedCollection new). - name := 'a new Project'. - packageName := 'private'. - changeSet := ChangeSet new. - self directory:'.' + p := CurrentProject. + (p notNil + and:[(c := p changeSet) notNil]) ifTrue:[ + c addMethodCategoryChange:aMethod category:newCategory in:aClass + ] ! ! !Project methodsFor:'accessing'! -views - ^ views -! - -views:aSetOfViews - views := aSetOfViews +packageName + ^ packageName ! changeSet ^ changeSet ! -changeSet:aChangeSet - changeSet := aChangeSet -! - name ^ name ! -name:aString - name := aString -! - -packageName - ^ packageName -! - -packageName:aStringOrSymbol - packageName := aStringOrSymbol asSymbol +views + ^ views ! classes @@ -196,43 +172,22 @@ ]. ^ classes -! ! - -!Project methodsFor:'properties'! - -properties - ^ properties ! -properties:p - properties := p -! - -directory - ^ properties at:#directoryName ifAbsent:['.'] +name:aString + name := aString ! -directory:aDirectoryName - properties isNil ifTrue:[ - properties := Dictionary new - ]. - properties at:#directoryName put:aDirectoryName +views:aSetOfViews + views := aSetOfViews ! -type - "return the type of project" - - ^ properties at:#type ifAbsent:[#application] +changeSet:aChangeSet + changeSet := aChangeSet ! -type:aSymbol - "set the projects type" - - (#(application library smalltalk) includes:aSymbol) ifFalse:[ - self warn:'invalid project type'. - ^ self - ]. - properties at:#type put:aSymbol +packageName:aStringOrSymbol + packageName := aStringOrSymbol asSymbol ! ! !Project methodsFor:'views'! @@ -263,6 +218,53 @@ ]. ! ! +!Project methodsFor:'initialization'! + +initialize + views := (OrderedCollection new). + name := 'a new Project'. + packageName := 'private'. + changeSet := ChangeSet new. + self directory:'.' +! ! + +!Project methodsFor:'properties'! + +directory + ^ properties at:#directoryName ifAbsent:['.'] +! + +directory:aDirectoryName + properties isNil ifTrue:[ + properties := Dictionary new + ]. + properties at:#directoryName put:aDirectoryName +! + +properties + ^ properties +! + +properties:p + properties := p +! + +type + "return the type of project" + + ^ properties at:#type ifAbsent:[#application] +! + +type:aSymbol + "set the projects type" + + (#(application library smalltalk) includes:aSymbol) ifFalse:[ + self warn:'invalid project type'. + ^ self + ]. + properties at:#type put:aSymbol +! ! + !Project methodsFor:'maintenance'! buildProject @@ -287,19 +289,20 @@ createSourcefiles "creates all Smalltalk-source files in the project directory" - |classes| + |classes dir| - Transcript showCr:'creating sources ...'; endEntry. + dir := FileDirectory directoryNamed:self directory. + Transcript showCr:'creating sources in ' , dir pathName , ' ...'; endEntry. classes := self classes. classes notNil ifTrue:[ - classes do:[:aClass | - aClass isLoaded ifFalse:[ - aClass autoload. - ]. - Transcript show:' ... '; showCr:aClass name; endEntry. - aClass fileOut - ] + classes do:[:aClass | + aClass isLoaded ifFalse:[ + aClass autoload. + ]. + Transcript show:' ... '; showCr:aClass name; endEntry. + aClass fileOutIn:dir + ] ]. !