// Path: brjs-core/src/main/java/org/bladerunnerjs/api/LinkedAsset.java
// public interface LinkedAsset extends Asset {
// 	/**
// 	 * Returns a list of files this LinkedAssetFile depends on
// 	 * @param bundlableNode TODO
// 	 * @throws ModelOperationException for any exception when calculating dependencies and resolving require paths
// 	 * @return The list of assets
// 	 */
// 	List<Asset> getDependentAssets(BundlableNode bundlableNode) throws ModelOperationException;
// 	
// 	/**
// 	 * BRJS calculates dependencies implicitly for additional {@link Asset}s found by plugins, for example, a JavaScript file
// 	 * from a blade will implicitly depend on a CSS file in the same blade once this has been located. The method will add these implicit 
// 	 * dependencies to the current LinkedAsset. 
// 	 * 
// 	 * @param implicitDependencies the previously retrieved implicitDependencies to be added
// 	 */
// 	void addImplicitDependencies(List<Asset> implicitDependencies);
// }


import java.util.ArrayList;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
import org.bladerunnerjs.api.Asset;
import org.bladerunnerjs.api.BRJS;
import org.bladerunnerjs.api.BundlableNode;
import org.bladerunnerjs.api.BundleSet;
import org.bladerunnerjs.api.JsLib;
import org.bladerunnerjs.api.LinkedAsset;
import org.bladerunnerjs.api.SourceModule;
import org.bladerunnerjs.api.Workbench;
import org.bladerunnerjs.api.logging.Logger;
import org.bladerunnerjs.api.memoization.MemoizedFile;
import org.bladerunnerjs.api.model.exception.ModelOperationException;
import org.bladerunnerjs.api.model.exception.OutOfBundleScopeRequirePathException;
import org.bladerunnerjs.api.model.exception.OutOfScopeRequirePathException;
import org.bladerunnerjs.api.model.exception.RequirePathException;
import org.bladerunnerjs.model.AssetContainer;
import org.bladerunnerjs.model.BundleSetCreator;
import org.bladerunnerjs.model.BundleSetCreator.Messages;
import org.bladerunnerjs.model.StandardBundleSet;
import com.google.common.base.Joiner;
package org.bladerunnerjs.utility;




public class BundleSetBuilder {

	public static final String BOOTSTRAP_LIB_NAME = "br-bootstrap";
	public static final String STRICT_CHECKING_DISABLED_MSG = "Strict checking has been disabled for the directory '%s' and for the Asset '%s'."+
			" This allows the Blade class to directly depend on another Blade class when the App loaded. This dependency should be broken using Services and the file '%s' should be removed to re-enable the scope enforcement.";
	public static final String INVALID_REQUIRE_MSG = "The class '%s' depends on the class '%s' which is outside of it's scope - this dependency should be broken using Services.";

	// use Maps rather than Lists and Sets so we're in control of what's used as the key rather than relying on #equals being implemented properly
// Path: brjs-core/src/main/java/org/bladerunnerjs/api/LinkedAsset.java
// public interface LinkedAsset extends Asset {
// 	/**
// 	 * Returns a list of files this LinkedAssetFile depends on
// 	 * @param bundlableNode TODO
// 	 * @throws ModelOperationException for any exception when calculating dependencies and resolving require paths
// 	 * @return The list of assets
// 	 */
// 	List<Asset> getDependentAssets(BundlableNode bundlableNode) throws ModelOperationException;
// 	
// 	/**
// 	 * BRJS calculates dependencies implicitly for additional {@link Asset}s found by plugins, for example, a JavaScript file
// 	 * from a blade will implicitly depend on a CSS file in the same blade once this has been located. The method will add these implicit 
// 	 * dependencies to the current LinkedAsset. 
// 	 * 
// 	 * @param implicitDependencies the previously retrieved implicitDependencies to be added
// 	 */
// 	void addImplicitDependencies(List<Asset> implicitDependencies);
// }


// Path: brjs-core/src/main/java/org/bladerunnerjs/utility/BundleSetBuilder.java
import java.util.ArrayList;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
import org.bladerunnerjs.api.Asset;
import org.bladerunnerjs.api.BRJS;
import org.bladerunnerjs.api.BundlableNode;
import org.bladerunnerjs.api.BundleSet;
import org.bladerunnerjs.api.JsLib;
import org.bladerunnerjs.api.LinkedAsset;
import org.bladerunnerjs.api.SourceModule;
import org.bladerunnerjs.api.Workbench;
import org.bladerunnerjs.api.logging.Logger;
import org.bladerunnerjs.api.memoization.MemoizedFile;
import org.bladerunnerjs.api.model.exception.ModelOperationException;
import org.bladerunnerjs.api.model.exception.OutOfBundleScopeRequirePathException;
import org.bladerunnerjs.api.model.exception.OutOfScopeRequirePathException;
import org.bladerunnerjs.api.model.exception.RequirePathException;
import org.bladerunnerjs.model.AssetContainer;
import org.bladerunnerjs.model.BundleSetCreator;
import org.bladerunnerjs.model.BundleSetCreator.Messages;
import org.bladerunnerjs.model.StandardBundleSet;
import com.google.common.base.Joiner;

package org.bladerunnerjs.utility;




public class BundleSetBuilder {

	public static final String BOOTSTRAP_LIB_NAME = "br-bootstrap";
	public static final String STRICT_CHECKING_DISABLED_MSG = "Strict checking has been disabled for the directory '%s' and for the Asset '%s'."+
			" This allows the Blade class to directly depend on another Blade class when the App loaded. This dependency should be broken using Services and the file '%s' should be removed to re-enable the scope enforcement.";
	public static final String INVALID_REQUIRE_MSG = "The class '%s' depends on the class '%s' which is outside of it's scope - this dependency should be broken using Services.";

	// use Maps rather than Lists and Sets so we're in control of what's used as the key rather than relying on #equals being implemented properly
	private final AssetMap<LinkedAsset> seedAssets = new AssetMap<>();