Exemple #1
0
 public ImportCommand(
     IFileSystem fileSystem,
     ProjectDetector projectDetector,
     params ImportOperation[] availableOperations)
     : base("import", "Import a file to your fuse project")
 {
     _fileSystem      = fileSystem;
     _projectDetector = projectDetector;
     _operations      = availableOperations;
 }
Exemple #2
0
        public static BuildCommand CreateBuildCommand()
        {
            var shell           = new Shell();
            var projectDetector = new ProjectDetector(shell);
            var fuse            = FuseApi.Initialize("Fuse", new List <string>());

            return(new BuildCommand(
                       fuse,
                       ColoredTextWriter.Out,
                       ColoredTextWriter.Error,
                       fuse.Report,
                       projectDetector,
                       fileSystem: shell,
                       uno: fuse.Uno));
        }
Exemple #3
0
        public static ImportCommand CreateImportCommand()
        {
            var shell           = new Shell();
            var fuse            = FuseApi.Initialize("Fuse", new List <string>());
            var projectDetector = new ProjectDetector(shell);

            ImportOperation[] importers =
            {
                new SketchConversionOperation(
                    "sketch",
                    "Import Sketch symbols from given sketch file or from <project>.sketchFiles",
                    shell,
                    fuse.Report)
            };

            return(new ImportCommand(shell, projectDetector, importers));
        }
Exemple #4
0
 public BuildCommand(
     IFuseLauncher daemonSpawner,
     ColoredTextWriter outWriter,
     ColoredTextWriter errorWriter,
     IReport report,
     ProjectDetector projectDetector,
     IFileSystem fileSystem,
     IExternalApplication uno)
     : base("build", "Build a project for a given target")
 {
     _daemonSpawner   = daemonSpawner;
     _outWriter       = outWriter;
     _errorWriter     = errorWriter;
     _report          = report;
     _projectDetector = projectDetector;
     _fileSystem      = fileSystem;
     _uno             = uno;
 }
Exemple #5
0
        public static PreviewCommand CreatePreviewCommand()
        {
            var shell           = new Shell();
            var projectDetector = new ProjectDetector(shell);
            var coloredConsole  = ColoredTextWriter.Out;
            var fuse            = FuseApi.Initialize("Fuse", new List <string>());

            return(new PreviewCommand(
                       coloredConsole,
                       new PreviewArgumentResolver(
                           projectDetector,
                           shell),
                       new PreviewMain(
                           shell, fuse,
                           new PreviewExported(coloredConsole),
                           coloredConsole),
                       fuse));
        }
Exemple #6
0
 public override void Run(string[] args, CancellationToken ct)
 {
     if (args.Length == 0)
     {
         LaunchFuseOpen(args);
     }
     else
     {
         try
         {
             var projectPath = new ProjectDetector(_fileSystem).GetProject(_fileSystem.ResolveAbsolutePath(args[0]));
             LaunchFuseOpen(args.Skip(1).ToArray(), projectPath);
         }
         catch (ProjectNotFound)
         {
             throw new ExitWithError("Project '" + args[0] + "' was not found");
         }
     }
 }
Exemple #7
0
 public PreviewArgumentResolver(ProjectDetector projects, IFileSystem fileSystem)
 {
     _projects   = projects;
     _fileSystem = fileSystem;
 }