Permalink
Browse files

temporary

  • Loading branch information...
1 parent 8d9ed3b commit 2ed4f5d5910162f12033da81fded04cc3268b839 @serialseb serialseb committed Apr 12, 2012
@@ -1,9 +1,9 @@
// ReSharper disable UnusedMember.Global
using System;
using System.Collections.Generic;
-using System.IO;
+using OpenFileSystem.IO;
+using OpenFileSystem.IO.FileSystems.Local;
using OpenWrap.IO;
-using OpenWrap.PackageManagement.AssemblyResolvers;
using OpenWrap.PackageModel;
using OpenWrap.Runtime;
using OpenWrap.Services;
@@ -14,13 +14,14 @@ public static class BuildInitializer
{
public static IDictionary<string, string> Initialize(string projectFile, string currentDirectory)
{
+ var cd = LocalFileSystem.Instance.GetDirectory(currentDirectory);
new ServiceRegistry()
- .Override<IEnvironment>(() => new MSBuildEnvironment(Path.GetDirectoryName(projectFile), currentDirectory))
+ .Override<IEnvironment>(() => new CurrentDirectoryEnvironment(cd))
.Initialize();
var env = ServiceLocator.GetService<IEnvironment>();
- var scope = PathFinder.GetCurrentScope(env.Descriptor.DirectoryStructure, new OpenFileSystem.IO.Path(projectFile));
+ var scope = PathFinder.GetCurrentScope(env.Descriptor.DirectoryStructure, new Path(projectFile));
var currentDescriptor = env.GetOrCreateScopedDescriptor(scope);
return new Dictionary<string, string>
@@ -4,13 +4,4 @@
namespace OpenWrap.Build
{
- public class MSBuildEnvironment : CurrentDirectoryEnvironment
- {
- public MSBuildEnvironment(string projectFileDirectory, string currentDirectory)
- : base(LocalFileSystem.Instance.GetDirectory(projectFileDirectory))
- {
- if (currentDirectory != null)
- CurrentDirectory = LocalFileSystem.Instance.GetDirectory(currentDirectory);
- }
- }
}
@@ -22,11 +22,12 @@ public static int Main(string[] args)
"Your version of the shell is out of date and cannot execute this version of OpenWrap.\r\nWe're very sorry for the invonvenience, but we promise the new version is eons better.\r\nThe latest shell can be downloaded from http://openwrap.org by click on the 'Download' icon on the top right.");
return -250;
}
+
#pragma warning disable 28
public static int Main(IDictionary<string, object> env)
{
bool requireFirstRunOnProjectUpgrade = false;
- //bool inSystem = true;
+
var serviceRegistry = new ServiceRegistry();
serviceRegistry = serviceRegistry.Override<IEnvironment>(() =>
{
@@ -35,11 +36,10 @@ public static int Main(IDictionary<string, object> env)
BeforeProjectRepositoryInitialized = (dir, options) =>
{
requireFirstRunOnProjectUpgrade = dir.GetFile("packages").Exists == false;
- //inSystem = false;
}
};
if (env.SysPath() != null)
- cdenv.SystemRepositoryDirectory = LocalFileSystem.Instance.GetDirectory(new Path(env.SysPath()).Combine("wraps"));
+ cdenv.SystemRepositoryDirectory = LocalFileSystem.Instance.GetDirectory(new Path(env.SysPath()));
return cdenv;
});
@@ -65,14 +65,6 @@ public static int Main(IDictionary<string, object> env)
}
serviceRegistry.Initialize();
- //if (requireFirstRunOnProjectUpgrade)
- //{
- // ServiceLocator.GetService<ICommandOutputFormatter>().Render(
- // new Warning("This is the first time you run a version of OpenWrap that supports post-install hooks on this project. Please wait while we run the hooks for the current packages."));
-
- // serviceRegistry.Initialize();
- //}
-
return new ConsoleCommandExecutor(ServiceLocator.GetService<IEnumerable<ICommandLocator>>(), ServiceLocator.GetService<IEventHub>(), ServiceLocator.GetService<ICommandOutputFormatter>())
.Execute(env.CommandLine(), env.ShellArgs());
}

0 comments on commit 2ed4f5d

Please sign in to comment.