ProjectBuilder.st
author Claus Gittinger <cg@exept.de>
Tue, 04 Sep 2012 01:09:05 +0200
changeset 2912 6e62954c5f35
parent 2911 e12e4a47cfaa
child 2914 745b9c77b599
permissions -rw-r--r--
added: #copySupportFilesForCompilation
comment/format in:
#copySTCDirectoryForBuild
#copySupportFilesForLinkage
changed:
#buildWithOutputTo:errorTo:
#copyStartupFilesFromSmalltalk
cg@2741
     1
"
cg@2741
     2
 COPYRIGHT (c) 2009 by eXept Software AG
cg@2741
     3
              All Rights Reserved
cg@2741
     4
cg@2741
     5
 This software is furnished under a license and may be used
cg@2741
     6
 only in accordance with the terms of that license and with the
cg@2741
     7
 inclusion of the above copyright notice.   This software may not
cg@2741
     8
 be provided or otherwise made available to, or used by, any
cg@2741
     9
 other person.  No title to or ownership of the software is
cg@2741
    10
 hereby transferred.
cg@2741
    11
"
cg@2596
    12
"{ Package: 'stx:libtool2' }"
cg@2596
    13
cg@2635
    14
"{ NameSpace: Tools }"
cg@2635
    15
cg@2596
    16
Object subclass:#ProjectBuilder
cg@2596
    17
	instanceVariableNames:'package projectDefinitionClass sourceCodeManager buildDirectory
cg@2673
    18
		myWorkingDirectory mySTXTopDirectory myTopDirectory outputStream
cg@2680
    19
		makeExeOnly usedCompiler'
cg@2596
    20
	classVariableNames:'PreviousBuildDirectory'
cg@2596
    21
	poolDictionaries:''
cg@2596
    22
	category:'System-Support-Projects'
cg@2596
    23
!
cg@2596
    24
cg@2741
    25
!ProjectBuilder class methodsFor:'documentation'!
cg@2741
    26
cg@2741
    27
copyright
cg@2741
    28
"
cg@2741
    29
 COPYRIGHT (c) 2009 by eXept Software AG
cg@2741
    30
              All Rights Reserved
cg@2741
    31
cg@2741
    32
 This software is furnished under a license and may be used
cg@2741
    33
 only in accordance with the terms of that license and with the
cg@2741
    34
 inclusion of the above copyright notice.   This software may not
cg@2741
    35
 be provided or otherwise made available to, or used by, any
cg@2741
    36
 other person.  No title to or ownership of the software is
cg@2741
    37
 hereby transferred.
cg@2741
    38
"
cg@2741
    39
! !
cg@2596
    40
cg@2633
    41
!ProjectBuilder class methodsFor:'accessing'!
cg@2633
    42
cg@2633
    43
previousBuildDirectory
cg@2633
    44
    ^ PreviousBuildDirectory
cg@2633
    45
!
cg@2633
    46
cg@2633
    47
previousBuildDirectory:something
cg@2633
    48
    PreviousBuildDirectory := something.
cg@2633
    49
! !
cg@2633
    50
cg@2596
    51
!ProjectBuilder class methodsFor:'examples'!
cg@2596
    52
cg@2644
    53
example1
cg@2644
    54
    Smalltalk loadPackage:'stx:projects/helloWorldApp' asAutoloaded:true.
cg@2644
    55
cg@2644
    56
    self new
cg@2644
    57
        package:'stx:projects/helloWorldApp';
cg@2644
    58
        build
cg@2622
    59
!
cg@2622
    60
cg@2644
    61
example2
cg@2644
    62
    |builder|
cg@2644
    63
cg@2644
    64
    Smalltalk loadPackage:'stx:clients/Demos/foxCalcApplication' asAutoloaded:true.
cg@2644
    65
cg@2644
    66
    builder := self new.
cg@2909
    67
    builder 
cg@2909
    68
        package:'stx:clients/Demos/foxCalcApplication';
cg@2909
    69
        build.
cg@2644
    70
cg@2644
    71
    UserPreferences fileBrowserClass openOnDirectory:builder packageBuildDirectory.
cg@2909
    72
cg@2909
    73
    "Modified: / 03-09-2012 / 19:23:53 / cg"
cg@2596
    74
! !
cg@2596
    75
cg@2873
    76
!ProjectBuilder class methodsFor:'queries'!
cg@2873
    77
cg@2873
    78
defaultUsedCompiler
cg@2873
    79
    |compiler|
cg@2873
    80
cg@2873
    81
    (compiler := UserPreferences current usedCompilerForBuild) notNil ifTrue:[
cg@2873
    82
        ^ compiler
cg@2873
    83
    ].
cg@2873
    84
cg@2873
    85
    OperatingSystem isMSWINDOWSlike ifTrue:[
cg@2873
    86
        ^ 'bcc'
cg@2873
    87
    ].
cg@2873
    88
    ^ 'gcc'
cg@2873
    89
cg@2873
    90
    "Created: / 21-01-2012 / 14:06:51 / cg"
cg@2873
    91
!
cg@2873
    92
cg@2873
    93
listOfPossibleCompilers
cg@2873
    94
    OperatingSystem isMSWINDOWSlike ifTrue:[
cg@2909
    95
        ^ #('bcc' 'vc' 'tcc' 'lcc' 'gcc'  )
cg@2873
    96
    ].
cg@2873
    97
    ^ #('gcc')
cg@2873
    98
cg@2873
    99
    "Created: / 21-01-2012 / 14:04:15 / cg"
cg@2873
   100
! !
cg@2873
   101
cg@2596
   102
!ProjectBuilder methodsFor:'accessing'!
cg@2596
   103
cg@2644
   104
buildDirectory
cg@2644
   105
    ^ buildDirectory
cg@2622
   106
!
cg@2622
   107
cg@2634
   108
buildDirectory:something
cg@2634
   109
    buildDirectory := something.
cg@2634
   110
!
cg@2634
   111
cg@2673
   112
makeExeOnly:aBoolean
cg@2673
   113
    makeExeOnly := aBoolean.
cg@2673
   114
!
cg@2673
   115
cg@2644
   116
package:aPackageIDOrSymbol
cg@2644
   117
    package := aPackageIDOrSymbol asPackageId.
cg@2596
   118
!
cg@2596
   119
cg@2644
   120
packageBuildDirectory
cg@2644
   121
    "the directoray, where the deployable binary is created (xxxSetup.exe)"
cg@2622
   122
cg@2622
   123
    ^ buildDirectory / (package asPackageId module) / (package asPackageId directory)
cg@2635
   124
!
cg@2635
   125
cg@2644
   126
projectDefinitionClass:something
cg@2644
   127
    projectDefinitionClass := something.
cg@2680
   128
