Gradle upgrade to 5.1.1 with classesDir into classesDirs

Hello

Coming from gradle 4.8.1, we usually set our classesDir like this

sourceSets {
	def classesDir = "$buildDir/classes/$project.name"
	def resourcesDir = "$buildDir/resources/$project.name"

	main {
		output.classesDir = file("$classesDir/main")
		output.resourcesDir = file("$resourcesDir/main")
	}
	test {
		output.classesDir = file("$classesDir/test")
		output.resourcesDir = file("$resourcesDir/test")
	}
	functionalTest {
		java {
			srcDir 'src/functional/java'
		}
		resources {
			srcDir 'src/test/resources'
		}
		output.classesDir = file("$classesDir/functional")
		output.resourcesDir = file("$resourcesDir/functional")
	}
}

However, with gradle 5.1.1, classesDir is depracated and replaced with classesDirs, and classesDirs is a read-only property, how would we overwrite this?

Something like this works I think.

main {
    java.outputDir = file("$classesDir/main")
    output.resourcesDir = file("$resourcesDir/main")
}

https://docs.gradle.org/current/userguide/java_plugin.html#sec:source_set_properties

I actually found the answer to this from the documentations, thank you tho for responding :slight_smile: