ProjectBuilder.st
author Claus Gittinger <cg@exept.de>
Sun, 11 Oct 2009 02:20:25 +0200
changeset 2612 2e735008a4d8
parent 2611 706991dee298
child 2613 b8d38caaa884
permissions -rw-r--r--
changed: #buildWithOutputTo:errorTo: #makeWithOutputTo:errorTo:
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
2611
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
    38
    |makeOutput stdOut stdErr lock|
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
    39
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
    40
    lock := Semaphore forMutualExclusion.
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
    41
    makeOutput := TextStream on:(Text new:10000).
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
    42
    stdErr := ActorStream new
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
    43
                    nextPutBlock:[:char |
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
    44
                        lock critical:[
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
    45
                            makeOutput emphasis:{#backgroundColor->Color red. #color->Color white.}.
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
    46
                            makeOutput nextPut:char.
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
    47
                            makeOutput emphasis:nil.
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
    48
                        ]
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
    49
                    ];
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
    50
                    nextPutAllBlock:[:char |
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
    51
                        lock critical:[
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
    52
                            makeOutput emphasis:{#backgroundColor->Color red. #color->Color white.}.
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
    53
                            makeOutput nextPutAll:char.
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
    54
                            makeOutput emphasis:nil.
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
    55
                        ]
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
    56
                    ].
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
    57
    stdOut := ActorStream new
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
    58
                    nextPutBlock:[:char |
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
    59
                        lock critical:[
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
    60
                            makeOutput nextPut:char.
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
    61
                        ]
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
    62
                    ];
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
    63
                    nextPutAllBlock:[:char |
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
    64
                        lock critical:[
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
    65
                            makeOutput nextPutAll:char.
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
    66
                        ]
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
    67
                    ].
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
    68
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
    69
    self buildWithOutputTo:stdOut errorTo:stdErr.
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
    70
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
    71
    TextView openWith:makeOutput contents.
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
    72
!
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
    73
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
    74
buildWithOutputTo:stdOut errorTo:stdErr
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
    75
    "/ intermediate - this will move into a commonly used utility class
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
    76
    "/ (where all the project code support will be collected).
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
    77
2596
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    78
    |module directory|
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    79
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    80
    projectDefinitionClass := ProjectDefinition definitionClassForPackage:package.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
    projectDefinitionClass isNil ifTrue:[
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
        self error:('Missing ProjectDefinition class for "',package asString,'"')
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
    ].
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    84
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    85
    "/ ensure that everything is loaded...
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
    projectDefinitionClass loadAsAutoloaded:false.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
    projectDefinitionClass loadExtensions.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
    projectDefinitionClass loadAllClassesAsAutoloaded:false.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    89
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    90
    module := package module.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    91
    directory := package directory.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    92
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    93
    buildDirectory := PreviousBuildDirectory ifNil:[ UserPreferences current buildDirectory ].
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    94
    buildDirectory isNil ifTrue:[
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    95
        buildDirectory := Filename tempDirectory construct:'stx_build'.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    96
    ].
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    97
    buildDirectory := buildDirectory asFilename.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    98
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    99
    "/ self validateBuildDirectoryIsPresent.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   100
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   101
    PreviousBuildDirectory := buildDirectory.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   102
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   103
    "/ UserPreferences current localBuild:true
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   104
    UserPreferences current localBuild ifFalse:[
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   105
        SourceCodeManager notNil ifTrue:[
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   106
            sourceCodeManager := SourceCodeManagerUtilities sourceCodeManagerFor:projectDefinitionClass.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   107
        ]
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   108
    ].
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   109
    sourceCodeManager := nil.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   110
2598
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   111
    myTopDirectory := 
2596
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   112
        Smalltalk packagePath 
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   113
            detect:[:aPath |
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   114
                (aPath asFilename / 'stx' / 'include') exists
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   115
                and: [ (aPath asFilename / 'stx' / 'rules') exists ]]
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   116
            ifNone:nil.       
2598
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   117
    myTopDirectory isNil ifTrue:[
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   118
        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
   119
    ].
2598
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   120
    myTopDirectory := myTopDirectory asFilename.
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   121
    mySTXTopDirectory := myTopDirectory / 'stx'.
2612
2e735008a4d8 changed:
Claus Gittinger <cg@exept.de>
parents: 2611
diff changeset
   122
self halt.
2596
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   123
    self setupBuildDirectory.
2599
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
   124
    self copySTCDirectoryForBuild.
2596
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   125
    self generateSourceFiles.
2600
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   126
    self copyDLLsForLinkage.
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   127
    self copySupportFilesForLinkage.
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   128
    self copyStartupFilesFromSmalltalk.
2596
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   129
2611
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
   130
    self makeWithOutputTo:stdOut errorTo:stdErr.
2596
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   131
!
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   132
2600
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   133
copyDLLsForLinkage
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   134
    |targetBuildDir|
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   135
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   136
    targetBuildDir := buildDirectory / package module / package directory.
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   137
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   138
    (projectDefinitionClass allPreRequisites)
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   139
    do:[:eachPackageToFileout |
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   140
        |packageId packageDef packageModule packageDirectory packageTargetDir
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   141
         dllSource dllSourceDir libraryName dllRelativePath|
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   142
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   143
        packageId := eachPackageToFileout asPackageId.
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   144
        packageModule := packageId module.
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   145
        packageDirectory := packageId directory.
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   146
        packageTargetDir := (buildDirectory / packageModule / packageDirectory) recursiveMakeDirectory.
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   147
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   148
        packageDef := packageId projectDefinitionClass.
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   149
        libraryName := packageDef libraryName.
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   150
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   151
        "/ mhmh - take them from my tree or from the projects/smalltalk execution directory ??
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   152
        dllSourceDir := myTopDirectory / packageModule / packageDirectory.
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   153
        OperatingSystem isMSWINDOWSlike ifTrue:[
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   154
"/            dllRelativePath := 'objvc','/',(libraryName,'.dll').
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   155
"/            (dllSourceDir / dllRelativePath) exists 
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   156
            false ifFalse:[
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   157
                dllRelativePath := 'objbc','/',(libraryName,'.dll').
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   158
            ]
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   159
        ] ifFalse:[
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   160
            dllRelativePath := libraryName,'.so'.
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   161
        ].
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   162
        ((packageTargetDir / dllRelativePath) exists
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   163
        and:[ (dllSourceDir / dllRelativePath) fileSize = (packageTargetDir / dllRelativePath) fileSize
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   164
        and:[ (dllSourceDir / dllRelativePath) modificationTime < (packageTargetDir / dllRelativePath) modificationTime
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   165
        "/ and:[ (dllSourceDir / dllRelativePath) sameContentsAs:(packageTargetDir / dllRelativePath) ]
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   166
        ]]) ifFalse:[
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   167
            (packageTargetDir / dllRelativePath) directory recursiveMakeDirectory.
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   168
            (dllSourceDir / dllRelativePath) copyTo:(packageTargetDir / dllRelativePath).    
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   169
        ]
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   170
    ].
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   171
!
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   172
2596
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   173
copyDirectory:relativepath
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   174
    "/ need rules in stx
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   175
    ((Smalltalk projectDirectoryForPackage:'stx') asFilename construct:relativepath)
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   176
        recursiveCopyTo:(buildDirectory construct:'stx').
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   177
!
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   178
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   179
copyDirectoryForBuild:subdir
2598
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   180
    |targetDir targetFile|
2596
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   181
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   182
    targetDir := buildDirectory / 'stx' / subdir.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   183
    targetDir exists ifFalse:[
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   184
        targetDir makeDirectory.
2598
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   185
    ].
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   186
    (mySTXTopDirectory / subdir) directoryContentsAsFilenamesDo:[:eachFile |
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   187
        eachFile isDirectory ifFalse:[
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   188
            targetFile := targetDir / eachFile baseName.
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   189
            (targetFile exists not
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   190
            or:[ targetFile modificationTime < eachFile modificationTime ]) ifTrue:[
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   191
                self activityNotification:'copying ',eachFile pathName,'...'.
2596
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   192
                eachFile copyTo:(targetDir construct:eachFile baseName)
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   193
            ]
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   194
        ].
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   195
    ].
2598
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   196
    self activityNotification:nil
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   197
!
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   198
2600
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   199
copyResourcesForPackage:aPackage
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   200
    |module directory|
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   201
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   202
    module := aPackage asPackageId module.
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   203
    directory := aPackage asPackageId directory.
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   204
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   205
    (myTopDirectory / module / directory / 'resources' ) exists ifTrue:[
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   206
        (myTopDirectory / module / directory / 'resources' )
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   207
            recursiveCopyTo:(buildDirectory / module / directory)
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   208
    ].
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   209
    (myTopDirectory / module / directory / 'styles' ) exists ifTrue:[
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   210
        (myTopDirectory / module / directory / 'styles' )
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   211
            recursiveCopyTo:(buildDirectory / module / directory)
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   212
    ].
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   213
!
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   214
2599
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
   215
copySTCDirectoryForBuild
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
   216
    |targetDir stc files|
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
   217
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
   218
    targetDir := buildDirectory / 'stx' / 'stc'.
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
   219
    targetDir exists ifFalse:[ targetDir makeDirectory ].
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
   220
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
   221
    stc := OperatingSystem isMSWINDOWSlike 
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
   222
                ifTrue:[ 'stc.exe' ]
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
   223
                ifFalse:[ 'stc' ].
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
   224
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
   225
    files := #( ) copyWith:stc.
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
   226
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
   227
    files do:[:eachFile |
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
   228
        |sourceFile targetFile|
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
   229
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
   230
        sourceFile := mySTXTopDirectory / 'stc' / eachFile.
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
   231
        targetFile := targetDir / eachFile.
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
   232
        (targetFile exists not
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
   233
        or:[ targetFile modificationTime < sourceFile modificationTime ]) ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
   234
            self activityNotification:'copying ',sourceFile pathName,'...'.
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
   235
            sourceFile copyTo:targetFile
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
   236
        ].
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
   237
    ].
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
   238
    self activityNotification:nil
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
   239
!
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
   240
2600
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   241
copyStartupFilesFromSmalltalk
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   242
    (buildDirectory / 'stx' / 'projects/smalltalk' ) exists ifFalse:[
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   243
        (buildDirectory / 'stx' / 'projects/smalltalk' ) recursiveMakeDirectory.
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   244
    ].
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   245
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   246
    #( 'keyboard.rc' 'keyboardMacros.rc' 'display.rc' 'd_win32.rc'
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   247
       'host.rc' 'h_win32.rc'  
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   248
    ) do:[:fn |
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   249
        (myTopDirectory / 'stx' / 'projects/smalltalk' / fn)
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   250
            copyTo: (buildDirectory / 'stx' / 'projects/smalltalk' / fn)
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   251
    ]
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   252
!
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   253
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   254
copySupportFilesForLinkage
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   255
    |files|
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   256
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   257
    OperatingSystem isMSWINDOWSlike ifTrue:[
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   258
        files := #( 
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   259
                    'support/win32/borland/cs3245.dll' 
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   260
                    'support/win32/X11.dll'
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   261
                    'support/win32/Xext.dll'
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   262
                    'librun/librun.dll'
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   263
                    'libbc/librun.lib'
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   264
                    'libbc/cs32i.lib'
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   265
                    'librun/genDate.exe'
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   266
                    'librun/main.c'
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   267
                 ).
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   268
    ] ifFalse:[
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   269
        files := #(
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   270
                    'librun/genDate'
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   271
                    'librun/main.c'
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   272
                    'librun/librun.so'
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   273
                )
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   274
    ].
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   275
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   276
    files do:[:dllRelativePath |
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   277
        ((buildDirectory / 'stx' / dllRelativePath) exists
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   278
        and:[ (mySTXTopDirectory / dllRelativePath) fileSize = (buildDirectory / 'stx' / dllRelativePath) fileSize
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   279
        and:[ (mySTXTopDirectory / dllRelativePath) modificationTime < (buildDirectory / 'stx' / dllRelativePath) modificationTime
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   280
        "/ and:[ (mySTXTopDirectory / dllRelativePath) sameContentsAs:(targetBuildDir / dllRelativePath) ]
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   281
        ]]) ifFalse:[
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   282
            (buildDirectory / 'stx' / dllRelativePath) directory recursiveMakeDirectory.
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   283
            (mySTXTopDirectory / dllRelativePath) copyTo:(buildDirectory / 'stx' / dllRelativePath).    
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   284
        ]
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   285
    ].
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   286
!
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   287
2598
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   288
createHeaderFileFor:aClass in:packageTargetDir
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   289
    |instVarList classInstVarList classVarList bindings superclassFilename
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   290
     template file newContents oldContents|
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   291
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   292
    instVarList := StringCollection new.
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   293
    aClass instVarNames do:[:v |
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   294
        instVarList add:('OBJ %1;' bindWith:v)
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   295
    ].
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   296
    classInstVarList := StringCollection new.
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   297
    aClass class instVarNames do:[:v |
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   298
(v includes:$_) ifTrue:[self halt].
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   299
        classInstVarList add:('OBJ %1;' bindWith:v)
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
    classVarList := StringCollection new.
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   302
    aClass classVarNames do:[:v |
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   303
        classVarList add:('extern OBJ %1_%2;' bindWith:aClass name with:v)
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   304
    ].
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   305
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   306
    bindings := Dictionary new.
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   307
    bindings at:'ClassName' put:aClass name. 
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   308
    aClass superclass isNil ifTrue:[
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   309
        bindings at:'SuperclassName' put:'-'. 
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   310
        bindings at:'SuperclassFileInclude' put:nil.
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   311
    ] ifFalse:[
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   312
        bindings at:'SuperclassName' put:aClass superclass name. 
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   313
        bindings at:'SuperclassFileName' put:(superclassFilename := Smalltalk fileNameForClass:aClass superclass).
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   314
        bindings at:'SuperclassFileInclude' put:('#include "%1.STH"' bindWith:superclassFilename).
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   315
    ].
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   316
    bindings at:'InstVarList' put:instVarList asString. 
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   317
    bindings at:'ClassVarList' put:classVarList asString. 
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   318
    bindings at:'ClassInstVarList' put:classInstVarList asString. 
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   319
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   320
    template := 
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   321
'/* This file was generated by ProjectBuilder. */
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   322
/* !!!!!!!! Do not change by hand !!!!!!!! */
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   323
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   324
/* Class: %(ClassName) */
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   325
/* Superclass: %(SuperclassName) */
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   326
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   327
%(SuperclassFileInclude)
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   328
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   329
/* INDIRECTGLOBALS */
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   330
#ifdef _HEADER_INST_
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   331
%(InstVarList)
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   332
#endif /* _HEADER_INST_ */
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   333
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   334
#ifdef _HEADER_CLASS_
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   335
%(ClassVarList)
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   336
#endif /* _HEADER_CLASS_ */
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   337
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   338
#ifdef _HEADER_CLASSINST_
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   339
%(ClassInstVarList)
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   340
#endif /* _HEADER_CLASSINST_ */
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   341
'.
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   342
    newContents := template bindWithArguments:bindings.
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   343
    file := packageTargetDir asFilename / ((Smalltalk fileNameForClass:aClass),'.STH').
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   344
    (file exists not
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   345
    or:[ (oldContents := file contents) ~= newContents ]) ifTrue:[
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   346
        file contents: newContents.
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   347
    ].
2596
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   348
!
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   349
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   350
generateSourceFiles
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   351
    sourceCodeManager notNil ifTrue:[
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   352
        "/ check out / generate files there
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   353
        self generateSourceFilesByCheckingOutUsing:sourceCodeManager
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   354
    ] ifFalse:[
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   355
        "/ local build
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   356
        "/ fileout the project
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   357
        self generateSourceFilesByFilingOut
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   358
    ]
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   359
!
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   360
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   361
generateSourceFilesByCheckingOutUsing:aSourceCodeManager
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   362
    "/ will no longer be needed/supported
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   363
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   364
    |repository stxRepository module directory|
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   365
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   366
self halt.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   367
    "/ check out / generate files there
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   368
    repository := (aSourceCodeManager repositoryNameForModule:module) ifNil:[aSourceCodeManager repositoryName].
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   369
    stxRepository := aSourceCodeManager repositoryName.
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 construct:'stx') exists ifFalse:[
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   372
        (module ~= 'stx') ifTrue:[
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   373
            OperatingSystem
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   374
                executeCommand:('cvs -d ',stxRepository,' co stx')
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   375
                inputFrom:nil
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   376
                outputTo:Transcript
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   377
                errorTo:Transcript
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   378
                inDirectory:buildDirectory
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   379
                onError:[:status| self error:'cvs update stx failed'].
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   380
        ].
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   381
    ].
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   382
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   383
    ((buildDirectory construct:module) construct:'CVS') exists ifFalse:[
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   384
        OperatingSystem
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   385
            executeCommand:('cvs -d ',repository,' co -l ',directory)
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   386
            inputFrom:nil
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   387
            outputTo:Transcript
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   388
            errorTo:Transcript
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   389
            inDirectory:buildDirectory
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   390
            onError:[:status| self error:'cvs update failed'].
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   391
    ].
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   392
    OperatingSystem
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   393
        executeCommand:'cvs upd -d'
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   394
        inputFrom:nil
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   395
        outputTo:Transcript
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   396
        errorTo:Transcript
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   397
        inDirectory:(buildDirectory construct:module)
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   398
        onError:[:status| self error:'cvs update failed'].
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   399
self halt.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   400
!
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   401
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   402
generateSourceFilesByFilingOut
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   403
    "/ local build
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   404
    "/ fileout the project
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   405
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   406
    (package module ~= 'stx') ifTrue:[
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   407
        (buildDirectory / package module) makeDirectory.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   408
    ].
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   409
2599
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
   410
    "/ file out the package(s) which are to be built
