"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.CodeBuildStep=void 0;const jsiiDeprecationWarnings=require("../../../.warnings.jsii.js"),JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti"),codebuild=require("../../../aws-codebuild"),blueprint_1=require("../blueprint"),buildspecs_1=require("./private/buildspecs"),outputs_1=require("./private/outputs");class CodeBuildStep extends blueprint_1.ShellStep{constructor(id,props){super(id,props),this.exportedVariables=new Set,this.exportedVarsRendered=!1;try{jsiiDeprecationWarnings.aws_cdk_lib_pipelines_CodeBuildStepProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.constructor),error}this.projectName=props.projectName,this.buildEnvironment=props.buildEnvironment,this._partialBuildSpec=props.partialBuildSpec,this.vpc=props.vpc,this.subnetSelection=props.subnetSelection,this.role=props.role,this.rolePolicyStatements=props.rolePolicyStatements,this.securityGroups=props.securityGroups,this.timeout=props.timeout}get project(){if(!this._project)throw new Error("Call pipeline.buildPipeline() before reading this property");return this._project}get grantPrincipal(){return this.project.grantPrincipal}get partialBuildSpec(){this.exportedVarsRendered=!0;const varsBuildSpec=this.exportedVariables.size>0?codebuild.BuildSpec.fromObject({version:"0.2",env:{"exported-variables":Array.from(this.exportedVariables)}}):void 0;return buildspecs_1.mergeBuildSpecs(varsBuildSpec,this._partialBuildSpec)}exportedVariable(variableName){if(this.exportedVarsRendered&&!this.exportedVariables.has(variableName))throw new Error("exportVariable(): Pipeline has already been produced, cannot call this function anymore");return this.exportedVariables.add(variableName),outputs_1.makeCodePipelineOutput(this,variableName)}_setProject(project){this._project=project}}exports.CodeBuildStep=CodeBuildStep,_a=JSII_RTTI_SYMBOL_1,CodeBuildStep[_a]={fqn:"aws-cdk-lib.pipelines.CodeBuildStep",version:"2.24.1"};
//# sourceMappingURL=codebuild-step.js.map
