Using the following build.gradle
:
apply plugin: 'java'
def srcDirs = file('paths.list').text.readLines()
srcDirs.each { srcDirectory ->
sourceSets {
main {
java {
srcDir srcDirectory
}
}
}
}
and paths.list
:
current/path/to/hai
current/path/to/hai2
path/to/hai3
path/to/hai4
Executing ‘gradle build’ fails with the following error message:
Neither path nor baseDir may be null or empty string. path='' basedir='/home/martin/devel/tmp/gradle-srcdirs-from-file'
Gradle Version: 2.14.1
Operating System: Xubuntu 16.04.1
Java: 1.8.0_101 (Oracle Corporation 25.101-b13)