nuget runner and nuget extensions + some integration tests
[teamcity/dotNetPackagesSupport.git] / nuget-extensions / nuget-runner / src / AssemblyHelper.cs
1 using System;\r
2 using System.IO;\r
3 using System.Reflection;\r
4 \r
5 namespace JetBrains.TeamCity.NuGetRunner\r
6 {\r
7   public static class AssemblyHelper\r
8   {\r
9     public static string GetAssemblyDirectory(this Assembly assembly)\r
10     {\r
11       return Path.GetDirectoryName(GetAssemblyPath(assembly));\r
12     }\r
13 \r
14     public static string GetAssemblyPath(this Assembly assembly)\r
15     {\r
16       return new Uri(assembly.CodeBase).LocalPath;\r
17     }\r
18 \r
19     public static string GetAssemblyDirectory(this Type type)\r
20     {\r
21       return GetAssemblyDirectory(type.Assembly);\r
22     }\r
23     \r
24     public static string GetAssemblyPath(this Type type)\r
25     {\r
26       return GetAssemblyPath(type.Assembly);\r
27     }\r
28   }\r
29 }