Exemplo n.º 1
0
        static void Main(string[] args)
        {
            // arguments
            if (string.IsNullOrEmpty(args[0])) {
                throw new ArgumentException("Source path is not specified.");
            }
            if (string.IsNullOrEmpty(args[1])) {
                throw new ArgumentException("Destination path is not specified.");
            }

            string sourcePath = args[0];
            string destinationPath = args[1];

            bool includeProjectFile = false;

            if (args.Length > 2) {
                includeProjectFile = (args[2].ToLower() == "/p");
            }

            // parse sources
            Parser xmlParser = new Parser(sourcePath, Console.Out);
            IList<Entry> entries = xmlParser.Parse();

            // generate files
            Generator generator = new Generator(destinationPath, Console.Out);
            generator.Render(entries);

            if (includeProjectFile) {
                generator.RenderProjectFile(entries);
            }
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            // arguments
            if (string.IsNullOrEmpty(args[0]))
            {
                throw new ArgumentException("Source path is not specified.");
            }
            if (string.IsNullOrEmpty(args[1]))
            {
                throw new ArgumentException("Destination path is not specified.");
            }

            string sourcePath      = args[0];
            string destinationPath = args[1];

            bool includeProjectFile = false;

            if (args.Length > 2)
            {
                includeProjectFile = (args[2].ToLowerInvariant() == "/p");
            }

            // parse sources
            Parser        xmlParser = new Parser(sourcePath, Console.Out);
            IList <Entry> entries   = xmlParser.Parse();

            // generate files
            Generator generator = new Generator(destinationPath, Console.Out);

            generator.Render(entries);

            foreach (var f in Directory.EnumerateFiles(sourcePath, "*.js"))
            {
                File.Copy(f, Path.Combine(destinationPath, Path.GetFileName(f)));
            }

            if (includeProjectFile)
            {
                generator.RenderProjectFile(entries);
            }
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            // arguments
            if (string.IsNullOrEmpty(args[0]))
            {
                throw new ArgumentException("Source path is not specified.");
            }
            if (string.IsNullOrEmpty(args[1]))
            {
                throw new ArgumentException("Destination path is not specified.");
            }

            string sourcePath      = args[0];
            string destinationPath = args[1];

            bool includeProjectFile = false;

            if (args.Length > 2)
            {
                includeProjectFile = (args[2].ToLower() == "/p");
            }

            // parse sources
            Parser        xmlParser = new Parser(sourcePath, Console.Out);
            IList <Entry> entries   = xmlParser.Parse();

            // generate files
            Generator generator = new Generator(destinationPath, Console.Out);

            generator.Render(entries);

            if (includeProjectFile)
            {
                generator.RenderProjectFile(entries);
            }
        }