Changeset 798


Ignore:
Timestamp:
Dec 4, 2007 3:51:08 AM (12 years ago)
Author:
kmartin
Message:

start to put in code to generate binaries

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/testScripts/NBbuildConfig.py

    r796 r798  
    1616import NBsvnCommand
    1717import NBcheckResult
     18
     19import NBuserParameters
    1820
    1921#---------------------------------------------------------------------
     
    490492  # Run all install executables
    491493  #---------------------------------------------------------------------
    492   if "install" in configuration :
    493     for t in range( len(configuration['install']) ) :
    494       installRelDir=configuration['install'][t]['dir']
    495       installDir = os.path.join(fullBuildDir, installRelDir)
    496       installCmd=configuration['install'][t]['cmd']
    497       if not os.path.isdir( installDir) :
    498         NBlogMessages.writeMessage('  Directory to run install from does not exist:')
    499         NBlogMessages.writeMessage('    Intended directory: '+installDir)
    500         NBlogMessages.writeMessage('    Intended command: '+installCmd)
    501         continue
    502       os.chdir(installDir)
    503       NBlogMessages.writeMessage('  cd '+installDir)
    504       NBlogMessages.writeMessage( '  '+installCmd )
    505       commandHistory+=[ installCmd ]
    506       result=NBosCommand.run(installCmd)
    507       writeResults(result,installCmd)
    508       if result['returnCode'] != 0 :
    509           result['svn version']=configuration['svnVersion']
    510           result['install']=installResultFail
    511           result['command history']=commandHistory
    512           NBemail.sendCmdMsgs(configuration['project'],result,installCmd)
    513           return
    514 
    515      
    516 
     494
     495
     496  if configuration['buildMethod']=='unixConfig' or configuration['buildMethod']=='mingw':
     497    if "install" in configuration :
     498      for t in range( len(configuration['install']) ) :
     499        installRelDir=configuration['install'][t]['dir']
     500        installDir = os.path.join(fullBuildDir, installRelDir)
     501        installCmd=configuration['install'][t]['cmd']
     502        if not os.path.isdir( installDir) :
     503          NBlogMessages.writeMessage('  Directory to run install from does not exist:')
     504          NBlogMessages.writeMessage('    Intended directory: '+installDir)
     505          NBlogMessages.writeMessage('    Intended command: '+installCmd)
     506          continue
     507        os.chdir(installDir)
     508        NBlogMessages.writeMessage('  cd '+installDir)
     509        NBlogMessages.writeMessage( '  '+installCmd )
     510        commandHistory+=[ installCmd ]
     511        result=NBosCommand.run(installCmd)
     512        writeResults(result,installCmd)
     513        if result['returnCode'] != 0 :
     514            result['svn version']=configuration['svnVersion']
     515            result['install']=installResultFail
     516            result['command history']=commandHistory
     517            NBemail.sendCmdMsgs(configuration['project'],result,installCmd)
     518            return
     519
     520   
     521    #---------------------------------------------------------------------
     522    # Build the binary distribution
     523    #---------------------------------------------------------------------
     524       
     525    # when doing this right make sure the example, include, and lib directories
     526    # are there.
     527    # if the lib  directory is there, add it
     528    directories  = " lib "
     529
     530    # if the include directory is there, add it
     531    directories +=  " include "
     532
     533    # if the examples directory is there, add it
     534    #directories +=  " examples "
     535
     536    # if the bin directory is there, add it
     537    #directories +=  " bin "
     538
     539    # don't forget to add LICENSE and AUTHORS file
     540
     541    #configuration['project']
     542    outputDirectory = os.path.join(NBuserParameters.NIGHTLY_BUILD_BIN_DIR, configuration['project'])
     543    print outputDirectory
     544    # create the output directory
     545   
     546    # tar it up
     547
     548    tarCmd = "tar -czvf "
     549    tarCmd += os.path.join(outputDirectory, "test.tgz")
     550    tarCmd += directories
     551
     552    print tarCmd
     553
     554    result=NBosCommand.run( tarCmd)
     555
     556
     557
     558 
    517559  #---------------------------------------------------------------------
    518560  # Everything build and all tests passed.
Note: See TracChangeset for help on using the changeset viewer.