1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-27 00:38:11 -07:00

Skip install if there's nothing to install.

This commit is contained in:
Cedric Beust 2015-11-26 20:18:39 -08:00
parent c98d6e4311
commit 0118e71b4f

View file

@ -264,15 +264,14 @@ class PackagingPlugin @Inject constructor(val dependencyManager : DependencyMana
@Task(name = PackagingPlugin.TASK_INSTALL, description = "Install the artifacts",
runAfter = arrayOf(PackagingPlugin.TASK_ASSEMBLE))
fun taskInstall(project: Project) : TaskResult {
val config = configurationFor(project)
if (config != null) {
val config = configurationFor(project) ?: InstallConfig()
val buildDir = project.projectProperties.getString(LIBS_DIR)
val buildDirFile = File(buildDir)
if (buildDirFile.exists()) {
log(1, "Installing from $buildDir to ${config.libDir}")
val toDir = KFiles.makeDir(config.libDir)
KFiles.copyRecursively(File(buildDir), toDir)
} else {
log(1, "No install specified for ${project.name}, nothing to do")
KFiles.copyRecursively(buildDirFile, toDir)
}
return TaskResult()