Exemple #1
0
        /// <summary>
        /// Create the build host
        /// </summary>
        /// <param name="hostEnvironment"></param>
        /// <param name="hostFactory"></param>
        public static void CreateHost([NotNull] HostEnvironment hostEnvironment,
                                      Func <HostEnvironment, RootContainerFactory, IosBuildHostInstance> hostFactory = default)
        {
            if (_instance != null)
            {
                throw new InvalidOperationException("The build host has already been initialized.");
            }

            if (hostFactory == default)
            {
                hostFactory = (environment, container) => new IosBuildHostInstance(environment, container);
            }

            _instance = new BuildHost(hostEnvironment, hostFactory);
        }
Exemple #2
0
        /// <summary>
        /// Create a host and initialize the environment.
        /// </summary>
        /// <param name="builder"></param>
        public void Init(HostEnvironment.Builder builder)
        {
            var hostEnvironment = builder.Create();

            // setup any logging rules
            LoggingRules.SetRules(LoggingRulesList.Create(false, hostEnvironment.LoggingRules));

            // create the main build host
            BuildHost.CreateHost(hostEnvironment);

            // now hang on, we need to do the appropriate registration and setup
            Logging.Set(hostEnvironment.Logger);

            // set the default collection comparer for children
            PrimitiveCollectionComparer.SetDefault(hostEnvironment.DefaultCollectionComparer);
        }