mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 08:27:12 -07:00
Fix build.
This commit is contained in:
parent
6816ba8a3b
commit
e9b8212dbd
1 changed files with 13 additions and 5 deletions
|
@ -74,8 +74,18 @@ data class ProxyConfig(val host: String = "", val port: Int = 0, val type: Strin
|
||||||
fun toAetherProxy() = Proxy(type, host, port) // TODO make support for proxy auth
|
fun toAetherProxy() = Proxy(type, host, port) // TODO make support for proxy auth
|
||||||
}
|
}
|
||||||
|
|
||||||
data class HostConfig(var url: String = "", var name: String, var username: String? = null,
|
data class HostConfig(var url: String = "", var name: String = HostConfig.createRepoName(url),
|
||||||
var password: String? = null) {
|
var username: String? = null, var password: String? = null) {
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
/**
|
||||||
|
* For repos specified in the build file (repos()) that don't have an associated unique name,
|
||||||
|
* create such a name from the URL. This is a requirement from Maven Resolver, and failing to do
|
||||||
|
* this leads to very weird resolution errors.
|
||||||
|
*/
|
||||||
|
private fun createRepoName(url: String) = url.replace("/", "_").replace("\\", "_").replace(":", "_")
|
||||||
|
}
|
||||||
|
|
||||||
fun hasAuth() : Boolean {
|
fun hasAuth() : Boolean {
|
||||||
return (! username.isNullOrBlank()) && (! password.isNullOrBlank())
|
return (! username.isNullOrBlank()) && (! password.isNullOrBlank())
|
||||||
}
|
}
|
||||||
|
@ -95,10 +105,8 @@ fun repos(vararg repos : String) {
|
||||||
newRepos(*repos)
|
newRepos(*repos)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun createRepoName(url: String) = url.replace("/", "_").replace("\\", "_").replace(":", "_")
|
|
||||||
|
|
||||||
fun newRepos(vararg repos: String) {
|
fun newRepos(vararg repos: String) {
|
||||||
repos.forEach { Kobalt.addRepo(HostConfig(it, createRepoName(it))) }
|
repos.forEach { Kobalt.addRepo(HostConfig(it)) }
|
||||||
}
|
}
|
||||||
|
|
||||||
fun buildFileClasspath(vararg deps: String) {
|
fun buildFileClasspath(vararg deps: String) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue