Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-1229

Add prebuild script to mongo.vcxproj to create mongo.cpp and mongo-server.cpp

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Trivial - P5
    • Resolution: Works as Designed
    • Affects Version/s: 1.5.2
    • Fix Version/s: None
    • Component/s: Build, Shell
    • Labels:
      None
    • Environment:
      Visual Studio 2010
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL

      Description

      If you build mongo.vcxproj it will fail because it cannot find mongo.cpp and mongo-server.cpp.

      I don't know python but I put what I believe to be the sconstruct snippet that makes these files at the end of this post. To not introduce python as a dependency on building mngo with visual studio I think a javascript or vbscript should be written and executed with cscript.exe to duplicate this functionality. That script can be called as part of a prebuild action.

      Justin

      1. — jsh —

      def jsToH(target, source, env):

      outFile = str( target[0] )
      if len( source ) != 1:
      raise Exception( "wrong" )

      h = "const char * jsconcatcode" + outFile.split( "mongo" )[-1].replace( "-" , "_").split( ".cpp")[0] + " = \n"

      for l in open( str(source[0]) , 'r' ):
      l = l.strip()
      l = l.split( "//" )[0]
      l = l.replace( '
      ' , "\\\\" )
      l = l.replace( '"' , "\\\"" )

      h += '"' + l + "\\n\"\n "

      h += ";\n\n"

      out = open( outFile , 'w' )
      out.write( h )

      return None

      jshBuilder = Builder(action = jsToH,
      suffix = '.cpp',
      src_suffix = '.jsall')

      env.Append( BUILDERS=

      {'JSHeader' : jshBuilder}

      )

        Attachments

          Activity

            People

            Assignee:
            backlog-server-build Backlog - Build Team
            Reporter:
            zippy1981 Justin Dearing
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: