mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 08:27:12 -07:00
return config objects from directives
This commit is contained in:
parent
607b8a001f
commit
cb101cd410
1 changed files with 8 additions and 10 deletions
|
@ -206,12 +206,11 @@ data class GithubConfig(val project: Project) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Directive
|
@Directive
|
||||||
fun Project.github(init: GithubConfig.() -> Unit) {
|
fun Project.github(init: GithubConfig.() -> Unit): GithubConfig =
|
||||||
with(GithubConfig(this)) {
|
GithubConfig(this).also { config ->
|
||||||
init()
|
config.init()
|
||||||
(Kobalt.findPlugin(PublishPlugin.PLUGIN_NAME) as PublishPlugin).addGithubConfiguration(name, this)
|
(Kobalt.findPlugin(PublishPlugin.PLUGIN_NAME) as PublishPlugin).addGithubConfiguration(name, config)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
data class BintrayConfig(val project: Project) {
|
data class BintrayConfig(val project: Project) {
|
||||||
/**
|
/**
|
||||||
|
@ -245,9 +244,8 @@ data class BintrayConfig(val project: Project) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Directive
|
@Directive
|
||||||
fun Project.bintray(init: BintrayConfig.() -> Unit) {
|
fun Project.bintray(init: BintrayConfig.() -> Unit) =
|
||||||
with(BintrayConfig(this)) {
|
BintrayConfig(this).also { config ->
|
||||||
init()
|
config.init()
|
||||||
(Kobalt.findPlugin(PublishPlugin.PLUGIN_NAME) as PublishPlugin).addBintrayConfiguration(name, this)
|
(Kobalt.findPlugin(PublishPlugin.PLUGIN_NAME) as PublishPlugin).addBintrayConfiguration(name, config)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue