Example #1
0
        /// <summary>
        /// Constructs a BuildRequestData for build requests based on project files.
        /// </summary>
        /// <param name="projectFullPath">The full path to the project file.</param>
        /// <param name="globalProperties">The global properties which should be used during evaluation of the project.  Cannot be null.</param>
        /// <param name="toolsVersion">The tools version to use for the build.  May be null.</param>
        /// <param name="targetsToBuild">The targets to build.</param>
        /// <param name="hostServices">The host services to use.  May be null.</param>
        /// <param name="flags">The <see cref="BuildRequestDataFlags"/> to use.</param>
        public BuildRequestData(string projectFullPath, IDictionary <string, string> globalProperties, string toolsVersion, string[] targetsToBuild, HostServices hostServices, BuildRequestDataFlags flags)
            : this(targetsToBuild, hostServices, flags)
        {
            ErrorUtilities.VerifyThrowArgumentLength(projectFullPath, nameof(projectFullPath));
            ErrorUtilities.VerifyThrowArgumentNull(globalProperties, nameof(globalProperties));

            ProjectFullPath            = FileUtilities.NormalizePath(projectFullPath);
            TargetNames                = (ICollection <string>)targetsToBuild.Clone();
            GlobalPropertiesDictionary = new PropertyDictionary <ProjectPropertyInstance>(globalProperties.Count);
            foreach (KeyValuePair <string, string> propertyPair in globalProperties)
            {
                GlobalPropertiesDictionary.Set(ProjectPropertyInstance.Create(propertyPair.Key, propertyPair.Value));
            }

            ExplicitlySpecifiedToolsVersion = toolsVersion;
        }
Example #2
0
 /// <summary>
 /// Constructs a BuildRequestData for build requests based on project files.
 /// </summary>
 /// <param name="projectFullPath">The full path to the project file.</param>
 /// <param name="globalProperties">The global properties which should be used during evaluation of the project.  Cannot be null.</param>
 /// <param name="toolsVersion">The tools version to use for the build.  May be null.</param>
 /// <param name="targetsToBuild">The targets to build.</param>
 /// <param name="hostServices">The host services to use.  May be null.</param>
 public BuildRequestData(string projectFullPath, IDictionary <string, string> globalProperties, string toolsVersion, string[] targetsToBuild, HostServices hostServices)
     : this(projectFullPath, globalProperties, toolsVersion, targetsToBuild, hostServices, BuildRequestDataFlags.None)
 {
 }
Example #3
0
        /// <summary>
        /// Constructs a BuildRequestData for build requests based on project instances.
        /// </summary>
        /// <param name="projectInstance">The instance to build.</param>
        /// <param name="targetsToBuild">The targets to build.</param>
        /// <param name="hostServices">The host services to use, if any.  May be null.</param>
        /// <param name="flags">Flags controlling this build request.</param>
        /// <param name="propertiesToTransfer">The list of properties whose values should be transferred from the project to any out-of-proc node.</param>
        public BuildRequestData(ProjectInstance projectInstance, string[] targetsToBuild, HostServices hostServices, BuildRequestDataFlags flags, IEnumerable <string> propertiesToTransfer)
            : this(targetsToBuild, hostServices, flags)
        {
            ErrorUtilities.VerifyThrowArgumentNull(projectInstance, nameof(projectInstance));

            foreach (string targetName in targetsToBuild)
            {
                ErrorUtilities.VerifyThrowArgumentNull(targetName, "target");
            }

            ProjectInstance = projectInstance;

            ProjectFullPath                 = projectInstance.FullPath;
            GlobalPropertiesDictionary      = projectInstance.GlobalPropertiesDictionary;
            ExplicitlySpecifiedToolsVersion = projectInstance.ExplicitToolsVersion;
            if (propertiesToTransfer != null)
            {
                PropertiesToTransfer = new List <string>(propertiesToTransfer);
            }
        }
Example #4
0
        /// <summary>
        /// Constructs a BuildRequestData for build requests based on project instances.
        /// </summary>
        /// <param name="projectInstance">The instance to build.</param>
        /// <param name="targetsToBuild">The targets to build.</param>
        /// <param name="hostServices">The host services to use, if any.  May be null.</param>
        /// <param name="flags">Flags controlling this build request.</param>
        /// <param name="propertiesToTransfer">The list of properties whose values should be transferred from the project to any out-of-proc node.</param>
        /// <param name="requestedProjectState">A <see cref="Execution.RequestedProjectState"/> describing properties, items, and metadata that should be returned. Requires setting <see cref="BuildRequestDataFlags.ProvideSubsetOfStateAfterBuild"/>.</param>
        public BuildRequestData(ProjectInstance projectInstance, string[] targetsToBuild, HostServices hostServices, BuildRequestDataFlags flags, IEnumerable <string> propertiesToTransfer, RequestedProjectState requestedProjectState)
            : this(projectInstance, targetsToBuild, hostServices, flags, propertiesToTransfer)
        {
            ErrorUtilities.VerifyThrowArgumentNull(requestedProjectState, nameof(requestedProjectState));

            RequestedProjectState = requestedProjectState;
        }
Example #5
0
 /// <summary>
 /// Constructs a BuildRequestData for build requests based on project instances.
 /// </summary>
 /// <param name="projectInstance">The instance to build.</param>
 /// <param name="targetsToBuild">The targets to build.</param>
 /// <param name="hostServices">The host services to use, if any.  May be null.</param>
 /// <param name="flags">Flags controlling this build request.</param>
 public BuildRequestData(ProjectInstance projectInstance, string[] targetsToBuild, HostServices hostServices, BuildRequestDataFlags flags)
     : this(projectInstance, targetsToBuild, hostServices, flags, null)
 {
 }