Esempio n. 1
0
 /// <summary>
 /// This method does two important things:
 /// 1. Normalizes string parameters, trimming whitespace and coalescing empty strings to null.
 /// 2. Wrap <see cref="ITaskItem"/> instances to facility unit testing.
 /// </summary>
 private IPackTaskRequest <IMSBuildItem> GetRequest()
 {
     return(new PackTaskRequest
     {
         AllowedOutputExtensionsInPackageBuildOutputFolder = MSBuildStringUtility.TrimAndExcludeNullOrEmpty(AllowedOutputExtensionsInPackageBuildOutputFolder),
         AllowedOutputExtensionsInSymbolsPackageBuildOutputFolder = MSBuildStringUtility.TrimAndExcludeNullOrEmpty(AllowedOutputExtensionsInSymbolsPackageBuildOutputFolder),
         AssemblyName = MSBuildStringUtility.TrimAndGetNullForEmpty(AssemblyName),
         Authors = MSBuildStringUtility.TrimAndExcludeNullOrEmpty(Authors),
         BuildOutputInPackage = MSBuildUtility.WrapMSBuildItem(BuildOutputInPackage),
         BuildOutputFolder = MSBuildStringUtility.TrimAndGetNullForEmpty(BuildOutputFolder),
         ContinuePackingAfterGeneratingNuspec = ContinuePackingAfterGeneratingNuspec,
         ContentTargetFolders = MSBuildStringUtility.TrimAndExcludeNullOrEmpty(ContentTargetFolders),
         Copyright = MSBuildStringUtility.TrimAndGetNullForEmpty(Copyright),
         Description = MSBuildStringUtility.TrimAndGetNullForEmpty(Description),
         DevelopmentDependency = DevelopmentDependency,
         FrameworkAssemblyReferences = MSBuildUtility.WrapMSBuildItem(FrameworkAssemblyReferences),
         FrameworksWithSuppressedDependencies = MSBuildUtility.WrapMSBuildItem(FrameworksWithSuppressedDependencies),
         IconUrl = MSBuildStringUtility.TrimAndGetNullForEmpty(IconUrl),
         IncludeBuildOutput = IncludeBuildOutput,
         IncludeSource = IncludeSource,
         IncludeSymbols = IncludeSymbols,
         InstallPackageToOutputPath = InstallPackageToOutputPath,
         IsTool = IsTool,
         LicenseUrl = MSBuildStringUtility.TrimAndGetNullForEmpty(LicenseUrl),
         Logger = Logger,
         MinClientVersion = MSBuildStringUtility.TrimAndGetNullForEmpty(MinClientVersion),
         NoDefaultExcludes = NoDefaultExcludes,
         NoPackageAnalysis = NoPackageAnalysis,
         NuspecBasePath = MSBuildStringUtility.TrimAndGetNullForEmpty(NuspecBasePath),
         NuspecFile = MSBuildStringUtility.TrimAndGetNullForEmpty(NuspecFile),
         NuspecOutputPath = MSBuildStringUtility.TrimAndGetNullForEmpty(NuspecOutputPath),
         NuspecProperties = MSBuildStringUtility.TrimAndExcludeNullOrEmpty(NuspecProperties),
         OutputFileNamesWithoutVersion = OutputFileNamesWithoutVersion,
         PackageFiles = MSBuildUtility.WrapMSBuildItem(PackageFiles),
         PackageFilesToExclude = MSBuildUtility.WrapMSBuildItem(PackageFilesToExclude),
         PackageId = MSBuildStringUtility.TrimAndGetNullForEmpty(PackageId),
         PackageOutputPath = MSBuildStringUtility.TrimAndGetNullForEmpty(PackageOutputPath),
         PackageTypes = MSBuildStringUtility.TrimAndExcludeNullOrEmpty(PackageTypes),
         PackageVersion = MSBuildStringUtility.TrimAndGetNullForEmpty(PackageVersion),
         PackItem = MSBuildUtility.WrapMSBuildItem(PackItem),
         ProjectReferencesWithVersions = MSBuildUtility.WrapMSBuildItem(ProjectReferencesWithVersions),
         ProjectUrl = MSBuildStringUtility.TrimAndGetNullForEmpty(ProjectUrl),
         ReleaseNotes = MSBuildStringUtility.TrimAndGetNullForEmpty(ReleaseNotes),
         RepositoryType = MSBuildStringUtility.TrimAndGetNullForEmpty(RepositoryType),
         RepositoryUrl = MSBuildStringUtility.TrimAndGetNullForEmpty(RepositoryUrl),
         RepositoryBranch = MSBuildStringUtility.TrimAndGetNullForEmpty(RepositoryBranch),
         RepositoryCommit = MSBuildStringUtility.TrimAndGetNullForEmpty(RepositoryCommit),
         RequireLicenseAcceptance = RequireLicenseAcceptance,
         RestoreOutputPath = MSBuildStringUtility.TrimAndGetNullForEmpty(RestoreOutputPath),
         Serviceable = Serviceable,
         SourceFiles = MSBuildUtility.WrapMSBuildItem(SourceFiles),
         Tags = MSBuildStringUtility.TrimAndExcludeNullOrEmpty(Tags),
         TargetFrameworks = MSBuildStringUtility.TrimAndExcludeNullOrEmpty(TargetFrameworks),
         TargetPathsToSymbols = MSBuildUtility.WrapMSBuildItem(TargetPathsToSymbols),
         Title = MSBuildStringUtility.TrimAndGetNullForEmpty(Title),
         TreatWarningsAsErrors = MSBuildStringUtility.TrimAndGetNullForEmpty(TreatWarningsAsErrors),
         NoWarn = MSBuildStringUtility.TrimAndGetNullForEmpty(NoWarn),
         WarningsAsErrors = MSBuildStringUtility.TrimAndGetNullForEmpty(WarningsAsErrors)
     });
 }
