Roots

class Roots(rootFolders: Collection<File>)

A helper class to get a package name from a list of root folders

Given:

  • a list of root folders like "src/main/graphql/", "src/debug/graphql/", etc...

  • an absolute file path like "/User/lee/projects/app/src/main/graphql/com/example/Query.graphql will return "com.example"

Constructors

Link copied to clipboard
fun Roots(rootFolders: Collection<File>)

Functions

Link copied to clipboard
fun filePackageName(filePath: String): String

Return the packageName if this file is in these Roots or throw else