2598
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   411
    ((Array with:package))
2596
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   412
    do:[:eachPackageToFileout |
2598
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   413
        |packageId packageModule packageDirectory packageTargetDir packageDef|
2596
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   414
2598
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   415
        packageId := eachPackageToFileout asPackageId.
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   416
        packageModule := packageId module.
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   417
        packageDirectory := packageId directory.
2596
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   418
        packageTargetDir := (buildDirectory / packageModule / packageDirectory) recursiveMakeDirectory.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   419
2598
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   420
        packageDef := packageId projectDefinitionClass.
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   421
        (packageDef compiled_classNames_common ,
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   422
        packageDef compiled_classNamesForPlatform) do:[:eachClassName |
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   423
            |cls|
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   424
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   425
            cls := Smalltalk classNamed:eachClassName.
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   426
            self assert:cls isLoaded.
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   427
            cls fileOutIn:packageTargetDir
2596
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   428
        ].
2598
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   429
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   430
"/        (Smalltalk allClassesInPackage:eachPackageToFileout) do:[:cls |
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   431
"/            cls isPrivate ifFalse:[
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   432
"/                cls isLoaded ifFalse:[
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   433
"/                    self halt.
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   434
"/                    cls autoload.
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   435
"/                ].
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   436
"/                cls fileOutIn:packageTargetDir
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   437
"/            ]
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   438
"/        ].
2599
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
   439
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
   440
        projectDefinitionClass forEachFileNameAndGeneratedContentsDo:[:fileName :fileContents |
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
   441
            ((packageTargetDir / fileName) exists
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
   442
            and:[ (packageTargetDir / fileName) contents = fileContents ]) ifFalse:[
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
   443
                (packageTargetDir / fileName) contents:fileContents.
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
   444
            ].
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
   445
        ].    
2598
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   446
    ].
