How to include all src/test/resources/** AND src/main/java/**/*.html in the test sourceset in gradle? -
i have following , thought 'adding' sourceset modified it..
sourcesets { test { resources { srcdirs = ["src/main/java"] includes = ["**/*.html"] } } }
what want both src/test/resources/** , above well. don't want exclude files src/test/resources though , above including html directories put there.
thanks, dean
the following illustrate technique using main
(so can verified):
apply plugin: 'java' sourcesets { myextra { resources { srcdirs "src/main/java" includes = ["**/*.html"] } } main { resources { source myextra.resources } } }
proof of concept via command-line:
bash$ ls src/main/java abc.html xyz.txt bash$ ls src/main/resources/ def.html ijk.txt bash$ gradle clean jar bash$ jar tf build/libs/myexample.jar meta-inf/ meta-inf/manifest.mf abc.html def.html ijk.txt
in case, change main
test
. answer discovered via gradle doc sourcedirectoryset. interestingly, 3.0, contains todo:
todo - configure includes/excludes individual source dirs
which implies work-around (via this method) necessary.
Comments
Post a Comment