private void BuildPlugin(IPackage package, string language, string rulesFilePath, string sqaleFilePath, PluginManifest pluginDefn, string baseTempDirectory)
        {
            this.logger.LogInfo(UIResources.APG_GeneratingPlugin);

            // Make the .jar name match the format [artefactid]-[version].jar
            // i.e. the format expected by Maven
            string fullJarPath = Path.Combine(Directory.GetCurrentDirectory(),
                                              package.Id + "-plugin-" + pluginDefn.Version + ".jar");

            PluginBuilder builder = new PluginBuilder(logger);

            RulesPluginBuilder.ConfigureBuilder(builder, pluginDefn, language, rulesFilePath, sqaleFilePath);

            AddRoslynMetadata(baseTempDirectory, builder, package);

            builder.SetJarFilePath(fullJarPath);
            builder.Build();

            this.logger.LogInfo(UIResources.APG_PluginGenerated, fullJarPath);
        }
예제 #2
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);
        }