public boolean tryWaitForLoadedProject() {
    if (GradleDaemonManager.isRunningExclusiveTask()) {
      throw new IllegalStateException(
          "Cannot wait for loading a project"
              + " while blocking daemon tasks from being executed."
              + " Possible dead-lock.");
    }

    // Ensure that the project is started to be loaded.
    getCurrentModel();
    return loadedAtLeastOnceSignal.tryWaitForSignal();
  }
 public boolean hasLoadedProject() {
   return loadedAtLeastOnceSignal.isSignaled();
 }