Skip to content

Commit

Permalink
Document deprecated PipelineGenerator constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
samrocketman committed Jul 29, 2023
1 parent e9f5bb6 commit ac1de3b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
26 changes: 22 additions & 4 deletions src/main/groovy/net/gleske/jervis/lang/PipelineGenerator.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,21 @@ pipeline_generator.stashMap['html']['includes']
private Map user_defined_collect_settings = [:]

/**
Instantiates this class with a <tt>{@link LifecycleGenerator}</tt> which
is used for helper functions when creating a pipeline job designed to
support Jervis.
<b>Deprecated:</b> Instantiates this class with a
<tt>{@link LifecycleGenerator}</tt> 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
<tt>{@link #PipelineGenerator(net.gleske.jervis.lang.MultiPlatformGenerator)}</tt>,
instead.
@param generator A <tt>LifecycleGenerator</tt> 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
Expand All @@ -210,6 +220,14 @@ pipeline_generator.stashMap['html']['includes']
processCollectItems()
}

/**
Instantiates this class with a <tt>{@link MultiPlatformGenerator}</tt> which
is used for helper functions when creating a pipeline job designed to
support Jervis.
@param platformGenerator A <tt>MultiPlatformGenerator</tt> 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 {
Expand Down

0 comments on commit ac1de3b

Please sign in to comment.