!
cg@2680
   129
sr@2683
   130
suffixForHeaderFiles
sr@2683
   131
    ^ OperatingSystem isUNIXlike ifTrue:['.H'] ifFalse:['.STH']
sr@2683
   132
!
sr@2683
   133
cg@2873
   134
usedCompilerForBuild:something
cg@2680
   135
    usedCompiler := something.
cg@2873
   136
cg@2873
   137
    "Created: / 22-01-2012 / 10:50:48 / cg"
cg@2596
   138
! !
cg@2596
   139
cg@2596
   140
!ProjectBuilder methodsFor:'building'!
cg@2596
   141
cg@2644
   142
build
cg@2644
   143
    "/ intermediate - this will move into a commonly used utility class
cg@2635
   144
    "/ (where all the project code support will be collected).
cg@2635
   145
cg@2647
   146
    |makeOutput|
cg@2647
   147
cg@2647
   148
    makeOutput := TextStream on:(Text new:10000).
cg@2647
   149
    self buildWithColorizedOutputTo:makeOutput.
cg@2647
   150
cg@2647
   151
    TextView openWith:makeOutput contents.
cg@2647
   152
!
cg@2647
   153
cg@2647
   154
buildWithColorizedOutputTo:makeOutput
cg@2647
   155
    "/ intermediate - this will move into a commonly used utility class
cg@2647
   156
    "/ (where all the project code support will be collected).
cg@2647
   157
cg@2647
   158
    |stdOut stdErr lock|
cg@2635
   159
cg@2644
   160
    lock := Semaphore forMutualExclusion.
cg@2647
   161
cg@2644
   162
    stdErr := ActorStream new
