@Nullable
  private DelegatingScript loadScriptFromFileSystemLocation(String location) {
    File file = new File(location);

    try {
      if (!file.exists()) return null;
    } catch (AccessControlException e) {
      // no permission to check for existence of file (e.g. on Spock Web Console),
      // so let's just assume it's not there and continue
      return null;
    }

    GroovyShell shell = createShell();

    try {
      return (DelegatingScript) shell.parse(file);
    } catch (IOException e) {
      throw new ConfigurationException("Error reading configuration script '%s'", location);
    } catch (CompilationFailedException e) {
      throw new ConfigurationException("Error compiling configuration script '%s'", location);
    }
  }
For testing purposes. Do not use directly.
spock-core/src/main/java/org/spockframework/runtime/ConfigurationScriptLoader.java