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

Adjust a few paths.

This commit is contained in:
Cedric Beust 2016-01-01 10:19:22 -08:00
parent 94364cbe07
commit 4017cd820f
2 changed files with 7 additions and 6 deletions

View file

@ -31,7 +31,9 @@ class JarGenerator @Inject constructor(val dependencyManager: DependencyManager)
// Class files
val files = KFiles.findRecursively(classesDir).map { File(relClassesDir.toFile(), it) }
val filesNotExcluded : List<File> = files.filter { ! KFiles.isExcluded(it, jar.excludes) }
val filesNotExcluded : List<File> = files.filter {
! KFiles.isExcluded(KFiles.joinDir(project.directory, it.path), jar.excludes)
}
val fileSpecs = arrayListOf<IFileSpec>()
filesNotExcluded.forEach {
fileSpecs.add(IFileSpec.FileSpec(it.path.toString().substring(prefixPath.toString().length + 1)))

View file

@ -52,13 +52,12 @@ class PackagingPlugin @Inject constructor(val dependencyManager : DependencyMana
val fromPath = directory + "/" + includedFile.from
if (File(fromPath).exists()) {
spec.toFiles(fromPath).forEach { file ->
File(fromPath, file.path).let {
if (!it.exists()) {
throw AssertionError("File should exist: $it")
}
val fullFile = File(fromPath, file.path)
if (! fullFile.exists()) {
throw AssertionError("File should exist: $fullFile")
}
if (!KFiles.isExcluded(file, excludes)) {
if (!KFiles.isExcluded(fullFile, excludes)) {
includedSpecs.add(FileSpec(file.path))
} else {
log(2, "Not adding ${file.path} to jar file because it's excluded")