private String getSourceSetNameFromFile ( File file ) { Path absolutePath = Paths . get ( file . getAbsolutePath ( ) ) ; Path basePath = Paths . get ( task . getProject ( ) . file ( "src" ) . getAbsolutePath ( ) ) ; return basePath . relativize ( absolutePath ) . toString ( ) . split ( Matcher . quoteReplacement ( File . separator ) ) [ 0 ] ; }
Returns the source set folder name given a file path . Assumes the source set name follows the src folder based on the inputs received from GraphQLSourceDirectorySet .