cg@2596: "{ Package: 'stx:libtool2' }" cg@2596: cg@2596: Object subclass:#ProjectBuilder cg@2596: instanceVariableNames:'package projectDefinitionClass sourceCodeManager buildDirectory cg@2598: myWorkingDirectory mySTXTopDirectory myTopDirectory' cg@2596: classVariableNames:'PreviousBuildDirectory' cg@2596: poolDictionaries:'' cg@2596: category:'System-Support-Projects' cg@2596: ! cg@2596: cg@2596: cg@2596: !ProjectBuilder class methodsFor:'examples'! cg@2596: cg@2596: example1 cg@2596: Smalltalk loadPackage:'stx:projects/helloWorldApp' asAutoloaded:true. cg@2596: cg@2596: self new cg@2596: package:'stx:projects/helloWorldApp'; cg@2596: build cg@2622: ! cg@2622: cg@2622: example2 cg@2622: |builder| cg@2622: cg@2622: Smalltalk loadPackage:'stx:clients/Demos/foxCalcApplication' asAutoloaded:true. cg@2622: cg@2622: builder := self new. cg@2622: builder package:'stx:clients/Demos/foxCalcApplication'. cg@2622: builder build. cg@2622: cg@2622: UserPreferences fileBrowserClass openOnDirectory:builder packageBuildDirectory. cg@2596: ! ! cg@2596: cg@2596: !ProjectBuilder methodsFor:'accessing'! cg@2596: cg@2622: buildDirectory cg@2622: ^ buildDirectory cg@2622: ! cg@2622: cg@2596: package:aPackageIDOrSymbol cg@2596: package := aPackageIDOrSymbol asPackageId. cg@2596: ! cg@2596: cg@2622: packageBuildDirectory cg@2622: "the directoray, where the deployable binary is created (xxxSetup.exe)" cg@2622: cg@2622: ^ buildDirectory / (package asPackageId module) / (package asPackageId directory) cg@2622: ! cg@2622: cg@2596: projectDefinitionClass:something cg@2596: projectDefinitionClass := something. cg@2596: ! ! cg@2596: cg@2596: !ProjectBuilder methodsFor:'building'! cg@2596: cg@2596: build cg@2596: "/ intermediate - this will move into a commonly used utility class cg@2596: "/ (where all the project code support will be collected). cg@2596: cg@2611: |makeOutput stdOut stdErr lock| cg@2611: cg@2611: lock := Semaphore forMutualExclusion. cg@2611: makeOutput := TextStream on:(Text new:10000). cg@2611: stdErr := ActorStream new cg@2611: nextPutBlock:[:char | cg@2611: lock critical:[ cg@2611: makeOutput emphasis:{#backgroundColor->Color red. #color->Color white.}. cg@2611: makeOutput nextPut:char. cg@2611: makeOutput emphasis:nil. cg@2611: ] cg@2611: ]; cg@2611: nextPutAllBlock:[:char | cg@2611: lock critical:[ cg@2611: makeOutput emphasis:{#backgroundColor->Color red. #color->Color white.}. cg@2611: makeOutput nextPutAll:char. cg@2611: makeOutput emphasis:nil. cg@2611: ] cg@2611: ]. cg@2611: stdOut := ActorStream new cg@2611: nextPutBlock:[:char | cg@2611: lock critical:[ cg@2611: makeOutput nextPut:char. cg@2611: ] cg@2611: ]; cg@2611: nextPutAllBlock:[:char | cg@2611: lock critical:[ cg@2611: makeOutput nextPutAll:char. cg@2611: ] cg@2611: ]. cg@2611: cg@2611: self buildWithOutputTo:stdOut errorTo:stdErr. cg@2611: cg@2611: TextView openWith:makeOutput contents. cg@2611: ! cg@2611: cg@2611: buildWithOutputTo:stdOut errorTo:stdErr cg@2611: "/ intermediate - this will move into a commonly used utility class cg@2611: "/ (where all the project code support will be collected). cg@2611: cg@2596: |module directory| cg@2596: cg@2596: projectDefinitionClass := ProjectDefinition definitionClassForPackage:package. cg@2596: projectDefinitionClass isNil ifTrue:[ cg@2596: self error:('Missing ProjectDefinition class for "',package asString,'"') cg@2596: ]. cg@2596: cg@2596: "/ ensure that everything is loaded... cg@2596: projectDefinitionClass loadAsAutoloaded:false. cg@2596: projectDefinitionClass loadExtensions. cg@2596: projectDefinitionClass loadAllClassesAsAutoloaded:false. cg@2596: cg@2596: module := package module. cg@2596: directory := package directory. cg@2596: cg@2596: buildDirectory := PreviousBuildDirectory ifNil:[ UserPreferences current buildDirectory ]. cg@2596: buildDirectory isNil ifTrue:[ cg@2596: buildDirectory := Filename tempDirectory construct:'stx_build'. cg@2596: ]. cg@2596: buildDirectory := buildDirectory asFilename. cg@2596: cg@2596: "/ self validateBuildDirectoryIsPresent. cg@2596: cg@2596: PreviousBuildDirectory := buildDirectory. cg@2596: cg@2596: "/ UserPreferences current localBuild:true cg@2596: UserPreferences current localBuild ifFalse:[ cg@2596: SourceCodeManager notNil ifTrue:[ cg@2596: sourceCodeManager := SourceCodeManagerUtilities sourceCodeManagerFor:projectDefinitionClass. cg@2596: ] cg@2596: ]. cg@2596: sourceCodeManager := nil. cg@2596: cg@2598: myTopDirectory := cg@2596: Smalltalk packagePath cg@2596: detect:[:aPath | cg@2596: (aPath asFilename / 'stx' / 'include') exists cg@2596: and: [ (aPath asFilename / 'stx' / 'rules') exists ]] cg@2596: ifNone:nil. cg@2598: myTopDirectory isNil ifTrue:[ cg@2598: self error:('Cannot figure out my top directory (where stx/include and stx/rules are)') cg@2596: ]. cg@2598: myTopDirectory := myTopDirectory asFilename. cg@2598: mySTXTopDirectory := myTopDirectory / 'stx'. cg@2613: cg@2596: self setupBuildDirectory. cg@2599: self copySTCDirectoryForBuild. cg@2596: self generateSourceFiles. cg@2600: self copyDLLsForLinkage. cg@2600: self copySupportFilesForLinkage. cg@2600: self copyStartupFilesFromSmalltalk. cg@2596: cg@2611: self makeWithOutputTo:stdOut errorTo:stdErr. cg@2596: ! cg@2596: cg@2614: copyDLLsForLinkage cg@2614: |targetBuildDir| cg@2614: cg@2614: targetBuildDir := buildDirectory / package module / package directory. cg@2614: cg@2614: (projectDefinitionClass allPreRequisites) cg@2614: do:[:eachPackageToFileout | cg@2614: |packageId packageDef packageModule packageDirectory packageTargetDir cg@2614: dllSource dllSourceDir libraryName dllRelativePath| cg@2614: cg@2614: packageId := eachPackageToFileout asPackageId. cg@2614: packageModule := packageId module. cg@2614: packageDirectory := packageId directory. cg@2614: packageTargetDir := (buildDirectory / packageModule / packageDirectory) recursiveMakeDirectory. cg@2614: cg@2614: packageDef := packageId projectDefinitionClass. cg@2614: libraryName := packageDef libraryName. cg@2614: cg@2614: "/ mhmh - take them from my tree or from the projects/smalltalk execution directory ?? cg@2614: dllSourceDir := myTopDirectory / packageModule / packageDirectory. cg@2614: OperatingSystem isMSWINDOWSlike ifTrue:[ cg@2614: "/ dllRelativePath := 'objvc','/',(libraryName,'.dll'). cg@2614: "/ (dllSourceDir / dllRelativePath) exists cg@2614: false ifFalse:[ cg@2614: dllRelativePath := 'objbc','/',(libraryName,'.dll'). cg@2614: ] cg@2614: ] ifFalse:[ cg@2614: dllRelativePath := libraryName,'.so'. cg@2614: ]. cg@2614: ((packageTargetDir / dllRelativePath) exists cg@2614: and:[ (dllSourceDir / dllRelativePath) fileSize = (packageTargetDir / dllRelativePath) fileSize cg@2614: and:[ (dllSourceDir / dllRelativePath) modificationTime < (packageTargetDir / dllRelativePath) modificationTime cg@2614: "/ and:[ (dllSourceDir / dllRelativePath) sameContentsAs:(packageTargetDir / dllRelativePath) ] cg@2614: ]]) ifFalse:[ cg@2614: (packageTargetDir / dllRelativePath) directory recursiveMakeDirectory. cg@2614: (dllSourceDir / dllRelativePath) copyTo:(packageTargetDir / dllRelativePath). cg@2614: ] cg@2614: ]. cg@2600: ! cg@2600: cg@2614: copyDirectory:relativepath cg@2614: "/ need rules in stx cg@2614: ((Smalltalk projectDirectoryForPackage:'stx') asFilename construct:relativepath) cg@2614: recursiveCopyTo:(buildDirectory construct:'stx'). cg@2614: ! cg@2614: cg@2614: copyDirectoryForBuild:subdir cg@2614: |targetDir targetFile| cg@2614: cg@2614: targetDir := buildDirectory / 'stx' / subdir. cg@2614: targetDir exists ifFalse:[ cg@2614: targetDir makeDirectory. cg@2614: ]. cg@2614: (mySTXTopDirectory / subdir) directoryContentsAsFilenamesDo:[:eachFile | cg@2614: eachFile isDirectory ifFalse:[ cg@2614: targetFile := targetDir / eachFile baseName. cg@2614: (targetFile exists not cg@2614: or:[ targetFile modificationTime < eachFile modificationTime ]) ifTrue:[ cg@2614: self activityNotification:'copying ',eachFile pathName,'...'. cg@2614: eachFile copyTo:(targetDir construct:eachFile baseName) cg@2614: ] cg@2614: ]. cg@2614: ]. cg@2614: self activityNotification:nil cg@2598: ! cg@2598: cg@2614: copyResourcesForPackage:aPackage cg@2614: |module directory| cg@2614: cg@2614: module := aPackage asPackageId module. cg@2614: directory := aPackage asPackageId directory. cg@2614: cg@2614: (myTopDirectory / module / directory / 'resources' ) exists ifTrue:[ cg@2614: (myTopDirectory / module / directory / 'resources' ) cg@2614: recursiveCopyTo:(buildDirectory / module / directory) cg@2614: ]. cg@2614: (myTopDirectory / module / directory / 'styles' ) exists ifTrue:[ cg@2614: (myTopDirectory / module / directory / 'styles' ) cg@2614: recursiveCopyTo:(buildDirectory / module / directory) cg@2614: ]. cg@2614: ! cg@2614: cg@2614: copySTCDirectoryForBuild cg@2614: |targetDir stc files| cg@2614: cg@2614: targetDir := buildDirectory / 'stx' / 'stc'. cg@2614: targetDir exists ifFalse:[ targetDir makeDirectory ]. cg@2614: cg@2614: stc := OperatingSystem isMSWINDOWSlike cg@2614: ifTrue:[ 'stc.exe' ] cg@2614: ifFalse:[ 'stc' ]. cg@2614: cg@2614: files := #( ) copyWith:stc. cg@2614: cg@2614: files do:[:eachFile | cg@2614: |sourceFile targetFile| cg@2614: cg@2614: sourceFile := mySTXTopDirectory / 'stc' / eachFile. cg@2614: targetFile := targetDir / eachFile. cg@2614: (targetFile exists not cg@2614: or:[ targetFile modificationTime < sourceFile modificationTime ]) ifTrue:[ cg@2614: self activityNotification:'copying ',sourceFile pathName,'...'. cg@2614: sourceFile copyTo:targetFile cg@2614: ]. cg@2614: ]. cg@2614: self activityNotification:nil cg@2599: ! cg@2599: cg@2614: copyStartupFilesFromSmalltalk cg@2614: (buildDirectory / 'stx' / 'projects/smalltalk' ) exists ifFalse:[ cg@2614: (buildDirectory / 'stx' / 'projects/smalltalk' ) recursiveMakeDirectory. cg@2614: ]. cg@2614: cg@2614: #( 'keyboard.rc' 'keyboardMacros.rc' 'display.rc' 'd_win32.rc' cg@2614: 'host.rc' 'h_win32.rc' cg@2614: ) do:[:fn | cg@2614: (myTopDirectory / 'stx' / 'projects/smalltalk' / fn) cg@2614: copyTo: (buildDirectory / 'stx' / 'projects/smalltalk' / fn) cg@2614: ] cg@2600: ! cg@2600: cg@2614: copySupportFilesForLinkage cg@2614: |files| cg@2614: cg@2614: OperatingSystem isMSWINDOWSlike ifTrue:[ cg@2614: files := #( cg@2614: 'support/win32/borland/cs3245.dll' cg@2614: 'support/win32/X11.dll' cg@2614: 'support/win32/Xext.dll' cg@2614: 'librun/librun.dll' cg@2614: 'libbc/librun.lib' cg@2614: 'libbc/cs32i.lib' cg@2614: 'librun/genDate.exe' cg@2614: 'librun/main.c' cg@2614: ). cg@2614: ] ifFalse:[ cg@2614: files := #( cg@2614: 'librun/genDate' cg@2614: 'librun/main.c' cg@2614: 'librun/librun.so' cg@2614: ) cg@2614: ]. cg@2614: cg@2614: files do:[:dllRelativePath | cg@2614: ((buildDirectory / 'stx' / dllRelativePath) exists cg@2614: and:[ (mySTXTopDirectory / dllRelativePath) fileSize = (buildDirectory / 'stx' / dllRelativePath) fileSize cg@2614: and:[ (mySTXTopDirectory / dllRelativePath) modificationTime < (buildDirectory / 'stx' / dllRelativePath) modificationTime cg@2614: "/ and:[ (mySTXTopDirectory / dllRelativePath) sameContentsAs:(targetBuildDir / dllRelativePath) ] cg@2614: ]]) ifFalse:[ cg@2614: (buildDirectory / 'stx' / dllRelativePath) directory recursiveMakeDirectory. cg@2614: (mySTXTopDirectory / dllRelativePath) copyTo:(buildDirectory / 'stx' / dllRelativePath). cg@2614: ] cg@2614: ]. cg@2600: ! cg@2600: cg@2614: createHeaderFileFor:aClass in:packageTargetDir cg@2614: |instVarList classInstVarList classVarList bindings superclassFilename cg@2614: template file newContents oldContents| cg@2614: cg@2614: instVarList := StringCollection new. cg@2614: aClass instVarNames do:[:v | cg@2614: instVarList add:('OBJ %1;' bindWith:v) cg@2614: ]. cg@2614: classInstVarList := StringCollection new. cg@2614: aClass class instVarNames do:[:v | cg@2614: (v includes:$_) ifTrue:[self halt]. cg@2614: classInstVarList add:('OBJ %1;' bindWith:v) cg@2614: ]. cg@2614: classVarList := StringCollection new. cg@2614: aClass classVarNames do:[:v | cg@2614: classVarList add:('extern OBJ %1_%2;' bindWith:aClass name with:v) cg@2614: ]. cg@2614: cg@2614: bindings := Dictionary new. cg@2614: bindings at:'ClassName' put:aClass name. cg@2614: aClass superclass isNil ifTrue:[ cg@2614: bindings at:'SuperclassName' put:'-'. cg@2614: bindings at:'SuperclassFileInclude' put:nil. cg@2614: ] ifFalse:[ cg@2614: bindings at:'SuperclassName' put:aClass superclass name. cg@2614: bindings at:'SuperclassFileName' put:(superclassFilename := Smalltalk fileNameForClass:aClass superclass). cg@2614: bindings at:'SuperclassFileInclude' put:('#include "%1.STH"' bindWith:superclassFilename). cg@2614: ]. cg@2614: bindings at:'InstVarList' put:instVarList asString. cg@2614: bindings at:'ClassVarList' put:classVarList asString. cg@2614: bindings at:'ClassInstVarList' put:classInstVarList asString. cg@2614: cg@2614: template := cg@2614: '/* This file was generated by ProjectBuilder. */ cg@2614: /* !!!!!!!! Do not change by hand !!!!!!!! */ cg@2614: cg@2614: /* Class: %(ClassName) */ cg@2614: /* Superclass: %(SuperclassName) */ cg@2614: cg@2614: %(SuperclassFileInclude) cg@2614: cg@2614: /* INDIRECTGLOBALS */ cg@2614: #ifdef _HEADER_INST_ cg@2614: %(InstVarList) cg@2614: #endif /* _HEADER_INST_ */ cg@2614: cg@2614: #ifdef _HEADER_CLASS_ cg@2614: %(ClassVarList) cg@2614: #endif /* _HEADER_CLASS_ */ cg@2614: cg@2614: #ifdef _HEADER_CLASSINST_ cg@2614: %(ClassInstVarList) cg@2614: #endif /* _HEADER_CLASSINST_ */ cg@2614: '. cg@2614: newContents := template bindWithArguments:bindings. cg@2614: file := packageTargetDir asFilename / ((Smalltalk fileNameForClass:aClass),'.STH'). cg@2614: (file exists not cg@2614: or:[ (oldContents := file contents) ~= newContents ]) ifTrue:[ cg@2614: file contents: newContents. cg@2614: ]. cg@2596: ! cg@2596: cg@2614: generateSourceFiles cg@2614: sourceCodeManager notNil ifTrue:[ cg@2614: "/ check out / generate files there cg@2614: self generateSourceFilesByCheckingOutUsing:sourceCodeManager cg@2614: ] ifFalse:[ cg@2614: "/ local build cg@2614: "/ fileout the project cg@2614: self generateSourceFilesByFilingOut cg@2614: ] cg@2596: ! cg@2596: cg@2614: generateSourceFilesByCheckingOutUsing:aSourceCodeManager cg@2614: "/ will no longer be needed/supported cg@2614: cg@2614: |repository stxRepository module directory| cg@2614: cg@2614: self halt. cg@2614: "/ check out / generate files there cg@2614: repository := (aSourceCodeManager repositoryNameForModule:module) ifNil:[aSourceCodeManager repositoryName]. cg@2614: stxRepository := aSourceCodeManager repositoryName. cg@2614: cg@2614: (buildDirectory construct:'stx') exists ifFalse:[ cg@2614: (module ~= 'stx') ifTrue:[ cg@2614: OperatingSystem cg@2614: executeCommand:('cvs -d ',stxRepository,' co stx') cg@2614: inputFrom:nil cg@2614: outputTo:Transcript cg@2614: errorTo:Transcript cg@2614: inDirectory:buildDirectory cg@2614: onError:[:status| self error:'cvs update stx failed']. cg@2614: ]. cg@2614: ]. cg@2614: cg@2614: ((buildDirectory construct:module) construct:'CVS') exists ifFalse:[ cg@2614: OperatingSystem cg@2614: executeCommand:('cvs -d ',repository,' co -l ',directory) cg@2614: inputFrom:nil cg@2614: outputTo:Transcript cg@2614: errorTo:Transcript cg@2614: inDirectory:buildDirectory cg@2614: onError:[:status| self error:'cvs update failed']. cg@2614: ]. cg@2614: OperatingSystem cg@2614: executeCommand:'cvs upd -d' cg@2614: inputFrom:nil cg@2614: outputTo:Transcript cg@2614: errorTo:Transcript cg@2614: inDirectory:(buildDirectory construct:module) cg@2614: onError:[:status| self error:'cvs update failed']. cg@2614: self halt. cg@2596: ! cg@2596: cg@2614: generateSourceFilesByFilingOut cg@2614: "/ local build cg@2614: "/ fileout the project cg@2614: cg@2614: (package module ~= 'stx') ifTrue:[ cg@2614: (buildDirectory / package module) makeDirectory. cg@2614: ]. cg@2614: cg@2614: "/ file out the package(s) which are to be built cg@2614: ((Array with:package)) cg@2614: do:[:eachPackageToFileout | cg@2614: |packageId packageModule packageDirectory packageTargetDir packageDef| cg@2614: cg@2614: packageId := eachPackageToFileout asPackageId. cg@2614: packageModule := packageId module. cg@2614: packageDirectory := packageId directory. cg@2614: packageTargetDir := (buildDirectory / packageModule / packageDirectory) recursiveMakeDirectory. cg@2614: cg@2614: packageDef := packageId projectDefinitionClass. cg@2614: (packageDef compiled_classNames_common , cg@2614: packageDef compiled_classNamesForPlatform) do:[:eachClassName | cg@2614: |cls| cg@2614: cg@2614: cls := Smalltalk classNamed:eachClassName. cg@2614: self assert:cls isLoaded. cg@2614: cls fileOutIn:packageTargetDir cg@2614: ]. cg@2598: cg@2614: "/ (Smalltalk allClassesInPackage:eachPackageToFileout) do:[:cls | cg@2614: "/ cls isPrivate ifFalse:[ cg@2614: "/ cls isLoaded ifFalse:[ cg@2614: "/ self halt. cg@2614: "/ cls autoload. cg@2614: "/ ]. cg@2614: "/ cls fileOutIn:packageTargetDir cg@2614: "/ ] cg@2614: "/ ]. cg@2614: cg@2614: projectDefinitionClass forEachFileNameAndGeneratedContentsDo:[:fileName :fileContents | cg@2614: ((packageTargetDir / fileName) exists cg@2614: and:[ (packageTargetDir / fileName) contents = fileContents ]) ifFalse:[ cg@2614: (packageTargetDir / fileName) contents:fileContents. cg@2614: ]. cg@2614: ]. cg@2614: ]. cg@2599: cg@2614: "/ generate header files in prerequisite packages... cg@2614: (projectDefinitionClass allPreRequisites) cg@2614: do:[:eachPackageToFileout | cg@2614: |packageId packageDef packageModule packageDirectory packageTargetDir| cg@2614: cg@2614: packageId := eachPackageToFileout asPackageId. cg@2614: packageModule := packageId module. cg@2614: packageDirectory := packageId directory. cg@2614: packageTargetDir := (buildDirectory / packageModule / packageDirectory) recursiveMakeDirectory. cg@2614: cg@2614: packageDef := packageId projectDefinitionClass. cg@2614: (packageDef compiled_classNames_common , cg@2614: packageDef compiled_classNamesForPlatform) do:[:eachClassName | cg@2614: |cls| cg@2614: cg@2614: cls := Smalltalk classNamed:eachClassName. cg@2614: "/ self assert:cls isLoaded. cg@2614: cls isLoaded ifTrue:[ cg@2614: self createHeaderFileFor:cls in:packageTargetDir cg@2614: ]. cg@2614: ]. cg@2614: self copyResourcesForPackage:eachPackageToFileout. cg@2614: ]. cg@2614: cg@2614: "/ stx_libbasic2 preRequisitesForBuilding#(#'stx:libbasic') cg@2596: ! cg@2596: cg@2611: makeWithOutputTo:stdOut errorTo:stdErr cg@2611: |module directory| cg@2611: cg@2611: module := package module. cg@2611: directory := package directory. cg@2611: cg@2612: projectDefinitionClass isLibraryDefinition ifTrue:[ cg@2612: OperatingSystem cg@2612: executeCommand:(ParserFlags makeCommand,' classLibRule') cg@2612: inputFrom:nil cg@2612: outputTo:stdOut cg@2612: errorTo:stdErr cg@2612: inDirectory:(buildDirectory / module / directory) cg@2612: onError:[:status| self error:'make failed']. cg@2612: ] ifFalse:[ cg@2612: OperatingSystem cg@2612: executeCommand:(ParserFlags makeCommand,' exe') cg@2612: inputFrom:nil cg@2612: outputTo:stdOut cg@2612: errorTo:stdErr cg@2612: inDirectory:(buildDirectory / module / directory) cg@2612: onError:[:status| self error:'make failed']. cg@2611: cg@2612: OperatingSystem cg@2612: executeCommand:(ParserFlags makeCommand,' setup') cg@2612: inputFrom:nil cg@2612: outputTo:stdOut cg@2612: errorTo:stdErr cg@2612: inDirectory:(buildDirectory / module / directory) cg@2612: onError:[:status| self error:'make failed']. cg@2612: ] cg@2611: ! cg@2611: cg@2614: setupBuildDirectory cg@2614: buildDirectory exists ifFalse:[ cg@2614: buildDirectory recursiveMakeDirectory. cg@2614: ]. cg@2614: (buildDirectory / 'stx') exists ifFalse:[ cg@2614: (buildDirectory / 'stx') makeDirectory. cg@2614: ]. cg@2596: cg@2614: self copyDirectoryForBuild:'include'. cg@2614: self copyDirectoryForBuild:'rules'. cg@2596: ! cg@2596: cg@2614: validateBuildDirectoryIsPresent cg@2614: cg@2614: ^ self. cg@2614: cg@2614: "/ [ cg@2614: "/ |default directoryIsOKForMe stc | cg@2614: "/ cg@2614: "/ default := (buildDirectory ? cg@2614: "/ PreviousBuildDirectory) cg@2614: "/ ifNil:[ UserPreferences current buildDirectory]. cg@2614: "/ cg@2614: "/ buildDirectory := Dialog requestDirectoryName:'Temporary Work-ROOT for build:' cg@2614: "/ default:default. cg@2614: "/ cg@2614: "/ buildDirectory isEmptyOrNil ifTrue:[^ self]. cg@2614: "/ buildDirectory := buildDirectory asFilename. cg@2614: "/ directoryIsOKForMe := true. cg@2614: "/ cg@2614: "/ buildDirectory exists ifFalse:[ cg@2614: "/ Dialog warn:(self classResources string:'Work directory %1 does not exist.' with:buildDirectory). cg@2614: "/ directoryIsOKForMe := false. cg@2614: "/ ] ifTrue:[ cg@2614: "/ (buildDirectory construct:'stx') exists ifFalse:[ cg@2614: "/ Dialog warn:(self classResources stringWithCRs:'Work directory must contain an stx subDirectory,\which contains (at least) the stc and include subdirectories.'). cg@2614: "/ directoryIsOKForMe := false. cg@2614: "/ ] ifTrue:[ cg@2614: "/ stc := (OperatingSystem isMSDOSlike) ifTrue:['stc.exe'] ifFalse:['stc']. cg@2614: "/ (((buildDirectory construct:'stx')construct:'stc')construct:stc) exists ifFalse:[ cg@2614: "/ Dialog warn:(self classResources stringWithCRs:'Work directory must contain an stc compiler in the stx/stc subDirectory.'). cg@2614: "/ directoryIsOKForMe := false. cg@2614: "/ ]. cg@2614: "/ ((buildDirectory construct:'stx')construct:'include') exists ifFalse:[ cg@2614: "/ Dialog warn:(self classResources stringWithCRs:'Work directory must have had a make run before (for include files to exists).'). cg@2614: "/ directoryIsOKForMe := false. cg@2614: "/ ]. cg@2614: "/ ] cg@2614: "/ ]. cg@2614: "/ directoryIsOKForMe cg@2614: "/ ] whileFalse cg@2596: ! ! cg@2596: cg@2596: !ProjectBuilder class methodsFor:'documentation'! cg@2596: cg@2596: version_CVS cg@2596: ^ '$Header$' cg@2596: ! !