2599
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
   447
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
   448
    "/ generate header files in prerequisite packages...
2598
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   449
    (projectDefinitionClass allPreRequisites)
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   450
    do:[:eachPackageToFileout |
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   451
        |packageId packageDef packageModule packageDirectory packageTargetDir|
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   452
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   453
        packageId := eachPackageToFileout asPackageId.
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   454
        packageModule := packageId module.
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   455
        packageDirectory := packageId directory.
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   456
        packageTargetDir := (buildDirectory / packageModule / packageDirectory) recursiveMakeDirectory.
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   457
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   458
        packageDef := packageId projectDefinitionClass.
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   459
        (packageDef compiled_classNames_common ,
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   460
        packageDef compiled_classNamesForPlatform) do:[:eachClassName |
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   461
            |cls|
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   462
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   463
            cls := Smalltalk classNamed:eachClassName.
2600
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   464
            "/ self assert:cls isLoaded.
2598
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   465
            cls isLoaded ifTrue:[    
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   466
                self createHeaderFileFor:cls in:packageTargetDir
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   467
            ].
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   468
        ].
2600
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   469
        self copyResourcesForPackage:eachPackageToFileout.
2596
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   470
    ].
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   471
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   472
"/    stx_libbasic2 preRequisitesForBuilding#(#'stx:libbasic')
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   473
!
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   474
2611
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
   475
