Permalink
Browse files

Adds name input (see #157)

  • Loading branch information...
1 parent 6bb3c82 commit f0e0f2fb4abc0ecc34c560d241acf36aaa221d32 @serialseb serialseb committed Jun 12, 2011
Showing with 371 additions and 306 deletions.
  1. +10 −10 .gitignore
  2. BIN bugs.txt
  3. +1 −0 openwrap.tests.wrapdesc
  4. +2 −0 openwrap.wrapdesc
  5. +1 −5 src/OpenWrap.Build.Tasks/InitializeVisualStudioIntegration.cs
  6. +0 −1 src/OpenWrap.Build.Tasks/ResolveWrapReferences.cs
  7. +3 −0 src/OpenWrap.Commands/CommandDocumentation.resx
  8. +61 −0 src/OpenWrap.Commands/Core/InvokeSolutionPlugin.cs
  9. +1 −0 src/OpenWrap.Commands/OpenWrap.Commands.csproj
  10. +9 −1 src/OpenWrap.Commands/Wrap/InitWrapCommand.cs
  11. +0 −1 src/OpenWrap.Tests/AssemblyBUilder.cs
  12. +1 −1 src/OpenWrap.Tests/Commands/contexts/add_wrap.cs
  13. +0 −1 src/OpenWrap.Tests/Commands/contexts/command_line_runner.cs
  14. +16 −2 src/OpenWrap.Tests/IO/template_processor/parsing_path_with_absolute_template.cs
  15. +10 −1 src/OpenWrap.Tests/Repositories/nufeed/parser/reading_one_dependency.cs
  16. +3 −1 src/OpenWrap.Tests/Repositories/nufeed/reading_package_feeds.cs
  17. +0 −5 src/OpenWrap.Tests/Tests.csproj
  18. +1 −1 src/OpenWrap.Tests/visiting_package_graphs/visiting_from_node.cs
  19. +1 −1 src/OpenWrap.Tests/visiting_package_graphs/visiting_linear_package_graph.cs
  20. +0 −1 src/OpenWrap.Tests/visiting_package_graphs/visiting_non_linear_package_graph.cs
  21. +12 −51 src/OpenWrap/Build/BuildInitializer.cs
  22. +12 −71 src/OpenWrap/Commands/Cli/ShellRunner.cs
  23. +20 −9 src/OpenWrap/IO/PathTemplateProcessor.cs
  24. +1 −1 src/OpenWrap/OpenWrap.csproj
  25. +35 −1 src/OpenWrap/Repositories/NuFeed/NuFeedReader.cs
  26. +17 −3 src/OpenWrap/Repositories/NuFeed/NuFeedRepository.cs
  27. +8 −6 src/OpenWrap/Repositories/NuFeed/NuFeedRepositoryFactory.cs
  28. +0 −12 src/OpenWrap/Services/InternalServices.cs
  29. +137 −0 src/OpenWrap/Services/ServiceRegistry.cs
  30. +0 −4 wraps/.gitignore
  31. BIN wraps/Mono.Cecil-0.9.4.1.wrap
  32. BIN wraps/NUnit-2.5.9.10348.wrap
  33. BIN wraps/Newtonsoft.Json-4.0.2.wrap
  34. BIN wraps/SharpZipLib-0.86.0.wrap
  35. BIN wraps/openfilesystem-1.0.0.57432799.wrap
  36. BIN wraps/openfilesystem-1.0.0.57471848.wrap
  37. BIN wraps/{openfilesystem-1.0.0.57857380.wrap → openfilesystem-1.0.0.61263243.wrap}
  38. BIN wraps/openwrap-1.0.0.57442501.wrap
  39. BIN wraps/openwrap-1.1.0.57857518.wrap
  40. BIN wraps/openwrap-1.1.0.68601235.wrap
  41. BIN wraps/openwrap-1.1.0.68608825.wrap
  42. BIN wraps/openwrap/bin-net35/OpenRasta.Client.dll
  43. BIN wraps/openwrap/bin-net35/OpenRasta.Client.pdb
  44. BIN wraps/openwrap/bin-net35/OpenWrap.Testing.dll
  45. BIN wraps/openwrap/bin-net35/OpenWrap.Testing.pdb
  46. BIN wraps/openwrap/bin-net35/OpenWrap.dll
  47. BIN wraps/openwrap/bin-net35/OpenWrap.pdb
  48. BIN wraps/openwrap/build/OpenWrap.Build.Bootstrap.dll
  49. BIN wraps/openwrap/build/OpenWrap.Build.Bootstrap.pdb
  50. BIN wraps/openwrap/build/OpenWrap.Build.Tasks.dll
  51. BIN wraps/openwrap/build/OpenWrap.Build.Tasks.pdb
  52. +5 −4 wraps/openwrap/build/OpenWrap.CSharp.targets
  53. BIN wraps/openwrap/build/OpenWrap.Resharper.450.dll
  54. BIN wraps/openwrap/build/OpenWrap.Resharper.450.pdb
  55. BIN wraps/openwrap/build/OpenWrap.Resharper.500.dll
  56. BIN wraps/openwrap/build/OpenWrap.Resharper.500.pdb
  57. BIN wraps/openwrap/build/OpenWrap.Resharper.510.dll
  58. BIN wraps/openwrap/build/OpenWrap.Resharper.510.pdb
  59. BIN wraps/openwrap/build/OpenWrap.Resharper.511.dll
  60. BIN wraps/openwrap/build/OpenWrap.Resharper.511.pdb
  61. BIN wraps/openwrap/build/OpenWrap.VisualStudio.ComShim.dll
  62. BIN wraps/openwrap/build/OpenWrap.VisualStudio.ComShim.pdb
  63. BIN wraps/openwrap/build/OpenWrap.VisualStudio.dll
  64. BIN wraps/openwrap/build/OpenWrap.VisualStudio.pdb
  65. BIN wraps/openwrap/commands/OpenWrap.Commands.dll
  66. BIN wraps/openwrap/commands/OpenWrap.Commands.pdb
  67. +3 −1 wraps/openwrap/openwrap.wrapdesc
  68. BIN wraps/openwrap/tests/OpenWrap.Build.Tasks.dll
  69. BIN wraps/openwrap/tests/OpenWrap.Build.Tasks.pdb
  70. BIN wraps/openwrap/tests/OpenWrap.Commands.dll
  71. BIN wraps/openwrap/tests/OpenWrap.Commands.pdb
  72. BIN wraps/openwrap/tests/OpenWrap.Resharper.450.dll
  73. BIN wraps/openwrap/tests/OpenWrap.Resharper.450.pdb
  74. BIN wraps/openwrap/tests/OpenWrap.Resharper.500.dll
  75. BIN wraps/openwrap/tests/OpenWrap.Resharper.500.pdb
  76. BIN wraps/openwrap/tests/OpenWrap.Resharper.510.dll
  77. BIN wraps/openwrap/tests/OpenWrap.Resharper.510.pdb
  78. BIN wraps/openwrap/tests/OpenWrap.Resharper.511.dll
  79. BIN wraps/openwrap/tests/OpenWrap.Resharper.511.pdb
  80. BIN wraps/openwrap/tests/OpenWrap.Tests.dll
  81. BIN wraps/openwrap/tests/OpenWrap.Tests.pdb
  82. +0 −55 wraps/openwrap/tests/Repositories/feedodata.xml
  83. +0 −55 wraps/openwrap/tests/Repositories/feedodata2.xml
  84. +1 −1 wraps/openwrap/version
View
@@ -1,24 +1,24 @@
+_cache
+_cache/*
+_*
+*/_*
+src/_*
obj
bin
bin/*
-scratch
-scratch/*
deploy
deploy/*
-NDependOut
_ReSharper.*
*.csproj.user
-*.resharper.user
-*.ReSharper.user
+*.user
*.suo
*.cache
*.Cache
~$*
Thumbs.db
*.cache
.svn
-*.pidb
-*.user
-*.ndproj
-*.xls
-*.htm
+reports
+reports/*
+/*.wrap
+src/_mm_cache.bin
View
BIN bugs.txt
Binary file not shown.
View
@@ -0,0 +1 @@
+depends: nunit
View
@@ -7,3 +7,5 @@ name: openwrap
depends: tdnet-framework
use-symlinks: true
depends: mono.cecil
+directory-structure: src\*{scope: Tests=tests}\**
+depends: Newtonsoft.Json
@@ -72,11 +72,7 @@ void EnsureWrapRepositoryIsInitialized()
[Required]
public string ProjectFilePath { get; set; }
- public InitializeVisualStudioIntegration()
- {
- InternalServices.Initialize();
-
- }
+
public override bool Execute()
{
ResharperLogger.Debug("Initialize called on " + ProjectFilePath);
@@ -24,7 +24,6 @@ public class ResolveWrapReferences : Task, IResolvedAssembliesUpdateListener
public ResolveWrapReferences()
{
- InternalServices.Initialize();
_fileSystem = LocalFileSystem.Instance;
}
@@ -193,6 +193,9 @@ Note that the NuPack support is only provided for backward compatibility with le
<data name="build-wrap-name" xml:space="preserve">
<value>Sets the name of the package to create. If not present, the name specified in the descriptor is used.</value>
</data>
+ <data name="init-wrap-name" xml:space="preserve">
+ <value>Specifies the package name to initialize. If -Target is specified, the default is the directory name specified there, otherwise the default is the current directory name.</value>
+ </data>
<data name="build-wrap-path" xml:space="preserve">
<value>Sets the location in which to build the package. Defaults to the current directory.</value>
</data>
@@ -0,0 +1,61 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading;
+using OpenWrap.PackageManagement;
+using OpenWrap.PackageManagement.Exporters.Assemblies;
+using OpenWrap.PackageManagement.Monitoring;
+using OpenWrap.Runtime;
+
+namespace OpenWrap.Commands.Core
+{
+ [Command(Visible = false, Noun = "solutionplugin", Verb = "start")]
+ public class StartSolutionPlugin : AbstractCommand, IResolvedAssembliesUpdateListener
+ {
+ IPackageManager _manager;
+ IEnvironment _environment;
+ IPackageDescriptorMonitor _monitor;
+ ManualResetEvent _exit = new ManualResetEvent(false);
+
+ public StartSolutionPlugin()
+ {
+
+ }
+ protected override IEnumerable<ICommandOutput> ExecuteCore()
+ {
+ yield return new Info("Solution plugin started");
+ //_monitor.RegisterListener(_environment.DescriptorFile, _environment.ProjectRepository, this);
+
+
+ //var solPackages = _manager.GetProjectExports<Exports.ISolutionPlugin>(_environment.Descriptor, _environment.ProjectRepository, _environment.ExecutionEnvironment)
+ // .SelectMany(x=>x)
+ // .Select(x=>x.Start())
+ // .ToList();
+
+ //_exit.WaitOne();
+ //solPackages.ForEach(x => x.Dispose());
+
+ //CommitSuicide();
+ }
+
+ static void CommitSuicide()
+ {
+ AppDomain.Unload(AppDomain.CurrentDomain);
+ }
+
+ public void AssembliesUpdated(IEnumerable<Exports.IAssembly> assemblyPaths)
+ {
+ _exit.Set();
+ }
+
+ public ExecutionEnvironment Environment
+ {
+ get { return _environment.ExecutionEnvironment; }
+ }
+
+ public bool IsLongRunning
+ {
+ get { return true; }
+ }
+ }
+}
@@ -63,6 +63,7 @@
<Compile Include="Core\InvalidProxy.cs" />
<Compile Include="Core\RemoveConfigurationCommand.cs" />
<Compile Include="Core\SetConfigurationCommand.cs" />
+ <Compile Include="Core\InvokeSolutionPlugin.cs" />
<Compile Include="Errors\FileNotFound.cs" />
<Compile Include="Gui\ShowPackageExplorerCommand.cs" />
<Compile Include="Gui\InvokeGuiCommand.cs" />
@@ -24,6 +24,7 @@ public class InitWrapCommand : AbstractCommand
bool? _allProjects;
IEnumerable<IFile> _projectsToPatch;
IFile _packageDescriptorFile;
+ string _name;
public InitWrapCommand()
{
@@ -192,14 +193,21 @@ string GetOpenWrapPath(IDirectory projectPath, IDirectory rootPath)
}
throw new InvalidOperationException("Could not find a descriptor.");
}
+ [CommandInput (Position = 1)]
+ public string Name
+ {
+ get { return _name ?? (Target == "." ? Environment.CurrentDirectory.Name : Target); }
+ set { _name = value; }
+ }
+
IEnumerable<ICommandOutput> SetupDirectoriesAndDescriptor()
{
IDirectory currentDirectory = Environment.CurrentDirectory;
IDirectory projectDirectory = Target == "." ? currentDirectory : currentDirectory.GetDirectory(Target);
- string packageName = Target == "." ? Environment.CurrentDirectory.Name : Target;
+ string packageName = Name;
_packageDescriptorFile = projectDirectory.GetFile(packageName + ".wrapdesc");
if (_packageDescriptorFile.Exists)
@@ -225,7 +225,6 @@ public class FluentMethodBuilder
TypeReference _returnType;
MethodAttributes _visibility;
MethodAttributes _instance;
- object _returnValue;
public FluentMethodBuilder(ModuleDefinition module, string name)
{
@@ -16,7 +16,7 @@ public add_wrap()
{
given_remote_repository("iron-hills");
}
- protected void when_executing_command(string parameters)
+ protected override void when_executing_command(string parameters)
{
base.when_executing_command(parameters);
@@ -68,7 +68,6 @@ bool SaveProperty(string name, IEnumerable<string> val)
public class InputBuilder
{
readonly MemoryCommandInput _descriptor;
- readonly string _name;
public InputBuilder(string name)
{
@@ -60,7 +60,7 @@ public void property_value_is_name_of_folder()
Properties["source"].ShouldBe("src");
}
}
- [TestFixture(@"projects\**\{source: src}")]
+ [TestFixture(@"projects\**\{source: src}\**")]
[TestFixture(@"projects\{source: src}")]
[TestFixture(@"**\{source: src}")]
public class parsing_path_with_relative_template : contexts.template_processor
@@ -84,6 +84,20 @@ public void property_value_is_name_of_folder()
Properties["source"].ShouldBe("src");
}
}
+ public class parsing_path_with_relative_template_repeating_segments : contexts.template_processor
+ {
+ public parsing_path_with_relative_template_repeating_segments()
+ {
+ given_template(@"src\{scope: project}\**");
+ when_parsing_path(@"c:\src\middle-earth\src\project\project.csproj");
+ }
+
+ [Test]
+ public void property_is_found()
+ {
+ Properties["scope"].ShouldBe("project");
+ }
+ }
namespace contexts
{
public abstract class template_processor : OpenWrap.Testing.context
@@ -112,7 +126,7 @@ protected void given_template(string path)
protected void when_parsing_path(string path)
{
IDictionary<string,string> props;
- SuccessfulParsing = Processor.TryParsePath(new Path(path), out props);
+ SuccessfulParsing = Processor.TryParsePath(new Path(path), false, out props);
Properties = props;
}
@@ -1,5 +1,6 @@
using System.Linq;
using NUnit.Framework;
+using OpenRasta.Client;
using OpenWrap.Testing;
using Tests.Repositories.contexts;
using Tests.Repositories.factories.nuget;
@@ -16,7 +17,8 @@ public reading_one_dependency()
"openwrap",
"1.1.0",
"The best package manager for .net",
- dependencies: "openfilesystem:1.0.0"));
+ dependencies: "openfilesystem:1.0.0",
+ contentUri: "openwrap.nupkg"));
when_reading_feed();
}
@@ -32,5 +34,12 @@ public void dependency_version_ignores_build()
{
Feed.Packages.Single().Dependencies.Single().ShouldBe("openfilesystem >= 1.0 and < 1.1");
}
+
+ [Test]
+ public void dependency_content_is_correct()
+ {
+ Feed.Packages.Single().PackageHref.ShouldNotBeNull()
+ .ShouldBe(NuGetBaseUri.Combine("openwrap.nupkg"));
+ }
}
}
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using NUnit.Framework;
+using OpenFileSystem.IO.FileSystems.InMemory;
using OpenRasta.Client;
using OpenWrap;
using OpenWrap.PackageModel;
@@ -47,10 +48,11 @@ namespace Tests.Repositories.contexts
public class nufeed : http
{
protected ILookup<string, IPackageInfo> Packages;
+ protected InMemoryFileSystem FileSystem = new InMemoryFileSystem();
protected void when_reading_packages()
{
- Packages = new NuFeedRepository(base.Client, "http://localhost/packages/1".ToUri(), "http://localhost/packages/1".ToUri())
+ Packages = new NuFeedRepository(FileSystem, base.Client, "http://localhost/packages/1".ToUri(), "http://localhost/packages/1".ToUri())
.PackagesByName;
}
}
@@ -400,11 +400,6 @@
<HintPath>..\..\..\..\..\..\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\Microsoft.Build.Engine.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Build.Framework" />
- <Reference Include="nunit.framework, Version=2.5.7.10213, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <Private>False</Private>
- <HintPath>..\..\lib\nunit-2.5.5\nunit.framework.dll</HintPath>
- </Reference>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
@@ -8,7 +8,7 @@ namespace Tests.visiting_package_graphs
{
class visiting_from_node : contexts.package_graph_visitor
{
- List<IPackageInfo> visited = new List<IPackageInfo>();
+ //List<IPackageInfo> visited = new List<IPackageInfo>();
public visiting_from_node()
{
@@ -13,7 +13,7 @@ namespace Tests.visiting_package_graphs
{
class visiting_linear_package_graph : contexts.package_graph_visitor
{
- List<IPackageInfo> visited = new List<IPackageInfo>();
+ //List<IPackageInfo> visited = new List<IPackageInfo>();
public visiting_linear_package_graph()
@@ -9,7 +9,6 @@ namespace Tests.visiting_package_graphs
{
class visiting_non_linear_package_graph : contexts.package_graph_visitor
{
- List<IPackageInfo> visited = new List<IPackageInfo>();
public visiting_non_linear_package_graph()
{
given_package("the-shire", "1.0");
Oops, something went wrong.

0 comments on commit f0e0f2f

Please sign in to comment.