Beispiel #1
0
        public async Task Pack_project_blazor_contents()
        {
            var asset = await Create.NetstandardWorkspaceCopy();

            var packageName = Path.GetFileNameWithoutExtension(asset.Directory.GetFiles("*.csproj").First().Name);

            var console = new TestConsole();

            await PackCommand.Do(new PackOptions(asset.Directory, enableBlazor : true), console);

            asset.Directory
            .GetFiles()
            .Should()
            .Contain(f => f.Name.Contains("nupkg"));

            var dotnet = new Dotnet(asset.Directory);

            var result = await dotnet.ToolInstall(packageName, asset.Directory, asset.Directory);

            var exe = Path.Combine(asset.Directory.FullName, packageName);

            var tool = new WorkspaceServer.WorkspaceFeatures.PackageTool(packageName, asset.Directory);

            await tool.Prepare();

            var projectDirectory = await tool.LocateProjects();

            var subDirectories = projectDirectory.GetDirectories();

            subDirectories.Should().Contain(d => d.Name == "packTarget");
            subDirectories.Should().Contain(d => d.Name == $"runner-{packageName}");
        }
        public async Task Pack_project_blazor_contents()
        {
            var asset = await Create.NetstandardWorkspaceCopy();

            var packageName = Path.GetFileNameWithoutExtension(asset.Directory.GetFiles("*.csproj").First().Name);

            var console = new TestConsole();

            await PackCommand.Do(new PackOptions(asset.Directory, enableWasm : true), console);

            asset.Directory
            .GetFiles()
            .Should()
            .Contain(f => f.Name.Contains("nupkg"));

            var dotnet = new Dotnet(asset.Directory);

            var result = await dotnet.ToolInstall(packageName, asset.Directory, new PackageSource(asset.Directory.FullName));

            var exe = Path.Combine(asset.Directory.FullName, packageName);

            var tool = new WorkspaceServer.WorkspaceFeatures.PackageTool(packageName, asset.Directory);

            await tool.Prepare();

            var wasmDirectory = await tool.LocateWasmAsset();

            wasmDirectory.Should().NotBeNull();
        }
Beispiel #3
0
        public static async Task Do(InstallOptions options, IConsole console)
        {
            var dotnet = new Dotnet();

            (await dotnet.ToolInstall(
                 options.PackageName,
                 options.Location,
                 options.AddSource)).ThrowOnFailure();

            var tool = new WorkspaceServer.WorkspaceFeatures.PackageTool(options.PackageName, options.Location);
            await tool.Prepare();
        }
Beispiel #4
0
        public static PackageTool TryCreateFromDirectory(string name, IDirectoryAccessor directoryAccessor)
        {
            var tool = new PackageTool(name, directoryAccessor);

            if (tool.Exists())
            {
                return(tool);
            }
            else
            {
                return(null);
            }
        }