How to inherit sourceSets settings? / What is the closure for 'test srcDir' and 'test resources'


(J.V.) #1

If I redefine where my source is in build.gradle

sourceSets {
    main {
        java {
            srcDir 'src/main'
        }
    }
}

How do I inherit these settings in other .gradle files that I have (for example if I have another dot gradle file in the same directory named myFile.gradle?

Is there a way to define these sourceSets in a properties file that every gradle build file will pickup automatically?

What is the closure for “test resources”, I searched the Java plugin but did not see a reference if I need to redefine “test srcDir” or test resources?

I have a small project where all code will be .java, so having a directory that contains only a directory like; src/main/java is not really needed.

thanks