mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-27 08:38:13 -07:00
Fail the build if "assemble" fails.
This commit is contained in:
parent
231b18302e
commit
bcc6af5f37
1 changed files with 13 additions and 12 deletions
|
@ -1,15 +1,12 @@
|
||||||
package com.beust.kobalt.plugin.packaging
|
package com.beust.kobalt.plugin.packaging
|
||||||
|
|
||||||
import com.beust.kobalt.Features
|
import com.beust.kobalt.*
|
||||||
import com.beust.kobalt.IFileSpec
|
|
||||||
import com.beust.kobalt.IFileSpec.FileSpec
|
import com.beust.kobalt.IFileSpec.FileSpec
|
||||||
import com.beust.kobalt.IFileSpec.Glob
|
import com.beust.kobalt.IFileSpec.Glob
|
||||||
import com.beust.kobalt.TaskResult
|
|
||||||
import com.beust.kobalt.api.*
|
import com.beust.kobalt.api.*
|
||||||
import com.beust.kobalt.api.annotation.Directive
|
import com.beust.kobalt.api.annotation.Directive
|
||||||
import com.beust.kobalt.api.annotation.ExportedProjectProperty
|
import com.beust.kobalt.api.annotation.ExportedProjectProperty
|
||||||
import com.beust.kobalt.api.annotation.Task
|
import com.beust.kobalt.api.annotation.Task
|
||||||
import com.beust.kobalt.glob
|
|
||||||
import com.beust.kobalt.internal.JvmCompilerPlugin
|
import com.beust.kobalt.internal.JvmCompilerPlugin
|
||||||
import com.beust.kobalt.maven.DependencyManager
|
import com.beust.kobalt.maven.DependencyManager
|
||||||
import com.beust.kobalt.maven.PomGenerator
|
import com.beust.kobalt.maven.PomGenerator
|
||||||
|
@ -177,16 +174,20 @@ class PackagingPlugin @Inject constructor(val dependencyManager : DependencyMana
|
||||||
@Task(name = TASK_ASSEMBLE, description = "Package the artifacts",
|
@Task(name = TASK_ASSEMBLE, description = "Package the artifacts",
|
||||||
runAfter = arrayOf(JvmCompilerPlugin.TASK_COMPILE))
|
runAfter = arrayOf(JvmCompilerPlugin.TASK_COMPILE))
|
||||||
fun doTaskAssemble(project: Project) : TaskResult {
|
fun doTaskAssemble(project: Project) : TaskResult {
|
||||||
project.projectProperties.put(PACKAGES, packages)
|
try {
|
||||||
packages.filter { it.project.name == project.name }.forEach { pkg ->
|
project.projectProperties.put(PACKAGES, packages)
|
||||||
pkg.jars.forEach { jarGenerator.generateJar(pkg.project, context, it) }
|
packages.filter { it.project.name == project.name }.forEach { pkg ->
|
||||||
pkg.wars.forEach { warGenerator.generateWar(pkg.project, context, it, projects) }
|
pkg.jars.forEach { jarGenerator.generateJar(pkg.project, context, it) }
|
||||||
pkg.zips.forEach { zipGenerator.generateZip(pkg.project, context, it) }
|
pkg.wars.forEach { warGenerator.generateWar(pkg.project, context, it, projects) }
|
||||||
if (pkg.generatePom) {
|
pkg.zips.forEach { zipGenerator.generateZip(pkg.project, context, it) }
|
||||||
pomFactory.create(project).generate()
|
if (pkg.generatePom) {
|
||||||
|
pomFactory.create(project).generate()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
return TaskResult()
|
||||||
|
} catch(ex: Exception) {
|
||||||
|
throw KobaltException(ex)
|
||||||
}
|
}
|
||||||
return TaskResult()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun addPackage(p: PackageConfig) {
|
fun addPackage(p: PackageConfig) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue