Skip to content

Commit

Permalink
Fixes #99 - Gives a better error message for ideaProject task when co…
Browse files Browse the repository at this point in the history
…pyright folder doesn't exist (#100)
  • Loading branch information
EthanLozano authored and uschi2000 committed Sep 16, 2016
1 parent 245871c commit 351577d
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import org.gradle.api.tasks.compile.JavaCompile
import org.gradle.plugins.ide.idea.IdeaPlugin
import org.gradle.plugins.ide.idea.model.IdeaModel

import java.nio.file.Files
import java.nio.file.Paths

class BaselineIdea extends AbstractBaselinePlugin {
Expand Down Expand Up @@ -70,7 +71,9 @@ class BaselineIdea extends AbstractBaselinePlugin {
private void addCopyright(node) {
def copyrightManager = node.component.find { it.'@name' == 'CopyrightManager' }
def copyrightDir = Paths.get("${configDir}/copyright/")
assert Files.exists(copyrightDir), "${copyrightDir} must exist"
def copyrightFiles = project.fileTree(copyrightDir.toFile()).include("*")
assert copyrightFiles.iterator().hasNext(), "${copyrightDir} must contain one or more copyright file"
copyrightFiles.each { File file ->
def fileName = copyrightDir.relativize(file.toPath())
def copyrightNode = copyrightManager.copyright.find {
Expand Down

0 comments on commit 351577d

Please sign in to comment.