forked from microsoft/CodeContracts
-
Notifications
You must be signed in to change notification settings - Fork 0
Building Setup
Andrew Billings edited this page Apr 28, 2015
·
2 revisions
Currently it is not initially possible to build the setup by running buildCC.bat, due to an executable called UpdateManifestVersion.exe that is missing.
Fortunately the purpose of the executable is fairly obvious and simple to implement. You can find my implementation here. Just save the file to Microsoft.Research\common\bin and you should be able to build the setup.
In the event the link breaks, you can just create a C# console application and paste this code in the Main method:
string version = args[0];
string path = Path.GetFullPath(args[1]);
bool save = false;
XDocument doc = XDocument.Load(path, LoadOptions.PreserveWhitespace);
XNamespace xmlns = doc.Root.GetDefaultNamespace();
XElement identifierElement = doc.Root.Element(xmlns.GetName("Identifier"));
if (identifierElement != null)
{
XElement versionElement = identifierElement.Element(xmlns.GetName("Version"));
if (versionElement != null && versionElement.Value != version)
{
versionElement.Value = version;
save = true;
}
}
XElement metadataElement = doc.Root.Element(xmlns.GetName("Metadata"));
if (metadataElement != null)
{
XElement identityElement = metadataElement.Element(xmlns.GetName("Identity"));
if (identityElement != null)
{
XAttribute versionAttribute = identityElement.Attribute("Version");
if (versionAttribute != null && versionAttribute.Value != version)
{
versionAttribute.Value = version;
save = true;
}
}
}
if (save)
doc.Save(path);