1.4
false
$(BeatSaberDir)\IPA\Pending\Plugins
$(BeatSaberDir)\Plugins
0 && endColumn > 0)
AssemblyVersion = firstLineStr.Substring(startColumn, endColumn - startColumn);
else
badParse = true;
}
else
badParse = true;
if (badParse)
{
Log.LogError("Build", "BSMOD03", "", assemblyFile, 0, 0, 0, 0, "Unable to parse the AssemblyVersion from {0}", assemblyFile);
if(ErrorOnMismatch)
return false;
badParse = false;
}
if (PluginVersion != "E.R.R" && AssemblyVersion != PluginVersion)
{
Log.LogError("Build", "BSMOD01", "", assemblyFile, startLine, startColumn + 1, startLine, endColumn + 1, "PluginVersion {0} in manifest.json does not match AssemblyVersion {1} in AssemblyInfo.cs", PluginVersion, AssemblyVersion, assemblyFile);
Log.LogMessage(MessageImportance.High, "PluginVersion {0} does not match AssemblyVersion {1}", PluginVersion, AssemblyVersion);
if(ErrorOnMismatch)
return false;
}
if (!string.IsNullOrEmpty(endLineStr))
{
startColumn = endLineStr.IndexOf('"') + 1;
endColumn = endLineStr.LastIndexOf('"');
if (startColumn > 0 && endColumn > 0)
{
assemblyFileVersion = endLineStr.Substring(startColumn, endColumn - startColumn);
if (AssemblyVersion != assemblyFileVersion)
{
Log.LogWarning("Build", "BSMOD02", "", assemblyFile, endLine, startColumn + 1, endLine, endColumn + 1, "AssemblyVersion {0} does not match AssemblyFileVersion {1} in AssemblyInfo.cs", AssemblyVersion, assemblyFileVersion);
if(ErrorOnMismatch)
return false;
}
}
else
{
Log.LogWarning("Build", "BSMOD06", "", assemblyFile, 0, 0, 0, 0, "Unable to parse the AssemblyFileVersion from {0}", assemblyFile);
if(ErrorOnMismatch)
return false;
}
}
return true;
}
catch (Exception ex)
{
Log.LogErrorFromException(ex);
return false;
}
]]>
= 7)
{
CommitShortHash = outText.Substring(0, 7);
return true;
}
}
catch (Win32Exception ex)
{
noGitFound = true;
}
catch (Exception ex)
{
Log.LogErrorFromException(ex);
return true;
}
try
{
string gitPath = Path.GetFullPath(Path.Combine(ProjectDir, ".git"));
string headPath = Path.Combine(gitPath, "HEAD");
string headContents = null;
if (File.Exists(headPath))
headContents = File.ReadAllText(headPath);
else
{
gitPath = Path.GetFullPath(Path.Combine(ProjectDir, "..", ".git"));
headPath = Path.Combine(gitPath, "HEAD");
if (File.Exists(headPath))
headContents = File.ReadAllText(headPath);
}
headPath = null;
if (!string.IsNullOrEmpty(headContents) && headContents.StartsWith("ref:"))
headPath = Path.Combine(gitPath, headContents.Replace("ref:", "").Trim());
if (File.Exists(headPath))
{
headContents = File.ReadAllText(headPath);
if (headContents.Length >= 7)
CommitShortHash = headContents.Substring(0, 7);
}
}
catch { }
if (CommitShortHash == "local")
{
if(noGitFound)
Log.LogMessage(MessageImportance.High, " 'git' command not found, unable to retrieve current commit hash.");
else
Log.LogMessage(MessageImportance.High, " Unable to retrieve current commit hash.");
}
return true;
]]>