Skip to content

Commit cf39493

Browse files
authored
Fix running ./gradlew tasks (#14407)
1 parent 3022b24 commit cf39493

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

build.gradle.kts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -166,15 +166,14 @@ tasks {
166166

167167
val uploadReleaseBundle by registering {
168168
dependsOn(generateReleaseBundle)
169+
doFirst {
170+
val username = System.getenv("SONATYPE_USER") ?: throw GradleException("Sonatype user not set")
171+
val password = System.getenv("SONATYPE_KEY") ?: throw GradleException("Sonatype key not set")
172+
val token = Base64.getEncoder().encodeToString("$username:$password".toByteArray())
169173

170-
val username = System.getenv("SONATYPE_USER") ?: throw GradleException("Sonatype user not set")
171-
val password = System.getenv("SONATYPE_KEY") ?: throw GradleException("Sonatype key not set")
172-
val token = Base64.getEncoder().encodeToString("$username:$password".toByteArray())
173-
174-
var query = "?name=opentelemetry-java-instrumentation-$stableVersion"
175-
query += "&publishingType=AUTOMATIC"
174+
var query = "?name=opentelemetry-java-instrumentation-$stableVersion"
175+
query += "&publishingType=AUTOMATIC"
176176

177-
doFirst {
178177
val bundle = generateReleaseBundle.get().outputs.files.singleFile
179178
val httpClient = OkHttpClient()
180179

0 commit comments

Comments
 (0)