private String getPathRelativeToSourceSet ( File file ) { Path absolutePath = Paths . get ( file . getAbsolutePath ( ) ) ; Path basePath = Paths . get ( task . getProject ( ) . file ( "src" ) . getAbsolutePath ( ) + File . separator + getSourceSetNameFromFile ( file ) ) ; return basePath . relativize ( absolutePath ) . toString ( ) ; }
Returns the file path relative to the sourceSet directory