diff --git a/build_projects/update-dependencies/Config.cs b/build_projects/update-dependencies/Config.cs index 9ba4b41ea..88c47ee94 100644 --- a/build_projects/update-dependencies/Config.cs +++ b/build_projects/update-dependencies/Config.cs @@ -39,12 +39,15 @@ namespace Microsoft.DotNet.Scripts private Lazy _dotNetVersionUrl = new Lazy(() => GetEnvironmentVariable("DOTNET_VERSION_URL", "https://raw.githubusercontent.com/dotnet/versions/master/build-info")); private Lazy _coreSetupVersionFragment = new Lazy(() => GetEnvironmentVariable("CORESETUP_VERSION_FRAGMENT", GetDefaultCoreSetupVersionFragment())); + + private Lazy _roslynVersionFragment = new Lazy(() => GetEnvironmentVariable("ROSLYN_VERSION_FRAGMENT")); private Lazy _gitHubUpstreamOwner = new Lazy(() => GetEnvironmentVariable("GITHUB_UPSTREAM_OWNER", "dotnet")); private Lazy _gitHubProject = new Lazy(() => GetEnvironmentVariable("GITHUB_PROJECT", "cli")); private Lazy _gitHubUpstreamBranch = new Lazy(() => GetEnvironmentVariable("GITHUB_UPSTREAM_BRANCH", GetDefaultUpstreamBranch())); private Lazy _gitHubPullRequestNotifications = new Lazy(() => GetEnvironmentVariable("GITHUB_PULL_REQUEST_NOTIFICATIONS", "") .Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries)); + private Config() { } @@ -54,6 +57,8 @@ namespace Microsoft.DotNet.Scripts public string Password => _password.Value; public string DotNetVersionUrl => _dotNetVersionUrl.Value; public string CoreSetupVersionFragment => _coreSetupVersionFragment.Value; + public string RoslynVersionFragment => _roslynVersionFragment.Value; + public bool HasRoslynVersionFragment => !string.IsNullOrEmpty(RoslynVersionFragment); public string GitHubUpstreamOwner => _gitHubUpstreamOwner.Value; public string GitHubProject => _gitHubProject.Value; public string GitHubUpstreamBranch => _gitHubUpstreamBranch.Value; diff --git a/build_projects/update-dependencies/Program.cs b/build_projects/update-dependencies/Program.cs index ae39b89aa..99b77691e 100644 --- a/build_projects/update-dependencies/Program.cs +++ b/build_projects/update-dependencies/Program.cs @@ -28,6 +28,11 @@ namespace Microsoft.DotNet.Scripts buildInfos.Add(GetBuildInfo("CoreSetup", s_config.CoreSetupVersionFragment, fetchLatestReleaseFile: false)); + if (s_config.HasRoslynVersionFragment) + { + buildInfos.Add(GetBuildInfo("Roslyn", s_config.RoslynVersionFragment, fetchLatestReleaseFile: false)); + } + IEnumerable updaters = GetUpdaters(); var dependencyBuildInfos = buildInfos.Select(buildInfo => new BuildDependencyInfo( @@ -88,6 +93,11 @@ namespace Microsoft.DotNet.Scripts yield return CreateRegexUpdater(dependencyVersionsPath, "MicrosoftNETCoreAppPackageVersion", "Microsoft.NETCore.App"); yield return CreateRegexUpdater(dependencyVersionsPath, "MicrosoftDotNetPlatformAbstractionsPackageVersion", "Microsoft.DotNet.PlatformAbstractions"); yield return CreateRegexUpdater(dependencyVersionsPath, "MicrosoftExtensionsDependencyModelPackageVersion", "Microsoft.Extensions.DependencyModel"); + + if (s_config.HasRoslynVersionFragment) + { + yield return CreateRegexUpdater(dependencyVersionsPath, "MicrosoftCodeAnalysisCSharpPackageVersion", "Microsoft.CodeAnalysis.CSharp"); + } } private static IDependencyUpdater CreateRegexUpdater(string repoRelativePath, string propertyName, string packageId)