ProjectBuilder.st
changeset 2964 44fd164ad253
parent 2961 f28135198d42
child 2969 d03c40cd3fa5
equal deleted inserted replaced
2963:7df17046fc89 2964:44fd164ad253
    14 "{ NameSpace: Tools }"
    14 "{ NameSpace: Tools }"
    15 
    15 
    16 Object subclass:#ProjectBuilder
    16 Object subclass:#ProjectBuilder
    17 	instanceVariableNames:'package projectDefinitionClass sourceCodeManager buildDirectory
    17 	instanceVariableNames:'package projectDefinitionClass sourceCodeManager buildDirectory
    18 		myWorkingDirectory mySTXTopDirectory myTopDirectory outputStream
    18 		myWorkingDirectory mySTXTopDirectory myTopDirectory outputStream
    19 		makeExeOnly usedCompiler stdOut stdErr'
    19 		makeExeOnly usedCompiler stdOut stdErr isQuickBuild isLocalBuild'
    20 	classVariableNames:'PreviousBuildDirectory'
    20 	classVariableNames:'PreviousBuildDirectory'
    21 	poolDictionaries:''
    21 	poolDictionaries:''
    22 	category:'System-Support-Projects'
    22 	category:'System-Support-Projects'
    23 !
    23 !
    24 
    24 
   139     ^ buildDirectory
   139     ^ buildDirectory
   140 !
   140 !
   141 
   141 
   142 buildDirectory:something
   142 buildDirectory:something
   143     buildDirectory := something.
   143     buildDirectory := something.
       
   144 !
       
   145 
       
   146 isLocalBuild
       
   147     ^ isLocalBuild ? false
       
   148 !
       
   149 
       
   150 isLocalBuild:aBoolean
       
   151     "create a files without going through the source code manager"
       
   152 
       
   153     isLocalBuild := aBoolean.
       
   154 !
       
   155 
       
   156 isQuickBuild
       
   157     ^ isQuickBuild ? false
       
   158 !
       
   159 
       
   160 isQuickBuild:aBoolean
       
   161     "skips creation of header files, and copying of support files, if possible
       
   162      to speedup a build. Use with care."
       
   163 
       
   164     isQuickBuild := aBoolean.
   144 !
   165 !
   145 
   166 
   146 makeExeOnly:aBoolean
   167 makeExeOnly:aBoolean
   147     makeExeOnly := aBoolean.
   168     makeExeOnly := aBoolean.
   148 !
   169 !
   257     "/ self validateBuildDirectoryIsPresent.
   278     "/ self validateBuildDirectoryIsPresent.
   258 
   279 
   259     PreviousBuildDirectory := buildDirectory.
   280     PreviousBuildDirectory := buildDirectory.
   260 
   281 
   261     "/ UserPreferences current localBuild:true
   282     "/ UserPreferences current localBuild:true
   262     UserPreferences current localBuild ifFalse:[
   283     (self isLocalBuild or:[UserPreferences current localBuild]) ifFalse:[
   263         SourceCodeManager notNil ifTrue:[
   284         SourceCodeManager notNil ifTrue:[
   264             sourceCodeManager := SourceCodeManagerUtilities default sourceCodeManagerFor:projectDefinitionClass.
   285             sourceCodeManager := SourceCodeManagerUtilities default sourceCodeManagerFor:projectDefinitionClass.
   265         ]
   286         ]
   266     ].
   287     ].
   267     sourceCodeManager := nil.
   288     sourceCodeManager := nil.
   406     |targetDir targetFile|
   427     |targetDir targetFile|
   407 
   428 
   408     targetDir := buildDirectory / 'stx' / subdir.
   429     targetDir := buildDirectory / 'stx' / subdir.
   409     targetDir exists ifFalse:[
   430     targetDir exists ifFalse:[
   410         targetDir makeDirectory.
   431         targetDir makeDirectory.
       
   432     ] ifTrue:[
       
   433         self isQuickBuild ifTrue:[^ self]
   411     ].
   434     ].
   412     (mySTXTopDirectory / subdir) directoryContentsAsFilenamesDo:[:eachFile |
   435     (mySTXTopDirectory / subdir) directoryContentsAsFilenamesDo:[:eachFile |
   413         eachFile isDirectory ifFalse:[
   436         eachFile isDirectory ifFalse:[
   414             targetFile := targetDir / eachFile baseName.
   437             targetFile := targetDir / eachFile baseName.
   415             (targetFile exists not
   438             (targetFile exists not
   506     |files|
   529     |files|
   507 
   530 
   508     files := #().
   531     files := #().
   509 
   532 
   510     OperatingSystem isMSWINDOWSlike ifTrue:[
   533     OperatingSystem isMSWINDOWSlike ifTrue:[
       
   534         files := files , #( 'librun/genDate.com' ).
   511         usedCompiler = 'tcc' ifTrue:[
   535         usedCompiler = 'tcc' ifTrue:[
   512             files := files , #( 
   536             files := files , #( 
   513                         'support/tcc'
   537                         'support/tcc'
   514                     ).
   538                     ).
   515         ].
   539         ].
   516     ] ifFalse:[
   540     ] ifFalse:[
   517         files := files , #(
   541         files := files , #( 'librun/genDate' ).
   518                 )
   542     ].
   519     ].
       
   520     files := files asOrderedCollection.
       
   521 
   543 
   522     files do:[:relativePath |
   544     files do:[:relativePath |
   523         (mySTXTopDirectory / relativePath) exists ifTrue:[
   545         (mySTXTopDirectory / relativePath) exists ifTrue:[
   524             ((buildDirectory / 'stx' / relativePath) exists
   546             ((buildDirectory / 'stx' / relativePath) exists
   525             and:[ (mySTXTopDirectory / relativePath) fileSize = (buildDirectory / 'stx' / relativePath) fileSize
   547             and:[ (mySTXTopDirectory / relativePath) fileSize = (buildDirectory / 'stx' / relativePath) fileSize
   682 
   704 
   683     "Modified: / 15-08-2011 / 14:58:46 / cg"
   705     "Modified: / 15-08-2011 / 14:58:46 / cg"
   684 !
   706 !
   685 
   707 
   686 generateSourceFiles
   708 generateSourceFiles
   687     sourceCodeManager notNil ifTrue:[
   709     (self isLocalBuild not and:[ sourceCodeManager notNil ])  ifTrue:[
   688         "/ check out / generate files there
   710         "/ check out / generate files there
   689         self generateSourceFilesByCheckingOutUsing:sourceCodeManager
   711         self generateSourceFilesByCheckingOutUsing:sourceCodeManager
   690     ] ifFalse:[
   712     ] ifFalse:[
   691         "/ local build
   713         "/ local build
   692         "/ fileout the project
   714         "/ fileout the project