makeWithOutputTo:stdOut errorTo:stdErr
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
   476
    |module directory|
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
   477
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
   478
    module := package module.
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
   479
    directory := package directory.
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
   480
2612
2e735008a4d8 changed:
Claus Gittinger <cg@exept.de>
parents: 2611
diff changeset
   481
    projectDefinitionClass isLibraryDefinition ifTrue:[
2e735008a4d8 changed:
Claus Gittinger <cg@exept.de>
parents: 2611
diff changeset
   482
        OperatingSystem
2e735008a4d8 changed:
Claus Gittinger <cg@exept.de>
parents: 2611
diff changeset
   483
            executeCommand:(ParserFlags makeCommand,' classLibRule')
2e735008a4d8 changed:
Claus Gittinger <cg@exept.de>
parents: 2611
diff changeset
   484
            inputFrom:nil
2e735008a4d8 changed:
Claus Gittinger <cg@exept.de>
parents: 2611
diff changeset
   485
            outputTo:stdOut
2e735008a4d8 changed:
Claus Gittinger <cg@exept.de>
parents: 2611
diff changeset
   486
            errorTo:stdErr
2e735008a4d8 changed:
Claus Gittinger <cg@exept.de>
parents: 2611
diff changeset
   487
            inDirectory:(buildDirectory / module / directory)
2e735008a4d8 changed:
Claus Gittinger <cg@exept.de>
parents: 2611
diff changeset
   488
            onError:[:status| self error:'make failed'].
2e735008a4d8 changed:
Claus Gittinger <cg@exept.de>
parents: 2611
diff changeset
   489
    ] ifFalse:[
2e735008a4d8 changed:
Claus Gittinger <cg@exept.de>
parents: 2611
diff changeset
   490
        OperatingSystem
2e735008a4d8 changed:
Claus Gittinger <cg@exept.de>
parents: 2611
diff changeset
   491
            executeCommand:(ParserFlags makeCommand,' exe')
2e735008a4d8 changed:
Claus Gittinger <cg@exept.de>
parents: 2611
diff changeset
   492
            inputFrom:nil
2e735008a4d8 changed:
Claus Gittinger <cg@exept.de>
parents: 2611
diff changeset
   493
            outputTo:stdOut
2e735008a4d8 changed:
Claus Gittinger <cg@exept.de>
parents: 2611
diff changeset
   494
            errorTo:stdErr
2e735008a4d8 changed:
Claus Gittinger <cg@exept.de>
parents: 2611
diff changeset
   495
            inDirectory:(buildDirectory / module / directory)
2e735008a4d8 changed:
Claus Gittinger <cg@exept.de>
parents: 2611
diff changeset
   496
            onError:[:status| self error:'make failed'].
2611
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
   497
2612
2e735008a4d8 changed:
Claus Gittinger <cg@exept.de>
parents: 2611
diff changeset
   498
        OperatingSystem
2e735008a4d8 changed:
Claus Gittinger <cg@exept.de>
parents: 2611
diff changeset
   499
            executeCommand:(ParserFlags makeCommand,' setup')
2e735008a4d8 changed:
Claus Gittinger <cg@exept.de>
parents: 2611
diff changeset
   500
            inputFrom:nil
2e735008a4d8 changed:
Claus Gittinger <cg@exept.de>
parents: 2611
diff changeset
   501
            outputTo:stdOut
2e735008a4d8 changed:
Claus Gittinger <cg@exept.de>
parents: 2611
diff changeset
   502
            errorTo:stdErr
2e735008a4d8 changed:
Claus Gittinger <cg@exept.de>
parents: 2611
diff changeset
   503
            inDirectory:(buildDirectory / module / directory)
2e735008a4d8 changed:
Claus Gittinger <cg@exept.de>
parents: 2611
diff changeset
   504
            onError:[:status| self error:'make failed'].
2e735008a4d8 changed:
Claus Gittinger <cg@exept.de>
parents: 2611
diff changeset
   505
    ]
