Exemplo n.º 1
0
        private static async Task Main(string[] args)
        {
            var settings = new ScoreCommand.Settings {
                PackageName = "Newtonsoft.Json", PackageVersion = "12.0.3"
            };
            var nuGetService   = new NuGetService();
            var packageContext = new PackageContext(settings);

            packageContext.NuspecReader = await nuGetService.GetNuspecFromPackage(packageContext);

            packageContext.PackageMetadata = await nuGetService.GetNuGetPackageMetadataFromPackage(packageContext);

            var scoreService = new ScoreService();
            var score        = await scoreService.ScorePackage(packageContext);

            ScoreDumper.DumpScore(score);
        }
Exemplo n.º 2
0
        public override async Task <int> ExecuteAsync(CommandContext context, Settings settings)
        {
            var nuGetService   = new NuGetService();
            var packageContext = new PackageContext(settings);

            //if packageContext does not have a version, we need to get latest version.
            //But let's make it required for now
            //then we can get the nuspec from the package.
            packageContext.NuspecReader = await nuGetService.GetNuspecFromPackage(packageContext);

            packageContext.PackageMetadata = await nuGetService.GetNuGetPackageMetadataFromPackage(packageContext);

            var scoreService = new ScoreService();
            var score        = await scoreService.ScorePackage(packageContext);

            ScoreDumper.DumpScore(score);
            //ScoreDumper.DumpSettings(settings);
            return(0);
        }