cg@2644
   163
                    nextPutBlock:[:char |
cg@2644
   164
                        lock critical:[
cg@2644
   165
                            makeOutput emphasis:{#backgroundColor->Color red. #color->Color white.}.
cg@2644
   166
                            makeOutput nextPut:char.
cg@2644
   167
                            makeOutput emphasis:nil.
cg@2644
   168
                        ]
cg@2644
   169
                    ];
sr@2683
   170
                    nextPutAllBlock:[:string |
cg@2873
   171
                        lock critical:[          
cg@2873
   172
                            "/ (string includesString:'das Ziel' )ifTrue:[self halt].
cg@2644
   173
                            makeOutput emphasis:{#backgroundColor->Color red. #color->Color white.}.
sr@2683
   174
                            makeOutput nextPutAll:string.
cg@2644
   175
                            makeOutput emphasis:nil.
cg@2644
   176
                        ]
cg@2644
   177
                    ].
cg@2644
   178
    stdOut := ActorStream new
cg@2644
   179
                    nextPutBlock:[:char |
cg@2644
   180
                        lock critical:[
cg@2644
   181
                            makeOutput nextPut:char.
cg@2644
   182
                        ]
cg@2644
   183
                    ];
sr@2683
   184
                    nextPutAllBlock:[:string |
cg@2873
   185
                        lock critical:[         
cg@2873
   186
                            "/ (string includesString:'das Ziel' )ifTrue:[self halt].
sr@2683
   187
                            makeOutput nextPutAll:string.
cg@2644
   188
                        ]
cg@2644
   189
                    ].
cg@2635
   190
cg@2644
   191
    self buildWithOutputTo:stdOut errorTo:stdErr.
cg@2873
   192
cg@2873
   193
    "Modified: / 21-01-2012 / 13:49:13 / cg"
cg@2611
   194
!
cg@2611
   195
cg@2611
   196
buildWithOutputTo:stdOut errorTo:stdErr
cg@2611
   197
    "/ intermediate - this will move into a commonly used utility class
cg@2611
   198
    "/ (where all the project code support will be collected).
cg@2611
   199
cg@2596
   200
    |module directory|
cg@2596
   201
cg@2596
   202
    projectDefinitionClass := ProjectDefinition definitionClassForPackage:package.
cg@2596
   203
    projectDefinitionClass isNil ifTrue:[
cg@2596
   204
        self error:('Missing ProjectDefinition class for "',package asString,'"')
cg@2596
   205
    ].
cg@2596
   206
cg@2596
   207
    "/ ensure that everything is loaded...
cg@2596
   208
    projectDefinitionClass loadAsAutoloaded:false.
cg@2596
   209
    projectDefinitionClass loadExtensions.
cg@2596
   210
    projectDefinitionClass loadAllClassesAsAutoloaded:false.
cg@2596
   211
cg@2596
   212
    module := package module.
cg@2596
   213
    directory := package directory.
cg@2596
   214
cg@2596
   215
    buildDirectory isNil ifTrue:[
cg@2634
   216
        buildDirectory := PreviousBuildDirectory ifNil:[ UserPreferences current buildDirectory ].
cg@2634
   217
        buildDirectory isNil ifTrue:[
cg@2634
   218
            buildDirectory := Filename tempDirectory construct:'stx_build'.
cg@2634
   219
        ].
cg@2596
   220
    ].
cg@2596
   221
    buildDirectory := buildDirectory asFilename.
cg@2596
   222
cg@2596
   223
    "/ self validateBuildDirectoryIsPresent.
cg@2596
   224
cg@2596
   225
    PreviousBuildDirectory := buildDirectory.
cg@2596
   226
cg@2596
   227
    "/ UserPreferences current localBuild:true
cg@2596
   228
    UserPreferences current localBuild ifFalse:[
cg@2596
   229
        SourceCodeManager notNil ifTrue:[
sv@2861
   230
            sourceCodeManager := SourceCodeManagerUtilities default sourceCodeManagerFor:projectDefinitionClass.
cg@2596
   231
        ]
cg@2596
   232
    ].
cg@2596
   233
    sourceCodeManager := nil.
cg@2596
   234
cg@2598
   235
    myTopDirectory := 
cg@2596
   236
        Smalltalk packagePath 
cg@2596
   237
            detect:[:aPath |
cg@2596
   238
                (aPath asFilename / 'stx' / 'include') exists
cg@2596
   239
                and: [ (aPath asFilename / 'stx' / 'rules') exists ]]
cg@2596
   240
            ifNone:nil.       
cg@2598
   241
    myTopDirectory isNil ifTrue:[
cg@2598
   242
        self error:('Cannot figure out my top directory (where stx/include and stx/rules are)')
cg@2596
   243
    ].
cg@2598
   244
    myTopDirectory := myTopDirectory asFilename.
cg@2598
   245
    mySTXTopDirectory := myTopDirectory / 'stx'.
cg@2613
   246
cg@2596
   247
    self setupBuildDirectory.
cg@2628
   248
    self activityNotification:'Generating stc directory...'.
cg@2599
   249
    self copySTCDirectoryForBuild.
cg@2628
   250
    self activityNotification:'Generating source files...'.
cg@2596
   251
    self generateSourceFiles.
cg@2672
   252
    self activityNotification:'Copying dlls for linkage...'.
cg@2600
   253
    self copyDLLsForLinkage.
cg@2912
   254
    self activityNotification:'Copying support files for compilation and linkage...'.
cg@2912
   255
    self copySupportFilesForCompilation.
cg@2600
   256
    self copySupportFilesForLinkage.
cg@2600
   257
    self copyStartupFilesFromSmalltalk.
cg@2596
   258
cg@2628
   259
    self activityNotification:'Executing make...'.
cg@2611
   260
    self makeWithOutputTo:stdOut errorTo:stdErr.
cg@2912
   261
cg@2912
   262
    "Modified: / 04-09-2012 / 00:49:52 / cg"
cg@2898
   263
! !
cg@2898
   264
cg@2898
   265
!ProjectBuilder methodsFor:'building/private'!
cg@2596
   266
cg@2644
   267
copyDLLsForLinkage
cg@2911
   268
    |targetBuildDir preRequisites dllRelativeSourcePathes dllRelativeDestPathes|
sv@2723
   269
cg@2644
   270
cg@2644
   271
    targetBuildDir := buildDirectory / package module / package directory.
cg@2644
   272
sv@2723
   273
    preRequisites := projectDefinitionClass allPreRequisites.
sv@2723
   274
    OperatingSystem isUNIXlike ifTrue:[
sv@2723
   275
        "For now: unix Makefiles require some libs implicitely..."
sv@2723
   276
        preRequisites := preRequisites union:#(
sv@2723
   277
                               'stx:goodies/refactoryBrowser/parser'
sv@2723
   278
                               'stx:libtool'
sv@2723
   279
                            ).
sv@2723
   280
    ].
sv@2723
   281
sv@2723
   282
    preRequisites do:[:eachPackageToFileout |
cg@2644
   283
        |packageId packageDef packageModule packageDirectory packageTargetDir
cg@2911
   284
         dllSource dllSourceDir libraryName dllRelativePathSource 
cg@2911
   285
         dllRelativePathDest objDirSource objDirDest|
cg@2644
   286
cg@2644
   287
        packageId := eachPackageToFileout asPackageId.
cg@2644
   288
        packageModule := packageId module.
cg@2644
   289
        packageDirectory := packageId directory.
cg@2644
   290
        packageTargetDir := (buildDirectory / packageModule / packageDirectory) recursiveMakeDirectory.
cg@2644
   291
cg@2644
   292
        packageDef := packageId projectDefinitionClass.
cg@2644
   293
        libraryName := packageDef libraryName.
cg@2644
   294
cg@2644
   295
        "/ mhmh - take them from my tree or from the projects/smalltalk execution directory ??
cg@2644
   296
        dllSourceDir := myTopDirectory / packageModule / packageDirectory.
cg@2909
   297
cg@2644
   298
        OperatingSystem isMSWINDOWSlike ifTrue:[
cg@2911
   299
            objDirDest := self objDirForUsedCompiler:usedCompiler.
cg@2911
   300
            "/ use visual-c files for tcc linkage
cg@2911
   301
            usedCompiler = 'tcc' ifTrue:[
cg@2911
   302
                objDirSource := self objDirForUsedCompiler:'vc'.
cg@2911
   303
            ] ifFalse:[
cg@2911
   304
                objDirSource := objDirDest
cg@2911
   305
            ].
cg@2905
   306
"/            dllRelativePath := objDir,'/',(libraryName,'.dll').
cg@2644
   307
"/            (dllSourceDir / dllRelativePath) exists 
cg@2911
   308
            dllRelativeSourcePathes := Array with:(objDirSource,'\', libraryName, '.dll').
cg@2911
   309
            dllRelativeDestPathes := Array with:(objDirDest,'\', libraryName, '.dll').
cg@2644
   310
        ] ifFalse:[
cg@2911
   311
            dllRelativeSourcePathes := Array with:(libraryName,'.so').
sv@2723
   312
            (packageModule = 'stx' and:[packageDirectory = 'libview']) ifTrue:[
cg@2911
   313
                dllRelativeSourcePathes := dllRelativeSourcePathes, #('XWorkstation.so' 'GLXWorkstation.so').
sv@2723
   314
            ].
cg@2644
   315
        ].
cg@2911
   316
        dllRelativeSourcePathes with:dllRelativeDestPathes do:[:dllRelativeSourcePath :dllRelativeDestPath|
cg@2896
   317
            |source dest|
cg@2896
   318
cg@2911
   319
            source := dllSourceDir / dllRelativeSourcePath.
cg@2911
   320
            dest := packageTargetDir / dllRelativeDestPath.
cg@2896
   321
            (dest exists not
cg@2896
   322
             or:[source fileSize ~= dest fileSize
cg@2896
   323
             or:[source modificationTime >= dest modificationTime
sv@2723
   324
             "/ or:[ ((dllSourceDir / dllRelativePath) sameContentsAs:(packageTargetDir / dllRelativePath)) not ]
sv@2723
   325
            ]]) ifTrue:[
cg@2911
   326
                Transcript showCR:'updating ',dllRelativeDestPath.
cg@2896
   327
                dest directory recursiveMakeDirectory.
cg@2896
   328
                source copyTo:dest.    
sv@2723
   329
            ].
sv@2723
   330
        ].
cg@2614
   331
    ].
cg@2896
   332
cg@2911
   333
    "Modified: / 04-09-2012 / 00:30:21 / cg"
cg@2600
   334
!
cg@2600
   335
cg@2644
   336
copyDirectory:relativepath
cg@2644
   337
    "/ need rules in stx
cg@2644
   338
    ((Smalltalk projectDirectoryForPackage:'stx') asFilename construct:relativepath)
cg@2644
   339
        recursiveCopyTo:(buildDirectory construct:'stx').
cg@2596
   340
!
cg@2596
   341
cg@2644
   342
copyDirectoryForBuild:subdir
cg@2644
   343
    |targetDir targetFile|
cg@2644
   344
cg@2644
   345
    targetDir := buildDirectory / 'stx' / subdir.
cg@2644
   346
    targetDir exists ifFalse:[
cg@2644
   347
        targetDir makeDirectory.
cg@2644
   348
    ].
cg@2644
   349
    (mySTXTopDirectory / subdir) directoryContentsAsFilenamesDo:[:eachFile |
cg@2644
   350
        eachFile isDirectory ifFalse:[
cg@2644
   351
            targetFile := targetDir / eachFile baseName.
cg@2644
   352
            (targetFile exists not
cg@2644
   353
            or:[ targetFile modificationTime < eachFile modificationTime ]) ifTrue:[
cg@2644
   354
                self activityNotification:'copying ',eachFile pathName,'...'.
cg@2644
   355
                eachFile copyTo:(targetDir construct:eachFile baseName)
cg@2644
   356
            ]
cg@2644
   357
        ].
cg@2644
   358
    ].
cg@2644
   359
    self activityNotification:nil
cg@2598
   360
!
cg@2598
   361
cg@2644
   362
copyResourcesForPackage:aPackage
cg@2644
   363
    |module directory|
cg@2644
   364
cg@2644
   365
    module := aPackage asPackageId module.
cg@2644
   366
    directory := aPackage asPackageId directory.
cg@2644
   367
cg@2644
   368
    (myTopDirectory / module / directory / 'resources' ) exists ifTrue:[
cg@2644
   369
        (myTopDirectory / module / directory / 'resources' )
cg@2644
   370
            recursiveCopyTo:(buildDirectory / module / directory)
cg@2644
   371
    ].
cg@2644
   372
    (myTopDirectory / module / directory / 'styles' ) exists ifTrue:[
cg@2644
   373
        (myTopDirectory / module / directory / 'styles' )
cg@2644
   374
            recursiveCopyTo:(buildDirectory / module / directory)
cg@2644
   375
    ].
cg@2600
   376
!
cg@2600
   377
cg@2644
   378
copySTCDirectoryForBuild
cg@2912
   379
    "copy stc files to the build directory"
cg@2912
   380
cg@2644
   381
    |targetDir stc files|
cg@2644
   382
cg@2644
   383
    targetDir := buildDirectory / 'stx' / 'stc'.
cg@2644
   384
    targetDir exists ifFalse:[ targetDir makeDirectory ].
cg@2644
   385
cg@2644
   386
    stc := OperatingSystem isMSWINDOWSlike 
cg@2644
   387
                ifTrue:[ 'stc.exe' ]
cg@2644
   388
                ifFalse:[ 'stc' ].
cg@2644
   389
cg@2644
   390
    files := #( ) copyWith:stc.
cg@2644
   391
cg@2644
   392
    files do:[:eachFile |
cg@2644
   393
        |sourceFile targetFile|
cg@2644
   394
cg@2644
   395
        sourceFile := mySTXTopDirectory / 'stc' / eachFile.
cg@2644
   396
        targetFile := targetDir / eachFile.
cg@2644
   397
        (targetFile exists not
cg@2644
   398
        or:[ targetFile modificationTime < sourceFile modificationTime ]) ifTrue:[
cg@2644
   399
            self activityNotification:'copying ',sourceFile pathName,'...'.
cg@2644
   400
            sourceFile copyTo:targetFile
cg@2644
   401
        ].
cg@2644
   402
    ].
sr@2683
   403
sr@2683
   404
    OperatingSystem isUNIXlike ifTrue:[
sr@2683
   405
        (targetDir / 'stc') makeExecutableForAll    
sr@2683
   406
    ].
sr@2683
   407
cg@2644
   408
    self activityNotification:nil
cg@2912
   409
cg@2912
   410
    "Modified (comment): / 04-09-2012 / 00:49:19 / cg"
cg@2599
   411
!
cg@2599
   412
cg@2644
   413
copyStartupFilesFromSmalltalk
cg@2912
   414
    "copy additional smalltalk startup files to the build directory"
cg@2912
   415
cg@2644
   416
    (buildDirectory / 'stx' / 'projects/smalltalk' ) exists ifFalse:[
cg@2644
   417
        (buildDirectory / 'stx' / 'projects/smalltalk' ) recursiveMakeDirectory.
cg@2644
   418
    ].
cg@2644
   419
cg@2678
   420
    #( 
cg@2678
   421
        'keyboard.rc' 
cg@2678
   422
        'keyboardMacros.rc' 
cg@2678
   423
        'display.rc' 
cg@2678
   424
        'd_win32.rc'
cg@2678
   425
        'host.rc' 
cg@2678
   426
        'h_win32.rc'  
cg@2678
   427
        'smalltalk.rc'  
cg@2678
   428
        'private.rc'  
cg@2644
   429
    ) do:[:fn |
cg@2644
   430
        (myTopDirectory / 'stx' / 'projects/smalltalk' / fn)
cg@2644
   431
            copyTo: (buildDirectory / 'stx' / 'projects/smalltalk' / fn)
cg@2678
   432
    ].
cg@2678
   433
cg@2678
   434
    (myTopDirectory / 'stx' / 'doc/online/english/LICENCE_STX.html')
cg@2678
   435
            copyTo: (buildDirectory / 'stx' / 'projects/smalltalk' / 'LICENCE_STX.html').
cg@2912
   436
cg@2912
   437
    "Modified (comment): / 04-09-2012 / 00:48:47 / cg"
cg@2912
   438
!
cg@2912
   439
cg@2912
   440
copySupportFilesForCompilation
cg@2912
   441
    "copy the tcc compiler to the build directory"
cg@2912
   442
cg@2912
   443
    |files|
cg@2912
   444
cg@2912
   445
    files := #().
cg@2912
   446
cg@2912
   447
    OperatingSystem isMSWINDOWSlike ifTrue:[
cg@2912
   448
        usedCompiler = 'tcc' ifTrue:[
cg@2912
   449
            files := files , #( 
cg@2912
   450
                        'support/tcc'
cg@2912
   451
                    ).
cg@2912
   452
        ].
cg@2912
   453
    ] ifFalse:[
cg@2912
   454
        files := files , #(
cg@2912
   455
                )
cg@2912
   456
    ].
