Skip to content

Commit

Permalink
Don't crash on non-js dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
shafirov committed Aug 29, 2016
1 parent bb3e939 commit 9b6a182
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/main/groovy/KWP.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 40,10 @@ class KWP implements Plugin<Project> {
writeSafely(new File(targetDir, "__modules.txt")) { buf ->
dependencies.each {jar ->
def m = unzipSafely(jar, targetDir)
def moduleName = m.name.substring(0, m.name.lastIndexOf('.'))
buf.append("${ moduleName}:${normalizedAbsolutePath(m)}\n")
if (m != null) {
def moduleName = m.name.substring(0, m.name.lastIndexOf('.'))
buf.append("${moduleName}:${normalizedAbsolutePath(m)}\n")
}
}
}

Expand Down Expand Up @@ -89,9 91,12 @@ class KWP implements Plugin<Project> {
if (targets == 3) break
}

timestampFile.text = ""
timestampFile.text = targetFile?.absolutePath ?: "notfound.js"
timestampFile.setLastModified(jar.lastModified())
}
else {
targetFile = new File(timestampFile.text)
}

return targetFile
}
Expand Down

0 comments on commit 9b6a182

Please sign in to comment.