Пример #1
0
        public void SetUp()
        {
            graph = new ScriptGraph();
            var reader = new ScriptDslReader(graph);

            reader.ReadLine("1 includes A,B,C");
            reader.ReadLine("2 includes C,D");
            reader.ReadLine("3 includes 1,E");
            reader.ReadLine("D requires D1,D2");
            reader.ReadLine("3 requires 4");
            reader.ReadLine("4 includes jquery,validation.js");
            reader.ReadLine("Combo includes 1,2");
            reader.ReadLine("C-1 extends C");
            reader.ReadLine("crud includes crudForm.js,validation.js");
            reader.ReadLine("A requires crud");
            graph.CompileDependencies(new PackageRegistryLog());
        }
Пример #2
0
        public void ReadFile(string file, IPackageLog log)
        {
            var reader = new ScriptDslReader(_scripts);

            log.Trace("  Reading script directives from {0}", file);
            log.TrapErrors(() =>
            {
                _fileSystem.ReadTextFile(file, text =>
                {
                    if (text.Trim().IsEmpty())
                    {
                        return;
                    }

                    log.TrapErrors(() => reader.ReadLine(text));
                });
            });
        }