ProjectBuilder.st
author Claus Gittinger <cg@exept.de>
Sat, 10 Oct 2009 15:10:56 +0200
changeset 2598 2bb47a698d59
parent 2596 876679f78999
child 2599 e8624fcf3c1b
permissions -rw-r--r--
*** empty log message ***
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2596
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"{ Package: 'stx:libtool2' }"
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     2
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
Object subclass:#ProjectBuilder
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
	instanceVariableNames:'package projectDefinitionClass sourceCodeManager buildDirectory
2598
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
     5
		myWorkingDirectory mySTXTopDirectory myTopDirectory'
2596
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
	classVariableNames:'PreviousBuildDirectory'
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
	poolDictionaries:''
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
	category:'System-Support-Projects'
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
!
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
!ProjectBuilder class methodsFor:'examples'!
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
example1
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
    Smalltalk loadPackage:'stx:projects/helloWorldApp' asAutoloaded:true.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
    self new
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
        package:'stx:projects/helloWorldApp';
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
        build
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
! !
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
!ProjectBuilder methodsFor:'accessing'!
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
package:aPackageIDOrSymbol
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
    package := aPackageIDOrSymbol asPackageId.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
!
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
projectDefinitionClass:something
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
    projectDefinitionClass := something.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
! !
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
!ProjectBuilder methodsFor:'building'!
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
build
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
    "/ intermediate - this will move into a commonly used utility class
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
    "/ (where all the project code support will be collected).
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
    |module directory|
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
    projectDefinitionClass := ProjectDefinition definitionClassForPackage:package.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
    projectDefinitionClass isNil ifTrue:[
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
        self error:('Missing ProjectDefinition class for "',package asString,'"')
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
    ].
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
    "/ ensure that everything is loaded...
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
    projectDefinitionClass loadAsAutoloaded:false.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
    projectDefinitionClass loadExtensions.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
    projectDefinitionClass loadAllClassesAsAutoloaded:false.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
    module := package module.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
    directory := package directory.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
    buildDirectory := PreviousBuildDirectory ifNil:[ UserPreferences current buildDirectory ].
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
    buildDirectory isNil ifTrue:[
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
        buildDirectory := Filename tempDirectory construct:'stx_build'.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
    ].
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
    buildDirectory := buildDirectory asFilename.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
    "/ self validateBuildDirectoryIsPresent.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
    PreviousBuildDirectory := buildDirectory.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
    "/ UserPreferences current localBuild:true
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
    UserPreferences current localBuild ifFalse:[
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
        SourceCodeManager notNil ifTrue:[
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
            sourceCodeManager := SourceCodeManagerUtilities sourceCodeManagerFor:projectDefinitionClass.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
        ]
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
    ].
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
    sourceCodeManager := nil.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
2598
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
    71
    myTopDirectory := 
2596
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
        Smalltalk packagePath 
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
            detect:[:aPath |
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
                (aPath asFilename / 'stx' / 'include') exists
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
                and: [ (aPath asFilename / 'stx' / 'rules') exists ]]
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
            ifNone:nil.       
2598
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
    77
    myTopDirectory isNil ifTrue:[
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
    78
        self error:('Cannot figure out my top directory (where stx/include and stx/rules are)')
2596
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    79
    ].
2598
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
    80
    myTopDirectory := myTopDirectory asFilename.
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
    81
    mySTXTopDirectory := myTopDirectory / 'stx'.
2596
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
    self setupBuildDirectory.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    84
    self generateSourceFiles.
2598
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
    85
self halt.
2596
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
    OperatingSystem
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
        executeCommand:(ParserFlags makeCommand)
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    89
        inputFrom:nil
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    90
        outputTo:Transcript
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    91
        errorTo:Transcript
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    92
        inDirectory:((buildDirectory construct:module) construct:directory)
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    93
        onError:[:status| self error:'make failed'].
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    94
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    95
    "Created: / 09-08-2006 / 18:37:19 / fm"
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    96
    "Modified: / 09-08-2006 / 19:55:50 / fm"
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    97
    "Modified: / 22-09-2006 / 17:37:11 / cg"
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    98
!
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    99
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   100
copyDirectory:relativepath
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   101
    "/ need rules in stx
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   102
    ((Smalltalk projectDirectoryForPackage:'stx') asFilename construct:relativepath)
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   103
        recursiveCopyTo:(buildDirectory construct:'stx').
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   104
!
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   105
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   106
copyDirectoryForBuild:subdir
2598
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   107
    |targetDir targetFile|
