gt:     Project project(String path) throws UnknownProjectException;
context: /*
   * Copyright 2010 the original author or authors.
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *      http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  package org.gradle.api;
  
  import groovy.lang.Closure;
  import groovy.lang.MissingPropertyException;
  import org.gradle.api.artifacts.ConfigurationContainer;
  import org.gradle.api.artifacts.dsl.ArtifactHandler;
  import org.gradle.api.artifacts.dsl.DependencyHandler;
  import org.gradle.api.artifacts.dsl.RepositoryHandler;
  import org.gradle.api.component.SoftwareComponentContainer;
  import org.gradle.api.file.ConfigurableFileCollection;
  import org.gradle.api.file.ConfigurableFileTree;
  import org.gradle.api.file.CopySpec;
  import org.gradle.api.file.FileTree;
  import org.gradle.api.initialization.dsl.ScriptHandler;
  import org.gradle.internal.HasInternalProtocol;
  import org.gradle.api.invocation.Gradle;
  import org.gradle.api.logging.Logger;
  import org.gradle.api.logging.LoggingManager;
  import org.gradle.api.plugins.*;
  import org.gradle.api.resources.ResourceHandler;
  import org.gradle.api.tasks.TaskContainer;
  import org.gradle.api.tasks.WorkResult;
  import org.gradle.process.ExecResult;
  import org.gradle.process.ExecSpec;
  import org.gradle.process.JavaExecSpec;
  
  import java.io.File;
  import java.net.URI;
  import java.util.List;
  import java.util.Map;
  import java.util.Set;
  
  /**
   * <p>This interface is the main API you use to interact with Gradle from your build file. From a <code>Project</code>,
   * you have programmatic access to all of Gradle's features.</p>
   *
   * <h3>Lifecycle</h3>
   *
   * <p>There is a one-to-one relationship between a <code>Project</code> and a <code>{@value #DEFAULT_BUILD_FILE}</code>
   * file. During build initialisation, Gradle assembles a <code>Project</code> object for each project which is to
   * participate in the build, as follows:</p>
   *
   * <ul>
   *
   * <li>Create a {@link org.gradle.api.initialization.Settings} instance for the build.</li>
   *
   * <li>Evaluate the <code>{@value org.gradle.api.initialization.Settings#DEFAULT_SETTINGS_FILE}</code> script, if
   * present, against the {@link org.gradle.api.initialization.Settings} object to configure it.</li>
   *
   * <li>Use the configured {@link org.gradle.api.initialization.Settings} object to create the hierarchy of
   * <code>Project</code> instances.</li>
   *
   * <li>Finally, evaluate each <code>Project</code> by executing its <code>{@value #DEFAULT_BUILD_FILE}</code> file, if
   * present, against the project. The projects are evaluated in breadth-wise order, such that a project is evaluated
   * before its child projects. This order can be overridden by calling <code>{@link #evaluationDependsOnChildren()}</code> or by adding an
   * explicit evaluation dependency using <code>{@link #evaluationDependsOn(String)}</code>.</li>
   *
   * </ul>
   *
   * <h3>Tasks</h3>
   *
   * <p>A project is essentially a collection of {@link Task} objects. Each task performs some basic piece of work, such
   * as compiling classes, or running unit tests, or zipping up a WAR file. You add tasks to a project using one of the
   * {@code create()} methods on {@link TaskContainer}, such as {@link TaskContainer#create(String)}.  You can locate existing
   * tasks using one of the lookup methods on {@link TaskContainer}, such as {@link org.gradle.api.tasks.TaskCollection#getByName(String)}.</p>
   *
   * <h3>Dependencies</h3>
   *
   * <p>A project generally has a number of dependencies it needs in order to do its work.  Also, a project generally
   * produces a number of artifacts, which other projects can use. Those dependencies are grouped in configurations, and
   * can be retrieved and uploaded from repositories. You use the {@link org.gradle.api.artifacts.ConfigurationContainer}
   * returned by {@link #getConfigurations()} method to manage the configurations. The {@link
   * org.gradle.api.artifacts.dsl.DependencyHandler} returned by {@link #getDependencies()} method to manage the
   * dependencies. The {@link org.gradle.api.artifacts.dsl.ArtifactHandler} returned by {@link #getArtifacts()} method to
   * manage the artifacts. The {@link org.gradle.api.artifacts.dsl.RepositoryHandler} returned by {@link
   * #getRepositories()} method to manage the repositories.</p>
   *
   * <h3>Multi-project Builds</h3>
   *
   * <p>Projects are arranged into a hierarchy of projects. A project has a name, and a fully qualified path which
   * uniquely identifies it in the hierarchy.</p>
   *
   * <h3>Plugins</h3>
   *
   * <p>
   * Plugins can be used to modularise and reuse project configuration.
   * Plugins can be applied using the {@link PluginAware#apply(java.util.Map)} method, or by using the {@link org.gradle.plugin.use.PluginDependenciesSpec plugins script block}.
   * </p>
   *
   * <a name="properties"/> <h3>Properties</h3>
   *
   * <p>Gradle executes the project's build file against the <code>Project</code> instance to configure the project. Any
   * property or method which your script uses is delegated through to the associated <code>Project</code> object.  This
   * means, that you can use any of the methods and properties on the <code>Project</code> interface directly in your script.
   * </p><p>For example:
   * <pre>
   * defaultTasks('some-task')  // Delegates to Project.defaultTasks()
   * reportsDir = file('reports') // Delegates to Project.file() and the Java Plugin
   * </pre>
   * <p>You can also access the <code>Project</code> instance using the <code>project</code> property. This can make the
   * script clearer in some cases. For example, you could use <code>project.name</code> rather than <code>name</code> to
   * access the project's name.</p>
   *
   * <p>A project has 5 property 'scopes', which it searches for properties. You can access these properties by name in
   * your build file, or by calling the project's {@link #property(String)} method. The scopes are:</p>
   *
   * <ul>
   *
   * <li>The <code>Project</code> object itself. This scope includes any property getters and setters declared by the
   * <code>Project</code> implementation class.  For example, {@link #getRootProject()} is accessible as the
   * <code>rootProject</code> property.  The properties of this scope are readable or writable depending on the presence
   * of the corresponding getter or setter method.</li>
   *
   * <li>The <em>extra</em> properties of the project.  Each project maintains a map of extra properties, which
   * can contain any arbitrary name -> value pair.  Once defined, the properties of this scope are readable and writable.
   * See <a href="#extraproperties">extra properties</a> for more details.</li>
   *
   * <li>The <em>extensions</em> added to the project by the plugins. Each extension is available as a read-only property with the same name as the extension.</li>
   *
   * <li>The <em>convention</em> properties added to the project by the plugins. A plugin can add properties and methods
   * to a project through the project's {@link Convention} object.  The properties of this scope may be readable or writable, depending on the convention objects.</li>
   *
   * <li>The tasks of the project.  A task is accessible by using its name as a property name.  The properties of this
   * scope are read-only. For example, a task called <code>compile</code> is accessible as the <code>compile</code>
   * property.</li>
   *
   * <li>The extra properties and convention properties inherited from the project's parent, recursively up to the root
   * project. The properties of this scope are read-only.</li>
   *
   * </ul>
   *
   * <p>When reading a property, the project searches the above scopes in order, and returns the value from the first
   * scope it finds the property in. If not found, an exception is thrown. See {@link #property(String)} for more details.</p>
   *
   * <p>When writing a property, the project searches the above scopes in order, and sets the property in the first scope
   * it finds the property in. If not found, an exception is thrown. See {@link #setProperty(String, Object)} for more details.</p>
   *
   * <a name="extraproperties"/> <h4>Extra Properties</h4>
   *
   * All extra properties must be defined through the &quot;ext&quot; namespace. Once an extra property has been defined,
   * it is available directly on the owning object (in the below case the Project, Task, and sub-projects respectively) and can
   * be read and updated. Only the initial declaration that needs to be done via the namespace.
   *
   * <pre>
   * project.ext.prop1 = "foo"
   * task doStuff {
   *     ext.prop2 = "bar"
   * }
   * subprojects { ext.${prop3} = false }
   * </pre>
   *
   * Reading extra properties is done through the &quot;ext&quot; or through the owning object.
   *
   * <pre>
   * ext.isSnapshot = version.endsWith("-SNAPSHOT")
   * if (isSnapshot) {
   *     // do snapshot stuff
   * }
   * </pre>
   *
   * <h4>Dynamic Methods</h4>
   *
   * <p>A project has 5 method 'scopes', which it searches for methods:</p>
   *
   * <ul>
   *
   * <li>The <code>Project</code> object itself.</li>
   *
   * <li>The build file. The project searches for a matching method declared in the build file.</li>
   *
   * <li>The <em>extensions</em> added to the project by the plugins. Each extension is available as a method which takes
   * a closure or {@link org.gradle.api.Action} as a parameter.</li>
   *
   * <li>The <em>convention</em> methods added to the project by the plugins. A plugin can add properties and method to
   * a project through the project's {@link Convention} object.</li>
   *
   * <li>The tasks of the project. A method is added for each task, using the name of the task as the method name and
   * taking a single closure or {@link org.gradle.api.Action} parameter. The method calls the {@link Task#configure(groovy.lang.Closure)} method for the
   * associated task with the provided closure. For example, if the project has a task called <code>compile</code>, then a
   * method is added with the following signature: <code>void compile(Closure configureClosure)</code>.</li>
   *
   * <li>The methods of the parent project, recursively up to the root project.</li>
   *
   * </ul>
   */
  @HasInternalProtocol
  public interface Project extends Comparable<Project>, ExtensionAware, PluginAware {
      /**
       * The default project build file name.
       */
      public static final String DEFAULT_BUILD_FILE = "build.gradle";
  
      /**
       * The hierarchy separator for project and task path names.
       */
      public static final String PATH_SEPARATOR = ":";
  
      /**
       * The default build directory name.
       */
      public static final String DEFAULT_BUILD_DIR_NAME = "build";
  
      public static final String GRADLE_PROPERTIES = "gradle.properties";
  
      public static final String SYSTEM_PROP_PREFIX = "systemProp";
  
      public static final String DEFAULT_VERSION = "unspecified";
  
      public static final String DEFAULT_STATUS = "release";
  
      /**
       * <p>Returns the root project for the hierarchy that this project belongs to.  In the case of a single-project
       * build, this method returns this project.</p>
       *
       * @return The root project. Never returns null.
       */
      Project getRootProject();
  
      /**
       * <p>Returns the root directory of this project. The root directory is the project directory of the root
       * project.</p>
       *
       * @return The root directory. Never returns null.
       */
      File getRootDir();
  
      /**
       * <p>Returns the build directory of this project.  The build directory is the directory which all artifacts are
       * generated into.  The default value for the build directory is <code><i>projectDir</i>/build</code></p>
       *
       * @return The build directory. Never returns null.
       */
      File getBuildDir();
  
      /**
       * <p>Sets the build directory of this project. The build directory is the directory which all artifacts are
       * generated into. The path parameter is evaluated as described for {@link #file(Object)}. This mean you can use,
       * amongst other things, a relative or absolute path or File object to specify the build directory.</p>
       *
       * @param path The build directory. This is evaluated as per {@link #file(Object)}
       */
      void setBuildDir(Object path);
  
      /**
       * <p>Returns the build file Gradle will evaluate against this project object. The default is <code> {@value
       * #DEFAULT_BUILD_FILE}</code>. If an embedded script is provided the build file will be null. </p>
       *
       * @return Current build file. May return null.
       */
      File getBuildFile();
  
      /**
       * <p>Returns the parent project of this project, if any.</p>
       *
       * @return The parent project, or null if this is the root project.
       */
      Project getParent();
  
      /**
       * <p>Returns the name of this project. The project's name is not necessarily unique within a project hierarchy. You
       * should use the {@link #getPath()} method for a unique identifier for the project.</p>
       *
       * @return The name of this project. Never return null.
       */
      String getName();
  
      /**
       * Returns the description of this project.
       *
       * @return the description. May return null.
       */
      String getDescription();
  
      /**
       * Sets a description for this project.
       *
       * @param description The description of the project. Might be null.
       */
      void setDescription(String description);
  
      /**
       * <p>Returns the group of this project. Gradle always uses the {@code toString()} value of the group. The group
       * defaults to the path with dots as separators.</p>
       *
       * @return The group of this project. Never returns null.
       */
      Object getGroup();
  
      /**
       * <p>Sets the group of this project.</p>
       *
       * @param group The group of this project. Must not be null.
       */
      void setGroup(Object group);
  
      /**
       * <p>Returns the version of this project. Gradle always uses the {@code toString()} value of the version. The
       * version defaults to {@value #DEFAULT_VERSION}.</p>
       *
       * @return The version of this project. Never returns null.
       */
      Object getVersion();
  
      /**
       * <p>Sets the version of this project.</p>
       *
       * @param version The version of this project. Must not be null.
       */
      void setVersion(Object version);
  
      /**
       * <p>Returns the status of this project. Gradle always uses the {@code toString()} value of the status. The status
       * defaults to {@value #DEFAULT_STATUS}.</p>
       *
       * <p>The status of the project is only relevant, if you upload libraries together with a module descriptor. The
       * status specified here, will be part of this module descriptor.</p>
       *
       * @return The status of this project. Never returns null.
       */
      Object getStatus();
  
      /**
       * Sets the status of this project.
       *
       * @param status The status. Must not be null.
       */
      void setStatus(Object status);
  
      /**
       * <p>Returns the direct children of this project.</p>
       *
       * @return A map from child project name to child project. Returns an empty map if this project does not have
       *         any children.
       */
      Map<String, Project> getChildProjects();
  
      /**
       * <p>Sets a property of this project.  This method searches for a property with the given name in the following
       * locations, and sets the property on the first location where it finds the property.</p>
       *
       * <ol>
       *
       * <li>The project object itself.  For example, the <code>rootDir</code> project property.</li>
       *
       * <li>The project's {@link Convention} object.  For example, the <code>srcRootName</code> java plugin
       * property.</li>
       *
       * <li>The project's extra properties.</li>
       *
       * </ol>
       *
       * If the property is not found, a {@link groovy.lang.MissingPropertyException} is thrown.
       *
       * @param name The name of the property
       * @param value The value of the property
       */
      void setProperty(String name, Object value) throws MissingPropertyException;
  
      /**
       * <p>Returns this project. This method is useful in build files to explicitly access project properties and
       * methods. For example, using <code>project.name</code> can express your intent better than using
       * <code>name</code>. This method also allows you to access project properties from a scope where the property may
       * be hidden, such as, for example, from a method or closure. </p>
       *
       * @return This project. Never returns null.
       */
      Project getProject();
  
      /**
       * <p>Returns the set containing this project and its subprojects.</p>
       *
       * @return The set of projects.
       */
      Set<Project> getAllprojects();
  
      /**
       * <p>Returns the set containing the subprojects of this project.</p>
       *
       * @return The set of projects.  Returns an empty set if this project has no subprojects.
       */
      Set<Project> getSubprojects();
  
      /**
       * <p>Creates a {@link Task} with the given name and adds it to this project. Calling this method is equivalent to
       * calling {@link #task(java.util.Map, String)} with an empty options map.</p>
       *
       * <p>After the task is added to the project, it is made available as a property of the project, so that you can
       * reference the task by name in your build file.  See <a href="#properties">here</a> for more details</p>
       *
       * <p>If a task with the given name already exists in this project, an exception is thrown.</p>
       *
       * @param name The name of the task to be created
       * @return The newly created task object
       * @throws InvalidUserDataException If a task with the given name already exists in this project.
       */
      Task task(String name) throws InvalidUserDataException;
  
      /**
       * <p>Creates a {@link Task} with the given name and adds it to this project. A map of creation options can be
       * passed to this method to control how the task is created. The following options are available:</p>
       *
       * <table>
       *
       * <tr><th>Option</th><th>Description</th><th>Default Value</th></tr>
       *
       * <tr><td><code>{@value org.gradle.api.Task#TASK_TYPE}</code></td><td>The class of the task to
       * create.</td><td>{@link org.gradle.api.DefaultTask}</td></tr>
       *
       * <tr><td><code>{@value org.gradle.api.Task#TASK_OVERWRITE}</code></td><td>Replace an existing
       * task?</td><td><code>false</code></td></tr>
       *
       *
       * <tr><td><code>{@value org.gradle.api.Task#TASK_DEPENDS_ON}</code></td><td>A task name or set of task names which
       * this task depends on</td><td><code>[]</code></td></tr>
       *
       * <tr><td><code>{@value org.gradle.api.Task#TASK_ACTION}</code></td><td>A closure or {@link Action} to add to the
       * task.</td><td><code>null</code></td></tr>
       *
       * <tr><td><code>{@value org.gradle.api.Task#TASK_DESCRIPTION}</code></td><td>A description of the task.
       * </td><td><code>null</code></td></tr>
       *
       * <tr><td><code>{@value org.gradle.api.Task#TASK_GROUP}</code></td><td>A task group which this task belongs to.
       * </td><td><code>null</code></td></tr>
       *
       * </table>
       *
       * <p>After the task is added to the project, it is made available as a property of the project, so that you can
       * reference the task by name in your build file.  See <a href="#properties">here</a> for more details</p>
       *
       * <p>If a task with the given name already exists in this project and the <code>override</code> option is not set
       * to true, an exception is thrown.</p>
       *
       * @param args The task creation options.
       * @param name The name of the task to be created
       * @return The newly created task object
       * @throws InvalidUserDataException If a task with the given name already exists in this project.
       */
      Task task(Map<String, ?> args, String name) throws InvalidUserDataException;
  
      /**
       * <p>Creates a {@link Task} with the given name and adds it to this project. Before the task is returned, the given
       * closure is executed to configure the task. A map of creation options can be passed to this method to control how
       * the task is created. See {@link #task(java.util.Map, String)} for the available options.</p>
       *
       * <p>After the task is added to the project, it is made available as a property of the project, so that you can
       * reference the task by name in your build file.  See <a href="#properties">here</a> for more details</p>
       *
       * <p>If a task with the given name already exists in this project and the <code>override</code> option is not set
       * to true, an exception is thrown.</p>
       *
       * @param args The task creation options.
       * @param name The name of the task to be created
       * @param configureClosure The closure to use to configure the created task.
       * @return The newly created task object
       * @throws InvalidUserDataException If a task with the given name already exists in this project.
       */
      Task task(Map<String, ?> args, String name, Closure configureClosure);
  
      /**
       * <p>Creates a {@link Task} with the given name and adds it to this project. Before the task is returned, the given
       * closure is executed to configure the task.</p> <p/> <p>After the task is added to the project, it is made
       * available as a property of the project, so that you can reference the task by name in your build file.  See <a
       * href="#properties">here</a> for more details</p>
       *
       * @param name The name of the task to be created
       * @param configureClosure The closure to use to configure the created task.
       * @return The newly created task object
       * @throws InvalidUserDataException If a task with the given name already exists in this project.
       */
      Task task(String name, Closure configureClosure);
  
      /**
       * <p>Returns the path of this project.  The path is the fully qualified name of the project.</p>
       *
       * @return The path. Never returns null.
       */
      String getPath();
  
      /**
       * <p>Returns the names of the default tasks of this project. These are used when no tasks names are provided when
       * starting the build.</p>
       *
       * @return The default task names. Returns an empty list if this project has no default tasks.
       */
      List<String> getDefaultTasks();
  
      /**
       * <p>Sets the names of the default tasks of this project. These are used when no tasks names are provided when
       * starting the build.</p>
       *
       * @param defaultTasks The default task names.
       */
      void setDefaultTasks(List<String> defaultTasks);
  
      /**
       * <p>Sets the names of the default tasks of this project. These are used when no tasks names are provided when
       * starting the build.</p>
       *
       * @param defaultTasks The default task names.
       */
      void defaultTasks(String... defaultTasks);
  
      /**
       * <p>Declares that this project has an evaluation dependency on the project with the given path.</p>
       *
       * @param path The path of the project which this project depends on.
       * @return The project which this project depends on.
       * @throws UnknownProjectException If no project with the given path exists.
       */
      Project evaluationDependsOn(String path) throws UnknownProjectException;
  
      /**
       * <p>Declares that this project has an evaluation dependency on each of its child projects.</p>
       *
       */
      void evaluationDependsOnChildren();
  
      /**
       * <p>Locates a project by path. If the path is relative, it is interpreted relative to this project.</p>
       *
       * @param path The path.
       * @return The project with the given path. Returns null if no such project exists.
       */
      Project findProject(String path);
  
      /**
       * <p>Locates a project by path. If the path is relative, it is interpreted relative to this project.</p>
       *
       * @param path The path.
       * @return The project with the given path. Never returns null.
       * @throws UnknownProjectException If no project with the given path exists.
       */
  