예제 #1
0
        static void Main(string[] args)
        {
            BuildGenerator generator = BuildGenerator.Create(args);

            if (generator != null)
            {
                generator.Generate();
            }
        }
예제 #2
0
        internal static BuildGenerator Create(Parser commandLineParser, string[] args)
        {
            if (commandLineParser == null)
            {
                throw new ArgumentNullException("commandLineParser");
            }

            BuildGenerator generator  = new BuildGenerator(commandLineParser.Settings.HelpWriter);
            var            helpWriter = generator.helpWriter;


            if (commandLineParser.ParseArguments(args, generator))
            {
                if ((string.IsNullOrWhiteSpace(generator.ReferencesPath) || string.IsNullOrWhiteSpace(generator.SourceCodeDir)) &&
                    string.IsNullOrEmpty(generator.DevExpressRoot))
                {
                    helpWriter.WriteLine(Resources.NoPathSpecifiedMessage);
                    helpWriter.WriteLine(Properties.Resources.UseHelpOptionForUsage);

                    return(null);
                }


                if (!string.IsNullOrWhiteSpace(generator.DevExpressRoot))
                {
                    if (!CheckDirectoryExists(helpWriter, generator.DevExpressRoot))
                    {
                        return(null);
                    }

                    generator.OutputPath    = generator.ReferencesPath = Path.Combine(generator.DevExpressRoot, "Bin", "Framework");
                    generator.SourceCodeDir = Path.Combine(generator.DevExpressRoot, "Sources");

                    helpWriter.WriteLine(Resources.OriginalFilesReplacementWarning);
                }


                if (CheckDirectoryExists(helpWriter, generator.SourceCodeDir) && CheckDirectoryExists(helpWriter, generator.ReferencesPath) &&
                    CheckDirectoryExistsOrEmpty(helpWriter, generator.CopyReferencesDirecotry))
                {
                    return(generator);
                }
            }

            return(null);
        }
예제 #3
0
        internal static BuildGenerator Create(Parser commandLineParser, string[] args)
        {
            if (commandLineParser == null)
                throw new ArgumentNullException("commandLineParser");

            BuildGenerator generator = new BuildGenerator(commandLineParser.Settings.HelpWriter);
            var helpWriter = generator.helpWriter;

            if (commandLineParser.ParseArguments(args, generator))
            {

                if ((string.IsNullOrWhiteSpace(generator.ReferencesPath) || string.IsNullOrWhiteSpace(generator.SourceCodeDir))
                    && string.IsNullOrEmpty(generator.DevExpressRoot))
                {
                    helpWriter.WriteLine(Resources.NoPathSpecifiedMessage);
                    helpWriter.WriteLine(Properties.Resources.UseHelpOptionForUsage);

                    return null;
                }

                if (!string.IsNullOrWhiteSpace(generator.DevExpressRoot))
                {

                    if (!CheckDirectoryExists(helpWriter, generator.DevExpressRoot)) return null;

                    generator.OutputPath = generator.ReferencesPath = Path.Combine(generator.DevExpressRoot, "Bin", "Framework");
                    generator.SourceCodeDir = Path.Combine(generator.DevExpressRoot, "Sources");

                    helpWriter.WriteLine(Resources.OriginalFilesReplacementWarning);
                }

                if (CheckDirectoryExists(helpWriter, generator.SourceCodeDir) && CheckDirectoryExists(helpWriter, generator.ReferencesPath)
                    && CheckDirectoryExistsOrEmpty(helpWriter, generator.CopyReferencesDirecotry))
                    return generator;
            }

            return null;
        }