Beispiel #1
0
        public void Default()
        {
            if (Directory.Exists(".Crow"))
            {
                if (File.Exists(".Crow/build.crow"))
                {
                    var buildConfig = configDeserializer.DeserializeFromFile <BuildConfig>(".Crow/build.crow");

                    List <string> compilableFiles = new List <string>();

                    if (string.Equals(buildConfig.Compiler, "custom", StringComparison.OrdinalIgnoreCase))
                    {
                        if (compilerManager.Compilers.All(compiler => compiler.FileTypes != buildConfig.CustomCompiler.FileTypes))
                        {
                            foreach (var file in Directory.GetFiles(Environment.CurrentDirectory, "*.*", SearchOption.AllDirectories))
                            {
                                foreach (var extension in buildConfig.CustomCompiler.FileTypes)
                                {
                                    if (string.Equals(Path.GetExtension(file), extension))
                                    {
                                        compilableFiles.Add(file);
                                    }
                                }
                            }

                            RegisterCompiler(buildConfig);
                        }
                    }
                    else
                    {
                        //TODO
                    }

                    Build(compilableFiles, buildConfig);
                }
                else
                {
                    throw new FileNotFoundException(".Crow/build.crow");
                }
            }
            else
            {
                throw new DirectoryNotFoundException(".Crow");
            }
        }
Beispiel #2
0
 public void Load <T>(string name, string file)
 {
     configs.Add(name, configDeserializer.DeserializeFromFile <T>(file));
 }