Exemple #1
0
        public TRunner RegisterAsWebProject(
            string projectName,
            string webApplicationUrl,
            string applicationPoolName)
        {
            VSProjectExtendedInfo projectExtendedInfo = projectExtendedInfos[projectName];

            projectExtendedInfo.IsWebProject        = true;
            projectExtendedInfo.WebApplicationUrl   = new Uri(webApplicationUrl);
            projectExtendedInfo.ApplicationPoolName = applicationPoolName;
            return(ReturnThisTRunner());
        }
        /// <summary>
        /// Adds the specified VisualStudio project to the list of build products.
        /// </summary>
        /// <param name="productPartId">The ID of the product part this project belongs to.</param>
        /// <param name="projectName">Name of the project.</param>
        /// <param name="productDirectoryPath">The path relative to the package directory where this product's files will be copied.
        /// If set to <see cref="string.Empty"/>, the files will be copied directly on the top-level directory.</param>
        /// <param name="includeDebugFiles">Indicates whether the PDB files should be included in the package.</param>
        /// <returns>
        /// This same instance of the <see cref="BuildProductsRegistry{TRunner}"/>.
        /// </returns>
        public BuildProductsRegistry <TRunner> AddProject(
            string productPartId,
            string projectName,
            string productDirectoryPath,
            bool includeDebugFiles)
        {
            VSProjectWithFileInfo projectWithFileInfo = (VSProjectWithFileInfo)runner.Solution.FindProjectByName(projectName);

            if (runner.ProjectExtendedInfos.ContainsKey(projectName))
            {
                VSProjectExtendedInfo extendedInfo = runner.ProjectExtendedInfos[projectName];
                if (extendedInfo.IsWebProject)
                {
                    buildProducts.Add(
                        new WebApplicationBuildProduct <TRunner> (
                            productPartId,
                            projectWithFileInfo.ProjectDirectoryPath,
                            productDirectoryPath));
                    return(this);
                }
            }

            string excludeFilter = null;

            if (false == includeDebugFiles)
            {
                excludeFilter = @".*\.pdb$";
            }

            buildProducts.Add(
                new SimpleBuildProduct <TRunner> (
                    productPartId,
                    Path.Combine(projectWithFileInfo.ProjectDirectoryPath, runner.GetProjectOutputPath(projectName)),
                    productDirectoryPath,
                    null,
                    excludeFilter));

            return(this);
        }