示例#1
0
        /// <inheritdoc/>
        public PlatformDetectorResult Detect(RepositoryContext context)
        {
            PlatformDetectorResult detectionResult;

            if (TryGetExplicitVersion(out var explicitVersion))
            {
                detectionResult = new PlatformDetectorResult
                {
                    Platform        = PythonConstants.PlatformName,
                    PlatformVersion = explicitVersion,
                };
            }
            else
            {
                detectionResult = _detector.Detect(context);
            }

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

            var version = ResolveVersion(detectionResult.PlatformVersion);

            detectionResult.PlatformVersion = version;
            return(detectionResult);
        }
示例#2
0
 /// <inheritdoc/>
 public PlatformDetectorResult Detect(RepositoryContext context)
 {
     return(_detector.Detect(context));
 }