/// <summary>
        /// Use the textual Assets DSL to configure asset dependencies and sets
        /// </summary>
        /// <param name="text"></param>
        /// <returns></returns>
        public AssetsExpression Configure(string text)
        {
            var dslReader = new AssetDslReader(_registration.Value);

            var    reader = new StringReader(text);
            string line;

            while ((line = reader.ReadLine()) != null)
            {
                dslReader.ReadLine(line);
            }

            return(this);
        }
        public void ReadFile(string file, IPackageLog log)
        {
            var reader = new AssetDslReader(_assets);
            log.Trace("  Reading script directives from {0}", file);
            log.TrapErrors(() =>
            {
                _fileSystem.ReadTextFile(file, text =>
                {
                    if (text.Trim().IsEmpty()) return;

                    log.TrapErrors(() => reader.ReadLine(text));
                });
            });
        }
        public void ReadFile(string file, IPackageLog log)
        {
            _diagnostics.SetCurrentProvenance(file);
            var reader = new AssetDslReader(_diagnostics);
            _configurationFiles.Fill(file.ToFullPath());

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

                    log.TrapErrors(() => reader.ReadLine(text));
                });
            });
        }
Example #4
0
            public Reader()
            {
                _graph = new AssetGraph();
                _cache = new Lazy <AssetDependencyFinderCache>(() =>
                {
                    _graph.CompileDependencies(new PackageLog());
                    return(new AssetDependencyFinderCache(_graph));
                });

                _dslReader = new AssetDslReader(_graph);

                _action = text =>
                {
                    if (text.StartsWith("if", StringComparison.OrdinalIgnoreCase))
                    {
                        _action = _dslReader.ReadLine;
                    }
                };
            }
Example #5
0
        public void ReadFile(string file, IPackageLog log)
        {
            _diagnostics.SetCurrentProvenance(file);
            var reader = new AssetDslReader(_diagnostics);

            _configurationFiles.Fill(file.ToFullPath());

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

                    log.TrapErrors(() => reader.ReadLine(text));
                });
            });
        }
Example #6
0
            public Reader()
            {
                _graph = new AssetGraph();
                _cache = new Lazy<AssetDependencyFinderCache>(() =>
                {
                    _graph.CompileDependencies(new PackageLog());
                    return new AssetDependencyFinderCache(_graph);
                });

                _dslReader = new AssetDslReader(_graph);

                _action = text =>
                {
                    if (text.StartsWith("if", StringComparison.OrdinalIgnoreCase))
                    {
                        _action = _dslReader.ReadLine;
                    }
                };
            }
 public void SetUp()
 {
     graph = new AssetGraph();
     var reader = new AssetDslReader(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 PackageLog());
 }