Exemplo n.º 1
0
		/// <summary>
		/// 
		/// </summary>
		/// <param name="options"></param>
		public static void Build ( BuildOptions options )
		{
			Log.Message("");
			Log.Message("-------- Build started : {0} --------", options.InputDirectory );

			options.CheckOptionsAndMakeDirs();

			Log.Message("Reading '.content'...");
			//
			//	Parse INI file :
			//
			var ip = new StreamIniDataParser();
			ip.Parser.Configuration.AllowDuplicateSections	=	true;
			ip.Parser.Configuration.AllowDuplicateKeys		=	true;
			ip.Parser.Configuration.CommentString			=	"#";
			ip.Parser.Configuration.OverrideDuplicateKeys	=	true;
			ip.Parser.Configuration.KeyValueAssigmentChar	=	'=';
			ip.Parser.Configuration.AllowKeysWithoutValues	=	true;

			var iniData = ip.ReadData( new StreamReader( options.ContentIniFile ) );


			//
			//	Setup builder :
			//	
			var bindings = AssetProcessorBinding.GatherAssetProcessors();

			Log.Message("Asset processors:");
			foreach ( var bind in bindings ) {
				Log.Message("  {0,-20} - {1}", bind.Name, bind.Type.Name );
			}
			Log.Message("");

			var builder = new Builder( bindings );

			var result  = builder.Build( options, iniData );

			Log.Message("-------- {5} total, {0} succeeded, {1} failed, {2} up-to-date, {3} ignored, {4} skipped --------", 
				result.Succeded,
				result.Failed,
				result.UpToDate,
				result.Ignored,
				result.Skipped,
				result.Total );

			Log.Message("");

			if (result.Failed>0) {
				throw new BuildException("Build errors");
			}
		}