cg@2912
   457
    files := files asOrderedCollection.
cg@2912
   458
cg@2912
   459
    files do:[:relativePath |
cg@2912
   460
        (mySTXTopDirectory / relativePath) exists ifTrue:[
cg@2912
   461
            ((buildDirectory / 'stx' / relativePath) exists
cg@2912
   462
            and:[ (mySTXTopDirectory / relativePath) fileSize = (buildDirectory / 'stx' / relativePath) fileSize
cg@2912
   463
            and:[ (mySTXTopDirectory / relativePath) modificationTime < (buildDirectory / 'stx' / relativePath) modificationTime
cg@2912
   464
            "/ and:[ (mySTXTopDirectory / dllRelativePath) sameContentsAs:(targetBuildDir / dllRelativePath) ]
cg@2912
   465
            ]]) ifFalse:[
cg@2912
   466
                (mySTXTopDirectory / relativePath) recursiveCopyTo:(buildDirectory / 'stx' / relativePath).    
cg@2912
   467
            ]
cg@2912
   468
        ] ifFalse:[
cg@2912
   469
            self error:'Missing directory: ',relativePath printString mayProceed:true.
cg@2912
   470
        ].
cg@2912
   471
    ].
cg@2912
   472
cg@2912
   473
    "Created: / 04-09-2012 / 00:47:49 / cg"