2596
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   108
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   109
    targetDir := buildDirectory / 'stx' / subdir.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   110
    targetDir exists ifFalse:[
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   111
        targetDir makeDirectory.
2598
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   112
    ].
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   113
    (mySTXTopDirectory / subdir) directoryContentsAsFilenamesDo:[:eachFile |
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   114
        eachFile isDirectory ifFalse:[
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   115
            targetFile := targetDir / eachFile baseName.
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   116
            (targetFile exists not
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   117
            or:[ targetFile modificationTime < eachFile modificationTime ]) ifTrue:[
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   118
                self activityNotification:'copying ',eachFile pathName,'...'.
2596
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   119
                eachFile copyTo:(targetDir construct:eachFile baseName)
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   120
            ]
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   121
        ].
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   122
    ].
2598
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   123
    self activityNotification:nil
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   124
!
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   125
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   126
createHeaderFileFor:aClass in:packageTargetDir
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   127
    |instVarList classInstVarList classVarList bindings superclassFilename
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   128
     template file newContents oldContents|
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   129
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   130
    instVarList := StringCollection new.
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   131
    aClass instVarNames do:[:v |
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   132
        instVarList add:('OBJ %1;' bindWith:v)
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   133
    ].
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   134
    classInstVarList := StringCollection new.
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   135
    aClass class instVarNames do:[:v |
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   136
(v includes:$_) ifTrue:[self halt].
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   137
        classInstVarList add:('OBJ %1;' bindWith:v)
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   138
    ].
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   139
    classVarList := StringCollection new.
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   140
    aClass classVarNames do:[:v |
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   141
        classVarList add:('extern OBJ %1_%2;' bindWith:aClass name with:v)
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   142
    ].
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   143
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   144
    bindings := Dictionary new.
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   145
    bindings at:'ClassName' put:aClass name. 
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   146
    aClass superclass isNil ifTrue:[
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   147
        bindings at:'SuperclassName' put:'-'. 
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   148
        bindings at:'SuperclassFileInclude' put:nil.
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   149
    ] ifFalse:[
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   150
        bindings at:'SuperclassName' put:aClass superclass name. 
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   151
        bindings at:'SuperclassFileName' put:(superclassFilename := Smalltalk fileNameForClass:aClass superclass).
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   152
        bindings at:'SuperclassFileInclude' put:('#include "%1.STH"' bindWith:superclassFilename).
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   153
    ].
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   154
    bindings at:'InstVarList' put:instVarList asString. 
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   155
    bindings at:'ClassVarList' put:classVarList asString. 
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   156
    bindings at:'ClassInstVarList' put:classInstVarList asString. 
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   157
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   158
    template := 
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   159
'/* This file was generated by ProjectBuilder. */
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   160
/* !!!!!!!! Do not change by hand !!!!!!!! */
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   161
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   162
/* Class: %(ClassName) */
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   163
/* Superclass: %(SuperclassName) */
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   164
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   165
%(SuperclassFileInclude)
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   166
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   167
/* INDIRECTGLOBALS */
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   168
#ifdef _HEADER_INST_
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   169
%(InstVarList)
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   170
#endif /* _HEADER_INST_ */
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   171
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   172
#ifdef _HEADER_CLASS_
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   173
%(ClassVarList)
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   174
#endif /* _HEADER_CLASS_ */
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   175
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   176
#ifdef _HEADER_CLASSINST_
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   177
%(ClassInstVarList)
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   178
#endif /* _HEADER_CLASSINST_ */
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   179
'.
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   180
    newContents := template bindWithArguments:bindings.
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   181
    file := packageTargetDir asFilename / ((Smalltalk fileNameForClass:aClass),'.STH').
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   182
    (file exists not
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   183
    or:[ (oldContents := file contents) ~= newContents ]) ifTrue:[
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   184
        file contents: newContents.
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   185
    ].
