Exemplo n.º 1
0
        static int Main(string[] args)
        {
            ILogger logger = new ConsoleLogger();

            Utilities.LogAssemblyVersion(typeof(Program).Assembly, UIResources.AssemblyDescription, logger);

            if (args.Length != 2 && args.Length != 3)
            {
                logger.LogError(UIResources.Cmd_Error_IncorrectArguments);
                return ERROR_CODE;
            }

            string pluginDefnFilePath = args[0];
            string rulesFilePath = args[1];
                        
            PluginManifest defn = PluginManifest.Load(pluginDefnFilePath);
            string fullNewJarFilePath = Path.Combine(Directory.GetCurrentDirectory(),
                Path.GetFileNameWithoutExtension(pluginDefnFilePath) + ".jar");

            string sqaleFilePath = null;
            if (args.Length == 3)
            {
                sqaleFilePath = args[2];
            }

            //TODO: support multiple languages
            string language = "cs";

            PluginBuilder builder = new PluginBuilder(logger);
            RulesPluginBuilder.ConfigureBuilder(builder, defn, language, rulesFilePath, sqaleFilePath);
            builder.SetJarFilePath(fullNewJarFilePath);
            builder.Build();

            return SUCCESS_CODE;
        }
Exemplo n.º 2
0
        static int Main(string[] args)
        {
            ConsoleLogger logger = new ConsoleLogger();
            Common.Utilities.LogAssemblyVersion(typeof(Program).Assembly, UIResources.AssemblyDescription, logger);

            ProcessedArgs processedArgs = ArgumentProcessor.TryProcessArguments(args, logger);

            bool success = false;
            if (processedArgs != null)
            {
                AnalyzerPluginGenerator generator = new AnalyzerPluginGenerator(logger);
                success = generator.Generate(processedArgs.AnalyzerRef, processedArgs.SqaleFilePath);
            }

            return success ? SUCCESS_CODE : ERROR_CODE;
        }
Exemplo n.º 3
0
        static int Main(string[] args)
        {
            ConsoleLogger logger = new ConsoleLogger();
            Common.Utilities.LogAssemblyVersion(typeof(Program).Assembly, UIResources.AssemblyDescription, logger);
            
            ProcessedArgs processedArgs = ArgumentProcessor.TryProcessArguments(args, logger);

            bool success = false;
            if (processedArgs != null)
            {
                NuGetPackageHandler packageHandler = new NuGetPackageHandler(NuGetPackageSource, logger);
                AnalyzerPluginGenerator generator = new AnalyzerPluginGenerator(packageHandler, logger);
                success = generator.Generate(processedArgs.AnalyzerRef, processedArgs.Language, processedArgs.SqaleFilePath,
                    System.IO.Directory.GetCurrentDirectory());
            }

            return success ? SUCCESS_CODE : ERROR_CODE;
        }
Exemplo n.º 4
0
        static int Main(string[] args)
        {
            ConsoleLogger logger = new ConsoleLogger();
            Utilities.LogAssemblyVersion(typeof(Program).Assembly, UIResources.AssemblyDescription, logger);
            
            ProcessedArgs processedArgs = ArgumentProcessor.TryProcessArguments(args, logger);

            bool success = false;
            if (processedArgs != null)
            {
                string exeDir = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
                ISettings nuGetSettings = NuGetRepositoryFactory.GetSettingsFromConfigFiles(exeDir);
                IPackageRepository repo = NuGetRepositoryFactory.CreateRepository(nuGetSettings, logger);
                string localNuGetCache = Utilities.CreateTempDirectory(".nuget");
                NuGetPackageHandler packageHandler = new NuGetPackageHandler(repo, localNuGetCache, logger);

                AnalyzerPluginGenerator generator = new AnalyzerPluginGenerator(packageHandler, logger);
                success = generator.Generate(processedArgs);
            }

            return success ? SUCCESS_CODE : ERROR_CODE;
        }