cg@2600
   474
!
cg@2600
   475
cg@2644
   476
copySupportFilesForLinkage
cg@2912
   477
    "copy additional files which are req'd for linkage to the build directory"
cg@2912
   478
cg@2644
   479
    |files|
cg@2644
   480
cg@2644
   481
    OperatingSystem isMSWINDOWSlike ifTrue:[
cg@2644
   482
        files := #( 
cg@2644
   483
                    'librun/genDate.exe'
cg@2644
   484
                    'librun/main.c'
cg@2673
   485
                    'projects/smalltalk/stx_16x16.ico'
cg@2673
   486
                    'projects/smalltalk/stx_32x32.ico'
cg@2673
   487
                    'projects/smalltalk/stx_splash.bmp'
cg@2644
   488
                 ).
cg@2905
   489
cg@2905
   490
        usedCompiler = 'bcc' ifTrue:[
cg@2905
   491
            files := files , #( 
cg@2905
   492
                        'librun/objbc/librun.dll'
cg@2905
   493
                        'support/win32/borland/cs3245.dll' 
cg@2905
   494
                        'support/win32/X11.dll'
cg@2905
   495
                        'support/win32/Xext.dll'
cg@2905
   496
                        'libbc/librun.lib'
cg@2905
   497
                        'libbc/cs32i.lib'
cg@2905
   498
                    ).
cg@2905
   499
        ].
cg@2905
   500
        usedCompiler = 'vc' ifTrue:[
cg@2905
   501
            files := files , #( 
cg@2905
   502
                        'librun/objvc/librun.dll'
cg@2905
   503
                        'libvc/librun.lib'
cg@2905
   504
                    ).
cg@2905
   505
        ].
cg@2911
   506
        usedCompiler = 'tcc' ifTrue:[
cg@2911
   507
            files := files , #( 
cg@2911
   508
                        'librun/objvc/librun.dll'
cg@2911
   509
                        'libvc/librun.lib'
cg@2911
   510
                    ).
cg@2911
   511
        ].
cg@2644
   512
    ] ifFalse:[
cg@2644
   513
        files := #(
cg@2644
   514
                    'librun/main.c'
cg@2644
   515
                    'librun/librun.so'
cg@2644
   516
                )
cg@2644
   517
    ].
cg@2677
   518
    files := files asOrderedCollection.
cg@2677
   519
cg@2677
   520
    OperatingSystem isMSWINDOWSlike ifTrue:[
cg@2677
   521
        projectDefinitionClass applicationIconFileName notNil ifTrue:[
cg@2678
   522
            files add:('projects/smalltalk/',projectDefinitionClass applicationIconFileName,'.ico')
cg@2678
   523
        ].
cg@2678
   524
        projectDefinitionClass splashFileName notNil ifTrue:[
cg@2678
   525
            files add:('projects/smalltalk/',projectDefinitionClass splashFileName,'.bmp')
cg@2678
   526
        ].
cg@2677
   527
    ].
cg@2644
   528
cg@2644
   529
    files do:[:dllRelativePath |
sr@2684
   530
        (mySTXTopDirectory / dllRelativePath) exists ifTrue:[
sr@2684
   531
            ((buildDirectory / 'stx' / dllRelativePath) exists
sr@2684
   532
            and:[ (mySTXTopDirectory / dllRelativePath) fileSize = (buildDirectory / 'stx' / dllRelativePath) fileSize
sr@2684
   533
            and:[ (mySTXTopDirectory / dllRelativePath) modificationTime < (buildDirectory / 'stx' / dllRelativePath) modificationTime
sr@2684
   534
            "/ and:[ (mySTXTopDirectory / dllRelativePath) sameContentsAs:(targetBuildDir / dllRelativePath) ]
sr@2684
   535
            ]]) ifFalse:[
sr@2684
   536
                (buildDirectory / 'stx' / dllRelativePath) directory recursiveMakeDirectory.
sr@2684
   537
                (mySTXTopDirectory / dllRelativePath) copyTo:(buildDirectory / 'stx' / dllRelativePath).    
sr@2684
   538
            ]
sr@2684
   539
        ] ifFalse:[
sr@2684
   540
            self error:'Missing file: ',dllRelativePath printString mayProceed:true.
sr@2684
   541
        ].
cg@2644
   542
    ].
cg@2873
   543
cg@2912
   544
    "Modified (comment): / 04-09-2012 / 00:48:24 / cg"
cg@2600
   545
!
cg@2600
   546
cg@2644
   547
createHeaderFileFor:aClass in:packageTargetDir
cg@2644
   548
    |instVarList classInstVarList classVarList bindings superclassFilename
cg@2644
   549
     template file newContents oldContents|
cg@2644
   550
cg@2644
   551
    instVarList := StringCollection new.
cg@2644
   552
    aClass instVarNames do:[:v |
cg@2644
   553
        instVarList add:('OBJ %1;' bindWith:v)
cg@2644
   554
    ].
cg@2644
   555
    classInstVarList := StringCollection new.
cg@2644
   556
    aClass class instVarNames do:[:v |
cg@2644
   557
(v includes:$_) ifTrue:[self halt].
cg@2644
   558
        classInstVarList add:('OBJ %1;' bindWith:v)
cg@2644
   559
    ].
cg@2644
   560
    classVarList := StringCollection new.
cg@2644
   561
    aClass classVarNames do:[:v |
cg@2644
   562
        classVarList add:('extern OBJ %1_%2;' bindWith:aClass name with:v)
cg@2644
   563
    ].
cg@2644
   564
cg@2644
   565
    bindings := Dictionary new.
cg@2644
   566
    bindings at:'ClassName' put:aClass name. 
cg@2644
   567
    aClass superclass isNil ifTrue:[
cg@2644
   568
        bindings at:'SuperclassName' put:'-'. 
cg@2852
   569
        bindings at:'SuperclassFileInclude' put:''.
cg@2644
   570
    ] ifFalse:[
cg@2644
   571
        bindings at:'SuperclassName' put:aClass superclass name. 
cg@2644
   572
        bindings at:'SuperclassFileName' put:(superclassFilename := Smalltalk fileNameForClass:aClass superclass).
cg@2644
   573
        bindings at:'SuperclassFileInclude' put:('#include "%1.STH"' bindWith:superclassFilename).
cg@2644
   574
    ].
cg@2644
   575
    bindings at:'InstVarList' put:instVarList asString. 
cg@2644
   576
    bindings at:'ClassVarList' put:classVarList asString. 
cg@2644
   577
    bindings at:'ClassInstVarList' put:classInstVarList asString. 
cg@2644
   578
cg@2644
   579
    template := 
