forked from libgit2/libgit2sharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGenerateNativeDllNameTask.cs
More file actions
41 lines (34 loc) · 973 Bytes
/
GenerateNativeDllNameTask.cs
File metadata and controls
41 lines (34 loc) · 973 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using System;
using System.IO;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
namespace CustomBuildTasks
{
public class GenerateNativeDllNameTask : Task
{
public ITaskItem InputHashFile { get; set; }
public string OutputFile { get; set; }
public override bool Execute()
{
var fileName = InputHashFile.GetMetadata("FullPath");
string libgit2FileName;
using (var sr = new StreamReader(fileName))
{
libgit2FileName = sr.ReadLine();
}
var nativeDllName = @"namespace LibGit2Sharp.Core
{{
internal static class NativeDllName
{{
public const string Name = ""{0}"";
}}
}}
";
using (var sw = new StreamWriter(OutputFile))
{
sw.Write(nativeDllName, libgit2FileName);
}
return true;
}
}
}