# ReportGroupProps

Construction properties for `ReportGroup`.

Used as props by: [ReportGroup](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_codebuild.ReportGroup.html)

- Source: [`aws-codebuild/lib/report-group.ts`](https://github.com/aws/aws-cdk/blob/v2.277.0/packages/aws-cdk-lib/aws-codebuild/lib/report-group.ts#L94)
- Type last changed: v2.143.0 · 24 May 2024

## Example

TypeScript:

```ts
declare const source: codebuild.Source;

// create a new ReportGroup
const reportGroup = new codebuild.ReportGroup(this, 'ReportGroup', {
    type: codebuild.ReportGroupType.CODE_COVERAGE
});

const project = new codebuild.Project(this, 'Project', {
  source,
  buildSpec: codebuild.BuildSpec.fromObject({
    // ...
    reports: {
      [reportGroup.reportGroupArn]: {
        files: '**/*',
        'base-directory': 'build/coverage-report.xml',
        'file-format': 'JACOCOXML'
      },
    },
  }),
});
```

Python:

```python
# source: codebuild.Source

# create a new ReportGroup
report_group = codebuild.ReportGroup(self, "ReportGroup",
    type=codebuild.ReportGroupType.CODE_COVERAGE
)

project = codebuild.Project(self, "Project",
    source=source,
    build_spec=codebuild.BuildSpec.from_object({
        # ...
        "reports": {
            "report_group.report_group_arn": {
                "files": "**/*",
                "base-directory": "build/coverage-report.xml",
                "file-format": "JACOCOXML"
            }
        }
    })
)
```

Java:

```java
Source source;

// create a new ReportGroup
ReportGroup reportGroup = ReportGroup.Builder.create(this, "ReportGroup")
        .type(ReportGroupType.CODE_COVERAGE)
        .build();

Project project = Project.Builder.create(this, "Project")
        .source(source)
        .buildSpec(BuildSpec.fromObject(Map.of(
                // ...
                "reports", Map.of(
                        reportGroup.getReportGroupArn(), Map.of(
                                "files", "**/*",
                                "base-directory", "build/coverage-report.xml",
                                "file-format", "JACOCOXML")))))
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
Source source;

// create a new ReportGroup
var reportGroup = new ReportGroup(this, "ReportGroup", new ReportGroupProps {
    Type = ReportGroupType.CODE_COVERAGE
});

var project = new Project(this, "Project", new ProjectProps {
    Source = source,
    BuildSpec = BuildSpec.FromObject(new Dictionary<string, object> {
        // ...
        { "reports", new Dictionary<string, IDictionary<string, string>> {
            { reportGroup.ReportGroupArn, new Struct {
                Files = "**/*",
                Base-directory = "build/coverage-report.xml",
                File-format = "JACOCOXML"
            } }
        } }
    })
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var source Source

// create a new ReportGroup
reportGroup := codebuild.NewReportGroup(this, jsii.String("ReportGroup"), &ReportGroupProps{
	Type: codebuild.ReportGroupType_CODE_COVERAGE,
})

project := codebuild.NewProject(this, jsii.String("Project"), &ProjectProps{
	Source: Source,
	BuildSpec: codebuild.BuildSpec_FromObject(map[string]interface{}{
		// ...
		"reports": map[string]map[string]*string{
			reportGroup.reportGroupArn: map[string]*string{
				"files": jsii.String("**/*"),
				"base-directory": jsii.String("build/coverage-report.xml"),
				"file-format": jsii.String("JACOCOXML"),
			},
		},
	}),
})
```

## Properties

- `deleteReports`: boolean = false — If true, deleting the report group force deletes the contents of the report group.

  If false, the report group must be empty before attempting to delete it.

- `exportBucket`: [IBucket](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_s3.IBucket.html) — An optional S3 bucket to export the reports to.

  **Default:** the reports will not be exported

- `removalPolicy`: [RemovalPolicy](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.RemovalPolicy.html) = RemovalPolicy.RETAIN — What to do when this resource is deleted from a stack.

  As CodeBuild does not allow deleting a ResourceGroup that has reports inside of it,
  this is set to retain the resource by default.

- `reportGroupName`: string — The physical name of the report group.

  **Default:** CloudFormation-generated name

- `type`: [ReportGroupType](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_codebuild.ReportGroupType.html) = TEST — The type of report group. This can be one of the following values:.

  - **TEST** - The report group contains test reports.
  - **CODE_COVERAGE** - The report group contains code coverage reports.

- `zipExport`: boolean — Whether to output the report files into the export bucket as-is, or create a ZIP from them before doing the export.

  **Default:** false (the files will not be ZIPped)

  Ignored if `exportBucket` has not been provided.
