"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.PipelineBase=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var constructs_1=()=>{var tmp=require("constructs");return constructs_1=()=>tmp,tmp},core_1=()=>{var tmp=require("../../../core");return core_1=()=>tmp,tmp},literal_string_1=()=>{var tmp=require("../../../core/lib/private/literal-string");return literal_string_1=()=>tmp,tmp},blueprint_1=()=>{var tmp=require("../blueprint");return blueprint_1=()=>tmp,tmp};const PIPELINE_SYMBOL=Symbol.for("@aws-cdk/pipelines.PipelineBase");class PipelineBase extends constructs_1().Construct{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.pipelines.PipelineBase",version:"2.256.1"};static isPipeline(x){return x!==null&&typeof x=="object"&&PIPELINE_SYMBOL in x}synth;waves;cloudAssemblyFileSet;built=!1;constructor(scope,id,props){super(scope,id);try{jsiiDeprecationWarnings().aws_cdk_lib_pipelines_PipelineBaseProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,PipelineBase),error}if(Object.defineProperty(this,PIPELINE_SYMBOL,{value:!0}),props.synth instanceof blueprint_1().ShellStep&&!props.synth.primaryOutput&&props.synth.primaryOutputDirectory("cdk.out"),!props.synth.primaryOutput)throw new(core_1()).ValidationError((0,literal_string_1().lit)`SynthStep`,`synthStep ${props.synth} must produce a primary output, but is not producing anything. Configure the Step differently or use a different Step type.`,this);this.synth=props.synth,this.waves=[],this.cloudAssemblyFileSet=props.synth.primaryOutput,core_1().Aspects.of(this).add({visit:()=>this.buildJustInTime()},{priority:core_1().AspectPriority.MUTATING})}addStage(stage,options){try{jsiiDeprecationWarnings().aws_cdk_lib_Stage(stage),jsiiDeprecationWarnings().aws_cdk_lib_pipelines_AddStageOpts(options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.addStage),error}if(this.built)throw new(core_1()).ValidationError((0,literal_string_1().lit)`AddstageCanTStagesAnymore`,"addStage: can't add Stages anymore after buildPipeline() has been called",this);return this.addWave(stage.stageName).addStage(stage,options)}addWave(id,options){try{jsiiDeprecationWarnings().aws_cdk_lib_pipelines_WaveOptions(options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.addWave),error}if(this.built)throw new(core_1()).ValidationError((0,literal_string_1().lit)`AddwaveCanTWavesAnymore`,"addWave: can't add Waves anymore after buildPipeline() has been called",this);const wave=new(blueprint_1()).Wave(id,options);return this.waves.push(wave),wave}buildPipeline(){if(this.built)throw new(core_1()).ValidationError((0,literal_string_1().lit)`BuildAlreadyCalledCall`,"build() has already been called: can only call it once",this);this.doBuildPipeline(),this.built=!0}buildJustInTime(){this.built||this.buildPipeline()}}exports.PipelineBase=PipelineBase;
