New tests.
[mono.git] / mcs / class / Microsoft.Build.Utilities / Microsoft.Build.Utilities / ToolLocationHelper.cs
index 3bad1b12c0a0ffbd563e3757cff56f358da632cb..a6c807cfbdfac942da27b1ad8821f38879c14f32 100644 (file)
@@ -34,6 +34,42 @@ namespace Microsoft.Build.Utilities
 {
        public static class ToolLocationHelper
        {
+               static string lib_mono_dir;
+               static string [] mono_dir;
+
+               static ToolLocationHelper ()
+               {
+                       string assemblyLocation;
+                       DirectoryInfo t1, t2;
+
+                       // /usr/local/lib/mono/1.0
+                       assemblyLocation = Path.GetDirectoryName (typeof (object).Assembly.Location);
+                       t1 = new DirectoryInfo (assemblyLocation);
+
+                       // usr/local/lib/mono
+                       t2 = t1.Parent;
+
+                       lib_mono_dir = t2.FullName;
+                       if (Environment.GetEnvironmentVariable ("TESTING_MONO") != null) {
+                               mono_dir = new string [] {
+                                       Path.Combine (lib_mono_dir, "net_1_0"),
+                                       Path.Combine (lib_mono_dir, "net_2_0"),
+                                       Path.Combine (lib_mono_dir, "net_2_0"),
+                                       Path.Combine (lib_mono_dir, "net_3_5"),
+                                       Path.Combine (lib_mono_dir, "net_4_0")
+                               };      
+                       } else {
+                               mono_dir = new string [] {
+                                       Path.Combine (lib_mono_dir, "1.0"),
+                                       Path.Combine (lib_mono_dir, "2.0"),
+                                       Path.Combine (lib_mono_dir, "2.0"),
+                                       Path.Combine (lib_mono_dir, "3.5"),
+                                       Path.Combine (lib_mono_dir, "4.0")
+                               };
+                       }
+
+               }
+
                [MonoTODO]
                public static string GetDotNetFrameworkRootRegistryKey (TargetDotNetFrameworkVersion version)
                {
@@ -52,10 +88,9 @@ namespace Microsoft.Build.Utilities
                        throw new NotImplementedException ();
                }
 
-               [MonoTODO]
                public static string GetPathToDotNetFramework (TargetDotNetFrameworkVersion version)
                {
-                       throw new NotImplementedException ();
+                       return mono_dir [(int)version];
                }
 
                [MonoTODO]
@@ -65,10 +100,9 @@ namespace Microsoft.Build.Utilities
                        throw new NotImplementedException ();
                }
 
-               [MonoTODO]
                public static string GetPathToDotNetFrameworkSdk (TargetDotNetFrameworkVersion version)
                {
-                       throw new NotImplementedException ();
+                       return GetPathToDotNetFramework (version);
                }
 
                [MonoTODO]
@@ -93,4 +127,4 @@ namespace Microsoft.Build.Utilities
        }
 }
 
-#endif
\ No newline at end of file
+#endif