mirror of
https://github.com/github/codeql.git
synced 2026-05-02 20:25:13 +02:00
Remove GitInfo dependency.
GitInfo doesn't work with the bazel-based build. Instead, we pull in the information from bazel, which correctly works with the bazel cache.
This commit is contained in:
@@ -30,8 +30,6 @@ codeql_csharp_library(
|
||||
visibility = ["//csharp:__subpackages__"],
|
||||
deps = [
|
||||
"//csharp/extractor/Semmle.Util",
|
||||
# "@paket.main//gitinfo",
|
||||
# "@paket.main//thisassembly.git",
|
||||
"@paket.main//microsoft.build",
|
||||
"@paket.main//microsoft.codeanalysis",
|
||||
],
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using System.IO;
|
||||
using Semmle.Util.Logging;
|
||||
|
||||
using CompilationInfo = (string key, string value);
|
||||
|
||||
namespace Semmle.Extraction
|
||||
@@ -102,7 +103,23 @@ namespace Semmle.Extraction
|
||||
|
||||
public ILogger Logger { get; private set; }
|
||||
|
||||
public static string Version => $"";
|
||||
public static string Version
|
||||
{
|
||||
get
|
||||
{
|
||||
// the resources for git information are always attached to the entry` assembly by our build system
|
||||
var assembly = Assembly.GetEntryAssembly();
|
||||
var describeAllStream = assembly.GetManifestResourceStream("git-ql-describe-all.log");
|
||||
var headSHAStream = assembly.GetManifestResourceStream("git-ql-rev-parse.log");
|
||||
if (describeAllStream == null || headSHAStream == null)
|
||||
{
|
||||
return "unknown (not built from internal bazel workspace)";
|
||||
}
|
||||
var describeAll = new StreamReader(describeAllStream).ReadToEnd().Trim('\n');
|
||||
var headSHA = new StreamReader(headSHAStream).ReadToEnd().Trim('\n');
|
||||
return $"{describeAll} ({headSHA})";
|
||||
}
|
||||
}
|
||||
|
||||
public PathTransformer PathTransformer { get; }
|
||||
}
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
Microsoft.Build
|
||||
Microsoft.CodeAnalysis
|
||||
GitInfo
|
||||
|
||||
Reference in New Issue
Block a user