Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

temporary

  • Loading branch information...
commit 2ed4f5d5910162f12033da81fded04cc3268b839 1 parent 8d9ed3b
@serialseb serialseb authored
View
9 src/OpenWrap/Build/BuildInitializer.cs
@@ -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>
View
9 src/OpenWrap/Build/MSBuildEnvironment.cs
@@ -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);
- }
- }
}
View
14 src/OpenWrap/Commands/Cli/ShellRunner.cs
@@ -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());
}
Please sign in to comment.
Something went wrong with that request. Please try again.