0
나는 *.dsl
확장자를 가진 파일 그루비 파일로 컴파일되어야한다 Gradle을 말하려고에 소스 파일 확장자를 추가, 그래서 포함 패턴으로 설정 소스를 추가하고 컴파일 작업을 변경 포함 재산 :가 Gradle을
sourceSets {
...
dsl_scripts {
groovy {
include '**/*.dsl'
}
}
}
compileDsl_scriptsGroovy.includes = ['**/*.dsl']
하지만 디버그 모드로 빌드를 실행할 때 다음과 같은 메시지가 모든 *.dsl
파일을 건너 뜁니다 :
Skipping task ':compileDsl_scriptsGroovy' as it has no source files
을
println sourceSets.dsl_scripts.allSource.matching({include '**/*.dsl'}).getFiles()
내가 뭘 잘못 했니?
편집 :
FileCollection groovyJavaOnly = spec.getSource().filter(new Spec<File>() {
public boolean isSatisfiedBy(File element) {
return element.getName().endsWith(".groovy") || element.getName().endsWith(".java");
}
});
spec.setSource(new SimpleFileCollection(groovyJavaOnly.getFiles()));
그것을 대체 할 수 있나요 : 나는 Gradle을 소스에 다음 코드를 발견?