File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed
build-plugins/build-support
src/main/kotlin/aws/sdk/kotlin/gradle/plugins/artifactsizemetrics Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 ->
You can’t perform that action at this time.
0 commit comments