2611
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
   506
!
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
   507
2596
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   508
setupBuildDirectory
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   509
    buildDirectory exists ifFalse:[
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   510
        buildDirectory recursiveMakeDirectory.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   511
    ].
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   512
    (buildDirectory / 'stx') exists ifFalse:[
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   513
        (buildDirectory / 'stx') makeDirectory.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   514
    ].
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   515
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   516
    self copyDirectoryForBuild:'include'.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   517
    self copyDirectoryForBuild:'rules'.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   518
!
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   519
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   520
validateBuildDirectoryIsPresent
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   521
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   522
    ^ self.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   523
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   524
"/    [
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   525
"/        |default directoryIsOKForMe stc |
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   526
"/
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   527
"/        default := (buildDirectory ?
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   528
"/                          PreviousBuildDirectory)
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   529
"/                          ifNil:[ UserPreferences current buildDirectory].
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   530
"/
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   531
"/        buildDirectory := Dialog requestDirectoryName:'Temporary Work-ROOT for build:'
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   532
"/                                 default:default.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   533
"/
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   534
"/        buildDirectory isEmptyOrNil ifTrue:[^ self].
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   535
"/        buildDirectory := buildDirectory asFilename.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   536
"/        directoryIsOKForMe := true.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   537
"/
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   538
"/        buildDirectory exists ifFalse:[
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   539
"/            Dialog warn:(self classResources string:'Work directory %1 does not exist.' with:buildDirectory).
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   540
"/            directoryIsOKForMe := false.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   541
"/        ] ifTrue:[
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   542
"/            (buildDirectory construct:'stx') exists ifFalse:[
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   543
"/                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
   544
"/                directoryIsOKForMe := false.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   545
"/            ] ifTrue:[
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   546
"/                stc := (OperatingSystem isMSDOSlike) ifTrue:['stc.exe'] ifFalse:['stc'].
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   547
"/                (((buildDirectory construct:'stx')construct:'stc')construct:stc) exists ifFalse:[
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   548
"/                    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
   549
"/                    directoryIsOKForMe := false.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   550
"/                ].
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   551
"/                ((buildDirectory construct:'stx')construct:'include') exists ifFalse:[
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   552
"/                    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
   553
"/                    directoryIsOKForMe := false.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   554
"/                ].
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   555
"/            ]
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   556
"/        ].
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   557
"/        directoryIsOKForMe
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   558
"/    ] whileFalse
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   559
! !
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   560
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   561
!ProjectBuilder class methodsFor:'documentation'!
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   562
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   563
version_CVS
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   564
    ^ '$Header$'
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   565
! !