cg@2644
   580
'/* This file was generated by ProjectBuilder. */
cg@2644
   581
/* !!!!!!!! Do not change by hand !!!!!!!! */
cg@2644
   582
cg@2644
   583
/* Class: %(ClassName) */
cg@2644
   584
/* Superclass: %(SuperclassName) */
cg@2644
   585
cg@2644
   586
%(SuperclassFileInclude)
cg@2644
   587
cg@2644
   588
/* INDIRECTGLOBALS */
cg@2644
   589
#ifdef _HEADER_INST_
cg@2644
   590
%(InstVarList)
cg@2644
   591
#endif /* _HEADER_INST_ */
cg@2644
   592
cg@2644
   593
#ifdef _HEADER_CLASS_
cg@2644
   594
%(ClassVarList)
cg@2644
   595
#endif /* _HEADER_CLASS_ */
cg@2644
   596
cg@2644
   597
#ifdef _HEADER_CLASSINST_
cg@2644
   598
%(ClassInstVarList)
cg@2644
   599
#endif /* _HEADER_CLASSINST_ */
cg@2644
   600
'.
cg@2644
   601
    newContents := template bindWithArguments:bindings.
sr@2683
   602
    file := packageTargetDir asFilename / ((Smalltalk fileNameForClass:aClass),(self suffixForHeaderFiles)).
cg@2644
   603
    (file exists not
cg@2644
   604
    or:[ (oldContents := file contents) ~= newContents ]) ifTrue:[
cg@2644
   605
        file contents: newContents.
cg@2644
   606
    ].
cg@2852
   607
cg@2852
   608
    "Modified: / 15-08-2011 / 14:58:46 / cg"
cg@2596
   609
!
cg@2596
   610
cg@2644
   611
generateSourceFiles
cg@2644
   612
    sourceCodeManager notNil ifTrue:[
cg@2644
   613
        "/ check out / generate files there
cg@2644
   614
        self generateSourceFilesByCheckingOutUsing:sourceCodeManager
cg@2644
   615
    ] ifFalse:[
cg@2644
   616
        "/ local build
cg@2644
   617
        "/ fileout the project
cg@2644
   618
        self generateSourceFilesByFilingOut
cg@2644
   619
    ]
cg@2596
   620
!
cg@2596
   621
cg@2644
   622
generateSourceFilesByCheckingOutUsing:aSourceCodeManager
cg@2644
   623
    "/ will no longer be needed/supported
cg@2644
   624
cg@2644
   625
    |repository stxRepository module directory|
cg@2644
   626
cg@2868
   627
    self breakPoint:#cg.
cg@2868
   628
cg@2644
   629
    "/ check out / generate files there
cg@2644
   630
    repository := (aSourceCodeManager repositoryNameForModule:module) ifNil:[aSourceCodeManager repositoryName].
cg@2644
   631
    stxRepository := aSourceCodeManager repositoryName.
cg@2644
   632
cg@2644
   633
    (buildDirectory construct:'stx') exists ifFalse:[
cg@2644
   634
        (module ~= 'stx') ifTrue:[
cg@2644
   635
            OperatingSystem
cg@2644
   636
                executeCommand:('cvs -d ',stxRepository,' co stx')
cg@2644
   637
                inputFrom:nil
cg@2644
   638
                outputTo:Transcript
cg@2644
   639
                errorTo:Transcript
cg@2644
   640
                inDirectory:buildDirectory
cg@2644
   641
                onError:[:status| self error:'cvs update stx failed'].
cg@2644
   642
        ].
cg@2644
   643
    ].
cg@2644
   644
cg@2644
   645
    ((buildDirectory construct:module) construct:'CVS') exists ifFalse:[
cg@2644
   646
        OperatingSystem
cg@2644
   647
            executeCommand:('cvs -d ',repository,' co -l ',directory)
cg@2644
   648
            inputFrom:nil
cg@2644
   649
            outputTo:Transcript
cg@2644
   650
            errorTo:Transcript
cg@2644
   651
            inDirectory:buildDirectory
cg@2644
   652
            onError:[:status| self error:'cvs update failed'].
cg@2644
   653
    ].
cg@2644
   654
    OperatingSystem
cg@2644
   655
        executeCommand:'cvs upd -d'
cg@2644
   656
        inputFrom:nil
cg@2644
   657
        outputTo:Transcript
cg@2644
   658
        errorTo:Transcript
cg@2644
   659
        inDirectory:(buildDirectory construct:module)
cg@2644
   660
        onError:[:status| self error:'cvs update failed'].
cg@2644
   661
self halt.
cg@2868
   662
cg@2868
   663
    "Modified: / 29-12-2011 / 14:02:56 / cg"
cg@2596
   664
!
cg@2596
   665
cg@2644
   666
generateSourceFilesByFilingOut
cg@2644
   667
    "/ local build
cg@2644
   668
    "/ fileout the project
cg@2644
   669
sv@2844
   670
    |fullPathName|
sv@2844
   671
cg@2644
   672
    (package module ~= 'stx') ifTrue:[
cg@2644
   673
        (buildDirectory / package module) makeDirectory.
cg@2644
   674
    ].
cg@2644
   675
cg@2644
   676
    "/ file out the package(s) which are to be built
cg@2644
   677
    ((Array with:package))
