The classesDirPath and testDirPath variables in Init.groovy are set by a system property named "grails.project.class.dir" if it exists. Otherwise, they default to separate directories for test and non-test classes within the user's home directory. However, there is no way to set different directories for test and non-test classes via system properties since classesDirPath and testDirPath both use the same system property. Referenced code is shown below.
classesDirPath = System.getProperty("grails.project.class.dir") ?: "$
{userHome}/.grails/${grailsVersion}/projects/${baseName}/classes"
testDirPath = System.getProperty("grails.project.class.dir") ?: "${userHome}
/.grails/$
{grailsVersion}
/projects/$
{baseName}
/test-classes"
The system property for testDirPath should be changed so that test and non-test classes do not have to be mixed if a user wants to place them in a non-default location. Perhaps the system property used to set testDirPath could be changed to "grails.project.test.dir" or "grails.project.test.class.dir". The included patch uses the second of the two suggested names.