Ejemplo n.º 1
0
        /// <inheritdoc/>
        public PlatformDetectorResult Detect(RepositoryContext context)
        {
            var detectionResult = _detector.Detect(new DetectorContext
            {
                SourceRepo = new Detector.LocalSourceRepo(context.SourceRepo.RootPath),
            });

            if (detectionResult == null)
            {
                return(null);
            }

            var version = ResolveVersion(detectionResult.PlatformVersion);

            detectionResult.PlatformVersion = version;
            return(detectionResult);
        }
Ejemplo n.º 2
0
        /// <inheritdoc/>
        public PlatformDetectorResult Detect(RepositoryContext context)
        {
            try
            {
                var detectionResult = _detector.Detect(new DetectorContext
                {
                    SourceRepo = new Detector.LocalSourceRepo(context.SourceRepo.RootPath),
                });
                if (detectionResult == null)
                {
                    return(null);
                }

                ResolveVersions(context, detectionResult);
                return(detectionResult);
            }
            catch (InvalidProjectFileException e)
            {
                _logger.LogError(e, "Error occurred while trying to detect for .Net Core application(s)");
                throw new InvalidUsageException(e.Message);
            }
        }