2596
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   186
!
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   187
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   188
generateSourceFiles
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   189
    sourceCodeManager notNil ifTrue:[
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   190
        "/ check out / generate files there
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   191
        self generateSourceFilesByCheckingOutUsing:sourceCodeManager
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   192
    ] ifFalse:[
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   193
        "/ local build
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   194
        "/ fileout the project
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   195
        self generateSourceFilesByFilingOut
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   196
    ]
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   197
!
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   198
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   199
generateSourceFilesByCheckingOutUsing:aSourceCodeManager
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   200
    "/ will no longer be needed/supported
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   201
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   202
    |repository stxRepository module directory|
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   203
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   204
self halt.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   205
    "/ check out / generate files there
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   206
    repository := (aSourceCodeManager repositoryNameForModule:module) ifNil:[aSourceCodeManager repositoryName].
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   207
    stxRepository := aSourceCodeManager repositoryName.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   208
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   209
    (buildDirectory construct:'stx') exists ifFalse:[
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   210
        (module ~= 'stx') ifTrue:[
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   211
            OperatingSystem
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   212
                executeCommand:('cvs -d ',stxRepository,' co stx')
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   213
                inputFrom:nil
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   214
                outputTo:Transcript
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   215
                errorTo:Transcript
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   216
                inDirectory:buildDirectory
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   217
                onError:[:status| self error:'cvs update stx failed'].
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   218
        ].
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   219
    ].
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   220
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   221
    ((buildDirectory construct:module) construct:'CVS') exists ifFalse:[
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   222
        OperatingSystem
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   223
            executeCommand:('cvs -d ',repository,' co -l ',directory)
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   224
            inputFrom:nil
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   225
            outputTo:Transcript
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   226
            errorTo:Transcript
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   227
            inDirectory:buildDirectory
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   228
            onError:[:status| self error:'cvs update failed'].
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   229
    ].
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   230
    OperatingSystem
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   231
        executeCommand:'cvs upd -d'
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   232
        inputFrom:nil
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   233
        outputTo:Transcript
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   234
        errorTo:Transcript
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   235
        inDirectory:(buildDirectory construct:module)
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   236
        onError:[:status| self error:'cvs update failed'].
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   237
self halt.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   238
!
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   239
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   240
generateSourceFilesByFilingOut
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   241
    |targetDir prerequisitePackages|
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   242
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   243
    "/ local build
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   244
    "/ fileout the project
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   245
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   246
    (package module ~= 'stx') ifTrue:[
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   247
        (buildDirectory / package module) makeDirectory.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   248
    ].
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   249
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   250
    "/ file out the package(s)
2598
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   251
    ((Array with:package))
2596
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   252
    do:[:eachPackageToFileout |
2598
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   253
        |packageId packageModule packageDirectory packageTargetDir packageDef|
2596
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   254
2598
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   255
        packageId := eachPackageToFileout asPackageId.
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   256
        packageModule := packageId module.
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   257
        packageDirectory := packageId directory.
2596
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   258
        packageTargetDir := (buildDirectory / packageModule / packageDirectory) recursiveMakeDirectory.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   259
2598
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   260
        packageDef := packageId projectDefinitionClass.
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   261
        (packageDef compiled_classNames_common ,
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   262
        packageDef compiled_classNamesForPlatform) do:[:eachClassName |
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   263
            |cls|
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   264
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   265
            cls := Smalltalk classNamed:eachClassName.
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   266
            self assert:cls isLoaded.
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   267
            cls fileOutIn:packageTargetDir
2596
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   268
        ].
2598
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   269
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   270
"/        (Smalltalk allClassesInPackage:eachPackageToFileout) do:[:cls |
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   271
"/            cls isPrivate ifFalse:[
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   272
"/                cls isLoaded ifFalse:[
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   273
"/                    self halt.
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   274
"/                    cls autoload.
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   275
"/                ].
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   276
"/                cls fileOutIn:packageTargetDir
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   277
"/            ]
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   278
"/        ].
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   279
    ].
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   280
    "/ generate header files...
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   281
    (projectDefinitionClass allPreRequisites)
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   282
    do:[:eachPackageToFileout |
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   283
        |packageId packageDef packageModule packageDirectory packageTargetDir|
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   284
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   285
        packageId := eachPackageToFileout asPackageId.
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   286
        packageModule := packageId module.
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   287
        packageDirectory := packageId directory.
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   288
        packageTargetDir := (buildDirectory / packageModule / packageDirectory) recursiveMakeDirectory.
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   289
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   290
        packageDef := packageId projectDefinitionClass.
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   291
        (packageDef compiled_classNames_common ,
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   292
        packageDef compiled_classNamesForPlatform) do:[:eachClassName |
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   293
            |cls|
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   294
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   295
            cls := Smalltalk classNamed:eachClassName.
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   296
            self assert:cls isLoaded.
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   297
            cls isLoaded ifTrue:[    
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   298
                self createHeaderFileFor:cls in:packageTargetDir
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   299
            ].
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   300
        ].
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   301
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   302
"/        (Smalltalk allClassesInPackage:eachPackageToFileout) do:[:cls |
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   303
"/            cls isPrivate ifFalse:[
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   304
"/                cls isLoaded ifTrue:[
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   305
"/                    self createHeaderFileFor:cls in:packageTargetDir
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   306
"/                ]
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   307
"/            ]
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   308
"/        ].
2596
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   309
    ].
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   310
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   311
"/    "/ copy h-files preRequisite packages
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   312
"/    prerequisitePackages := projectDefinitionClass preRequisitesForBuilding.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   313
"/    prerequisitePackages do:[:eachPackage |
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   314
"/        |relativeDir sourceDir|
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   315
"/
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   316
"/        relativeDir := eachPackage asPackageId pathRelativeToTopDirectory.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   317
"/        sourceDir := Smalltalk packageDirectoryForPackageId:eachPackage.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   318
"/        targetDir := buildDirectory construct:relativeDir.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   319
"/        targetDir recursiveMakeDirectory.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   320
"/        sourceDir directoryContentsAsFilenamesDo:[:eachSourceFilename |
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   321
"/            ((eachSourceFilename suffix asLowercase = 'h')
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   322
"/            or:[ eachSourceFilename suffix asLowercase = 'sth' ]) ifTrue:[
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   323
"/                eachSourceFilename copyTo:targetDir.    
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   324
"/            ].
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   325
"/        ].
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   326
"/    ].
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   327
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   328
"/    stx_libbasic2 preRequisitesForBuilding#(#'stx:libbasic')
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   329
"/    "/ generate support files there
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   330
"/    targetDir := ((buildDirectory construct:module) construct:directory) recursiveMakeDirectory.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   331
"/    #('bmake.bat' 'Make.spec' 'Make.proto' 'libInit.cc' 'abbrev.stc'
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   332
"/      'bc.mak'
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   333
"/    ) do:[:f |
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   334
"/        |contents|                          
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   335
"/
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   336
"/        contents := projectDefinitionClass generateFile:f.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   337
"/        (targetDir construct:f) contents:contents.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   338
"/    ].    
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   339
!
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   340
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   341
setupBuildDirectory
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   342
    buildDirectory exists ifFalse:[
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   343
        buildDirectory recursiveMakeDirectory.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   344
    ].
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   345
    (buildDirectory / 'stx') exists ifFalse:[
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   346
        (buildDirectory / 'stx') makeDirectory.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   347
    ].
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   348
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   349
    self copyDirectoryForBuild:'include'.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   350
    self copyDirectoryForBuild:'rules'.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   351
