Exemplo n.º 1
0
        public static void Main(String[] args)
        {
            String toolName = typeof(Program).GetTypeInfo().Assembly.GetName().Name;
            String path = Path.GetFullPath(Directory.GetCurrentDirectory());
            GennyApplication application = new GennyApplication();
            Project project = ProjectReader.GetProject(path);
            application.Name = project.Name;
            application.BasePath = path;

            if (args.Contains("--no-dispatch"))
            {
                new GennyCommand(application).Execute(args.Where(arg => arg != "--no-dispatch").ToArray());
            }
            else
            {
                ProjectDependenciesCommandFactory factory = new ProjectDependenciesCommandFactory(
                    project.GetTargetFrameworks().FirstOrDefault().FrameworkName,
                    Constants.DefaultConfiguration,
                    null,
                    null,
                    path);

                factory
                    .Create(toolName, args.Concat(new[] { "--no-dispatch" }).ToArray())
                    .ForwardStdErr()
                    .ForwardStdOut()
                    .Execute();
            }
        }
Exemplo n.º 2
0
        public GennyCommand(GennyApplication application)
        {
            ServiceProvider = new GennyServiceProvider();

            ServiceProvider.Add(application);
            ServiceProvider.Add<IGennyLogger, GennyLogger>();
            ServiceProvider.Add<IGennyCompiler, GennyCompiler>();
            ServiceProvider.Add<IGennyScaffolder, GennyScaffolder>();
            ServiceProvider.Add<IGennyModuleLoader, GennyModuleLoader>();
            ServiceProvider.Add<IGennyModuleLocator, GennyModuleLocator>();

            Logger = ServiceProvider.GetRequiredService<IGennyLogger>();
            Loader = ServiceProvider.GetRequiredService<IGennyModuleLoader>();
            Locator = ServiceProvider.GetRequiredService<IGennyModuleLocator>();
        }
Exemplo n.º 3
0
 public GennyCompiler(GennyApplication application)
 {
     Context = DependencyContext.Load(Assembly.Load(new AssemblyName(application.Name)));
 }
Exemplo n.º 4
0
 public GennyScaffolder(GennyApplication application, IGennyCompiler compiler)
 {
     Application = application;
     Compiler = compiler;
 }
Exemplo n.º 5
0
 public GennyModuleLocator(GennyApplication application)
 {
     ApplicationName = application.Name;
 }