|
| 1 | +// Copyright (c) SharpCrafters s.r.o. See the LICENSE.md file in the root directory of this repository root for details. |
| 2 | + |
| 3 | +using JetBrains.Annotations; |
| 4 | +using PostSharp.Engineering.BuildTools.Build; |
| 5 | +using PostSharp.Engineering.BuildTools.ContinuousIntegration.Model; |
| 6 | +using PostSharp.Engineering.BuildTools.Dependencies.Model; |
| 7 | +using PostSharp.Engineering.BuildTools.Tools.TeamCity; |
| 8 | +using System; |
| 9 | + |
| 10 | +namespace PostSharp.Engineering.BuildTools.Dependencies.Definitions; |
| 11 | + |
| 12 | +public static partial class MetalamaVsxDependencies |
| 13 | +{ |
| 14 | + // ReSharper disable once InconsistentNaming |
| 15 | + |
| 16 | + [PublicAPI] |
| 17 | + public static class V2026_1 |
| 18 | + { |
| 19 | + private class MetalamaVsxDependencyDefinition : DependencyDefinition |
| 20 | + { |
| 21 | + public MetalamaVsxDependencyDefinition( |
| 22 | + string dependencyName, |
| 23 | + VcsProvider vcsProvider, |
| 24 | + MetalamaGitHubOrganization? organization, |
| 25 | + bool isVersioned = true, |
| 26 | + string? parentCiProjectId = null, |
| 27 | + string? customCiProjectName = null, |
| 28 | + string? customBranch = null, |
| 29 | + string? customReleaseBranch = null, |
| 30 | + string? customRepositoryName = null, |
| 31 | + bool pullRequestRequiresStatusCheck = true, |
| 32 | + string? vcsRootProjectId = null ) |
| 33 | + : base( |
| 34 | + Family, |
| 35 | + dependencyName, |
| 36 | + customBranch ?? $"develop/{Family.Version}", |
| 37 | + customReleaseBranch ?? $"release/{Family.Version}", |
| 38 | + MetalamaDependencies.CreateMetalamaVcsRepository( |
| 39 | + customRepositoryName ?? dependencyName, |
| 40 | + vcsProvider, |
| 41 | + organization, |
| 42 | + customBranch == null && customReleaseBranch == null |
| 43 | + ? null |
| 44 | + : $"DefaultBranch_{dependencyName.Replace( ".", "", StringComparison.Ordinal )}" ), |
| 45 | + TeamCityHelper.CreateConfiguration( |
| 46 | + parentCiProjectId == null |
| 47 | + ? TeamCityHelper.GetProjectId( dependencyName, _projectName, Family.Version ) |
| 48 | + : TeamCityHelper.GetProjectIdWithParentProjectId( dependencyName, parentCiProjectId ), |
| 49 | + isVersioned, |
| 50 | + pullRequestRequiresStatusCheck: pullRequestRequiresStatusCheck, |
| 51 | + vcsRootProjectId: vcsRootProjectId ), |
| 52 | + isVersioned ) { } |
| 53 | + } |
| 54 | + |
| 55 | + public static ProductFamily Family { get; } = new( _projectName, "2026.1", DevelopmentDependencies.Family ) |
| 56 | + { |
| 57 | + UpstreamProductFamily = V2026_0.Family |
| 58 | + |
| 59 | + // DownstreamProductFamily = V2026_2.Family |
| 60 | + }; |
| 61 | + |
| 62 | + public static DependencyDefinition MetalamaVsx { get; } = |
| 63 | + new MetalamaVsxDependencyDefinition( |
| 64 | + "Metalama.Vsx", |
| 65 | + VcsProvider.GitHub, |
| 66 | + MetalamaGitHubOrganization.Metalama ) |
| 67 | + { |
| 68 | + PackagePatterns = ["Metalama.Repacked"], |
| 69 | + Dependencies = |
| 70 | + [ |
| 71 | + DevelopmentDependencies.PostSharpEngineering, |
| 72 | + MetalamaDependencies.V2026_1.Metalama, |
| 73 | + PostSharpDependencies.V2026_0.PostSharp.ToDependency( |
| 74 | + new ConfigurationSpecific<BuildConfiguration>( |
| 75 | + BuildConfiguration.Release, |
| 76 | + BuildConfiguration.Release, |
| 77 | + BuildConfiguration.Release ) ) |
| 78 | + ] |
| 79 | + }; |
| 80 | + } |
| 81 | +} |
0 commit comments