Beispiel #1
0
 public void SetHydraConfig(HydraConfig hydraConfig)
 {
     if (hydraConfig != null)
     {
         if (!String.IsNullOrWhiteSpace(hydraConfig.Layout))
         {
             this.LayoutPath = System.IO.Path.Combine(this.WorkspacePath, hydraConfig.Layout);
         }
         if (!String.IsNullOrWhiteSpace(hydraConfig.Title))
         {
             this.ViewTitle = hydraConfig.Title;
         }
     }
 }
Beispiel #2
0
        /// <summary>
        /// Компилира проект
        /// </summary>
        private void BuildProject(HCompilerConfig compilerConfig)
        {
            // Зарежда локалните настройки
            string      hydraConfigPath = Path.Combine(_WorkspacePath, "hydra.config.json");
            HydraConfig hydraConfig     = LoadHydraConfig(hydraConfigPath);

            compilerConfig.SetHydraConfig(hydraConfig);
            // Компилира файловете
            BuildDirectoryFiles(compilerConfig);

            // Компилира подпроектите
            foreach (string srcProject in Directory.GetDirectories(compilerConfig.WorkspacePath))
            {
                string projectName = srcProject.Substring(compilerConfig.WorkspacePath.Length + 1
                                                          , srcProject.Length - compilerConfig.WorkspacePath.Length - 1);

                if (projectName.StartsWith("."))
                {
                    _BuildSkipped += 1;
                }
                else
                {
                    PrintBuildLine(compilerConfig.ProjectName, projectName);

                    HCompilerConfig compilerConfigProject = new HCompilerConfig()
                    {
                        ProjectName = (String.IsNullOrWhiteSpace(compilerConfig.ProjectName) ? "" : compilerConfig.ProjectName + Path.DirectorySeparatorChar)
                                      + projectName,
                        WorkspacePath = srcProject,
                        OutputPath    = Path.Combine(compilerConfig.OutputPath, projectName),
                        LayoutPath    = compilerConfig.LayoutPath,
                        ViewTitle     = compilerConfig.ViewTitle
                    };
                    Directory.CreateDirectory(compilerConfigProject.OutputPath);
                    BuildProject(compilerConfigProject);
                }
            }
        }