cg@2644
   678
    do:[:eachPackageToFileout |
cg@2644
   679
        |packageId packageModule packageDirectory packageTargetDir packageDef|
cg@2644
   680
cg@2644
   681
        packageId := eachPackageToFileout asPackageId.
cg@2644
   682
        packageModule := packageId module.
cg@2644
   683
        packageDirectory := packageId directory.
cg@2644
   684
        packageTargetDir := (buildDirectory / packageModule / packageDirectory) recursiveMakeDirectory.
cg@2644
   685
cg@2644
   686
        packageDef := packageId projectDefinitionClass.
cg@2644
   687
        (packageDef compiled_classNames_common ,
cg@2644
   688
        packageDef compiled_classNamesForPlatform) do:[:eachClassName |
cg@2644
   689
            |cls fileName newSource|
cg@2644
   690
cg@2644
   691
            cls := Smalltalk classNamed:eachClassName.
cg@2644
   692
            self assert:cls isLoaded.
cg@2644
   693
            fileName := (Smalltalk fileNameForClass:cls),'.st'.
cg@2644
   694
            fileName := packageTargetDir asFilename construct:fileName.
cg@2644
   695
            fileName exists ifTrue:[
cg@2644
   696
                newSource := String streamContents:[:s | cls fileOutOn:s withTimeStamp:false].
cg@2644
   697
                newSource = fileName contentsAsString ifFalse:[
cg@2644
   698
                    fileName contents:newSource
cg@2644
   699
                ].
cg@2644
   700
            ] ifFalse:[
cg@2644
   701
                cls fileOutIn:packageTargetDir withTimeStamp:false
cg@2644
   702
            ].
cg@2644
   703
        ].
cg@2644
   704
cg@2644
   705
"/        (Smalltalk allClassesInPackage:eachPackageToFileout) do:[:cls |
cg@2644
   706
"/            cls isPrivate ifFalse:[
cg@2644
   707
"/                cls isLoaded ifFalse:[
cg@2644
   708
"/                    self halt.
cg@2644
   709
"/                    cls autoload.
cg@2644
   710
"/                ].
cg@2644
   711
"/                cls fileOutIn:packageTargetDir
cg@2644
   712
"/            ]
cg@2644
   713
"/        ].
cg@2644
   714
cg@2644
   715
        projectDefinitionClass forEachFileNameAndGeneratedContentsDo:[:fileName :fileContents |
sv@2844
   716
            fullPathName := packageTargetDir construct:fileName.
sv@2844
   717
            fullPathName directory exists ifFalse:[
sv@2844
   718
                "take care for files like 'autopackage/default.apspec'"
sv@2844
   719
                fullPathName directory makeDirectory.
sv@2844
   720
            ].
sv@2844
   721
            (fullPathName exists
sv@2844
   722
             and:[ fullPathName contents = fileContents ]) ifFalse:[
sv@2844
   723
                fullPathName contents:fileContents.
cg@2644
   724
            ].
cg@2644
   725
        ].    
cg@2644
   726
    ].
cg@2644
   727
cg@2644
   728
    "/ generate header files in prerequisite packages...
cg@2644
   729
    (projectDefinitionClass allPreRequisites)
cg@2644
   730
    do:[:eachPackageToFileout |
cg@2644
   731
        |packageId packageDef packageModule packageDirectory packageTargetDir|
cg@2644
   732
cg@2644
   733
        packageId := eachPackageToFileout asPackageId.
cg@2644
   734
        packageModule := packageId module.
cg@2644
   735
        packageDirectory := packageId directory.
cg@2644
   736
        packageTargetDir := (buildDirectory / packageModule / packageDirectory) recursiveMakeDirectory.
cg@2644
   737
cg@2644
   738
        packageDef := packageId projectDefinitionClass.
cg@2644
   739
        (packageDef compiled_classNames_common ,
cg@2644
   740
        packageDef compiled_classNamesForPlatform) do:[:eachClassName |
cg@2644
   741
            |cls|
cg@2644
   742
cg@2644
   743
            cls := Smalltalk classNamed:eachClassName.
cg@2644
   744
            "/ self assert:cls isLoaded.
cg@2644
   745
            cls isLoaded ifTrue:[    
cg@2644
   746
                self createHeaderFileFor:cls in:packageTargetDir
cg@2644
   747
            ].
cg@2644
   748
        ].
cg@2644
   749
        self copyResourcesForPackage:eachPackageToFileout.
cg@2644
   750
    ].
cg@2644
   751
cg@2644
   752
"/    stx_libbasic2 preRequisitesForBuilding#(#'stx:libbasic')
cg@2596
   753
!
cg@2596
   754
cg@2909
   755
makeCommandOfCompiler:usedCompiler
cg@2909
   756
    usedCompiler = 'bcc' ifTrue:[ 
cg@2909
   757
        ^ 'bmake'.
cg@2909
   758
    ].
cg@2909
   759
    usedCompiler = 'vc' ifTrue:[ 
cg@2909
   760
        ^ 'vcmake'. "/ compilerFlag := '-DUSEVC' 
cg@2909
   761
    ].
cg@2909
   762
    usedCompiler = 'lcc' ifTrue:[ 
cg@2909
   763
        ^ 'lccmake'. "/ compilerFlag := '-DUSELCC' 
cg@2909
   764
    ].
cg@2909
   765
    usedCompiler = 'tcc' ifTrue:[ 
cg@2909
   766
        ^ 'tccmake'. "/ compilerFlag := '-DUSELCC' 
cg@2909
   767
    ].
cg@2909
   768
    usedCompiler = 'gcc' ifTrue:[ 
cg@2909
   769
        ^ 'make'. 
cg@2909
   770
    ].
cg@2909
   771
    usedCompiler = 'gcc' ifTrue:[ 
cg@2909
   772
        ^ 'make'. 
cg@2909
   773
    ].
cg@2909
   774
    self error:'unknown compiler specified'.
cg@2909
   775
cg@2909
   776
    "Created: / 03-09-2012 / 19:46:07 / cg"
cg@2909
   777
!
cg@2909
   778
cg@2644
   779
makeWithOutputTo:stdOut errorTo:stdErr
cg@2909
   780
    |module directory makeCommand|
cg@2644
   781
cg@2644
   782
    module := package module.
cg@2644
   783
    directory := package directory.
cg@2644
   784
cg@2680
   785
    makeCommand := ParserFlags makeCommand.
cg@2895
   786
    usedCompiler isNil ifTrue:[
cg@2895
   787
        usedCompiler := ParserFlags usedCompiler.
cg@2895
   788
    ].
cg@2909
   789
    makeCommand := self makeCommandOfCompiler:usedCompiler.
cg@2873
   790
cg@2852
   791
    "/ makeCommand := makeCommand, ' TOP=', mySTXTopDirectory pathName.
cg@2680
   792
sr@2683
   793
    OperatingSystem isUNIXlike ifTrue:[
sr@2683
   794
        OperatingSystem
sv@2845
   795
            executeCommand:('sh %1/rules/stmkmf' bindWith:mySTXTopDirectory pathName)
sr@2683
   796
            inputFrom:nil
sr@2683
   797
            outputTo:stdOut
sr@2683
   798
            errorTo:stdErr
sr@2683
   799
            inDirectory:(buildDirectory / module / directory)
sr@2683
   800
            onError:[:status| self error:'make failed'].
sr@2683
   801
    ].
sr@2683
   802
cg@2644
   803
    projectDefinitionClass isLibraryDefinition ifTrue:[
cg@2644
   804
        OperatingSystem
cg@2680
   805
            executeCommand:(makeCommand,' classLibRule')
cg@2644
   806
            inputFrom:nil
cg@2644
   807
            outputTo:stdOut
cg@2644
   808
            errorTo:stdErr
cg@2644
   809
            inDirectory:(buildDirectory / module / directory)
cg@2644
   810
            onError:[:status| self error:'make failed'].
cg@2644
   811
    ] ifFalse:[
cg@2644
   812
        OperatingSystem
cg@2680
   813
            executeCommand:(makeCommand,' exe')
cg@2644
   814
            inputFrom:nil
cg@2644
   815
            outputTo:stdOut
cg@2644
   816
            errorTo:stdErr
cg@2644
   817
            inDirectory:(buildDirectory / module / directory)
cg@2644
   818
            onError:[:status| self error:'make failed'].
cg@2644
   819
cg@2673
   820
        (makeExeOnly ? false) ifFalse:[
cg@2673
   821
            OperatingSystem
cg@2680
   822
                executeCommand:(makeCommand,' setup')
cg@2673
   823
                inputFrom:nil
cg@2673
   824
                outputTo:stdOut
cg@2673
   825
                errorTo:stdErr
cg@2673
   826
                inDirectory:(buildDirectory / module / directory)
cg@2673
   827
                onError:[:status| self error:'make failed'].
cg@2673
   828
        ]
cg@2644
   829
    ]
