Skip to content

Commit 7e2c42d

Browse files
committed
Merge pull request #1157 from libgit2/custom_dllname
GenerateNativeDll task: use file name from nuget
2 parents fd54ae3 + 0328d59 commit 7e2c42d

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed
0 Bytes
Binary file not shown.

Lib/CustomBuildTasks/GenerateNativeDllNameTask.cs

+4-6
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,25 @@ public class GenerateNativeDllNameTask : Task
1414
public override bool Execute()
1515
{
1616
var fileName = InputHashFile.GetMetadata("FullPath");
17-
string hash;
17+
string libgit2FileName;
1818

1919
using (var sr = new StreamReader(fileName))
2020
{
21-
hash = sr.ReadLine();
21+
libgit2FileName = sr.ReadLine();
2222
}
2323

24-
var shortHash = hash.Substring(0, 7);
25-
2624
var nativeDllName = @"namespace LibGit2Sharp.Core
2725
{{
2826
internal static class NativeDllName
2927
{{
30-
public const string Name = ""git2-{0}"";
28+
public const string Name = ""{0}"";
3129
}}
3230
}}
3331
";
3432

3533
using (var sw = new StreamWriter(OutputFile))
3634
{
37-
sw.Write(nativeDllName, shortHash);
35+
sw.Write(nativeDllName, libgit2FileName);
3836
}
3937

4038
return true;

LibGit2Sharp/NativeDllName.targets

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<Target Name="GenerateNativeDllNameCs"
1515
Inputs="@(EmbeddedResource)"
1616
Outputs="$(NativeDllNamePath)">
17-
<GenerateNativeDllNameTask InputHashFile="@(EmbeddedResource)" Condition=" '%(Filename)%(Extension)' == 'libgit2_hash.txt' " OutputFile="$(NativeDllNamePath)" />
17+
<GenerateNativeDllNameTask InputHashFile="@(EmbeddedResource)" Condition=" '%(Filename)%(Extension)' == 'libgit2_filename.txt' " OutputFile="$(NativeDllNamePath)" />
1818
</Target>
1919

2020
<Target Name="CleanNativeDllNameCs">

0 commit comments

Comments
 (0)