private void CompileSubProjects(string projectDirPath, ProjectConfig projectConfig, CompiledProjects packages)
 {
     // Build Projects that weren't already built as dependencies
     foreach(var project in projectConfig.Projects)
     {
         var projectName = project.Key;
         if(packages.Contains(projectName)) continue;
         Compile(Path.Combine(projectDirPath, project.Value, ProjectFile.Name), packages);
         // TODO copy into target
     }
 }
        private void CompileDependencies(string projectDirPath, ProjectConfig projectConfig, CompiledProjects projects)
        {
            var paths = projectConfig.Dependencies
                    .Where(d => !projects.Contains(d.Key))
                    .Select(d => DependencyPath(d.Key, d.Value, projectDirPath, projectConfig.DependencyPaths));

            foreach(var path in paths)
                Compile(Path.Combine(path, ProjectFile.Name), projects);
        }
        private void CompileProject(string projectDirPath, ProjectConfig projectConfig, CompiledProjects projects)
        {
            Console.WriteLine($"Compiling {projectConfig.Name} ...");

            var sourceFiles = new DirectoryInfo(Path.Combine(projectDirPath, "src")).GetFiles("*.adam", SearchOption.AllDirectories);
            var isApp = projectConfig.Template == "app";
            // TODO read trusted from config
            var package = new PackageSyntax(projectConfig.Name, isApp, projectConfig.Dependencies.Select(d => new PackageReferenceSyntax(d.Key, null, true)));
            package = package.With(sourceFiles.Select(fileInfo => compiler.Parse(package, new SourceFile(fileInfo))));
            if(package.Diagnostics.Count > 0)
            {
                PrintDiagnostics(package);
                return;
            }
            var compiledPackage = compiler.Compile(package, projects.Select(p => p.Package));
            var compiledProject = new CompiledProject(projectDirPath, compiledPackage);
            projects.Add(compiledProject);
            OnProjectCompiled(compiledProject, projects);
        }