Build Mods from Command Line

S3rgeus

Emperor
Joined
Apr 10, 2011
Messages
1,270
Location
London, United Kingdom
Has anyone had any success building mods from command line? Building the gameplay dll is fairly straightforward since it's a traditional visual studio project and can so be built by MSBuild. Looking at the structure of the civ5 mod files (and given that ModBoddy is built onto visual studio), it looks like it should be possible to coerce MSBuild into doing this.

I see that ModBuddy defines its own custom .targets file and has some required dlls for the 'build' process in "%SDK.DIR%\ModBuddy\Build" and these targets are imported in the civ5proj files. Simply pointing MSBuild at the civ5sln file, predictably, errors out:

Code:
Project "E:\Documents\Coding\Civ5-WoTMod\WoTMod\WoTMod.civ5sln" on node 1 (depl
oy target(s)).
E:\Documents\Coding\Civ5-WoTMod\WoTMod\WoTMod.civ5sln(2,1): error MSB4025: The
project file could not be loaded. Data at the root level is invalid. Line 2, po
sition 1.
Done Building Project "E:\Documents\Coding\Civ5-WoTMod\WoTMod\WoTMod.civ5sln" (
deploy target(s)) -- FAILED.


Build FAILED.

"E:\Documents\Coding\Civ5-WoTMod\WoTMod\WoTMod.civ5sln" (deploy target) (1) ->
  E:\Documents\Coding\Civ5-WoTMod\WoTMod\WoTMod.civ5sln(2,1): error MSB4025: Th
e project file could not be loaded. Data at the root level is invalid. Line 2,
position 1.

    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:00.01

This makes me think some ModBuddy-related structure needs to be imported before you can load the file in the first place. I believe ModBuddy is based on VS2010, so that's the version of MSBuild I'm using. I've only done some very initial investigation, but if anyone has already solved this problem, then that would be awesome. I'll continue looking for now.
 
Anybody else who's ever looking to solve this issue, it is very simple: MSBuild doesn't like the .civ5sln file extension. Rename (or copy) the file to .sln and it builds fine. :) (Provided you specify the civ paths in some way via your project file/environment.)
 
Back
Top Bottom