src/com/esotericsoftware/scar/Build.java
static public Project project (String path, Project defaults) throws IOException {
		if (path == null) throw new IllegalArgumentException("path cannot be null.");
		if (defaults == null) throw new IllegalArgumentException("defaults cannot be null.");

		Project actualProject = new Project(path);

		Project project = new Project();
		project.replace(defaults);

		File parent = new File(actualProject.getDirectory()).getParentFile();
		while (parent != null) {
			File includeFile = new File(parent, "include.yaml");
			if (includeFile.exists()) {
				try {
					project.replace(project(includeFile.getAbsolutePath(), defaults));
				} catch (RuntimeException ex) {
					throw new RuntimeException("Error loading included project: " + includeFile.getAbsolutePath(), ex);
				}
			}
			parent = parent.getParentFile();
		}

		for (String include : actualProject.getList("include")) {
			try {
				project.replace(project(actualProject.path(include), defaults));
			} catch (RuntimeException ex) {
				throw new RuntimeException("Error loading included project: " + actualProject.path(include), ex);
			}
		}
		project.replace(actualProject);
		return project;
	}
/** Loads the specified project with the specified defaults and loads any other projects needed for the "include" property.
	 * @param path Path to a YAML project file, or a directory containing a "project.yaml" file. */
Loads the specified project with the specified defaults and loads any other projects needed for the "include" property.
@param path Path to a YAML project file, or a directory containing a "project.yaml" file.
Loads the specified project with the specified defaults and loads any other projects needed for the " include " property . @param path Path to a YAML project file or a directory containing a " project . yaml " file .
static public Project project (String path, Project defaults) throws IOException {
		if (path == null) throw new IllegalArgumentException("path cannot be null.");
		if (defaults == null) throw new IllegalArgumentException("defaults cannot be null.");
		Project actualProject = new Project(path);
		Project project = new Project();
		project.replace(defaults);
		File parent = new File(actualProject.getDirectory()).getParentFile();
		while (parent != null) {
			File includeFile = new File(parent, "include.yaml");
			if (includeFile.exists()) {
				try {
					project.replace(project(includeFile.getAbsolutePath(), defaults));
				} catch (RuntimeException ex) {
					throw new RuntimeException("Error loading included project: " + includeFile.getAbsolutePath(), ex);
				}
			}
			parent = parent.getParentFile();
		}
		for (String include : actualProject.getList("include")) {
			try {
				project.replace(project(actualProject.path(include), defaults));
			} catch (RuntimeException ex) {
				throw new RuntimeException("Error loading included project: " + actualProject.path(include), ex);
			}
		}
		project.replace(actualProject);
		return project;
	}
static public Project project ( String path , Project defaults ) throws IOException { if ( path == null ) throw new IllegalArgumentException ( "path cannot be null." ) ; if ( defaults == null ) throw new IllegalArgumentException ( "defaults cannot be null." ) ; Project actualProject = new Project ( path ) ; Project project = new Project ( ) ; project . replace ( defaults ) ; File parent = new File ( actualProject . getDirectory ( ) ) . getParentFile ( ) ; while ( parent != null ) { File includeFile = new File ( parent , "include.yaml" ) ; if ( includeFile . exists ( ) ) { try { project . replace ( project ( includeFile . getAbsolutePath ( ) , defaults ) ) ; } catch ( RuntimeException ex ) { throw new RuntimeException ( "Error loading included project: " + includeFile . getAbsolutePath ( ) , ex ) ; } } parent = parent . getParentFile ( ) ; } for ( String include : actualProject . getList ( "include" ) ) { try { project . replace ( project ( actualProject . path ( include ) , defaults ) ) ; } catch ( RuntimeException ex ) { throw new RuntimeException ( "Error loading included project: " + actualProject . path ( include ) , ex ) ; } } project . replace ( actualProject ) ; return project ; }
Loads the specified project with the specified defaults and loads any other projects needed for the "include" property.
Loads the specified project with the specified defaults and loads any other projects needed for the " include " property .