Example #1
0
    static void Build(string[] args, Log log)
    {
        var properties = ProjectPropertiesHelpers.InitializeProperties(args, log);

        if (properties.Sources.Count == 0)
        {
            Console.WriteLine("no sources found");
            return;
        }

        if (!Directory.Exists(properties.OutputDirectory))
        {
            Directory.CreateDirectory(properties.OutputDirectory);
        }

        if (!Directory.Exists(properties.ToolsDirectory))
        {
            Directory.CreateDirectory(properties.ToolsDirectory);
        }

        if (!Directory.Exists(properties.PackagesDirectory))
        {
            Directory.CreateDirectory(properties.PackagesDirectory);
        }

        NugetAction.DownloadNugetAction(properties);
        NugetAction.RestorePackagesAction(properties, Log);

        if (CscAction.Execute(properties, Log))
        {
            ConvertToCoreConsoleAction(properties);
            OutputRuntimeDependenciesAction(properties);
            Console.WriteLine("bin\\{0}.exe created", properties.AssemblyName);
        }
    }
Example #2
0
    static void Clean(string[] args, Log log)
    {
        var previous = log.IsEnabled; //TODO: this

        log.IsEnabled = false;
        var properties = ProjectPropertiesHelpers.InitializeProperties(args, log);

        log.IsEnabled = previous;
        Directory.Delete(properties.ToolsDirectory, true);
        Directory.Delete(properties.OutputDirectory, true);
        Directory.Delete(properties.PackagesDirectory, true);
    }