Esempio n. 2
0
 /// <summary>
 /// This method does two important things:
 /// 1. Normalizes string parameters, trimming whitespace and coalescing empty strings to null.
 /// 2. Wrap <see cref="ITaskItem"/> instances to facility unit testing.
 /// </summary>
 private IPackTaskRequest <IMSBuildItem> GetRequest()
 {
     return(new PackTaskRequest
     {
         AssemblyName = MSBuildStringUtility.TrimAndGetNullForEmpty(AssemblyName),
         AssemblyReferences = MSBuildUtility.WrapMSBuildItem(AssemblyReferences),
         Authors = MSBuildStringUtility.TrimAndExcludeNullOrEmpty(Authors),
         BuildOutputFolder = MSBuildStringUtility.TrimAndGetNullForEmpty(BuildOutputFolder),
         ContinuePackingAfterGeneratingNuspec = ContinuePackingAfterGeneratingNuspec,
         ContentTargetFolders = MSBuildStringUtility.TrimAndExcludeNullOrEmpty(ContentTargetFolders),
         Copyright = MSBuildStringUtility.TrimAndGetNullForEmpty(Copyright),
         Description = MSBuildStringUtility.TrimAndGetNullForEmpty(Description),
         IconUrl = MSBuildStringUtility.TrimAndGetNullForEmpty(IconUrl),
         IncludeBuildOutput = IncludeBuildOutput,
         IncludeSource = IncludeSource,
         IncludeSymbols = IncludeSymbols,
         IsTool = IsTool,
         LicenseUrl = MSBuildStringUtility.TrimAndGetNullForEmpty(LicenseUrl),
         Logger = Logger,
         MinClientVersion = MSBuildStringUtility.TrimAndGetNullForEmpty(MinClientVersion),
         NoPackageAnalysis = NoPackageAnalysis,
         NuspecBasePath = MSBuildStringUtility.TrimAndGetNullForEmpty(NuspecBasePath),
         NuspecFile = MSBuildStringUtility.TrimAndGetNullForEmpty(NuspecFile),
         NuspecOutputPath = MSBuildStringUtility.TrimAndGetNullForEmpty(NuspecOutputPath),
         NuspecProperties = MSBuildStringUtility.TrimAndExcludeNullOrEmpty(NuspecProperties),
         PackageFiles = MSBuildUtility.WrapMSBuildItem(PackageFiles),
         PackageFilesToExclude = MSBuildUtility.WrapMSBuildItem(PackageFilesToExclude),
         PackageId = MSBuildStringUtility.TrimAndGetNullForEmpty(PackageId),
         PackageOutputPath = MSBuildStringUtility.TrimAndGetNullForEmpty(PackageOutputPath),
         PackageTypes = MSBuildStringUtility.TrimAndExcludeNullOrEmpty(PackageTypes),
         PackageVersion = MSBuildStringUtility.TrimAndGetNullForEmpty(PackageVersion),
         PackItem = MSBuildUtility.WrapMSBuildItem(PackItem),
         ProjectUrl = MSBuildStringUtility.TrimAndGetNullForEmpty(ProjectUrl),
         ReleaseNotes = MSBuildStringUtility.TrimAndGetNullForEmpty(ReleaseNotes),
         RepositoryType = MSBuildStringUtility.TrimAndGetNullForEmpty(RepositoryType),
         RepositoryUrl = MSBuildStringUtility.TrimAndGetNullForEmpty(RepositoryUrl),
         RequireLicenseAcceptance = RequireLicenseAcceptance,
         RestoreOutputPath = MSBuildStringUtility.TrimAndGetNullForEmpty(RestoreOutputPath),
         Serviceable = Serviceable,
         SourceFiles = MSBuildUtility.WrapMSBuildItem(SourceFiles),
         Tags = MSBuildStringUtility.TrimAndExcludeNullOrEmpty(Tags),
         TargetFrameworks = MSBuildStringUtility.TrimAndExcludeNullOrEmpty(TargetFrameworks),
         TargetPathsToAssemblies = MSBuildStringUtility.TrimAndExcludeNullOrEmpty(TargetPathsToAssemblies),
         TargetPathsToSymbols = MSBuildStringUtility.TrimAndExcludeNullOrEmpty(TargetPathsToSymbols),
         Title = MSBuildStringUtility.TrimAndGetNullForEmpty(Title),
     });
 }