!
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   352
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   353
validateBuildDirectoryIsPresent
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   354
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   355
    ^ self.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   356
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   357
"/    [
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   358
"/        |default directoryIsOKForMe stc |
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   359
"/
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   360
"/        default := (buildDirectory ?
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   361
"/                          PreviousBuildDirectory)
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   362
"/                          ifNil:[ UserPreferences current buildDirectory].
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   363
"/
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   364
"/        buildDirectory := Dialog requestDirectoryName:'Temporary Work-ROOT for build:'
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   365
"/                                 default:default.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   366
"/
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   367
"/        buildDirectory isEmptyOrNil ifTrue:[^ self].
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   368
"/        buildDirectory := buildDirectory asFilename.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   369
"/        directoryIsOKForMe := true.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   370
"/
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   371
"/        buildDirectory exists ifFalse:[
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   372
"/            Dialog warn:(self classResources string:'Work directory %1 does not exist.' with:buildDirectory).
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   373
"/            directoryIsOKForMe := false.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   374
"/        ] ifTrue:[
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   375
"/            (buildDirectory construct:'stx') exists ifFalse:[
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   376
"/                Dialog warn:(self classResources stringWithCRs:'Work directory must contain an stx subDirectory,\which contains (at least) the stc and include subdirectories.').
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   377
"/                directoryIsOKForMe := false.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   378
"/            ] ifTrue:[
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   379
"/                stc := (OperatingSystem isMSDOSlike) ifTrue:['stc.exe'] ifFalse:['stc'].
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   380
"/                (((buildDirectory construct:'stx')construct:'stc')construct:stc) exists ifFalse:[
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   381
"/                    Dialog warn:(self classResources stringWithCRs:'Work directory must contain an stc compiler in the stx/stc subDirectory.').
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   382
"/                    directoryIsOKForMe := false.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   383
"/                ].
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   384
"/                ((buildDirectory construct:'stx')construct:'include') exists ifFalse:[
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   385
"/                    Dialog warn:(self classResources stringWithCRs:'Work directory must have had a make run before (for include files to exists).').
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   386
"/                    directoryIsOKForMe := false.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   387
"/                ].
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   388
"/            ]
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   389
"/        ].
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   390
"/        directoryIsOKForMe
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   391
"/    ] whileFalse
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   392
! !
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   393
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   394
!ProjectBuilder class methodsFor:'documentation'!
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   395
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   396
version_CVS
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   397
    ^ '$Header$'
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   398
! !