Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion librarian-cli/api/librarian-cli.api
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ public final class com/gradleup/librarian/cli/MultilineSecretComponent : com/git

public final class com/gradleup/librarian/cli/Update_repoKt {
public static final fun main ([Ljava/lang/String;)V
public static final fun updateRepo ([Ljava/lang/String;Lkotlin/jvm/functions/Function1;)V
public static final fun updateRepo ([Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)V
public static synthetic fun updateRepo$default ([Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
}

public final class com/gradleup/librarian/cli/UtilsKt {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ package com.gradleup.librarian.cli.command
import com.github.ajalt.clikt.core.CliktCommand
import com.github.ajalt.clikt.parameters.arguments.argument

internal class SetVersion : CliktCommand() {
internal class SetVersion(val setVersion: VersionContext.() -> Unit) : CliktCommand() {
val version by argument()
override fun run() {
setCurrentVersion(version)

VersionContext(version).setVersion()

println("Version is now '$version'.")
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,12 @@ private enum class State {
CommitChanges
}


fun updateRepo(args: Array<String>, setVersionInDocs: VersionContext.() -> Unit) {
MainCommand(setVersionInDocs).subcommands(SetVersion(), PrepareNextVersion(setVersionInDocs)).main(args)
/**
* @param setVersion how to set the version. The version is the version of the repo.
* @param setDocsVersion how to set the docs version. The docs version is lagging behind the repo version and is not a SNAPSHOT.
*/
fun updateRepo(args: Array<String>, setVersion: VersionContext.() -> Unit = {}, setDocsVersion: VersionContext.() -> Unit) {
MainCommand(setDocsVersion).subcommands(SetVersion(setVersion), PrepareNextVersion(setDocsVersion)).main(args)
}

fun main(args: Array<String>) {
Expand Down