[SERVER-1229] Add prebuild script to mongo.vcxproj to create mongo.cpp and mongo-server.cpp Created: 13/Jun/10  Updated: 06/Dec/22  Resolved: 21/Oct/16

Status: Closed
Project: Core Server
Component/s: Build, Shell
Affects Version/s: 1.5.2
Fix Version/s: None

Type: Bug Priority: Trivial - P5
Reporter: Justin Dearing Assignee: Backlog - Build Team (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Visual Studio 2010


Assigned Teams:
Build
Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

 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}

)



 Comments   
Comment by Mark Benvenuto [ 21/Oct/16 ]

Building with Visual Studio is not supported.

Comment by Eliot Horowitz (Inactive) [ 13/Jun/10 ]

prebuilding eventually - not likely soon - unless someone volunteers

we update mongo_vstudio occasionally.

Comment by Justin Dearing [ 13/Jun/10 ]

Eliot,

Are you assigning it to Dwight to replace the CPP files included in the vcxproj or to write the prebuild script?

Obviously fixing the dependency is a quick win and should be done short term. Long term I think the prebuild is the way to go.

Duplicatting jsToH()'s functionality makes more sense than duplicating the code it generates. The code it generates will be more likely to change.

Comment by Eliot Horowitz (Inactive) [ 13/Jun/10 ]

It should be using shell/mongo_vstudio.cpp

Generated at Thu Feb 08 02:56:26 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.