From ac1de3b81be03d21bfa22a13eec2bc719263cfc7 Mon Sep 17 00:00:00 2001 From: Sam Gleske Date: Sat, 29 Jul 2023 13:22:01 -0400 Subject: [PATCH] Document deprecated PipelineGenerator constructor --- .../jervis/lang/MultiPlatformGenerator.groovy | 1 - .../jervis/lang/PipelineGenerator.groovy | 26 ++++++++++++++++--- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/src/main/groovy/net/gleske/jervis/lang/MultiPlatformGenerator.groovy b/src/main/groovy/net/gleske/jervis/lang/MultiPlatformGenerator.groovy index 6040f72f..28e0b41a 100644 --- a/src/main/groovy/net/gleske/jervis/lang/MultiPlatformGenerator.groovy +++ b/src/main/groovy/net/gleske/jervis/lang/MultiPlatformGenerator.groovy @@ -85,7 +85,6 @@ class MultiPlatformGenerator implements Serializable { this.platforms_obj = platforms } - @Deprecated MultiPlatformGenerator(LifecycleGenerator lifecycleGenerator) { this.platforms_obj = new MultiPlatformValidator() if(lifecycleGenerator.platform_obj) { diff --git a/src/main/groovy/net/gleske/jervis/lang/PipelineGenerator.groovy b/src/main/groovy/net/gleske/jervis/lang/PipelineGenerator.groovy index d23efda9..fd0d2428 100644 --- a/src/main/groovy/net/gleske/jervis/lang/PipelineGenerator.groovy +++ b/src/main/groovy/net/gleske/jervis/lang/PipelineGenerator.groovy @@ -196,11 +196,21 @@ pipeline_generator.stashMap['html']['includes'] private Map user_defined_collect_settings = [:] /** - Instantiates this class with a {@link LifecycleGenerator} which - is used for helper functions when creating a pipeline job designed to - support Jervis. + Deprecated: Instantiates this class with a + {@link LifecycleGenerator} which is used for helper functions + when creating a pipeline job designed to support Jervis. + + + @Deprecated + This method is kept to help ease 3rd party legacy code migrations. It + will be removed in a future version of Jervis. Use + {@link #PipelineGenerator(net.gleske.jervis.lang.MultiPlatformGenerator)}, + instead. + + @param generator A LifecycleGenerator used as a backend to + generate Jenkins pipeline friendly code. */ - @Deprecated + @Deprecated(forRemoval=true, since="jervis-2.1") PipelineGenerator(LifecycleGenerator generator) { this.platformGenerator = new MultiPlatformGenerator(generator) // TODO replace stashes with platformGenerator.stashes @@ -210,6 +220,14 @@ pipeline_generator.stashMap['html']['includes'] processCollectItems() } + /** + Instantiates this class with a {@link MultiPlatformGenerator} which + is used for helper functions when creating a pipeline job designed to + support Jervis. + + @param platformGenerator A MultiPlatformGenerator used as a + backend to generate Jenkins pipeline friendly code. + */ PipelineGenerator(MultiPlatformGenerator platformGenerator) { this.platformGenerator = platformGenerator this.stashes = YamlOperator.getObjectValue(this.platformGenerator.getRawJervisYaml(), 'jenkins.stash', [[:], []]).with {