Skip to content

Commit fc86cb2

Browse files
kllarturcic
authored andcommitted
Fix ilrepack under mono
see: gluck/il-repack#203
1 parent 80b4f69 commit fc86cb2

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

build/utils.cake

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ void Build(string configuration)
7878
});
7979
}
8080

81-
void ILRepackGitVersionExe(bool includeLibGit2Sharp, DirectoryPath target, DirectoryPath ilMerge)
81+
void ILRepackGitVersionExe(bool includeLibGit2Sharp, DirectoryPath target, DirectoryPath ilMerge, string configuration, string dotnetVersion)
8282
{
8383
var exeName = "GitVersion.exe";
8484
var keyFilePath = "./src/key.snk";
@@ -100,6 +100,13 @@ void ILRepackGitVersionExe(bool includeLibGit2Sharp, DirectoryPath target, Direc
100100
sourceFiles = sourceFiles - GetFiles(excludePattern);
101101
}
102102
var settings = new ILRepackSettings { AllowDup = "", Keyfile = keyFilePath, Internalize = true, NDebug = true, TargetKind = TargetKind.Exe, TargetPlatform = TargetPlatformVersion.v4, XmlDocs = false };
103+
104+
if (IsRunningOnUnix())
105+
{
106+
var libFolder = GetDirectories($"**/GitVersionExe/bin/{configuration}/{dotnetVersion}").FirstOrDefault();
107+
settings.Libs = new List<DirectoryPath> { libFolder };
108+
}
109+
103110
FixForMono(settings, "ILRepack.exe");
104111
ILRepack(outFilePath, targetPath, sourceFiles, settings);
105112

@@ -117,7 +124,7 @@ void ILRepackGitVersionExe(bool includeLibGit2Sharp, DirectoryPath target, Direc
117124

118125
void PublishILRepackedGitVersionExe(bool includeLibGit2Sharp, DirectoryPath targetDir, DirectoryPath ilMergDir, DirectoryPath outputDir, string configuration, string dotnetVersion)
119126
{
120-
ILRepackGitVersionExe(includeLibGit2Sharp, targetDir, ilMergDir);
127+
ILRepackGitVersionExe(includeLibGit2Sharp, targetDir, ilMergDir, configuration, dotnetVersion);
121128
CopyDirectory(ilMergDir, outputDir);
122129

123130
if (includeLibGit2Sharp) {

0 commit comments

Comments
 (0)