Skip to content

Commit 545edec

Browse files
committed
Allow configuring bundle using command line option
1 parent dd5d828 commit 545edec

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

build-plugins/build-support/src/main/kotlin/aws/sdk/kotlin/gradle/publishing/SonatypeCentralPortalPublishTask.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ import org.gradle.api.DefaultTask
99
import org.gradle.api.file.RegularFileProperty
1010
import org.gradle.api.provider.Property
1111
import org.gradle.api.tasks.*
12+
import org.gradle.api.tasks.options.Option
13+
import kotlin.io.path.Path
14+
import kotlin.io.path.exists
1215
import kotlin.time.Duration
1316
import kotlin.time.Duration.Companion.minutes
1417
import kotlin.time.Duration.Companion.seconds
@@ -22,6 +25,12 @@ abstract class SonatypeCentralPortalPublishTask : DefaultTask() {
2225
@get:InputFile
2326
abstract val bundle: RegularFileProperty
2427

28+
@Option(option = "bundle", description = "Path to bundle")
29+
fun setBundleFromOption(path: String) {
30+
check(Path(path).exists()) { "Bundle not found at $path" }
31+
bundle.set(Path(path).toFile())
32+
}
33+
2534
/** Max time to wait for final state. */
2635
@get:Input
2736
@get:Optional

0 commit comments

Comments
 (0)