« Return to Thread: Excluding a Test Source File

Excluding a Test Source File

by JerodLass :: Rate this Message:

Reply to Author | View in Thread

I'm building a project with a test file that imports a class that I see no evidence actually exists.  The test file is 95% commented out so I know I can safely ignore it, but it's not mine so I cannot change it.  Thus, I would like to exclude it from the build (which doesn't run tests yet anyway).  I added the following line to the build file:

compileTests.exclude(**/BadTestFile.java)

When I build, the number of files to compile decreases by 1, but I still get the error.  The file looks to be effectively excluded by gradle in the debug output, but the javac command that is executed still gives -sourcepath /project/testsrc so it still tries to compile every test class and I get an error.  Basically, I am getting compile errors from a class that "isn't being compiled." Am I doing something wrong or does this functionality get lost somewhere before making it to the compiler?

Thanks for any help,
Jerod

 « Return to Thread: Excluding a Test Source File