使用非标准项目目录结构的示例(自定义布局):
sourceSets {
main {
java {
srcDir 'sources/main/java'
}
outputDir = file("$workDir/client/program")
// For older version (now deprecated):
//output.classesDir = "$workDir/client/program"
}
test {
java {
srcDir 'sources/test/java'
}
outputDir = file("$workDir/client/tests")
// For older versions (now deprecated):
//output.classesDir = "$workDir/client/tests"
//output.resourcesDir = "$workDir/client/tests"
}
resources {
srcDirs 'sources/test/res'
}
}
尝试:
sourceSets {
main {
java {
srcDirs = ['src/java']
}
resources {
srcDirs = ['src/resources']
}
}
}
或者
sourceSets {
main.java.srcDirs += 'src/java'
main.resources.srcDirs += 'src/resources'
}