Overriding by Command Line
colinbo
Posts: 18
I'm working on incorporating SQL Packager into our build process. At this point I've created an MSBuild task for Packager, Compare, and Data Compare. As I work through our setup I want to override certain values from the project files.
For example:
SQLCompare.exe /pr:"SnapshotDatabase.scp" /mksnap:"bin\database\snapshot_1.0.0.0.snp" /r:"bin\reports\DatabaseSnapshot.xml"
Here the snapshot database project would derrive values from the project and then have the snapshot filename overridden.
It doesn't seem this is possible. Is this something that can be added in the next release?
For example:
SQLCompare.exe /pr:"SnapshotDatabase.scp" /mksnap:"bin\database\snapshot_1.0.0.0.snp" /r:"bin\reports\DatabaseSnapshot.xml"
Here the snapshot database project would derrive values from the project and then have the snapshot filename overridden.
It doesn't seem this is possible. Is this something that can be added in the next release?
Comments
I don't know how we'd implement that but we can have a look. In the meantime, if this is an automated build you may want to look into writing a bit of .NET code to open the project, change some of the properties, and save it again. Then you can use the modified project file in place of your 'template' one. SQL Toolkit will allow you to create a new project object, load the project from disk, change some properties, and save it to disk again.
I'm not sure how your command line parser works but I would bring in the project file first, the arg file next, and any other command line parameter overwrites values set by those.
The reason I don't want to modify the file mid-build is that I then have to check it in to source control which triggers (albeit filterable) a modification in the source set. I'm going to pull out the version numbers for now and go with looping through a series of arg files.
Thanks,
Colin