Skip to content

GenerateNativeDll task: use file name from nuget #1157

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 23, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified Lib/CustomBuildTasks/CustomBuildTasks.dll
Binary file not shown.
10 changes: 4 additions & 6 deletions Lib/CustomBuildTasks/GenerateNativeDllNameTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,25 @@ public class GenerateNativeDllNameTask : Task
public override bool Execute()
{
var fileName = InputHashFile.GetMetadata("FullPath");
string hash;
string libgit2FileName;

using (var sr = new StreamReader(fileName))
{
hash = sr.ReadLine();
libgit2FileName = sr.ReadLine();
}

var shortHash = hash.Substring(0, 7);

var nativeDllName = @"namespace LibGit2Sharp.Core
{{
internal static class NativeDllName
{{
public const string Name = ""git2-{0}"";
public const string Name = ""{0}"";
}}
}}
";

using (var sw = new StreamWriter(OutputFile))
{
sw.Write(nativeDllName, shortHash);
sw.Write(nativeDllName, libgit2FileName);
}

return true;
Expand Down
2 changes: 1 addition & 1 deletion LibGit2Sharp/NativeDllName.targets
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<Target Name="GenerateNativeDllNameCs"
Inputs="@(EmbeddedResource)"
Outputs="$(NativeDllNamePath)">
<GenerateNativeDllNameTask InputHashFile="@(EmbeddedResource)" Condition=" '%(Filename)%(Extension)' == 'libgit2_hash.txt' " OutputFile="$(NativeDllNamePath)" />
<GenerateNativeDllNameTask InputHashFile="@(EmbeddedResource)" Condition=" '%(Filename)%(Extension)' == 'libgit2_filename.txt' " OutputFile="$(NativeDllNamePath)" />
</Target>

<Target Name="CleanNativeDllNameCs">
Expand Down