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