Skip to content

Commit dbc8510

Browse files
authored
fix: intellij collectDelegatedArtifactSizeMetrics issue (#95)
1 parent 196fa50 commit dbc8510

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

build-plugins/build-support/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ dependencies {
2626

2727
implementation(libs.nexusPublishPlugin)
2828
compileOnly(gradleApi())
29-
implementation("aws.sdk.kotlin:s3:1.1.+")
30-
implementation("aws.sdk.kotlin:cloudwatch:1.1.+")
29+
implementation("aws.sdk.kotlin:s3:1.4.+")
30+
implementation("aws.sdk.kotlin:cloudwatch:1.4.+")
3131
testImplementation(libs.junit.jupiter)
3232
}
3333

build-plugins/build-support/src/main/kotlin/aws/sdk/kotlin/gradle/plugins/artifactsizemetrics/CollectDelegatedArtifactSizeMetrics.kt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,18 +69,18 @@ internal abstract class CollectDelegatedArtifactSizeMetrics : DefaultTask() {
6969
private fun getFiles(keys: List<String>): List<String> = runBlocking {
7070
S3Client.fromEnvironment().use { s3 ->
7171
keys.map { key ->
72-
async { s3.getObjectAsText(key) }
72+
async {
73+
s3.getObject(
74+
GetObjectRequest {
75+
bucket = S3_ARTIFACT_SIZE_METRICS_BUCKET
76+
this.key = key
77+
},
78+
) { it.body?.decodeToString() ?: throw AwsSdkGradleException("Metrics file $key is missing a body") }
79+
}
7380
}.awaitAll()
7481
}
7582
}
7683

77-
private suspend fun S3Client.getObjectAsText(objectKey: String) = getObject(
78-
GetObjectRequest {
79-
bucket = S3_ARTIFACT_SIZE_METRICS_BUCKET
80-
key = objectKey
81-
},
82-
) { it.body?.decodeToString() ?: throw AwsSdkGradleException("Metrics file $objectKey is missing a body") }
83-
8484
private fun combine(metricsFiles: List<String>) = buildString {
8585
appendLine("Artifact, Size")
8686
metricsFiles.forEach { metricsFile ->

0 commit comments

Comments
 (0)