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

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Trivial - P5 Trivial - P5
    • None
    • Affects Version/s: 1.5.2
    • Component/s: Build, Shell
    • Labels:
      None
    • Environment:
      Visual Studio 2010
    • Build
    • Fully Compatible
    • ALL

      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}

      )

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

              Created:
              Updated:
              Resolved: