Example #1
0
        private void ProcessOptions(IProjectBuildSnapshot buildSnapshot)
        {
            Assumes.NotNull(_context);

            buildSnapshot.TargetOutputs.TryGetValue(
                "CompileDesignTime",
                out IImmutableList <KeyValuePair <string, IImmutableDictionary <string, string> > > targetOutputs);

            var options = ImmutableArray.CreateBuilder <string>(targetOutputs.Count);

            foreach ((string option, _) in targetOutputs)
            {
                options.Add(option);
            }

            // We just need to pass all options to Roslyn
            _context.SetOptions(options.MoveToImmutable());
        }
Example #2
0
        public async Task ApplyProjectBuildAsync(IProjectVersionedValue <IProjectSubscriptionUpdate> update,
                                                 IProjectBuildSnapshot buildSnapshot,
                                                 ContextState state,
                                                 CancellationToken cancellationToken)
        {
            Requires.NotNull(update, nameof(update));

            VerifyInitializedAndNotDisposed();

            IProjectChangeDescription projectChange = update.Value.ProjectChanges[ProjectBuildRuleName];

            if (projectChange.Difference.AnyChanges)
            {
                IComparable version = GetConfiguredProjectVersion(update);

                ProcessOptions(buildSnapshot);
                await ProcessCommandLineAsync(version, projectChange.Difference, state, cancellationToken);

                ProcessProjectBuildFailure(projectChange.After);
            }
        }