Exemplo n.º 1
0
        private static void Main(string[] args)
        {
            const string envVarName = "CHROMIUM_SRC";
            const string projectName = "Crystalbyte.Spectre.Projections";

            var created = false;

            var directoryInfo = new FileInfo(typeof (Program).Assembly.Location).Directory;
            if (directoryInfo == null)
                return;

            var solutionDir = Path.Combine(directoryInfo.Parent.Parent.Parent.Parent.FullName,"src");
            var outputDir = Path.Combine(solutionDir, projectName);

            var chromiumPath = Environment.GetEnvironmentVariable(envVarName);
            if (string.IsNullOrWhiteSpace(chromiumPath)) {
                //chromiumPath = "/home/alexander/Development/Google/chromium/src/";
                MessageBox.Show(
                    "Environmental variable 'CHROMIUM_SRC' not set, unable to determine Chromium source path.");
                Application.Exit();
            }

            var sourceDir = Path.Combine(chromiumPath, "cef", "include");
            var dirs = new List<string> {Path.Combine(sourceDir, "capi"), Path.Combine(sourceDir, "internal")};

            foreach (var dir in dirs)
            {
                var settings = new GeneratorSettings
                                   {
                                       RootDirectory = new DirectoryInfo(dir),
                                       OutputDirectory = new DirectoryInfo(outputDir),
                                       Namespace = projectName
                                   };
                if (dir.EndsWith("internal"))
                {
                    settings.ClassNameSuffix = "Class";
                    settings.Namespace = projectName + ".Internal";
                    settings.OutputDirectory = new DirectoryInfo(Path.Combine(outputDir, "Internal"));
                }
                var generator = new ProjectionsGenerator(settings);
                generator.Generate();

                if (created)
                {
                    continue;
                }
                generator.GenerateAssemblyFile();
                created = true;
            }
        }
Exemplo n.º 2
0
 public DiscoveryService(GeneratorSettings settings)
 {
     _settings = settings;
 }
Exemplo n.º 3
0
 public ProjectionsGenerator(GeneratorSettings settings)
 {
     _settings = settings;
     _delegateArchive = new Dictionary<string, string>();
 }