cg@2793
   830
cg@2909
   831
    "Modified: / 03-09-2012 / 19:47:15 / cg"
cg@2611
   832
!
cg@2611
   833
cg@2905
   834
objDirForUsedCompiler
cg@2909
   835
    ^ self objDirForUsedCompiler:usedCompiler
cg@2909
   836
cg@2909
   837
    "Created: / 20-08-2012 / 17:01:13 / cg"
cg@2909
   838
!
cg@2909
   839
cg@2909
   840
objDirForUsedCompiler:usedCompiler
cg@2905
   841
    usedCompiler = 'bcc' ifTrue:[^ 'objbc'].
cg@2905
   842
    usedCompiler = 'vc' ifTrue:[^ 'objvc'].
cg@2909
   843
    usedCompiler = 'tcc' ifTrue:[^ 'objtcc'].
cg@2909
   844
    usedCompiler = 'lcc' ifTrue:[^ 'objlcc'].
cg@2909
   845
    usedCompiler = 'gcc' ifTrue:[^ 'obj'].
cg@2905
   846
    self halt:'please fill in here'.
cg@2905
   847
    ^ 'objbc'
cg@2905
   848
cg@2909
   849
    "Created: / 03-09-2012 / 19:55:34 / cg"
cg@2905
   850
!
cg@2905
   851
sr@2683
   852
recursiveCopyDirectoryForBuild:subdir
sr@2683
   853
    |targetDir|
sr@2683
   854
sr@2683
   855
    targetDir := buildDirectory / 'stx' / subdir.
sr@2683
   856
    targetDir exists ifFalse:[
sr@2683
   857
        targetDir makeDirectory.
sr@2683
   858
    ].
sr@2683
   859
    (mySTXTopDirectory / subdir) directoryContentsAsFilenamesDo:[:eachFile |
sr@2683
   860
        eachFile recursiveCopyTo:(targetDir construct:eachFile baseName)
sr@2683
   861
    ].
sr@2683
   862
    self activityNotification:nil
sr@2683
   863
!
sr@2683
   864
cg@2644
   865
setupBuildDirectory
cg@2644
   866
    buildDirectory exists ifFalse:[
cg@2644
   867
        buildDirectory recursiveMakeDirectory.
cg@2644
   868
    ].
cg@2644
   869
    (buildDirectory / 'stx') exists ifFalse:[
cg@2644
   870
        (buildDirectory / 'stx') makeDirectory.
cg@2644
   871
    ].
cg@2644
   872
cg@2644
   873
    self copyDirectoryForBuild:'include'.
cg@2644
   874
    self copyDirectoryForBuild:'rules'.
sr@2683
   875
    OperatingSystem isUNIXlike ifTrue:[
sr@2683
   876
        self recursiveCopyDirectoryForBuild:'configurations'.
sr@2683
   877
    ]
cg@2635
   878
!
cg@2596
   879
cg@2644
   880
validateBuildDirectoryIsPresent
cg@2644
   881
cg@2644
   882
    ^ self.
cg@2644
   883
cg@2644
   884
"/    [
cg@2644
   885
"/        |default directoryIsOKForMe stc |
cg@2644
   886
"/
cg@2644
   887
"/        default := (buildDirectory ?
cg@2644
   888
"/                          PreviousBuildDirectory)
cg@2644
   889
"/                          ifNil:[ UserPreferences current buildDirectory].
cg@2644
   890
"/
cg@2644
   891
"/        buildDirectory := Dialog requestDirectoryName:'Temporary Work-ROOT for build:'
cg@2644
   892
"/                                 default:default.
cg@2644
   893
"/
cg@2644
   894
"/        buildDirectory isEmptyOrNil ifTrue:[^ self].
cg@2644
   895
"/        buildDirectory := buildDirectory asFilename.
cg@2644
   896
"/        directoryIsOKForMe := true.
cg@2644
   897
"/
cg@2644
   898
"/        buildDirectory exists ifFalse:[
cg@2644
   899
"/            Dialog warn:(self classResources string:'Work directory %1 does not exist.' with:buildDirectory).
cg@2644
   900
"/            directoryIsOKForMe := false.
cg@2644
   901
"/        ] ifTrue:[
cg@2644
   902
"/            (buildDirectory construct:'stx') exists ifFalse:[
cg@2644
   903
"/                Dialog warn:(self classResources stringWithCRs:'Work directory must contain an stx subDirectory,\which contains (at least) the stc and include subdirectories.').
cg@2644
   904
"/                directoryIsOKForMe := false.
cg@2644
   905
"/            ] ifTrue:[
cg@2644
   906
"/                stc := (OperatingSystem isMSDOSlike) ifTrue:['stc.exe'] ifFalse:['stc'].
cg@2644
   907
"/                (((buildDirectory construct:'stx')construct:'stc')construct:stc) exists ifFalse:[
cg@2644
   908
"/                    Dialog warn:(self classResources stringWithCRs:'Work directory must contain an stc compiler in the stx/stc subDirectory.').
cg@2644
   909
"/                    directoryIsOKForMe := false.
cg@2644
   910
"/                ].
cg@2644
   911
"/                ((buildDirectory construct:'stx')construct:'include') exists ifFalse:[
cg@2644
   912
"/                    Dialog warn:(self classResources stringWithCRs:'Work directory must have had a make run before (for include files to exists).').
cg@2644
   913
"/                    directoryIsOKForMe := false.
cg@2644
   914
"/                ].
cg@2644
   915
"/            ]
cg@2644
   916
"/        ].
cg@2644
   917
"/        directoryIsOKForMe
cg@2644
   918
"/    ] whileFalse
cg@2596
   919
! !
cg@2596
   920
cg@2596
   921
!ProjectBuilder class methodsFor:'documentation'!
cg@2596
   922
cg@2896
   923
version
cg@2896
   924
    ^ '$Header$'
cg@2896
   925
!
cg@2896
   926
cg@2596
   927
version_CVS
cg@2596
   928
    ^ '$Header$'
cg@2596
   929
! !