mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 08:27:12 -07:00
Log when publish configurations can't be found.
This commit is contained in:
parent
89262e9259
commit
352e32fe22
1 changed files with 24 additions and 20 deletions
|
@ -7,10 +7,7 @@ import com.beust.kobalt.api.annotation.Directive
|
||||||
import com.beust.kobalt.api.annotation.Task
|
import com.beust.kobalt.api.annotation.Task
|
||||||
import com.beust.kobalt.internal.TaskResult
|
import com.beust.kobalt.internal.TaskResult
|
||||||
import com.beust.kobalt.maven.PomGenerator
|
import com.beust.kobalt.maven.PomGenerator
|
||||||
import com.beust.kobalt.misc.GithubApi
|
import com.beust.kobalt.misc.*
|
||||||
import com.beust.kobalt.misc.KFiles
|
|
||||||
import com.beust.kobalt.misc.LocalProperties
|
|
||||||
import com.beust.kobalt.misc.log
|
|
||||||
import com.google.common.base.Preconditions
|
import com.google.common.base.Preconditions
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
@ -75,12 +72,15 @@ public class PublishPlugin @Inject constructor(val files: KFiles, val factory: P
|
||||||
//
|
//
|
||||||
// Upload individual files, if applicable
|
// Upload individual files, if applicable
|
||||||
//
|
//
|
||||||
configuration?.let { conf : GithubConfig ->
|
if (configuration != null) {
|
||||||
conf.files.forEach {
|
configuration.files.forEach {
|
||||||
log(2, "Uploading $it tag: ${project.version}")
|
log(2, "Uploading $it tag: ${project.version}")
|
||||||
github.uploadRelease(project.name, project.version!!, it)
|
github.uploadRelease(project.name, project.version!!, it)
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
warn("Couldn't find any github{} configuration, not uploading anything")
|
||||||
}
|
}
|
||||||
|
|
||||||
return TaskResult()
|
return TaskResult()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,29 +89,33 @@ public class PublishPlugin @Inject constructor(val files: KFiles, val factory: P
|
||||||
val password = localProperties.get(PROPERTY_BINTRAY_PASSWORD)
|
val password = localProperties.get(PROPERTY_BINTRAY_PASSWORD)
|
||||||
|
|
||||||
val jcenter = jcenterFactory.create(user, password)
|
val jcenter = jcenterFactory.create(user, password)
|
||||||
|
var success = false
|
||||||
val configuration = jcenterConfigurations.getRaw(project.name)
|
val configuration = jcenterConfigurations.getRaw(project.name)
|
||||||
|
|
||||||
//
|
|
||||||
// Upload to Maven
|
|
||||||
//
|
|
||||||
val trMaven = jcenter.uploadMaven(project, findArtifactFiles(project), configuration)
|
|
||||||
var success = trMaven.success
|
|
||||||
val messages = arrayListOf<String>()
|
val messages = arrayListOf<String>()
|
||||||
if (! success) messages.add(trMaven.errorMessage!!)
|
|
||||||
|
|
||||||
//
|
if (configuration != null) {
|
||||||
// Upload individual files, if applicable
|
//
|
||||||
//
|
// Upload to Maven
|
||||||
configuration?.let { conf : JCenterConfig ->
|
//
|
||||||
conf.files.forEach {
|
val trMaven = jcenter.uploadMaven(project, findArtifactFiles(project), configuration)
|
||||||
val taskResult = jcenter.uploadFile(File(project.directory, it.first), it.second /* url */, conf)
|
var success = trMaven.success
|
||||||
|
if (! success) messages.add(trMaven.errorMessage!!)
|
||||||
|
|
||||||
|
//
|
||||||
|
// Upload individual files, if applicable
|
||||||
|
//
|
||||||
|
configuration.files.forEach {
|
||||||
|
val taskResult = jcenter.uploadFile(File(project.directory, it.first), it.second /* url */,
|
||||||
|
configuration)
|
||||||
success = success and taskResult.success
|
success = success and taskResult.success
|
||||||
if (!taskResult.success) {
|
if (!taskResult.success) {
|
||||||
messages.add(taskResult.errorMessage!!)
|
messages.add(taskResult.errorMessage!!)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
warn("Couldn't find any jcenter{} configuration, not uploading anything")
|
||||||
}
|
}
|
||||||
|
|
||||||
return TaskResult(success, messages.joinToString("\n "))
|
return TaskResult(success, messages.joinToString("\n "))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue