diff --git a/.editorconfig b/.editorconfig index a7ab1957..039c4069 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,26 +1,53 @@ -; EditorConfig to support per-solution formatting. -; Use the EditorConfig VS add-in to make this work. -; http://editorconfig.org/ +# EditorConfig is awesome:http://EditorConfig.org -; This is the default for the codeline. +# top-most EditorConfig file root = true +# Don't use tabs for indentation. [*] -end_of_line = CRLF +indent_style = space +# (Please don't specify an indent_size here; that has too many unintended consequences.) -[*.{cs,fs}] -indent_style = tab +# Code files +[*.{cs,csx,vb,vbx}] +indent_size = 4 -[*.{sln,proj,props,targets,xaml,config,nuspec,vsixmanifest,vsct,vstemplate}] -indent_style = tab +# Xml project files +[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj,msbuildproj}] +indent_size = 2 -[*.{csproj,ps1,resx,rst,fsproj,wxs,wxi}] -indent_style = space +# Xml config files +[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}] indent_size = 2 -[*.{tt}] -indent_style = space -indent_size = 4 +# YAML files +[*.{yaml,yml}] +indent_size = 2 + +# JSON files +[*.json] +indent_size = 2 + +# Dotnet code style settings: +[*.{cs,vb}] +# Sort using and Import directives with System.* appearing first +dotnet_sort_system_directives_first = true +# Avoid "this." and "Me." if not necessary +dotnet_style_qualification_for_field = false:suggestion +dotnet_style_qualification_for_property = false:suggestion +dotnet_style_qualification_for_method = false:suggestion +dotnet_style_qualification_for_event = false:suggestion + +# Use language keywords instead of framework type names for type references +dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion +dotnet_style_predefined_type_for_member_access = true:suggestion + +# Suggest more modern language features when available +dotnet_style_object_initializer = true:suggestion +dotnet_style_collection_initializer = true:suggestion +dotnet_style_coalesce_expression = true:suggestion +dotnet_style_null_propagation = true:suggestion +dotnet_style_explicit_tuple_names = true:suggestion # CSharp code style settings: [*.cs] @@ -34,17 +61,17 @@ csharp_style_expression_bodied_methods = false:none csharp_style_expression_bodied_constructors = false:none csharp_style_expression_bodied_operators = false:none -# Prefer property-like constructs to have a block body -csharp_style_expression_bodied_properties = false:none -csharp_style_expression_bodied_indexers = false:none -csharp_style_expression_bodied_accessors = false:none +# Prefer property-like constructs to have an expression-body +csharp_style_expression_bodied_properties = true:none +csharp_style_expression_bodied_indexers = true:none +csharp_style_expression_bodied_accessors = true:none -# Don't suggest more modern language features when available -csharp_style_pattern_matching_over_is_with_cast_check = false:suggestion -csharp_style_pattern_matching_over_as_with_null_check = false:suggestion -csharp_style_inlined_variable_declaration = false:suggestion -csharp_style_throw_expression = false:suggestion -csharp_style_conditional_delegate_call = false:suggestion +# Suggest more modern language features when available +csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion +csharp_style_pattern_matching_over_as_with_null_check = true:suggestion +csharp_style_inlined_variable_declaration = true:suggestion +csharp_style_throw_expression = true:suggestion +csharp_style_conditional_delegate_call = true:suggestion # Newline settings csharp_new_line_before_open_brace = all @@ -53,33 +80,3 @@ csharp_new_line_before_catch = true csharp_new_line_before_finally = true csharp_new_line_before_members_in_object_initializers = true csharp_new_line_before_members_in_anonymous_types = true - -# Indentation preferences -csharp_indent_block_contents = true -csharp_indent_braces = false -csharp_indent_case_contents = true -csharp_indent_switch_labels = true -csharp_indent_labels = flush_left - -# Space preferences -csharp_space_after_cast = false -csharp_space_after_colon_in_inheritance_clause = true -csharp_space_after_comma = true -csharp_space_after_dot = false -csharp_space_after_keywords_in_control_flow_statements = true -csharp_space_after_semicolon_in_for_statement = true -csharp_space_around_binary_operators = before_and_after -csharp_space_around_declaration_statements = do_not_ignore -csharp_space_before_colon_in_inheritance_clause = true -csharp_space_before_comma = false -csharp_space_before_dot = false -csharp_space_before_open_square_brackets = false -csharp_space_before_semicolon_in_for_statement = false -csharp_space_between_empty_square_brackets = false -csharp_space_between_method_call_empty_parameter_list_parentheses = false -csharp_space_between_method_call_name_and_opening_parenthesis = false -csharp_space_between_method_call_parameter_list_parentheses = false -csharp_space_between_method_declaration_empty_parameter_list_parentheses = false -csharp_space_between_method_declaration_name_and_open_parenthesis = false -csharp_space_between_method_declaration_parameter_list_parentheses = false -csharp_space_between_square_brackets = false \ No newline at end of file diff --git a/.gitattributes b/.gitattributes index 624569f6..1ff0c423 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,30 +1,63 @@ -# This file is understood by git 1.7.2 and higher. Everyone should -# be on this version by now. +############################################################################### +# Set default behavior to automatically normalize line endings. +############################################################################### +* text=auto -# sln, csproj files (and friends) are always CRLF, even on linux -*.sln text eol=crlf -*.proj text eol=crlf +############################################################################### +# Set default behavior for command prompt diff. +# +# This is need for earlier builds of msysgit that does not have it on by +# default for csharp files. +# Note: This is only used by command line +############################################################################### +#*.cs diff=csharp -# These are windows specific files which we may as well ensure are -# always crlf on checkout -*.bat text eol=crlf -*.cmd text eol=crlf +############################################################################### +# Set the merge driver for project and solution files +# +# Merging from the command prompt will add diff markers to the files if there +# are conflicts (Merging from VS is not affected by the settings below, in VS +# the diff markers are never inserted). Diff markers may cause the following +# file extensions to fail to load in VS. An alternative would be to treat +# these files as binary and thus will always conflict and require user +# intervention with every merge. To do so, just uncomment the entries below +############################################################################### +#*.sln merge=binary +#*.csproj merge=binary +#*.vbproj merge=binary +#*.vcxproj merge=binary +#*.vcproj merge=binary +#*.dbproj merge=binary +#*.fsproj merge=binary +#*.lsproj merge=binary +#*.wixproj merge=binary +#*.modelproj merge=binary +#*.sqlproj merge=binary +#*.wwaproj merge=binary -# Opt in known filetypes to always normalize line endings on checkin -# and always use native endings on checkout -*.c text -*.config text -*.h text -*.cs text -*.csproj text -*.md text -*.tt text -*.txt text -*.vspackage text -*.vspackage.diagram text - -# Some must always be checked out as lf so enforce that for those files -# If these are not lf then bash/cygwin on windows will not be able to -# excute the files -*.sh text eol=lf +############################################################################### +# behavior for image files +# +# image files are treated as binary by default. +############################################################################### +#*.jpg binary +#*.png binary +#*.gif binary +############################################################################### +# diff behavior for common document formats +# +# Convert binary document formats to text before diffing them. This feature +# is only available from the command line. Turn it on by uncommenting the +# entries below. +############################################################################### +#*.doc diff=astextplain +#*.DOC diff=astextplain +#*.docx diff=astextplain +#*.DOCX diff=astextplain +#*.dot diff=astextplain +#*.DOT diff=astextplain +#*.pdf diff=astextplain +#*.PDF diff=astextplain +#*.rtf diff=astextplain +#*.RTF diff=astextplain diff --git a/.gitignore b/.gitignore index e4178aca..2ed6a02a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,29 +1,16 @@ +.nuget +.vs +.idea +out bin obj -out -temp -.vs - -*.suo -*.sdf -*.userprefs -*.user *.nupkg -*.vsix -*.sln.ide -*.metaproj -*.tmp -*.cache - -NuGet.exe -packages -project.lock.json -.nuget +*.lock.json *.nuget.props *.nuget.targets - -log.txt -test.proj +*.suo +*.user +*.cache *.log -*.g *.binlog +*.rsp \ No newline at end of file diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 07efdbb3..00000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "external/ApiIntersect"] - path = external/ApiIntersect - url = https://github.com/xamarin/ApiInteresect.git diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index f6bf28b6..00000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,56 +0,0 @@ -# Setup - -Just open the available `.sln` files under `src` and build :) (see Building in Visual Studio below). - -Build, test and run code coverage: - -Windows: - - build.cmd - -Mac: - - make - -> Mac support comming as soon as MSBuild ships by default with XS/Mono on Mac - - -# Building in Visual Studio - -There are two parts to the project: -1. The build targets and tasks -2. The NuGet package project system - -## Targets and tasks - -Install [Visual Studio 2015](https://www.visualstudio.com/) (preferrable also Update 3 or later). - -These can be built by just opening the [NuGet.Packaging.Build.sln](src\Build\NuGet.Packaging.Build.sln) solution. - -Alternatively, you can also build with the default configuration and platform from the command line with `msbuild` -from a developer command prompt. - -## NuGet Project System - -The project system is built on top of the new [Visual Studio Project System](https://github.com/Microsoft/VSProjectSystem/) -also known as "CPS" (Common Project System). - -There were API changes between CPS for Visual Studio 2015 and the upcoming `Visual Studio 15` (code name), so -at the moment, we require installing a [Preview 4](https://www.visualstudio.com/en-us/news/releasenotes/vs15-relnotes) -or later version. - -> NOTE: The project system is in flux at the moment, as many artifacts will move to the authoring package -> under the `src\Build` directory. - -# Contributing - -1. [Open an issue here](https://github.com/NuGet/Home/issues) and get some feedback from the NuGet team. -1. Create a branch. Base it on the `dev` branch. -1. Add unit tests (to the test project in the relevant solution). -1. Make sure all tests pass (via `Test -> Run -> All Tests`, or by running `build.cmd` on Windows). -1. Create a [pull request](https://github.com/NuGet/NuGet.Build.Packaging/pulls). -1. _One-time_: Sign the contributor license agreement, if you haven't signed it before. - The [.NET Foundation Bot](https://github.com/dnfclas) will comment on the pull request you just - created and guide you on how to sign the CLA. -1. Consider submitting a doc pull request to the [nugetdocs](https://github.com/NuGet/NuGetDocs/tree/master/NuGet.Docs) - repo, if this is a new feature or behavior change. \ No newline at end of file diff --git a/GitInfo.txt b/GitInfo.txt deleted file mode 100644 index 28af839c..00000000 --- a/GitInfo.txt +++ /dev/null @@ -1 +0,0 @@ -0.2.5 \ No newline at end of file diff --git a/LICENSE.txt b/LICENSE similarity index 100% rename from LICENSE.txt rename to LICENSE diff --git a/NuGetizer.sln b/NuGetizer.sln new file mode 100644 index 00000000..444e219b --- /dev/null +++ b/NuGetizer.sln @@ -0,0 +1,41 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30509.190 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{CDF1828A-0877-4238-A218-5E4FE219F6CC}" + ProjectSection(SolutionItems) = preProject + src\Directory.Build.props = src\Directory.Build.props + src\Directory.Build.targets = src\Directory.Build.targets + src\NuGet.Config = src\NuGet.Config + EndProjectSection +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NuGet.Build.Packaging.Tasks", "src\Build\NuGet.Build.Packaging.Tasks\NuGet.Build.Packaging.Tasks.csproj", "{57F59BF6-9272-4B66-98A1-334B3FDA5721}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NuGet.Build.Packaging.Tests", "src\Build\NuGet.Build.Packaging.Tests\NuGet.Build.Packaging.Tests.csproj", "{50032C88-1B52-4DB1-BFC5-6BADE2CC58CC}" + ProjectSection(ProjectDependencies) = postProject + {57F59BF6-9272-4B66-98A1-334B3FDA5721} = {57F59BF6-9272-4B66-98A1-334B3FDA5721} + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {57F59BF6-9272-4B66-98A1-334B3FDA5721}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {57F59BF6-9272-4B66-98A1-334B3FDA5721}.Debug|Any CPU.Build.0 = Debug|Any CPU + {57F59BF6-9272-4B66-98A1-334B3FDA5721}.Release|Any CPU.ActiveCfg = Release|Any CPU + {57F59BF6-9272-4B66-98A1-334B3FDA5721}.Release|Any CPU.Build.0 = Release|Any CPU + {50032C88-1B52-4DB1-BFC5-6BADE2CC58CC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {50032C88-1B52-4DB1-BFC5-6BADE2CC58CC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {50032C88-1B52-4DB1-BFC5-6BADE2CC58CC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {50032C88-1B52-4DB1-BFC5-6BADE2CC58CC}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {2260BB27-4F44-4309-9D78-E459B90C1A3B} + EndGlobalSection +EndGlobal diff --git a/README.md b/README.md index ea944ef9..7bcf3c9a 100644 --- a/README.md +++ b/README.md @@ -1,30 +1,12 @@ ![Nugetizer-3000 Logo](https://raw.githubusercontent.com/NuGet/NuGet.Build.Packaging/master/Nugetizer-3000.png) -# NuGetizer3000 +# NuGetizer 3000 -NuGetizer 3000 is here, and will be beyond awesome! +For the original design and intended goals and features, check out the [spec](https://github.com/NuGet/Home/wiki/NuGetizer-3000). -Check out the [spec](https://github.com/NuGet/Home/wiki/NuGetizer-3000) for more details. +## Why -[![Build status](https://ci.appveyor.com/api/projects/status/7wfadgtkhcwt0wrm?svg=true)](https://ci.appveyor.com/project/MobileEssentials/nuget-build-packaging) +I got sick of trying to modify the gazillion properties, weird item, property and target names and more from the built-in SDK Pack targets, and still never quite achieving the simple goals I had in mind. Also, the original clean and clear design from [NuGet.Build.Packaging](https://github.com/NuGet/NuGet.Build.Packaging) never got traction or support from the NuGet team, so the weirdness kept evolving in ever more incomprehensible ways ¯\_(ツ)_/¯. -## Installing - -Add the following NuGet feed to Visual Studio: - - https://ci.appveyor.com/nuget/nugetizer3000 - -Install the following package: - - Install-Package NuGet.Build.Packaging - -Add [NuGet properties to your MSBuild project](https://github.com/NuGet/Home/wiki/Adding-nuget-pack-as-a-msbuild-target) and invoke the `/t:Pack` target to generated a `.nupkg` for the project. - -## Issues - -Please report issues on the [NuGet/Home](https://github.com/NuGet/Home/issues?q=is%3Aopen+is%3Aissue+label%3AArea%3ANuGetizer) repo, and tag with `Area:NuGetizer`. - -### IDE Integration Early Preview - -Install the following VSIX from the evergreen CI URL [NuGetizer 3000 for VS2017](http://bit.ly/nugetizer-2017). Alternatively, you can download the specific build artifact for specifc builds from our [AppVeyor CI](https://ci.appveyor.com/project/MobileEssentials/nuget-build-packaging) +So, on to forking and shipping for real the simplified, understandable way of packing your libraries. diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index ae254c78..00000000 --- a/appveyor.yml +++ /dev/null @@ -1,34 +0,0 @@ -os: Visual Studio 2017 - -init: -- ps: >- - reg ADD "HKLM\Software\Microsoft\StrongName\Verification\*,*" /f - - if ($env:PROCESSOR_ARCHITECTURE -eq "AMD64") - - { - reg ADD "HKLM\Software\Wow6432Node\Microsoft\StrongName\Verification\*,*" /f - } - -build_script: - - cmd: echo /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" >> msbuild.rsp - - cmd: build.cmd /restore - - cmd: build.cmd /release - -install: -- cmd: git submodule update --init --recursive - -# we run the tests ourselves in build.proj for coverage -test: off - -nuget: - project_feed: true - disable_publish_on_pr: false - -artifacts: - - path: 'out\*.nupkg' - name: Package - - path: 'out\*.vsix' - name: Extension - - path: 'msbuild.log' - name: Log diff --git a/build.cmd b/build.cmd deleted file mode 100644 index e37071a7..00000000 --- a/build.cmd +++ /dev/null @@ -1,114 +0,0 @@ -@echo off -setlocal enabledelayedexpansion - -set BatchFile=%0 -set Root=%~dp0 -set BuildConfiguration=Debug -set MSBuildTarget=All -set NodeReuse=true -set MultiProcessor=/m -set MSBuildAdditionalArguments=/m - -:ParseArguments -if "%1" == "" goto :DoneParsing -if /I "%1" == "/?" call :Usage && exit /b 1 -if /I "%1" == "/debug" set BuildConfiguration=Debug&&shift&& goto :ParseArguments -if /I "%1" == "/release" set BuildConfiguration=Release&&shift&& goto :ParseArguments -if /I "%1" == "/build" set MSBuildTarget=Build&&shift&& goto :ParseArguments -if /I "%1" == "/rebuild" set MSBuildTarget=Rebuild&&shift&& goto :ParseArguments -if /I "%1" == "/package" set MSBuildTarget=Package&&shift&& goto :ParseArguments -if /I "%1" == "/test" set MSBuildTarget=Test&&shift&& goto :ParseArguments -if /I "%1" == "/restore" set MSBuildTarget=Restore&&shift&& goto :ParseArguments -if /I "%1" == "/no-node-reuse" set NodeReuse=false&&shift&& goto :ParseArguments -if /I "%1" == "/no-multi-proc" set MultiProcessor=&&shift&& goto :ParseArguments -set MSBuildAdditionalArguments=%MSBuildAdditionalArguments% %1&&shift&& goto :ParseArguments -:DoneParsing - -:: Detect if MSBuild is in the path -for /f "delims=" %%i in ('where msbuild') do set "MSBuildPath=%%i" & goto :MSBuildPathDone -:MSBuildPathDone - -if not exist "%MSBuildPath%" ( - call :PrintColor Red "To build this repository, MSBuild.exe must be in the PATH." - echo MSBuild is included with Visual Studio 2017 or later. - echo. - echo If Visual Studio is not installed, visit this page to download: - echo. - echo https://www.visualstudio.com/vs/ - echo. - exit /b 1 -) - -:: Detect MSBuild version >= 15 -for /f "delims=" %%i in ('msbuild -nologo -version') do set MSBuildFullVersion=%%i -for /f "delims=. tokens=1" %%a in ("%MSBuildFullVersion%") do ( - set MSBuildMajorVersion=%%a -) - -if %MSBuildMajorVersion% LSS 15 ( - call :PrintColor Red "To build this repository, the MSBuild.exe in the PATH needs to be 15.0 or higher." - echo MSBuild 15.0 is included with Visual Studio 2017 or later. - echo. - echo If Visual Studio is not installed, visit this page to download: - echo. - echo https://www.visualstudio.com/vs/ - echo. - echo Located MSBuild in the PATH was "%MSBuildPath%". - exit /b 1 -) - -:: Ensure developer command prompt variables are set -if "%VisualStudioVersion%" == "" ( - for /f "delims=" %%i in ('msbuild build.props /nologo /v:m /t:GetVsInstallRoot') do set "VsInstallRoot=%%i" & goto :VsInstallRootDone -:VsInstallRootDone - for /f "tokens=* delims= " %%i in ("%VsInstallRoot%") do set "VsInstallRoot=%%i" - set "DeveloperCommandPrompt=%VsInstallRoot%\Common7\Tools\VsDevCmd.bat" - if not exist "%DeveloperCommandPrompt%" ( - call :PrintColor Red "Failed to locate 'Common7\Tools\VsDevCmd.bat' under the reported Visual Studio installation root '%VsInstallRoot%'." - echo. - echo If Visual Studio is not installed, visit this page to download: - echo. - echo https://www.visualstudio.com/vs/ - echo. - exit /b 1 - ) - call "%DeveloperCommandPrompt%" || goto :BuildFailed -) - -@echo on -msbuild /nologo /nodeReuse:%NodeReuse% /t:"%MSBuildTarget%" /p:target="%MSBuildTarget%" /p:Configuration="%BuildConfiguration%" %MSBuildAdditionalArguments% -@echo off -if ERRORLEVEL 1 ( - echo. - call :PrintColor Red "Build failed, for full log see msbuild.log." - exit /b 1 -) - -echo. -call :PrintColor Green "Build completed successfully, for full log see msbuild.log" -exit /b 0 - -:Usage -echo Usage: %BatchFile% [/build^|/rebuild^|/test^|/restore^] [/debug^|/release] [/no-node-reuse] [/no-multi-proc] -echo. -echo Build targets: -echo /build Perform build -echo /rebuild Perform a clean, then build -echo /package Packages the product -echo /test Builds and runs tests only -echo /restore Only restore NuGet packages -echo. -echo Build options: -echo /debug Perform debug build (default) -echo /release Perform release build -echo /no-node-reuse Prevents MSBuild from reusing existing MSBuild instances, -echo useful for avoiding unexpected behavior on build machines -echo /no-multi-proc No multi-proc build, useful for diagnosing build logs -goto :eof - -:BuildFailed -call :PrintColor Red "Build failed with ERRORLEVEL %ERRORLEVEL%" -exit /b 1 - -:PrintColor -"%Windir%\System32\WindowsPowerShell\v1.0\Powershell.exe" -noprofile write-host -foregroundcolor %1 "'%2'" \ No newline at end of file diff --git a/build.proj b/build.proj deleted file mode 100644 index f3df9cd9..00000000 --- a/build.proj +++ /dev/null @@ -1,149 +0,0 @@ - - - - - - - - Debug - - - Release - - - - https://dist.nuget.org/win-x86-commandline/latest/nuget.exe - false - false - .nuget\ - $(IntermediateOutputPath)packages - WarningLevel=0;NoWarn=1591;Out=$(Out);Configuration=$(Configuration);RunCodeAnalysis=$(RunCodeAnalysis);PackageOutputPath=$(Out) - high - %WINDIR%\System32\WindowsPowerShell\v1.0\powershell.exe - high - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "$(XunitConsolePath)" - $(XunitOptions) -html $(Out)\test.html -xml $(Out)\test.xml -parallel none -noshadow - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $(XunitOptions) -html $(Out)\test.html -xml $(Out)\test.xml -parallel none -noshadow - - $(PackagesPath)\OpenCover\tools\OpenCover.Console.exe - $(CoverageOptions) -output:$(Out)\coverage.xml -returntargetcode -register:user -filter:"+[NuGet.Build.Packaging*]* -[NuGet.Packaging.Core*]* -[NuGet.Packaging.VisualStudio*]* -[Clide*]* -[xunit*]* -[*Tests]* -[*]*ThisAssembly*" -excludebyattribute:*ExcludeFromCodeCoverage*;*CompilerGenerated* -skipautoprops -showunvisited -mergebyhash - $(CoverageConsole) $(CoverageOptions) -target:$(XunitConsole) -targetargs:"@(TestAssembly, ' ') $(XunitOptions)" - - $(PackagesPath)\ReportGenerator\tools\ReportGenerator.exe - -reports:$(Out)\coverage.xml -targetdir:$(Out)\coverage -reporttypes:Html;Xml;Badges - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/build.props b/build.props deleted file mode 100644 index 3f5ff8c9..00000000 --- a/build.props +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - true - true - true - true - true - - true - - - - - - - - - $(MSBuildThisFileDirectory)out - - - \ No newline at end of file diff --git a/corebuild/corebuild.props b/corebuild/corebuild.props deleted file mode 100644 index 1a26ab11..00000000 --- a/corebuild/corebuild.props +++ /dev/null @@ -1,16 +0,0 @@ - - - - - netcore50 - - PackageReference - - $(MSBuildThisFileDirectory).nuget - 9f31d2c2a2dcddd79bfc28ddb5217663b761a17c - true - - - - - \ No newline at end of file diff --git a/corebuild/corebuild.targets b/corebuild/corebuild.targets deleted file mode 100644 index 35823f1e..00000000 --- a/corebuild/corebuild.targets +++ /dev/null @@ -1,34 +0,0 @@ - - - - - $(VsInstallRoot)\Common7\IDE\CommonExtensions\Microsoft\NuGet\NuGet.targets - - - - - - - - - - - - - - - - All - - - All - - - - - cdac7d6eaa07b64767e32bcb207a7dbdce1caf07 - - - - - \ No newline at end of file diff --git a/corebuild/update.targets b/corebuild/update.targets deleted file mode 100644 index c3a2d2fa..00000000 --- a/corebuild/update.targets +++ /dev/null @@ -1,18 +0,0 @@ - - - - https://raw.githubusercontent.com/kzu/corebuild/master/src/corebuild - - - <_Updatable Include="$(MSBuildThisFileDirectory)corebuild.props" /> - <_Updatable Include="$(MSBuildThisFileDirectory)corebuild.targets" /> - - - - - - - - diff --git a/external/ApiIntersect b/external/ApiIntersect deleted file mode 160000 index a7c652ca..00000000 --- a/external/ApiIntersect +++ /dev/null @@ -1 +0,0 @@ -Subproject commit a7c652ca3f399bbace7fd7f1e13b71da4b614d53 diff --git a/packages.config b/packages.config deleted file mode 100644 index dcf8e590..00000000 --- a/packages.config +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/src/Build/NuGet.Build.Packaging.Tasks.Shared.targets b/src/Build/NuGet.Build.Packaging.Tasks.Shared.targets deleted file mode 100644 index ac1cc5d5..00000000 --- a/src/Build/NuGet.Build.Packaging.Tasks.Shared.targets +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - Microsoft - Microsoft - © Microsoft Corporation. All rights reserved. - en - https://raw.githubusercontent.com/NuGet/NuGet.Build.Packaging/dev/LICENSE.txt - https://github.com/NuGet/NuGet.Build.Packaging - - - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - true - - \ No newline at end of file diff --git a/src/Build/NuGet.Build.Packaging.Tasks/ApiIntersect.cs b/src/Build/NuGet.Build.Packaging.Tasks/ApiIntersect.cs deleted file mode 100644 index 61402d04..00000000 --- a/src/Build/NuGet.Build.Packaging.Tasks/ApiIntersect.cs +++ /dev/null @@ -1,164 +0,0 @@ -using System; -using System.IO; -using Microsoft.Build.Framework; -using Microsoft.Build.Utilities; -using NuGet.Common; -using NuGet.Frameworks; - -namespace NuGet.Build.Packaging.Tasks -{ - public class ApiIntersect : ToolTask - { - [Required] - public ITaskItem Framework { get; set; } - - [Required] - public ITaskItem[] IntersectionAssembly { get; set; } - - public ITaskItem[] ReferencePath { get; set; } - - public ITaskItem[] ExcludeType { get; set; } - - public ITaskItem[] RemoveAbstractTypeMembers { get; set; } - - public ITaskItem[] ExcludeAssembly { get; set; } - - public string KeepInternalConstructors { get; set; } - - public string KeepMarshalling { get; set; } - - public string IgnoreUnresolvedAssemblies { get; set; } - - [Required] - public ITaskItem RootOutputDirectory { get; set; } - - [Output] - public ITaskItem OutputDirectory { get; set; } - - protected override string ToolName - { - get { return "ApiIntersect"; } - } - - protected override string GenerateFullPathToTool() - { - return Path.Combine(ToolPath, ToolExe); - } - - protected override MessageImportance StandardErrorLoggingImportance - { - get { return MessageImportance.High; } - } - - protected override string GenerateCommandLineCommands() - { - var builder = new CommandLineBuilder(); - - var nugetFramework = NuGetFramework.Parse(Framework.ItemSpec); - - builder.AppendSwitch("-o"); - CreateOutputDirectoryItem(nugetFramework); - builder.AppendFileNameIfNotNull(OutputDirectory.ItemSpec); - - string frameworkPath = GetFrameworkPath(nugetFramework); - builder.AppendSwitch("-f"); - builder.AppendFileNameIfNotNull(frameworkPath); - - foreach (var assembly in IntersectionAssembly.NullAsEmpty()) - { - builder.AppendSwitch("-i"); - builder.AppendFileNameIfNotNull(assembly.ItemSpec); - } - - foreach (var referencePath in ReferencePath.NullAsEmpty()) - { - builder.AppendSwitch("-r"); - builder.AppendFileNameIfNotNull(referencePath.ItemSpec); - } - - foreach (var excludeType in ExcludeType.NullAsEmpty()) - { - builder.AppendSwitch("-b"); - builder.AppendTextUnquoted(" \""); - builder.AppendTextUnquoted(excludeType.ItemSpec); - builder.AppendTextUnquoted("\""); - } - - foreach (var removeAbstractType in RemoveAbstractTypeMembers.NullAsEmpty()) - { - builder.AppendSwitch("-a"); - builder.AppendTextUnquoted(" \""); - builder.AppendTextUnquoted(removeAbstractType.ItemSpec); - builder.AppendTextUnquoted("\""); - } - - foreach (var assembly in ExcludeAssembly.NullAsEmpty()) - { - builder.AppendSwitch("-e"); - builder.AppendFileNameIfNotNull(assembly.ItemSpec); - } - - AppendSwitchIfTrue(builder, "-k", KeepInternalConstructors); - - AppendSwitchIfTrue(builder, "-m", KeepMarshalling); - - AppendSwitchIfTrue(builder, "-iua", IgnoreUnresolvedAssemblies); - - return builder.ToString(); - } - - void CreateOutputDirectoryItem(NuGetFramework framework) - { - string fullOutputPath = GetApiIntersectTargetPaths.GetOutputDirectory(RootOutputDirectory.ItemSpec, framework); - OutputDirectory = new TaskItem(fullOutputPath + Path.DirectorySeparatorChar); - OutputDirectory.SetMetadata("TargetFrameworkVersion", "v" + framework.Version.ToString(2)); - OutputDirectory.SetMetadata("TargetFrameworkProfile", framework.Profile); - OutputDirectory.SetMetadata(MetadataName.TargetFrameworkMoniker, Framework.ItemSpec); - } - - string GetFrameworkPath(NuGetFramework framework) - { - if (framework.IsPCL) - { - return GetPortableLibraryPath(framework); - } - - throw new NotImplementedException("Only PCL profiles supported."); - } - - string GetPortableLibraryPath(NuGetFramework framework) - { - return Path.Combine( - GetPortableRootDirectory(), - "v" + framework.Version.ToString(2), - "Profile", - framework.Profile); - } - - static string GetPortableRootDirectory() - { - if (RuntimeEnvironmentHelper.IsMono) - { - string macPath = "/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/xbuild-frameworks/.NETPortable/"; - if (Directory.Exists(macPath)) - return macPath; - - return Path.Combine(Path.GetDirectoryName(typeof(Object).Assembly.Location), "../xbuild-frameworks/.NETPortable/"); - } - - return Path.Combine( - Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86, Environment.SpecialFolderOption.DoNotVerify), - @"Reference Assemblies\Microsoft\Framework\.NETPortable"); - } - - static void AppendSwitchIfTrue(CommandLineBuilder builder, string switchName, string value) - { - if (string.IsNullOrEmpty(value)) - return; - - bool result; - if (bool.TryParse(value, out result)) - builder.AppendSwitch(switchName); - } - } -} \ No newline at end of file diff --git a/src/Build/NuGet.Build.Packaging.Tasks/AssignPackagePath.cs b/src/Build/NuGet.Build.Packaging.Tasks/AssignPackagePath.cs index 376df0ea..217139df 100644 --- a/src/Build/NuGet.Build.Packaging.Tasks/AssignPackagePath.cs +++ b/src/Build/NuGet.Build.Packaging.Tasks/AssignPackagePath.cs @@ -4,20 +4,19 @@ using System.Linq; using Microsoft.Build.Framework; using Microsoft.Build.Utilities; -using static NuGet.Build.Packaging.Properties.Strings; -using static NuGet.Client.ManagedCodeConventions; +using static ThisAssembly.Strings; using NuGet.Packaging; namespace NuGet.Build.Packaging.Tasks { - /// - /// Ensures all files have the PackagePath metadata. - /// If the PackagePath was not explicitly specified, - /// determine one from the project relative path and - /// the TargetFramework and Kind metadata, and set it - /// on the projected item. - /// - public class AssignPackagePath : Task + /// + /// Ensures all files have the PackagePath metadata. + /// If the PackagePath was not explicitly specified, + /// determine one from the project relative path and + /// the TargetFramework and Kind metadata, and set it + /// on the projected item. + /// + public class AssignPackagePath : Task { public string IsPackaging { get; set; } diff --git a/src/Build/NuGet.Build.Packaging.Tasks/CreatePackage.cs b/src/Build/NuGet.Build.Packaging.Tasks/CreatePackage.cs index bfa5f080..a501e44b 100644 --- a/src/Build/NuGet.Build.Packaging.Tasks/CreatePackage.cs +++ b/src/Build/NuGet.Build.Packaging.Tasks/CreatePackage.cs @@ -3,18 +3,17 @@ using System.IO; using Microsoft.Build.Framework; using Microsoft.Build.Utilities; -using System.Runtime.Versioning; using NuGet.Versioning; using NuGet.Frameworks; using NuGet.Packaging.Core; using NuGet.Packaging; using System.Collections.Generic; -using static NuGet.Build.Packaging.Properties.Strings; +using static ThisAssembly.Strings; using System.Security.Cryptography; namespace NuGet.Build.Packaging.Tasks { - public class CreatePackage : Task + public class CreatePackage : Task { [Required] public ITaskItem Manifest { get; set; } diff --git a/src/Build/NuGet.Build.Packaging.Tasks/GenerateAssemblyInfo.cs b/src/Build/NuGet.Build.Packaging.Tasks/GenerateAssemblyInfo.cs deleted file mode 100644 index c4dad1d0..00000000 --- a/src/Build/NuGet.Build.Packaging.Tasks/GenerateAssemblyInfo.cs +++ /dev/null @@ -1,72 +0,0 @@ -using System; -using System.IO; -using System.Reflection; -using System.Linq; -using Microsoft.Build.Framework; -using Microsoft.Build.Utilities; - -namespace NuGet.Build.Packaging.Tasks -{ - public class GenerateAssemblyInfo : Task - { - [Required] - public ITaskItem[] Assemblies { get; set; } - - [Required] - public ITaskItem[] OutputDirectories { get; set; } - - [Output] - public string AssemblyName { get; set; } - - public override bool Execute() - { - AssemblyName name = GetAssemblyName(); - CreateAssemblyInfo(name); - - AssemblyName = name.Name; - - return true; - } - - AssemblyName GetAssemblyName() - { - AssemblyName[] assemblyNames = Assemblies.NullAsEmpty() - .Select(assembly => System.Reflection.AssemblyName.GetAssemblyName(assembly.ItemSpec)) - .ToArray(); - - string[] allNames = assemblyNames.Select(name => name.Name).ToArray(); - if (allNames.Distinct().Count() > 1) - { - Log.LogWarningCode("NG1003", - BuildEngine.ProjectFileOfTaskNode, - "Assembly names should be the same for a bait and switch NuGet package. Names: '{0}' Assemblies: {1}", - string.Join(", ", allNames), - string.Join(", ", Assemblies.Select(assembly => assembly.ItemSpec))); - } - - Version[] allVersions = assemblyNames.Select(name => name.Version).ToArray(); - if (allVersions.Distinct().Count() > 1) - { - Log.LogWarningCode("NG1004", - BuildEngine.ProjectFileOfTaskNode, - "Assembly versions should be the same for a bait and switch NuGet package. Versions: '{0}' Assemblies: {1}", - string.Join(", ", allVersions.Select(version => version.ToString())), - string.Join(", ", Assemblies.Select(assembly => assembly.ItemSpec))); - } - - return assemblyNames.FirstOrDefault(); - } - - void CreateAssemblyInfo(AssemblyName assemblyName) - { - string text = "using System.Reflection;" + Environment.NewLine + - string.Format("[assembly: AssemblyVersion (\"{0}\")]", assemblyName.Version); - - foreach (ITaskItem directory in OutputDirectories.NullAsEmpty()) - { - string fileName = Path.Combine(directory.ItemSpec, "AssemblyInfo.cs"); - File.WriteAllText(fileName, text); - } - } - } -} \ No newline at end of file diff --git a/src/Build/NuGet.Build.Packaging.Tasks/GenerateReferenceAssembly.csproj b/src/Build/NuGet.Build.Packaging.Tasks/GenerateReferenceAssembly.csproj deleted file mode 100644 index a0c250f9..00000000 --- a/src/Build/NuGet.Build.Packaging.Tasks/GenerateReferenceAssembly.csproj +++ /dev/null @@ -1,39 +0,0 @@ - - - - Debug - AnyCPU - {9886C7D1-0610-4292-9E13-94EC012D0900} - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - true - Library - - - true - full - false - bin\Debug - DEBUG; - prompt - 4 - - - true - bin\Release - prompt - 4 - - - - - _CollectCompileFiles; - $(PrepareResourcesDependsOn) - - - - - - - - - \ No newline at end of file diff --git a/src/Build/NuGet.Build.Packaging.Tasks/GetApiIntersectTargetPaths.cs b/src/Build/NuGet.Build.Packaging.Tasks/GetApiIntersectTargetPaths.cs deleted file mode 100644 index 00c9109c..00000000 --- a/src/Build/NuGet.Build.Packaging.Tasks/GetApiIntersectTargetPaths.cs +++ /dev/null @@ -1,82 +0,0 @@ -using System; -using System.IO; -using System.Linq; -using System.Reflection; -using Microsoft.Build.Framework; -using Microsoft.Build.Utilities; -using NuGet.Frameworks; - -namespace NuGet.Build.Packaging.Tasks -{ - public class GetApiIntersectTargetPaths : Task - { - [Required] - public ITaskItem[] Frameworks { get; set; } - - [Required] - public ITaskItem[] Assemblies { get; set; } - - [Required] - public ITaskItem RootOutputDirectory { get; set; } - - [Output] - public ITaskItem[] TargetPaths { get; set; } - - public override bool Execute() - { - string assemblyFileName = GetAssemblyFileName(); - - TargetPaths = Frameworks.NullAsEmpty() - .Select(framework => GetTargetPath(framework, assemblyFileName)) - .ToArray(); - - return true; - } - - string GetAssemblyFileName() - { - string[] fileNames = Assemblies.NullAsEmpty() - .Select(assembly => Path.GetFileName(assembly.ItemSpec)) - .ToArray(); - - if (fileNames.Distinct().Count() > 1) - { - Log.LogWarningCode("NG1003", - BuildEngine.ProjectFileOfTaskNode, - "Assembly names should be the same for a bait and switch NuGet package. Names: '{0}' Assemblies: {1}", - string.Join(", ", fileNames), - string.Join(", ", Assemblies.Select(assembly => assembly.ItemSpec))); - } - - return fileNames.FirstOrDefault(); - } - - private ITaskItem GetTargetPath(ITaskItem framework, string assemblyFileName) - { - var nugetFramework = NuGetFramework.Parse(framework.ItemSpec); - string outputDirectory = GetOutputDirectory(RootOutputDirectory.ItemSpec, nugetFramework); - - string outputPath = Path.Combine(outputDirectory, "bin", assemblyFileName); - - var item = new TaskItem(outputPath); - item.SetMetadata(MetadataName.TargetFrameworkMoniker, framework.ItemSpec); - - return item; - } - - internal static string GetOutputDirectory(string rootDirectory, NuGetFramework framework) - { - return Path.Combine(rootDirectory, GetOutputDirectoryName(framework)); - } - - static string GetOutputDirectoryName(NuGetFramework framework) - { - if (framework.IsPCL && framework.HasProfile) - { - return framework.Profile; - } - - return framework.GetShortFolderName(); - } - } -} diff --git a/src/Build/NuGet.Build.Packaging.Tasks/NuGet.Build.Packaging.Authoring.props b/src/Build/NuGet.Build.Packaging.Tasks/NuGet.Build.Packaging.Authoring.props index d6bbc285..b776f603 100644 --- a/src/Build/NuGet.Build.Packaging.Tasks/NuGet.Build.Packaging.Authoring.props +++ b/src/Build/NuGet.Build.Packaging.Tasks/NuGet.Build.Packaging.Authoring.props @@ -13,7 +13,7 @@ Copyright (c) .NET Foundation. All rights reserved. PackageReference netstandard1.0 - net11;net20;net35;net40;net403;net45;net451;net452;net46;net461;net462;net47;net471;netcore;netcore45;netcore451;netcore50;win8;win81;win10;sl4;sl5;wp;wp7;wp75;wp8;wp81;wpa81;uap;uap10;netstandard1.0;netstandard1.1;netstandard1.2;netstandard1.3;netstandard1.4;netstandard1.5;netstandard1.6;netstandard2.0;netcoreapp1.0;netcoreapp2.0;monoandroid;monotouch;monomac;xamarinios;xamarinmac;xamarinpsthree;xamarinpsfour;xamarinpsvita;xamarinwatchos;xamarintvos;xamarinxboxthreesixty;xamarinxboxone + net11;net20;net35;net40;net403;net45;net451;net452;net46;net461;net462;net47;net471;net472;net48;netcore;netcore45;netcore451;netcore50;net5.0;win8;win81;win10;sl4;sl5;wp;wp7;wp75;wp8;wp81;wpa81;uap;uap10;netstandard1.0;netstandard1.1;netstandard1.2;netstandard1.3;netstandard1.4;netstandard1.5;netstandard1.6;netstandard2.0;netstandard2.1;netcoreapp1.0;netcoreapp2.0;netcoreapp2.1;netcoreapp2.2;netcoreapp3.0;netcoreapp3.1;monoandroid;monotouch;monomac;xamarinios;xamarinmac;xamarinpsthree;xamarinpsfour;xamarinpsvita;xamarinwatchos;xamarintvos;xamarinxboxthreesixty;xamarinxboxone .nupkg diff --git a/src/Build/NuGet.Build.Packaging.Tasks/NuGet.Build.Packaging.Authoring.targets b/src/Build/NuGet.Build.Packaging.Tasks/NuGet.Build.Packaging.Authoring.targets index 6af93b86..23319003 100644 --- a/src/Build/NuGet.Build.Packaging.Tasks/NuGet.Build.Packaging.Authoring.targets +++ b/src/Build/NuGet.Build.Packaging.Tasks/NuGet.Build.Packaging.Authoring.targets @@ -33,7 +33,6 @@ Copyright (c) .NET Foundation. All rights reserved. - diff --git a/src/Build/NuGet.Build.Packaging.Tasks/NuGet.Build.Packaging.Inference.targets b/src/Build/NuGet.Build.Packaging.Tasks/NuGet.Build.Packaging.Inference.targets index cf0843e9..24ef3b91 100644 --- a/src/Build/NuGet.Build.Packaging.Tasks/NuGet.Build.Packaging.Inference.targets +++ b/src/Build/NuGet.Build.Packaging.Tasks/NuGet.Build.Packaging.Inference.targets @@ -10,13 +10,8 @@ Copyright (c) .NET Foundation. All rights reserved. *********************************************************************************************** --> - - - - true - Lib @@ -254,19 +249,4 @@ Copyright (c) .NET Foundation. All rights reserved. - - - <_ProjectJson>$(MSBuildProjectDirectory)\project.json - <_PackagesConfig>$(MSBuildProjectDirectory)\packages.config - - - - - - - - - - - diff --git a/src/Build/NuGet.Build.Packaging.Tasks/NuGet.Build.Packaging.Legacy.props b/src/Build/NuGet.Build.Packaging.Tasks/NuGet.Build.Packaging.Legacy.props deleted file mode 100644 index c83f7e5b..00000000 --- a/src/Build/NuGet.Build.Packaging.Tasks/NuGet.Build.Packaging.Legacy.props +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - $(PrimaryOutputPackageFileKind) - - - $(IncludeOutputsInPackage) - - - \ No newline at end of file diff --git a/src/Build/NuGet.Build.Packaging.Tasks/NuGet.Build.Packaging.Legacy.targets b/src/Build/NuGet.Build.Packaging.Tasks/NuGet.Build.Packaging.Legacy.targets deleted file mode 100644 index 4824a38d..00000000 --- a/src/Build/NuGet.Build.Packaging.Tasks/NuGet.Build.Packaging.Legacy.targets +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - %(Content.IncludeInPackage) - - - %(None.IncludeInPackage) - - - - - - - - - %(ProjectReference.IncludeInPackage) - - - - - \ No newline at end of file diff --git a/src/Build/NuGet.Build.Packaging.Tasks/NuGet.Build.Packaging.MultiTargeting.targets b/src/Build/NuGet.Build.Packaging.Tasks/NuGet.Build.Packaging.MultiTargeting.targets index d5b5a802..ada493bb 100644 --- a/src/Build/NuGet.Build.Packaging.Tasks/NuGet.Build.Packaging.MultiTargeting.targets +++ b/src/Build/NuGet.Build.Packaging.Tasks/NuGet.Build.Packaging.MultiTargeting.targets @@ -11,10 +11,10 @@ Copyright (c) .NET Foundation. All rights reserved. --> - - + + - - - - - true - - - + + + true + + + - - - GetTargetPathWithTargetPlatformMoniker - - + + + GetTargetPathWithTargetPlatformMoniker + + - - - - <_PackageContent Include="@(InnerOutput)" /> - - + + + <_PackageContent Include="@(InnerOutput)" /> + + - - - GetPackageContents - - + + + GetPackageContents + + diff --git a/src/Build/NuGet.Build.Packaging.Tasks/NuGet.Build.Packaging.ReferenceAssembly.targets b/src/Build/NuGet.Build.Packaging.Tasks/NuGet.Build.Packaging.ReferenceAssembly.targets deleted file mode 100644 index 545f3902..00000000 --- a/src/Build/NuGet.Build.Packaging.Tasks/NuGet.Build.Packaging.ReferenceAssembly.targets +++ /dev/null @@ -1,118 +0,0 @@ - - - - - - - - - - - - - $(CleanDependsOn);_CleanReferenceAssemblyIntermediateOutputs - - - - - <_ReferenceAssemblyProjects Include="@(_MSBuildProjectReferenceExistent)" Condition="'%(_MSBuildProjectReferenceExistent.Pack)' != 'false'" /> - - - - - - - - - - - - - Lib - Implicit - %(_ReferenceAssemblyTargetPath.TargetFrameworkMoniker) - - - - - - - - true - true - - - - <_IntersectionReferencePath Include="@(IntersectionAssembly->'%(RootDir)%(Directory)')" Condition="'$(EnableDefaultIntersectionAssemblyReferencePath)' == 'true'" /> - <_IntersectionReferencePath Include="$(IntersectionAssemblyReferencePath)" /> - - - - - - - - - - - - - - - - <_ReferenceAssemblyIntermediateOutputDirectories>$([System.IO.Directory]::GetDirectories('$(IntermediateOutputPath)')) - - - - <_ReferenceAssemblyIntermediateOutputDirectory Include="$(_ReferenceAssemblyIntermediateOutputDirectories)" /> - - - - - - \ No newline at end of file diff --git a/src/Build/NuGet.Build.Packaging.Tasks/NuGet.Build.Packaging.Tasks.csproj b/src/Build/NuGet.Build.Packaging.Tasks/NuGet.Build.Packaging.Tasks.csproj index ecffd19f..1683bb5f 100644 --- a/src/Build/NuGet.Build.Packaging.Tasks/NuGet.Build.Packaging.Tasks.csproj +++ b/src/Build/NuGet.Build.Packaging.Tasks/NuGet.Build.Packaging.Tasks.csproj @@ -1,58 +1,35 @@ - - + + - {A3D231D7-31E4-4A70-8CD1-7246C7D069F6} - net46 + netstandard2.0 + NuGetizer NO-SDK-PACK - + false + true + true + NuGet.Build.Packaging + + - - - - - - - - + + + + + + + - - - PreserveNewest - - - - PreserveNewest - + - buildMultiTargeting\NuGet.Build.Packaging%(Extension) + buildMultiTargeting\NuGetizer%(Extension) + - - PublicResXFileCodeGenerator - Resources.Designer.cs - - - - - true - PrimaryOutputKind=build - {cd767d93-6c99-4d6a-a303-3c139a73400e} - ApiIntersect - - - - - GlobalAssemblyInfo.cs - - - - - True - True - Resources.resx - + - + + + \ No newline at end of file diff --git a/src/Build/NuGet.Build.Packaging.Tasks/NuGet.Build.Packaging.Tasks.targets b/src/Build/NuGet.Build.Packaging.Tasks/NuGet.Build.Packaging.Tasks.targets index 22e2a16a..0a57f9de 100644 --- a/src/Build/NuGet.Build.Packaging.Tasks/NuGet.Build.Packaging.Tasks.targets +++ b/src/Build/NuGet.Build.Packaging.Tasks/NuGet.Build.Packaging.Tasks.targets @@ -1,7 +1,7 @@ - + - + @@ -14,19 +14,18 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - NuGet.Build.Packaging - NuGetizer-3000 - NuGetizer-3000 + NuGetizer + NuGetizer + Simple and flexible NuGet packaging true build - true true - ..\..\..\out + ..\..\bin - + @@ -53,7 +52,6 @@ PackageItemKind; $(CoreCompileDependsOn); - $(IntermediateOutputPath)PackageItemKind.g$(DefaultLanguageSourceExtension) diff --git a/src/Build/NuGet.Build.Packaging.Tasks/NuGet.Build.Packaging.props b/src/Build/NuGet.Build.Packaging.Tasks/NuGet.Build.Packaging.props index 5e6cb8a4..0c230589 100644 --- a/src/Build/NuGet.Build.Packaging.Tasks/NuGet.Build.Packaging.props +++ b/src/Build/NuGet.Build.Packaging.Tasks/NuGet.Build.Packaging.props @@ -11,54 +11,49 @@ Copyright (c) .NET Foundation. All rights reserved. --> - - true - - - NO-SDK-PACK - false - - true - - - - $(MSBuildThisFileDirectory) - ApiIntersect.exe - - - - - - - - - - None - + NO-SDK-PACK + false + + true + + + + + + + + + + None + - Explicit - - - - - - - - - - - - - - false - - - - - - - + + + + + + + + + + + false + + + + + + + - contentFiles - true - - - - - lib - true - - - build - - - tools - - - native - - - runtimes - - - ref - - - analyzers - - - source - - - - + - - - - - true - + + + + + true + - - + + - - - true - - + + + true + + - - - + + + - - - true - true - + + + true + true + - - + + diff --git a/src/Build/NuGet.Build.Packaging.Tasks/NuGet.Build.Packaging.targets b/src/Build/NuGet.Build.Packaging.Tasks/NuGet.Build.Packaging.targets index b4d44d03..c93608fc 100644 --- a/src/Build/NuGet.Build.Packaging.Tasks/NuGet.Build.Packaging.targets +++ b/src/Build/NuGet.Build.Packaging.Tasks/NuGet.Build.Packaging.targets @@ -10,54 +10,53 @@ Copyright (c) .NET Foundation. All rights reserved. *********************************************************************************************** --> - - - - - - - - - - - true - - false - - - true - false - - true - - - $(OutputPath) - - - $(MSBuildProjectDirectory)\.packonbuild - - - false - - $(OutputPath)\$(PackageId).nuspec - - - - - - - - - - - - - $(IsPackable) - true - - - - + + + + + true + + false + + + true + false + + true + + + $(OutputPath) + + + $(MSBuildProjectDirectory)\.packonbuild + + + false + + $(OutputPath)\$(PackageId).nuspec + + + + + + + + + + + + + $(IsPackable) + true + + + + - - - $(GetPackageVersionDependsOn); - _SetDefaultPackageVersion - - - - - - $(Version) - - - - - - - $(GetPackageTargetPathDependsOn); - GetPackageVersion; - _SetDefaultPackageTargetPath; - - - - - - - - $(PackageId) - $(PackageVersion) - true - - $(Authors) - $(Owners) - $(Title) - $(Description) - $(Summary) - $(NeutralLanguage) - $(Copyright) - - $(PackageRequireLicenseAcceptance) - $(PackageLicenseUrl) - $(PackageProjectUrl) - $(PackageIconUrl) - $(PackageTags) - - $(PackageReleaseNotes) - $(RepositoryUrl) - $(RepositoryType) - $(PackageType) - - - - - - $([System.IO.Path]::Combine('$(PackageOutputPath)', '$(PackageId).$(PackageVersion).nupkg')) - - - - + + $(PackageId) + $(PackageVersion) + true + + $(Authors) + $(Owners) + $(Title) + $(Description) + $(Summary) + $(NeutralLanguage) + $(Copyright) + + $(PackageRequireLicenseAcceptance) + $(PackageLicenseUrl) + $(PackageProjectUrl) + $(PackageIconUrl) + $(PackageTags) + + $(PackageReleaseNotes) + $(RepositoryUrl) + $(RepositoryType) + $(PackageType) + + + + + + $([System.IO.Path]::Combine('$(PackageOutputPath)', '$(PackageId).$(PackageVersion).nupkg')) + + + + - - GetPackageTargetPath;$(PackageOutputGroupDependsOn) - - + + GetPackageTargetPath;$(PackageOutputGroupDependsOn) + + - - - - $(GetPackageContentsDependsOn); - GetPackageTargetPath; - _AddPackageManifest - - - $(GetPackageContentsDependsOn); - _GetReferencedPackageContents - - - - - - - - $(PackageId) - $(Platform) - $(TargetFrameworkMoniker) - - - - - - - - - - - - - - Metadata - $(PackageId) - $(Platform) - $(TargetFrameworkMoniker) - - - - - + + + + + + + + + Metadata + $(PackageId) + $(Platform) + $(TargetFrameworkMoniker) + + + + + - + Text="Some project references cannot be properly packaged. Please install the NuGetizer package on the following projects: @(_NonNuGetizedProjectReference)." /> - - - - - + + - - <_ReferencedPackageDependency Include="@(_ReferencedPackageContent)" + + <_ReferencedPackageDependency Include="@(_ReferencedPackageContent)" Condition="'%(_ReferencedPackageContent.PackageId)' != '$(PackageId)' and '%(_ReferencedPackageContent.Kind)' == 'Metadata'"> - - $(PackageId) - $(TargetFrameworkMoniker) - Dependency - - - <_PackageContentFromDependency Include="@(_ReferencedPackageContent)" + + $(PackageId) + $(TargetFrameworkMoniker) + Dependency + + + <_PackageContentFromDependency Include="@(_ReferencedPackageContent)" Condition="'%(_ReferencedPackageContent.PackageId)' != '' and '%(_ReferencedPackageContent.PackageId)' != '$(PackageId)'" /> - <_ReferencedPackageContent Remove="@(_PackageContentFromDependency)" /> - + <_ReferencedPackageContent Remove="@(_PackageContentFromDependency)" /> + - - + - - - - - - <_ReferencedPackageContentWithOriginalValues Condition="'%(_ReferencedPackageContentWithOriginalValues.PackageId)' == ''"> - $(PackageId) - - - - + <_ReferencedPackageContentWithOriginalValues Condition="'%(_ReferencedPackageContentWithOriginalValues.PackageId)' == ''"> + $(PackageId) + + + + - $(TargetFrameworkMoniker) - - - - - - <_ReferencedPackageContentWithOriginalValues Condition="'%(_ReferencedPackageContentWithOriginalValues.PackageId)' == ''"> - $(PackageId) - - - - %(_ReferencedPackageContentWithOriginalValues.OriginalTargetFrameworkMoniker) - - - - - + + + <_ReferencedPackageContentWithOriginalValues Condition="'%(_ReferencedPackageContentWithOriginalValues.PackageId)' == ''"> + $(PackageId) + + + + %(_ReferencedPackageContentWithOriginalValues.OriginalTargetFrameworkMoniker) + + + + + - - $(BuildingPackage) - - - - - - + $(BuildingPackage) + + + + + + - - - - - - <_IsNuGetized Condition="'%(_ReferencedProjectTargetPath.IsNuGetized)' != ''">true - - - - - <_NonNuGetizedProjectReference Include="@(_MSBuildProjectReferenceExistent)" Condition="'%(_MSBuildProjectReferenceExistent.Pack)' != 'false' and '$(_IsNuGetized)' != 'true'" /> - - <_NuGetizedProjectReference Include="@(_MSBuildProjectReferenceExistent)" Condition="'%(_MSBuildProjectReferenceExistent.Pack)' != 'false' and '$(_IsNuGetized)' == 'true'" /> - - - - - - - <_ShouldPackOnBuild Condition="('$(PackOnBuild)' == 'true' Or Exists('$(PackOnBuildFile)')) And '$(IsPackable)' == 'true'">true - - $(BuildDependsOn); - Pack; - - - - Build; - - - $(PackDependsOn) - GetPackageTargetPath; - GetPackageContents - - - - + + + <_NonNuGetizedProjectReference Include="@(_MSBuildProjectReferenceExistent)" Condition="'$(_IsNuGetized)' != 'true'" /> + + <_NuGetizedProjectReference Include="@(_MSBuildProjectReferenceExistent)" Condition="'$(_IsNuGetized)' == 'true'" /> + + + + + + + <_ShouldPackOnBuild Condition="('$(PackOnBuild)' == 'true' Or Exists('$(PackOnBuildFile)')) And '$(IsPackable)' == 'true'">true + + $(BuildDependsOn); + Pack; + + + + Build; + + + $(PackDependsOn) + GetPackageTargetPath; + GetPackageContents + + + + - - - - - - - - - - - - - <_AllProjectCapabilities>@(ProjectCapability) - - <_SupportsProjectReferences>$(_AllProjectCapabilities.Contains('ProjectReferences')) - <_GetReferencedPackageContentsDependsOn Condition="'$(_SupportsProjectReferences)' == 'true'"> - $(_GetReferencedPackageContentsDependsOn); - AssignProjectConfiguration; - _SplitProjectReferencesByFileExistence; - _SplitProjectReferencesByIsNuGetized - - - - - - - - + + + + + + + + + + + + + <_AllProjectCapabilities>@(ProjectCapability) + + <_SupportsProjectReferences>$(_AllProjectCapabilities.Contains('ProjectReferences')) + <_GetReferencedPackageContentsDependsOn Condition="'$(_SupportsProjectReferences)' == 'true'"> + $(_GetReferencedPackageContentsDependsOn); + AssignProjectConfiguration; + _SplitProjectReferencesByFileExistence; + _SplitProjectReferencesByIsNuGetized + + + + + + diff --git a/src/Build/NuGet.Build.Packaging.Tasks/NuGetizer.props b/src/Build/NuGet.Build.Packaging.Tasks/NuGetizer.props new file mode 100644 index 00000000..30dd346d --- /dev/null +++ b/src/Build/NuGet.Build.Packaging.Tasks/NuGetizer.props @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/Build/NuGet.Build.Packaging.Tasks/NuGetizer.targets b/src/Build/NuGet.Build.Packaging.Tasks/NuGetizer.targets new file mode 100644 index 00000000..e8e297a5 --- /dev/null +++ b/src/Build/NuGet.Build.Packaging.Tasks/NuGetizer.targets @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/Build/NuGet.Build.Packaging.Tasks/Program.cs b/src/Build/NuGet.Build.Packaging.Tasks/Program.cs deleted file mode 100644 index d08bf312..00000000 --- a/src/Build/NuGet.Build.Packaging.Tasks/Program.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System; - -namespace NuGet.Build.Packaging -{ - class Program - { - [STAThread] - public static void Main(string[] args) { } - } -} diff --git a/src/Build/NuGet.Build.Packaging.Tasks/Properties/Resources.Designer.cs b/src/Build/NuGet.Build.Packaging.Tasks/Properties/Resources.Designer.cs deleted file mode 100644 index 912df383..00000000 --- a/src/Build/NuGet.Build.Packaging.Tasks/Properties/Resources.Designer.cs +++ /dev/null @@ -1,100 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace NuGet.Build.Packaging.Properties { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - public class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("NuGet.Build.Packaging.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized string similar to Package file '{0}' must have either 'Kind' or 'PackagePath' metadata.. - /// - public static string ErrorCode_NG0010 { - get { - return ResourceManager.GetString("ErrorCode_NG0010", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Project references to include in package must be nugetized.. - /// - public static string ErrorCode_NG0011 { - get { - return ResourceManager.GetString("ErrorCode_NG0011", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Duplicate package source files with distinct content detected. Duplicates are not allowed in the package. Please remove the conflict between these files: - ///{0}. - /// - public static string ErrorCode_NG0012 { - get { - return ResourceManager.GetString("ErrorCode_NG0012", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Content files cannot specify the reserved 'contentFiles' relative directory. Please use the 'CodeLanguage' and 'TargetFramework' item metadata for '{0}' to control its relative path within 'contentFiles'.. - /// - public static string ErrorCode_NG0013 { - get { - return ResourceManager.GetString("ErrorCode_NG0013", resourceCulture); - } - } - } -} diff --git a/src/Build/NuGet.Build.Packaging.Tasks/ReadLegacyConfigDependencies.cs b/src/Build/NuGet.Build.Packaging.Tasks/ReadLegacyConfigDependencies.cs deleted file mode 100644 index 9999510d..00000000 --- a/src/Build/NuGet.Build.Packaging.Tasks/ReadLegacyConfigDependencies.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System; -using System.Linq; -using System.IO; -using Microsoft.Build.Framework; -using Microsoft.Build.Utilities; -using Newtonsoft.Json.Linq; -using NuGet.ProjectManagement; -using System.Collections.Generic; -using NuGet.Packaging.Core; -using System.Xml.Linq; -using NuGet.Packaging; -using NuGet.Versioning; - -namespace NuGet.Build.Packaging.Tasks -{ - public class ReadLegacyConfigDependencies : Task - { - [Required] - public ITaskItem PackagesConfigPath { get; set; } - - [Output] - public ITaskItem[] PackageReferences { get; set; } - - public override bool Execute() - { - var fullPath = PackagesConfigPath.GetMetadata("FullPath"); - var config = XDocument.Load(fullPath); - PackageReferences = new PackagesConfigReader(config).GetPackages() - .Where(reference => !reference.IsDevelopmentDependency) - .Select(ConvertToTaskItem) - .ToArray(); - - return true; - } - - static ITaskItem ConvertToTaskItem(PackageReference reference) - { - var metadata = new Dictionary(); - if (reference.HasAllowedVersions) - metadata.Add("Version", reference.AllowedVersions.ToString()); - else if (reference.PackageIdentity.HasVersion) - metadata.Add("Version", VersionRange.Parse(reference.PackageIdentity.Version.ToString()).ToString()); - - return new TaskItem(reference.PackageIdentity.Id, metadata); - } - } -} diff --git a/src/Build/NuGet.Build.Packaging.Tasks/ReadLegacyJsonDependencies.cs b/src/Build/NuGet.Build.Packaging.Tasks/ReadLegacyJsonDependencies.cs deleted file mode 100644 index d1b52cdd..00000000 --- a/src/Build/NuGet.Build.Packaging.Tasks/ReadLegacyJsonDependencies.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System; -using System.Linq; -using System.IO; -using Microsoft.Build.Framework; -using Microsoft.Build.Utilities; -using Newtonsoft.Json.Linq; -using NuGet.ProjectManagement; -using System.Collections.Generic; -using NuGet.Packaging.Core; - -namespace NuGet.Build.Packaging.Tasks -{ - public class ReadLegacyJsonDependencies : Task - { - [Required] - public ITaskItem ProjectJsonPath { get; set; } - - [Output] - public ITaskItem[] PackageReferences { get; set; } - - public override bool Execute() - { - var fullPath = ProjectJsonPath.GetMetadata("FullPath"); - using (var reader = new StreamReader(fullPath)) - { - var json = JObject.Parse(reader.ReadToEnd()); - PackageReferences = JsonConfigUtility.GetDependencies(json) - .Select(ConvertToTaskItem) - .ToArray(); - } - - return true; - } - - static ITaskItem ConvertToTaskItem(PackageDependency dependency) - { - var metadata = new Dictionary - { - { "Version", dependency.VersionRange.ToString() }, - }; - - // NOTE: due to https://github.com/NuGet/Home/issues/520, - // we currently have no way of determining if the dependency is a - // development dependency. We'll just skip our own package id for now. - if (dependency.Id == ThisAssembly.Project.Properties.PackageId) - metadata.Add("PrivateAssets", "All"); - - return new TaskItem(dependency.Id, metadata); - } - } -} diff --git a/src/Build/NuGet.Build.Packaging.Tasks/Properties/Resources.resx b/src/Build/NuGet.Build.Packaging.Tasks/Resources.resx similarity index 99% rename from src/Build/NuGet.Build.Packaging.Tasks/Properties/Resources.resx rename to src/Build/NuGet.Build.Packaging.Tasks/Resources.resx index 5307508d..0a63a5d9 100644 --- a/src/Build/NuGet.Build.Packaging.Tasks/Properties/Resources.resx +++ b/src/Build/NuGet.Build.Packaging.Tasks/Resources.resx @@ -124,8 +124,7 @@ Project references to include in package must be nugetized. - Duplicate package source files with distinct content detected. Duplicates are not allowed in the package. Please remove the conflict between these files: -{0} + Duplicate package source files with distinct content detected. Duplicates are not allowed in the package. Please remove the conflict between these files: {0} Content files cannot specify the reserved 'contentFiles' relative directory. Please use the 'CodeLanguage' and 'TargetFramework' item metadata for '{0}' to control its relative path within 'contentFiles'. diff --git a/src/Build/NuGet.Build.Packaging.Tests/AssignPackagePathTests.cs b/src/Build/NuGet.Build.Packaging.Tests/AssignPackagePathTests.cs index 559b1bb4..5a552388 100644 --- a/src/Build/NuGet.Build.Packaging.Tests/AssignPackagePathTests.cs +++ b/src/Build/NuGet.Build.Packaging.Tests/AssignPackagePathTests.cs @@ -7,40 +7,37 @@ using Xunit.Abstractions; using System.Linq; using NuGet.Build.Packaging.Tasks; -using static NuGet.Build.Packaging.Properties.Strings; using Metadata = System.Collections.Generic.Dictionary; using System; -using NuGet.Build.Packaging.Properties; namespace NuGet.Build.Packaging { public class AssignPackagePathTests { - static readonly ITaskItem[] kinds; + static ITaskItem[] kinds; + + static ITaskItem[] Kinds + => kinds ??= new Project(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "NuGet.Build.Packaging.props"), null, null, new ProjectCollection()) + .GetItems("PackageItemKind") + .Select(item => new TaskItem(item.EvaluatedInclude, item.Metadata.ToDictionary(meta => meta.Name, meta => meta.UnevaluatedValue))) + .ToArray(); + ITestOutputHelper output; MockBuildEngine engine; - static AssignPackagePathTests() - { - kinds = new Project(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "NuGet.Build.Packaging.props"), null, null, new ProjectCollection()) - .GetItems("PackageItemKind") - .Select(item => new TaskItem(item.EvaluatedInclude, item.Metadata.ToDictionary(meta => meta.Name, meta => meta.UnevaluatedValue))) - .ToArray(); - } - public AssignPackagePathTests(ITestOutputHelper output) { this.output = output; engine = new MockBuildEngine(output); - } + } - [Fact] + [Fact] public void when_file_has_no_kind_then_logs_error_code() { var task = new AssignPackagePath { BuildEngine = engine, - Kinds = kinds, + Kinds = Kinds, Files = new ITaskItem[] { new TaskItem("library.dll", new Metadata @@ -52,7 +49,7 @@ public void when_file_has_no_kind_then_logs_error_code() }; Assert.False(task.Execute()); - Assert.Equal(nameof(ErrorCode.NG0010), engine.LoggedErrorEvents[0].Code); + Assert.Equal(nameof(ThisAssembly.Strings.ErrorCode.NG0010), engine.LoggedErrorEvents[0].Code); } [Fact] @@ -61,7 +58,7 @@ public void when_file_has_no_kind_and_no_framework_specific_then_it_is_not_assig var task = new AssignPackagePath { BuildEngine = engine, - Kinds = kinds, + Kinds = Kinds, Files = new ITaskItem[] { new TaskItem("library.dll", new Metadata @@ -86,7 +83,7 @@ public void when_file_has_no_kind_and_package_path_and_framework_specific_then_i var task = new AssignPackagePath { BuildEngine = engine, - Kinds = kinds, + Kinds = Kinds, Files = new ITaskItem[] { new TaskItem("library.dll", new Metadata @@ -112,7 +109,7 @@ public void assigned_files_contains_all_files() var task = new AssignPackagePath { BuildEngine = engine, - Kinds = kinds, + Kinds = Kinds, Files = new ITaskItem[] { new TaskItem("a.dll", new Metadata @@ -141,7 +138,7 @@ public void when_file_has_no_package_id_then_package_path_is_not_specified() var task = new AssignPackagePath { BuildEngine = engine, - Kinds = kinds, + Kinds = Kinds, Files = new ITaskItem[] { new TaskItem("library.dll", new Metadata @@ -163,7 +160,7 @@ public void when_file_has_no_package_id_but_is_packaging_true_then_package_path_ { IsPackaging = "true", BuildEngine = engine, - Kinds = kinds, + Kinds = Kinds, Files = new ITaskItem[] { new TaskItem("library.dll", new Metadata @@ -184,7 +181,7 @@ public void when_file_has_no_package_id_then_target_framework_is_calculated_anyw var task = new AssignPackagePath { BuildEngine = engine, - Kinds = kinds, + Kinds = Kinds, Files = new ITaskItem[] { new TaskItem("library.dll", new Metadata @@ -208,7 +205,7 @@ public void when_file_has_no_package_id_then_package_folder_is_calculated_anyway var task = new AssignPackagePath { BuildEngine = engine, - Kinds = kinds, + Kinds = Kinds, Files = new ITaskItem[] { new TaskItem("library.dll", new Metadata @@ -232,7 +229,7 @@ public void when_file_has_no_tfm_then_assigned_file_contains_no_target_framework var task = new AssignPackagePath { BuildEngine = engine, - Kinds = kinds, + Kinds = Kinds, Files = new ITaskItem[] { new TaskItem("library.dll", new Metadata @@ -258,7 +255,7 @@ public void when_file_has_target_framework_and_tfm_then_existing_value_is_preser var task = new AssignPackagePath { BuildEngine = engine, - Kinds = kinds, + Kinds = Kinds, Files = new ITaskItem[] { new TaskItem("library.dll", new Metadata @@ -285,7 +282,7 @@ public void when_content_file_has_link_then_package_path_is_relative_to_link() var task = new AssignPackagePath { BuildEngine = engine, - Kinds = kinds, + Kinds = Kinds, Files = new ITaskItem[] { new TaskItem(@"..\..\readme.txt", new Metadata @@ -313,7 +310,7 @@ public void when_none_file_has_link_then_package_path_is_relative_to_link() var task = new AssignPackagePath { BuildEngine = engine, - Kinds = kinds, + Kinds = Kinds, Files = new ITaskItem[] { new TaskItem(@"..\..\readme.txt", new Metadata @@ -342,7 +339,7 @@ public void when_content_is_not_framework_specific_then_has_any_lang_and_tfm() var task = new AssignPackagePath { BuildEngine = engine, - Kinds = kinds, + Kinds = Kinds, Files = new ITaskItem[] { new TaskItem("readme.txt", new Metadata @@ -378,7 +375,7 @@ public void when_file_has_tfm_then_assigned_file_contains_target_framework(strin var task = new AssignPackagePath { BuildEngine = engine, - Kinds = kinds, + Kinds = Kinds, Files = new ITaskItem[] { new TaskItem("library.dll", new Metadata @@ -400,21 +397,21 @@ public void when_file_has_tfm_then_assigned_file_contains_target_framework(strin })); } - public static IEnumerable GetMappedKnownKinds => kinds + public static IEnumerable GetMappedKnownKinds => Kinds // Skip unmapped kinds (i.e. None, Dependency, etc.) .Where(kind => !string.IsNullOrEmpty(kind.GetMetadata(MetadataName.PackageFolder)) && // Skip contentFiles from this test since they get a special map that includes the codelang kind.GetMetadata(MetadataName.PackageFolder) != "contentFiles") .Select(kind => new object[] { kind.ItemSpec, kind.GetMetadata(MetadataName.PackageFolder), kind.GetMetadata(MetadataName.FrameworkSpecific) }); - [MemberData("GetMappedKnownKinds")] + [MemberData(nameof(GetMappedKnownKinds))] [Theory] public void when_file_has_known_kind_then_assigned_file_contains_mapped_package_folder(string packageFileKind, string mappedPackageFolder, string frameworkSpecific) { var task = new AssignPackagePath { BuildEngine = engine, - Kinds = kinds, + Kinds = Kinds, Files = new ITaskItem[] { new TaskItem("library.dll", new Metadata @@ -437,20 +434,20 @@ public void when_file_has_known_kind_then_assigned_file_contains_mapped_package_ })); } - public static IEnumerable GetUnmappedKnownKinds => kinds + public static IEnumerable GetUnmappedKnownKinds => Kinds .Where(kind => string.IsNullOrEmpty(kind.GetMetadata(MetadataName.PackageFolder)) && kind.GetMetadata(MetadataName.PackageFolder) != "contentFiles" && kind.ItemSpec != PackageItemKind.None) .Select(kind => new object[] { kind.ItemSpec }); - [MemberData("GetUnmappedKnownKinds")] + [MemberData(nameof(GetUnmappedKnownKinds))] [Theory] public void when_file_has_known_kind_with_no_package_folder_then_package_path_is_empty(string packageFileKind) { var task = new AssignPackagePath { BuildEngine = engine, - Kinds = kinds, + Kinds = Kinds, Files = new ITaskItem[] { new TaskItem("Foo", new Metadata @@ -475,7 +472,7 @@ public void when_file_has_explicit_package_path_then_calculated_package_folder_i var task = new AssignPackagePath { BuildEngine = engine, - Kinds = kinds, + Kinds = Kinds, Files = new ITaskItem[] { new TaskItem("readme.txt", new Metadata @@ -506,7 +503,7 @@ public void when_assigning_content_file_then_applies_tfm_and_language(string tfm var task = new AssignPackagePath { BuildEngine = engine, - Kinds = kinds, + Kinds = Kinds, Files = new ITaskItem[] { new TaskItem("Sample.cs", new Metadata @@ -531,7 +528,7 @@ public void when_assigning_content_file_with_reserved_dir_then_fails() var task = new AssignPackagePath { BuildEngine = engine, - Kinds = kinds, + Kinds = Kinds, Files = new ITaskItem[] { new TaskItem(@"contentFiles\cs\monodroid\content.cs", new Metadata @@ -545,15 +542,16 @@ public void when_assigning_content_file_with_reserved_dir_then_fails() }; Assert.False(task.Execute()); - Assert.True(engine.LoggedErrorEvents.Any(e => e.Code == nameof(Strings.ErrorCode.NG0013))); + Assert.Contains(engine.LoggedErrorEvents, e => e.Code == nameof(ThisAssembly.Strings.ErrorCode.NG0013)); } + [Fact] public void when_assigning_content_file_with_additional_metadata_then_preserves_metadata() { var task = new AssignPackagePath { BuildEngine = engine, - Kinds = kinds, + Kinds = Kinds, Files = new ITaskItem[] { new TaskItem("Sample.cs", new Metadata @@ -585,7 +583,7 @@ public void when_file_has_none_kind_then_assigned_file_has_empty_package_folder_ var task = new AssignPackagePath { BuildEngine = engine, - Kinds = kinds, + Kinds = Kinds, Files = new ITaskItem[] { new TaskItem(@"content\docs\readme.txt", new Metadata @@ -611,7 +609,7 @@ public void when_file_has_none_kind_with_target_path_then_assigned_file_has_empt var task = new AssignPackagePath { BuildEngine = engine, - Kinds = kinds, + Kinds = Kinds, Files = new ITaskItem[] { new TaskItem("library.dll", new Metadata @@ -638,7 +636,7 @@ public void when_file_has_none_kind_then_assigned_file_has_no_target_framework_i var task = new AssignPackagePath { BuildEngine = engine, - Kinds = kinds, + Kinds = Kinds, Files = new ITaskItem[] { new TaskItem("library.dll", new Metadata @@ -663,7 +661,7 @@ public void when_file_has_inferred_folder_from_kind_then_assigned_file_contains_ var task = new AssignPackagePath { BuildEngine = engine, - Kinds = kinds, + Kinds = Kinds, Files = new ITaskItem[] { new TaskItem("library.dll", new Metadata @@ -689,7 +687,7 @@ public void when_file_has_relative_target_path_without_tfm_then_package_path_has var task = new AssignPackagePath { BuildEngine = engine, - Kinds = kinds, + Kinds = Kinds, Files = new ITaskItem[] { new TaskItem("sdk\\bin\\tool.exe", new Metadata @@ -714,7 +712,7 @@ public void when_tool_has_relative_target_path_with_framework_specific_true_then var task = new AssignPackagePath { BuildEngine = engine, - Kinds = kinds, + Kinds = Kinds, Files = new ITaskItem[] { new TaskItem("sdk\\bin\\tool.exe", new Metadata @@ -741,7 +739,7 @@ public void when_lib_has_framework_specific_false_then_package_path_does_not_hav var task = new AssignPackagePath { BuildEngine = engine, - Kinds = kinds, + Kinds = Kinds, Files = new ITaskItem[] { new TaskItem("console.exe", new Metadata @@ -767,7 +765,7 @@ public void when_file_is_not_framework_specific_then_it_is_not_assigned_target_f var task = new AssignPackagePath { BuildEngine = engine, - Kinds = kinds, + Kinds = Kinds, Files = new ITaskItem[] { new TaskItem("tools\\foo.exe", new Metadata diff --git a/src/Build/NuGet.Build.Packaging.Tests/Builder.NuGetizer.cs b/src/Build/NuGet.Build.Packaging.Tests/Builder.NuGetizer.cs index 63263ad5..7ad7f0d0 100644 --- a/src/Build/NuGet.Build.Packaging.Tests/Builder.NuGetizer.cs +++ b/src/Build/NuGet.Build.Packaging.Tests/Builder.NuGetizer.cs @@ -8,7 +8,6 @@ using Microsoft.Build.Execution; using Microsoft.Build.Framework; using Microsoft.Build.Logging.StructuredLogger; -using NuGet.Build.Packaging; using Xunit; using Xunit.Abstractions; using Xunit.Sdk; @@ -71,8 +70,8 @@ public static TargetResult BuildScenario( .ToDictionary(prop => prop.Name, prop => prop.GetValue(properties).ToString()) ?? new Dictionary(); - buildProps[nameof(ThisAssembly.Project.Properties.NuGetRestoreTargets)] = ThisAssembly.Project.Properties.NuGetRestoreTargets; - buildProps[nameof(ThisAssembly.Project.Properties.NuGetTargets)] = ThisAssembly.Project.Properties.NuGetTargets; + buildProps[nameof(ThisAssembly.Project.NuGetRestoreTargets)] = ThisAssembly.Project.NuGetRestoreTargets; + buildProps[nameof(ThisAssembly.Project.NuGetTargets)] = ThisAssembly.Project.NuGetTargets; var result = Build(projectOrSolution, target, buildProps, loggers); if (OpenBuildLogAttribute.IsActive) diff --git a/src/Build/NuGet.Build.Packaging.Tests/Builder.cs b/src/Build/NuGet.Build.Packaging.Tests/Builder.cs index 83d1887d..acdbb793 100644 --- a/src/Build/NuGet.Build.Packaging.Tests/Builder.cs +++ b/src/Build/NuGet.Build.Packaging.Tests/Builder.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Diagnostics; using System.IO; using System.Xml.Linq; using Microsoft.Build.Evaluation; @@ -17,9 +16,9 @@ /// automatic solution-configuration generation for /// P2P references. /// -public static partial class Builder +static partial class Builder { - const string ToolsVersion = "15.0"; + const string ToolsVersion = "Current"; public static BuildResult Build(ProjectInstance project, string targets, Dictionary properties = null, ILogger[] loggers = null) { diff --git a/src/Build/NuGet.Build.Packaging.Tests/CreatePackageTests.cs b/src/Build/NuGet.Build.Packaging.Tests/CreatePackageTests.cs index 4b5b2206..426eaab3 100644 --- a/src/Build/NuGet.Build.Packaging.Tests/CreatePackageTests.cs +++ b/src/Build/NuGet.Build.Packaging.Tests/CreatePackageTests.cs @@ -1,24 +1,21 @@ using System; using System.Collections.Generic; using System.IO; -using Microsoft.Build.Evaluation; using Microsoft.Build.Framework; using Microsoft.Build.Utilities; using Xunit; using Xunit.Abstractions; using System.Linq; -using static NuGet.Build.Packaging.Properties.Strings; using System.Diagnostics; using NuGet.Frameworks; using NuGet.Packaging.Core; -using NuGet.Versioning; using Metadata = System.Collections.Generic.Dictionary; using NuGet.Build.Packaging.Tasks; using NuGet.Packaging; namespace NuGet.Build.Packaging { - public class CreatePackageTests + public class CreatePackageTests { ITestOutputHelper output; MockBuildEngine engine; @@ -148,9 +145,9 @@ public void when_creating_package_with_simple_dependency_then_contains_dependenc var manifest = ExecuteTask(); Assert.NotNull(manifest); - Assert.Equal(1, manifest.Metadata.DependencyGroups.Count()); + Assert.Single(manifest.Metadata.DependencyGroups); Assert.Equal(NuGetFramework.Parse(".NETFramework,Version=v4.5"), manifest.Metadata.DependencyGroups.First().TargetFramework); - Assert.Equal(1, manifest.Metadata.DependencyGroups.First().Packages.Count()); + Assert.Single(manifest.Metadata.DependencyGroups.First().Packages); Assert.Equal("Newtonsoft.Json", manifest.Metadata.DependencyGroups.First().Packages.First().Id); // We get a version range actually for the specified dependency, like [1.0.0,) @@ -176,8 +173,8 @@ public void when_creating_package_with_dependency_and_include_assets_then_contai var manifest = ExecuteTask(); Assert.NotNull(manifest); - Assert.Equal(1, manifest.Metadata.DependencyGroups.Count()); - Assert.Equal(1, manifest.Metadata.DependencyGroups.First().Packages.Count()); + Assert.Single(manifest.Metadata.DependencyGroups); + Assert.Single(manifest.Metadata.DependencyGroups.First().Packages); Assert.Equal("Newtonsoft.Json", manifest.Metadata.DependencyGroups.First().Packages.First().Id); Assert.Equal(1, manifest.Metadata.DependencyGroups.First().Packages.First().Include.Count); Assert.Equal("all", manifest.Metadata.DependencyGroups.First().Packages.First().Include[0]); @@ -202,8 +199,8 @@ public void when_creating_package_with_dependency_and_exclude_assets_then_contai var manifest = ExecuteTask(); Assert.NotNull(manifest); - Assert.Equal(1, manifest.Metadata.DependencyGroups.Count()); - Assert.Equal(1, manifest.Metadata.DependencyGroups.First().Packages.Count()); + Assert.Single(manifest.Metadata.DependencyGroups); + Assert.Single(manifest.Metadata.DependencyGroups.First().Packages); Assert.Equal("Newtonsoft.Json", manifest.Metadata.DependencyGroups.First().Packages.First().Id); Assert.Equal(1, manifest.Metadata.DependencyGroups.First().Packages.First().Exclude.Count); Assert.Equal("all", manifest.Metadata.DependencyGroups.First().Packages.First().Exclude[0]); @@ -227,8 +224,8 @@ public void when_creating_package_with_dependency_and_without_include_assets_the var manifest = ExecuteTask(); Assert.NotNull(manifest); - Assert.Equal(1, manifest.Metadata.DependencyGroups.Count()); - Assert.Equal(1, manifest.Metadata.DependencyGroups.First().Packages.Count()); + Assert.Single(manifest.Metadata.DependencyGroups); + Assert.Single(manifest.Metadata.DependencyGroups.First().Packages); Assert.Equal("Newtonsoft.Json", manifest.Metadata.DependencyGroups.First().Packages.First().Id); Assert.Equal(0, manifest.Metadata.DependencyGroups.First().Packages.First().Include.Count); } @@ -251,8 +248,8 @@ public void when_creating_package_with_dependency_and_without_exclude_assets_the var manifest = ExecuteTask(); Assert.NotNull(manifest); - Assert.Equal(1, manifest.Metadata.DependencyGroups.Count()); - Assert.Equal(1, manifest.Metadata.DependencyGroups.First().Packages.Count()); + Assert.Single(manifest.Metadata.DependencyGroups); + Assert.Single(manifest.Metadata.DependencyGroups.First().Packages); Assert.Equal("Newtonsoft.Json", manifest.Metadata.DependencyGroups.First().Packages.First().Id); Assert.Equal(0, manifest.Metadata.DependencyGroups.First().Packages.First().Exclude.Count); } @@ -291,11 +288,11 @@ public void when_creating_package_with_non_framework_secific_dependency_then_con Assert.Equal(NuGetFramework.Parse(".NETFramework,Version=v4.5"), manifest.Metadata.DependencyGroups.Last().TargetFramework); - Assert.Equal(1, manifest.Metadata.DependencyGroups.First().Packages.Count()); + Assert.Single(manifest.Metadata.DependencyGroups.First().Packages); Assert.Equal("Newtonsoft.Json", manifest.Metadata.DependencyGroups.First().Packages.First().Id); Assert.Equal("8.0.0", manifest.Metadata.DependencyGroups.First().Packages.First().VersionRange.MinVersion.ToString()); - Assert.Equal(1, manifest.Metadata.DependencyGroups.Last().Packages.Count()); + Assert.Single(manifest.Metadata.DependencyGroups.Last().Packages); Assert.Equal("Microsoft.Build", manifest.Metadata.DependencyGroups.Last().Packages.First().Id); Assert.Equal("15.0.0", manifest.Metadata.DependencyGroups.Last().Packages.First().VersionRange.MinVersion.ToString()); } @@ -331,11 +328,11 @@ public void when_creating_package_with_any_framework_secific_dependency_then_con Assert.Equal(NuGetFramework.Parse(".NETFramework,Version=v4.5"), manifest.Metadata.DependencyGroups.Last().TargetFramework); - Assert.Equal(1, manifest.Metadata.DependencyGroups.First().Packages.Count()); + Assert.Single(manifest.Metadata.DependencyGroups.First().Packages); Assert.Equal("Newtonsoft.Json", manifest.Metadata.DependencyGroups.First().Packages.First().Id); Assert.Equal("8.0.0", manifest.Metadata.DependencyGroups.First().Packages.First().VersionRange.MinVersion.ToString()); - Assert.Equal(1, manifest.Metadata.DependencyGroups.Last().Packages.Count()); + Assert.Single(manifest.Metadata.DependencyGroups.Last().Packages); Assert.Equal("Microsoft.Build", manifest.Metadata.DependencyGroups.Last().Packages.First().Id); Assert.Equal("15.0.0", manifest.Metadata.DependencyGroups.Last().Packages.First().VersionRange.MinVersion.ToString()); } @@ -457,7 +454,7 @@ public void when_creating_package_with_development_dependency_then_does_not_gene var manifest = ExecuteTask(); - Assert.Equal(0, manifest.Metadata.DependencyGroups.Count()); + Assert.Empty(manifest.Metadata.DependencyGroups); } [Fact] @@ -478,9 +475,9 @@ public void when_creating_package_with_referenced_package_project_then_contains_ var manifest = ExecuteTask(); Assert.NotNull(manifest); - Assert.Equal(1, manifest.Metadata.DependencyGroups.Count()); + Assert.Single(manifest.Metadata.DependencyGroups); Assert.Equal(NuGetFramework.Parse(".NETFramework,Version=v4.5"), manifest.Metadata.DependencyGroups.First().TargetFramework); - Assert.Equal(1, manifest.Metadata.DependencyGroups.First().Packages.Count()); + Assert.Single(manifest.Metadata.DependencyGroups.First().Packages); Assert.Equal("Newtonsoft.Json", manifest.Metadata.DependencyGroups.First().Packages.First().Id); // We get a version range actually for the specified dependency, like [1.0.0,) diff --git a/src/Build/NuGet.Build.Packaging.Tests/GetApiIntersectTargetPathsTests.cs b/src/Build/NuGet.Build.Packaging.Tests/GetApiIntersectTargetPathsTests.cs deleted file mode 100644 index e8956548..00000000 --- a/src/Build/NuGet.Build.Packaging.Tests/GetApiIntersectTargetPathsTests.cs +++ /dev/null @@ -1,73 +0,0 @@ -using System.IO; -using Microsoft.Build.Framework; -using Microsoft.Build.Utilities; -using NuGet.Build.Packaging.Tasks; -using Xunit; -using Xunit.Abstractions; - -namespace NuGet.Build.Packaging -{ - public class GetApiIntersectTargetPathsTests - { - ITestOutputHelper output; - MockBuildEngine engine; - GetApiIntersectTargetPaths task; - - public GetApiIntersectTargetPathsTests(ITestOutputHelper output) - { - this.output = output; - engine = new MockBuildEngine(output); - task = new GetApiIntersectTargetPaths - { - BuildEngine = engine - }; - } - - [Fact] - public void when_framework_is_profile_78_then_target_path_returned() - { - task.RootOutputDirectory = new TaskItem(Path.Combine("project", "obj", "Debug")); - task.Frameworks = new[] - { - new TaskItem(".NETPortable,Version=v4.5,Profile=Profile78") - }; - task.Assemblies = new[] - { - new TaskItem(Path.Combine("Android", "test.dll")), - new TaskItem(Path.Combine("iOS", "test.dll")) - }; - - bool result = task.Execute(); - - string expectedTargetPath = Path.Combine("project", "obj", "Debug", "Profile78", "bin", "test.dll"); - Assert.True(result); - Assert.Equal(1, task.TargetPaths.Length); - Assert.Equal(expectedTargetPath, task.TargetPaths[0].ItemSpec); - } - - [Fact] - public void when_assembly_filenames_do_not_match_then_warning_logged() - { - task.RootOutputDirectory = new TaskItem(Path.Combine("project", "obj", "Debug")); - task.Frameworks = new[] - { - new TaskItem(".NETPortable,Version=v4.5,Profile=Profile78") - }; - task.Assemblies = new[] - { - new TaskItem(Path.Combine("Android", "Test.Android.dll")), - new TaskItem(Path.Combine("iOS", "Test.iOS.dll")) - }; - - task.Execute(); - - string expectedMessage = string.Format("Assembly names should be the same for a bait and switch NuGet package. Names: 'Test.Android.dll, Test.iOS.dll' Assemblies: {0}, {1}", - task.Assemblies[0].ItemSpec, - task.Assemblies[1].ItemSpec); - var warningEvent = engine.LoggedWarningEvents[0]; - Assert.Equal(1, engine.LoggedWarningEvents.Count); - Assert.Equal("NG1003", warningEvent.Code); - Assert.Equal(expectedMessage, warningEvent.Message); - } - } -} diff --git a/src/Build/NuGet.Build.Packaging.Tests/ModuleInitializer.cs b/src/Build/NuGet.Build.Packaging.Tests/ModuleInitializer.cs new file mode 100644 index 00000000..2e259f9e --- /dev/null +++ b/src/Build/NuGet.Build.Packaging.Tests/ModuleInitializer.cs @@ -0,0 +1,52 @@ +using System; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Runtime.CompilerServices; + +namespace System.Runtime.CompilerServices +{ + [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] + public sealed class ModuleInitializerAttribute : Attribute { } +} + +namespace NuGetizer.Tests +{ + internal static class ModuleInitializer + { + [ModuleInitializer] + internal static void Run() + { + AppDomain.CurrentDomain.AssemblyResolve += OnAssemblyResolve; + + File.AppendAllText(@"C:\Delete\initializer.txt", $"Initializing MSBuild to {ThisAssembly.Project.MSBuildBinPath}\r\n"); + + //if (!AppDomain.CurrentDomain.GetAssemblies().Any(x => x.GetName().Name == "Microsoft.Build")) + //{ + // var binPath = ThisAssembly.Project.MSBuildBinPath; + + // Microsoft.Build.Locator.MSBuildLocator.RegisterMSBuildPath(binPath); + + // // Set environment variables so SDKs can be resolved. + // Environment.SetEnvironmentVariable("MSBUILD_EXE_PATH", Path.Combine(binPath, "MSBuild.exe"), EnvironmentVariableTarget.Process); + //} + } + + static Assembly OnAssemblyResolve(object sender, ResolveEventArgs args) + { + var name = new AssemblyName(args.Name).Name; + var file = Path.Combine(ThisAssembly.Project.MSBuildBinPath, name + ".dll"); + + File.AppendAllText(@"C:\Delete\initializer.txt", $"Resolving {name}\r\n"); + + if (name.StartsWith("Microsoft.Build") && File.Exists(file)) + { + File.AppendAllText(@"C:\Delete\initializer.txt", $"Found {file}\r\n"); + return Assembly.LoadFrom(file); + } + + return null; + } + } +} diff --git a/src/Build/NuGet.Build.Packaging.Tests/NuGet.Build.Packaging.Tests.csproj b/src/Build/NuGet.Build.Packaging.Tests/NuGet.Build.Packaging.Tests.csproj index aeac213f..cd06c94d 100644 --- a/src/Build/NuGet.Build.Packaging.Tests/NuGet.Build.Packaging.Tests.csproj +++ b/src/Build/NuGet.Build.Packaging.Tests/NuGet.Build.Packaging.Tests.csproj @@ -1,53 +1,53 @@ - - + + - {212952C3-22F5-4263-BF9B-B17316B3B3CA} - net46 - false - false + net472 NO-SDK-PACK - True + $(DefaultItemExcludes);Scenarios\**\* + Preview + - + + ..\NuGet.Build.Packaging.Tasks\bin\$(Configuration)\NuGet.Build.Packaging.Tasks.dll + - - - - - - - + + - - - all - runtime; build; native; contentfiles; analyzers - + + + + + + + + + - - {cd767d93-6c99-4d6a-a303-3c139a73400e} - ApiIntersect - + + + - - - - - - - - - + + - + + + - + + + + + + + \ No newline at end of file diff --git a/src/Build/NuGet.Build.Packaging.Tests/NuGet.Build.Packaging.Tests.targets b/src/Build/NuGet.Build.Packaging.Tests/NuGet.Build.Packaging.Tests.targets index 569068b4..c54f05d2 100644 --- a/src/Build/NuGet.Build.Packaging.Tests/NuGet.Build.Packaging.Tests.targets +++ b/src/Build/NuGet.Build.Packaging.Tests/NuGet.Build.Packaging.Tests.targets @@ -1,30 +1,25 @@ - - - 1 - - false - + + + 1 + + false + - - - - + + + + + - - - - - - - - - + diff --git a/src/Build/NuGet.Build.Packaging.Tests/ReadLegacyConfigDependenciesTests.cs b/src/Build/NuGet.Build.Packaging.Tests/ReadLegacyConfigDependenciesTests.cs deleted file mode 100644 index 83eac6ad..00000000 --- a/src/Build/NuGet.Build.Packaging.Tests/ReadLegacyConfigDependenciesTests.cs +++ /dev/null @@ -1,77 +0,0 @@ -using System.IO; -using Microsoft.Build.Framework; -using Microsoft.Build.Utilities; -using Xunit; -using Xunit.Abstractions; -using NuGet.Build.Packaging.Tasks; -using NuGet.Versioning; - -namespace NuGet.Build.Packaging -{ - public class ReadLegacyConfigDependenciesTests - { - ITestOutputHelper output; - MockBuildEngine engine; - - public ReadLegacyConfigDependenciesTests(ITestOutputHelper output) - { - this.output = output; - engine = new MockBuildEngine(output); - } - - [Fact] - public void when_config_has_dependency_then_projects_package_reference() - { - var configPath = Path.GetTempFileName(); - try - { - File.WriteAllText(configPath, @" - -"); - - var task = new ReadLegacyConfigDependencies - { - BuildEngine = engine, - PackagesConfigPath = new TaskItem(configPath) - }; - - Assert.True(task.Execute()); - - Assert.Contains(task.PackageReferences, item => item.Matches(new - { - Identity = "Newtonsoft.Json", - Version = VersionRange.Parse("9.0.1").ToString() - })); - } - finally - { - File.Delete(configPath); - } - } - - [Fact] - public void when_config_has_development_dependency_then_skips_package_reference() - { - var configPath = Path.GetTempFileName(); - try - { - File.WriteAllText(configPath, @" - -"); - - var task = new ReadLegacyConfigDependencies - { - BuildEngine = engine, - PackagesConfigPath = new TaskItem(configPath) - }; - - Assert.True(task.Execute()); - Assert.Equal(0, task.PackageReferences.Length); - } - finally - { - File.Delete(configPath); - } - } - } -} diff --git a/src/Build/NuGet.Build.Packaging.Tests/ReadLegacyJsonDependenciesTests.cs b/src/Build/NuGet.Build.Packaging.Tests/ReadLegacyJsonDependenciesTests.cs deleted file mode 100644 index f56938c6..00000000 --- a/src/Build/NuGet.Build.Packaging.Tests/ReadLegacyJsonDependenciesTests.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System.IO; -using Microsoft.Build.Framework; -using Microsoft.Build.Utilities; -using Xunit; -using Xunit.Abstractions; -using NuGet.Build.Packaging.Tasks; -using NuGet.Versioning; - -namespace NuGet.Build.Packaging -{ - public class ReadLegacyJsonDependenciesTests - { - ITestOutputHelper output; - MockBuildEngine engine; - - public ReadLegacyJsonDependenciesTests(ITestOutputHelper output) - { - this.output = output; - engine = new MockBuildEngine(output); - } - - [Fact] - public void when_config_has_dependency_then_projects_package_reference() - { - var configPath = Path.GetTempFileName(); - try - { - File.WriteAllText(configPath, @"{ - ""dependencies"": { - ""Newtonsoft.Json"": ""9.0.1"" - }, - ""frameworks"": { - ""net45"": { } - }, - ""runtimes"": { - ""win"": { } - } -}"); - - var task = new ReadLegacyJsonDependencies - { - BuildEngine = engine, - ProjectJsonPath = new TaskItem(configPath) - }; - - Assert.True(task.Execute()); - - Assert.Contains(task.PackageReferences, item => item.Matches(new - { - Identity = "Newtonsoft.Json", - Version = VersionRange.Parse("9.0.1").ToString() - })); - } - finally - { - File.Delete(configPath); - } - } - } -} diff --git a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/Directory.Build.props b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/Directory.Build.props new file mode 100644 index 00000000..f1ae1872 --- /dev/null +++ b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/Directory.Build.props @@ -0,0 +1,25 @@ + + + + false + false + false + obj\$(MSBuildProjectName) + + + + + + + + $(TargetPlatformMoniker) + $(TargetPlatformIdentifier) + $(TargetFrameworkIdentifier) + $(TargetFrameworkVersion.TrimStart('vV')) + $(TargetRefPath) + @(CopyUpToDateMarker) + + + + + \ No newline at end of file diff --git a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/Directory.Build.targets b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/Directory.Build.targets new file mode 100644 index 00000000..4de98b5c --- /dev/null +++ b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/Directory.Build.targets @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/Scenario.props b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/Scenario.props index 85c1645f..d03eff0a 100644 --- a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/Scenario.props +++ b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/Scenario.props @@ -1,52 +1,51 @@  - - - - - Debug - AnyCPU - bin\$(MSBuildProjectName) - obj\$(MSBuildProjectName)\ - Library - Scenario - - v4.5 - $(MSBuildProjectName) - - - {AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA} - {BBBBBBBB-BBBB-BBBB-BBBB-BBBBBBBBBBBB} - {CCCCCCCC-CCCC-CCCC-CCCC-CCCCCCCCCCCC} - {DDDDDDDD-DDDD-DDDD-DDDD-DDDDDDDDDDDD} - {EEEEEEEE-EEEE-EEEE-EEEE-EEEEEEEEEEEE} - {FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF} - - $(GuidA) - - - true - - false - - - 1 - - - None - - false - - - - - NuGet - Package for '$(MSBuildProjectName)' project. - - - $([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), NuGet.Build.Packaging.props)) - - $(MSBuildThisFileDirectory)..\..\NuGet.Build.Packaging.Tasks\bin\$(Configuration) - - - + + + + + Debug + AnyCPU + bin\$(MSBuildProjectName) + obj\$(MSBuildProjectName)\ + Library + Scenario + + v4.5 + $(MSBuildProjectName) + + + {AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA} + {BBBBBBBB-BBBB-BBBB-BBBB-BBBBBBBBBBBB} + {CCCCCCCC-CCCC-CCCC-CCCC-CCCCCCCCCCCC} + {DDDDDDDD-DDDD-DDDD-DDDD-DDDDDDDDDDDD} + {EEEEEEEE-EEEE-EEEE-EEEE-EEEEEEEEEEEE} + {FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF} + + $(GuidA) + + + true + + + 1 + + + None + + true + + + + + NuGet + Package for '$(MSBuildProjectName)' project. + + + $([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), NuGet.Build.Packaging.props)) + + $(MSBuildThisFileDirectory)..\..\NuGet.Build.Packaging.Tasks\bin\$(Configuration) + + + \ No newline at end of file diff --git a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/Scenario.targets b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/Scenario.targets index 1aefef8c..5ba566d0 100644 --- a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/Scenario.targets +++ b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/Scenario.targets @@ -2,13 +2,14 @@ $(OutputPath)\$(AssemblyName).xml + - + - - + Condition="'$(TargetFramework)' == '' and '$(IsPortable)' == 'true' and '$(MSBuildProjectExtension)' == '.csproj'" /> + + @@ -29,15 +30,6 @@ - - $(MSBuildBinPath)\Microsoft.Build.Tasks.v4.0.dll - $(MSBuildBinPath)\Microsoft.Build.Tasks.v12.0.dll - - $(MSBuildToolsPath)\Microsoft.Build.Tasks.v12.0.dll - - $(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll - - - + @@ -96,7 +88,7 @@ - - - + + + \ No newline at end of file diff --git a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/fakeframework.targets b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/fakeframework.targets index f1edbc68..79848e84 100644 --- a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/fakeframework.targets +++ b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/fakeframework.targets @@ -11,4 +11,5 @@ + \ No newline at end of file diff --git a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_complex_pack/a.csproj b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_complex_pack/a.csproj index cb2f55a4..d5d5b0b5 100644 --- a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_complex_pack/a.csproj +++ b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_complex_pack/a.csproj @@ -1,9 +1,9 @@ - + $(GuidA) - v4.5 + v4.7.2 A 1.0.0 diff --git a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_complex_pack/b.csproj b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_complex_pack/b.csproj index b22d47cb..e215828a 100644 --- a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_complex_pack/b.csproj +++ b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_complex_pack/b.csproj @@ -1,9 +1,9 @@ - + $(GuidB) - v4.5 + v4.7.2 B 2.0.0 diff --git a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_complex_pack/c.csproj b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_complex_pack/c.csproj index 4134e849..e9ef3711 100644 --- a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_complex_pack/c.csproj +++ b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_complex_pack/c.csproj @@ -1,5 +1,5 @@ - + $(GuidC) diff --git a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_complex_pack/d.csproj b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_complex_pack/d.csproj index a7ab3757..89c5573b 100644 --- a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_complex_pack/d.csproj +++ b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_complex_pack/d.csproj @@ -1,10 +1,11 @@ - - - - - $(GuidD) - .NETPortable,Version=v5.0 - v5.0 - - + + + netstandard1.6 + + + + $(GuidD) + false + + \ No newline at end of file diff --git a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_complex_pack/e.csproj b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_complex_pack/e.csproj index c982c525..4313cf91 100644 --- a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_complex_pack/e.csproj +++ b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_complex_pack/e.csproj @@ -1,5 +1,5 @@ - + $(GuidE) diff --git a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_custom_build_project/build.proj b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_custom_build_project/build.proj index c2a510dc..8e54f1a4 100644 --- a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_custom_build_project/build.proj +++ b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_custom_build_project/build.proj @@ -1,21 +1,21 @@ - - - - - $([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), NuGet.Build.Packaging.props)) - - $(MSBuildThisFileDirectory)..\..\..\NuGet.Build.Packaging.Tasks\bin\Debug - - + + + + $([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), NuGet.Build.Packaging.props)) + + $(MSBuildThisFileDirectory)..\..\NuGet.Build.Packaging.Tasks\bin\Debug + + - - build - 1.0.0 - NuGet - Package for '$(MSBuildProjectName)' project. - - - - - + + build + 1.0.0 + NuGet + Package for '$(MSBuildProjectName)' project. + + + + + + \ No newline at end of file diff --git a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_library_with_config_dependencies/a.csproj b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_library_with_config_dependencies/a.csproj deleted file mode 100644 index 79e72321..00000000 --- a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_library_with_config_dependencies/a.csproj +++ /dev/null @@ -1,90 +0,0 @@ - - - - - library - v4.5 - - - - packages\Microsoft.CodeAnalysis.Common.1.2.0\lib\net45\Microsoft.CodeAnalysis.dll - True - - - packages\Microsoft.CodeAnalysis.CSharp.1.2.0\lib\net45\Microsoft.CodeAnalysis.CSharp.dll - True - - - packages\Microsoft.CodeAnalysis.CSharp.Workspaces.1.2.0\lib\net45\Microsoft.CodeAnalysis.CSharp.Workspaces.dll - True - - - packages\Microsoft.CodeAnalysis.VisualBasic.1.2.0\lib\net45\Microsoft.CodeAnalysis.VisualBasic.dll - True - - - packages\Microsoft.CodeAnalysis.VisualBasic.Workspaces.1.2.0\lib\net45\Microsoft.CodeAnalysis.VisualBasic.Workspaces.dll - True - - - packages\Microsoft.CodeAnalysis.Workspaces.Common.1.2.0\lib\net45\Microsoft.CodeAnalysis.Workspaces.dll - True - - - packages\Microsoft.CodeAnalysis.Workspaces.Common.1.2.0\lib\net45\Microsoft.CodeAnalysis.Workspaces.Desktop.dll - True - - - packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll - True - - - - packages\System.Collections.Immutable.1.1.37\lib\dotnet\System.Collections.Immutable.dll - True - - - packages\Microsoft.Composition.1.0.27\lib\portable-net45+win8+wp8+wpa81\System.Composition.AttributedModel.dll - True - - - packages\Microsoft.Composition.1.0.27\lib\portable-net45+win8+wp8+wpa81\System.Composition.Convention.dll - True - - - packages\Microsoft.Composition.1.0.27\lib\portable-net45+win8+wp8+wpa81\System.Composition.Hosting.dll - True - - - packages\Microsoft.Composition.1.0.27\lib\portable-net45+win8+wp8+wpa81\System.Composition.Runtime.dll - True - - - packages\Microsoft.Composition.1.0.27\lib\portable-net45+win8+wp8+wpa81\System.Composition.TypedParts.dll - True - - - packages\System.Reflection.Metadata.1.2.0\lib\portable-net45+win8\System.Reflection.Metadata.dll - True - - - - - Designer - - - - - - - - - - - - <_CodeAnalysisDependency Include="@(PackageFile)" - Condition="'%(Kind)' == 'Dependency' And $([System.String]::new(%(Identity)).StartsWith('Microsoft.CodeAnalysis.'))" /> - - - - diff --git a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_library_with_config_dependencies/a.sln b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_library_with_config_dependencies/a.sln deleted file mode 100644 index 1c1e74da..00000000 --- a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_library_with_config_dependencies/a.sln +++ /dev/null @@ -1,19 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.25807.0 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "a", "a.csproj", "{AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA}.Debug|Any CPU.Build.0 = Debug|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_library_with_config_dependencies/packages.config b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_library_with_config_dependencies/packages.config deleted file mode 100644 index 23b55a14..00000000 --- a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_library_with_config_dependencies/packages.config +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_library_with_content/library_with_content.csproj b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_library_with_content/library_with_content.csproj index 38220a6a..a058df69 100644 --- a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_library_with_content/library_with_content.csproj +++ b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_library_with_content/library_with_content.csproj @@ -6,9 +6,7 @@ MonoAndroid,Version=v5.1 - - docs\Readme.txt - + cs any @@ -20,79 +18,31 @@ any any - - false - + - - true - + - - build - - - true - - - false - - - PreserveNewest - - - build - PreserveNewest - - - true - PreserveNewest - - - false - PreserveNewest - - - build - PreserveNewest - - - PreserveNewest - + + + + + + + + + - - build - - - true - - - false - - - PreserveNewest - - - build - PreserveNewest - - - true - PreserveNewest - - - false - PreserveNewest - - - build - PreserveNewest - - - PreserveNewest - + + + + + + + + + diff --git a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_library_with_json_dependencies/a.csproj b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_library_with_json_dependencies/a.csproj deleted file mode 100644 index 2a29ba1e..00000000 --- a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_library_with_json_dependencies/a.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - - library - v4.5 - - - - - - - - - - - \ No newline at end of file diff --git a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_library_with_json_dependencies/project.json b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_library_with_json_dependencies/project.json deleted file mode 100644 index a137e901..00000000 --- a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_library_with_json_dependencies/project.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "dependencies": { - "Newtonsoft.Json": "8.0.3", - "Microsoft.CodeAnalysis": "1.3.2", - "IFluentInterface": "2.0.3" - }, - "frameworks": { - "net45": {} - }, - "runtimes": { - "win": {} - } -} \ No newline at end of file diff --git a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_library_with_non_nugetized_reference/a.csproj b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_library_with_non_nugetized_reference/a.csproj index 91dc8eb4..d7334cf9 100644 --- a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_library_with_non_nugetized_reference/a.csproj +++ b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_library_with_non_nugetized_reference/a.csproj @@ -10,7 +10,7 @@ $(GuidB) b - $(IncludeInPackage) + $(IncludeInPackage) $(GuidC) diff --git a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_library_with_non_nugetized_reference/b/b.csproj b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_library_with_non_nugetized_reference/b/b.csproj index feaed349..8e050ade 100644 --- a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_library_with_non_nugetized_reference/b/b.csproj +++ b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_library_with_non_nugetized_reference/b/b.csproj @@ -1,5 +1,5 @@  - + $(GuidB) diff --git a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_library_with_non_nugetized_reference/c.csproj b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_library_with_non_nugetized_reference/c.csproj index b3907b2f..19f7ef24 100644 --- a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_library_with_non_nugetized_reference/c.csproj +++ b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_library_with_non_nugetized_reference/c.csproj @@ -1,5 +1,5 @@ - + $(GuidC) diff --git a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_library_with_non_nugetized_reference/d.csproj b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_library_with_non_nugetized_reference/d.csproj index 335bdc4d..2b245133 100644 --- a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_library_with_non_nugetized_reference/d.csproj +++ b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_library_with_non_nugetized_reference/d.csproj @@ -1,5 +1,5 @@ - + $(GuidD) diff --git a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_library_with_project_reference/a.csproj b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_library_with_project_reference/a.csproj index 11db149a..e944f000 100644 --- a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_library_with_project_reference/a.csproj +++ b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_library_with_project_reference/a.csproj @@ -8,7 +8,7 @@ $(GuidB) b - $(IncludeInPackage) + $(IncludeInPackage) diff --git a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_multi_platform_solution/android/forms.android.csproj b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_multi_platform_solution/android/forms.android.csproj index cf2a92e8..4fcd280b 100644 --- a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_multi_platform_solution/android/forms.android.csproj +++ b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_multi_platform_solution/android/forms.android.csproj @@ -1,12 +1,10 @@ - + Forms - Android,Version=v7.0 + MonoAndroid,Version=v9.0 $(GuidE) - bin - obj\ false diff --git a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_multi_platform_solution/common/common.csproj b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_multi_platform_solution/common/common.csproj index 13d64f76..271fcc59 100644 --- a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_multi_platform_solution/common/common.csproj +++ b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_multi_platform_solution/common/common.csproj @@ -1,18 +1,15 @@ - - - - - Common - $(GuidF) - true - v5.0 - bin - obj\ - false - - - - - - + + + netstandard1.6 + + + + Common + $(GuidF) + bin + obj\ + false + + + \ No newline at end of file diff --git a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_multi_platform_solution/common/project.json b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_multi_platform_solution/common/project.json deleted file mode 100644 index db0f83d5..00000000 --- a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_multi_platform_solution/common/project.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "supports": {}, - "dependencies": { - "Microsoft.NETCore.Portable.Compatibility": "1.0.1", - "NETStandard.Library": "1.6.0" - }, - "frameworks": { - "netstandard1.5": {} - } -} \ No newline at end of file diff --git a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_multi_platform_solution/forms.proj b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_multi_platform_solution/forms.proj index d04740b4..f6f8584c 100644 --- a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_multi_platform_solution/forms.proj +++ b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_multi_platform_solution/forms.proj @@ -1,5 +1,5 @@ - + Forms @@ -9,13 +9,13 @@ true - + $(GuidB) - forms.pcl + common - + $(GuidC) - forms.net46 + forms.net $(GuidD) diff --git a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_multi_platform_solution/forms.sln b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_multi_platform_solution/forms.sln index 37d2d26c..89261b59 100644 --- a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_multi_platform_solution/forms.sln +++ b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_multi_platform_solution/forms.sln @@ -9,9 +9,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "common", "common\common.csp EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "forms.ios", "ios\forms.ios.csproj", "{DDDDDDDD-DDDD-DDDD-DDDD-DDDDDDDDDDDD}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "forms.net46", "net\forms.net46.csproj", "{CCCCCCCC-CCCC-CCCC-CCCC-CCCCCCCCCCCC}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "forms.pcl", "pcl\forms.pcl.csproj", "{BBBBBBBB-BBBB-BBBB-BBBB-BBBBBBBBBBBB}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "forms.net46", "net\forms.net.csproj", "{CCCCCCCC-CCCC-CCCC-CCCC-CCCCCCCCCCCC}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -26,8 +24,6 @@ Global {DDDDDDDD-DDDD-DDDD-DDDD-DDDDDDDDDDDD}.Debug|Any CPU.Build.0 = Debug|Any CPU {CCCCCCCC-CCCC-CCCC-CCCC-CCCCCCCCCCCC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {CCCCCCCC-CCCC-CCCC-CCCC-CCCCCCCCCCCC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BBBBBBBB-BBBB-BBBB-BBBB-BBBBBBBBBBBB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BBBBBBBB-BBBB-BBBB-BBBB-BBBBBBBBBBBB}.Debug|Any CPU.Build.0 = Debug|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_multi_platform_solution/ios/forms.ios.csproj b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_multi_platform_solution/ios/forms.ios.csproj index e8a40aaf..19566b53 100644 --- a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_multi_platform_solution/ios/forms.ios.csproj +++ b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_multi_platform_solution/ios/forms.ios.csproj @@ -1,12 +1,10 @@ - + Forms - iOS,Version=v1.0 - $(GuidD) - bin - obj\ + Xamarin.iOS,Version=v1.0 + $(GuidD) false diff --git a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_multi_platform_solution/net/forms.net46.csproj b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_multi_platform_solution/net/forms.net.csproj similarity index 80% rename from src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_multi_platform_solution/net/forms.net46.csproj rename to src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_multi_platform_solution/net/forms.net.csproj index 377af25e..fb332d5e 100644 --- a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_multi_platform_solution/net/forms.net46.csproj +++ b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_multi_platform_solution/net/forms.net.csproj @@ -1,9 +1,9 @@ - + Forms - v4.6 + v4.7.2 $(GuidC) bin obj\ diff --git a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_multi_platform_solution/pcl/forms.pcl.csproj b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_multi_platform_solution/pcl/forms.pcl.csproj deleted file mode 100644 index 6c6b1b44..00000000 --- a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_multi_platform_solution/pcl/forms.pcl.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - - Forms - $(GuidB) - true - v5.0 - bin - obj\ - false - - - - - - - \ No newline at end of file diff --git a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_multi_platform_solution/pcl/project.json b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_multi_platform_solution/pcl/project.json deleted file mode 100644 index db0f83d5..00000000 --- a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_multi_platform_solution/pcl/project.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "supports": {}, - "dependencies": { - "Microsoft.NETCore.Portable.Compatibility": "1.0.1", - "NETStandard.Library": "1.6.0" - }, - "frameworks": { - "netstandard1.5": {} - } -} \ No newline at end of file diff --git a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_packaging_project/b/b.csproj b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_packaging_project/b/b.csproj index b22bc735..85542301 100644 --- a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_packaging_project/b/b.csproj +++ b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_packaging_project/b/b.csproj @@ -1,5 +1,5 @@  - + $(GuidB) diff --git a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_packaging_project/c.csproj b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_packaging_project/c.csproj index b3907b2f..19f7ef24 100644 --- a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_packaging_project/c.csproj +++ b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_packaging_project/c.csproj @@ -1,5 +1,5 @@ - + $(GuidC) diff --git a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_packaging_project/d.csproj b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_packaging_project/d.csproj index 335bdc4d..2b245133 100644 --- a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_packaging_project/d.csproj +++ b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_packaging_project/d.csproj @@ -1,5 +1,5 @@ - + $(GuidD) diff --git a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_packaging_project/e.csproj b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_packaging_project/e.csproj index ff381f37..0f3ef846 100644 --- a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_packaging_project/e.csproj +++ b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_packaging_project/e.csproj @@ -1,5 +1,5 @@ - + $(GuidE) diff --git a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_packaging_project_with_reference_assembly/a.nuproj b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_packaging_project_with_reference_assembly/a.nuproj deleted file mode 100644 index 6fc51044..00000000 --- a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_packaging_project_with_reference_assembly/a.nuproj +++ /dev/null @@ -1,19 +0,0 @@ - - - - - v4.6 - a.package - 1.0.0 - - - - $(GuidB) - b - - - - - - - \ No newline at end of file diff --git a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_packaging_project_with_reference_assembly/b.sln b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_packaging_project_with_reference_assembly/b.sln deleted file mode 100644 index 45a1dc94..00000000 --- a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_packaging_project_with_reference_assembly/b.sln +++ /dev/null @@ -1,23 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.25420.1 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "b", "b\b.csproj", "{BBBBBBBB-BBBB-BBBB-BBBB-BBBBBBBBBBBB}" -EndProject -Project("{5DD5E4FA-CB73-4610-85AB-557B54E96AA9}") = "a", "a.nuproj", "{AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {BBBBBBBB-BBBB-BBBB-BBBB-BBBBBBBBBBBB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BBBBBBBB-BBBB-BBBB-BBBB-BBBBBBBBBBBB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA}.Debug|Any CPU.Build.0 = Debug|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_packaging_project_with_reference_assembly/b/MyClass.cs b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_packaging_project_with_reference_assembly/b/MyClass.cs deleted file mode 100644 index be0e0bf8..00000000 --- a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_packaging_project_with_reference_assembly/b/MyClass.cs +++ /dev/null @@ -1,7 +0,0 @@ - -namespace b -{ - public class MyClass - { - } -} \ No newline at end of file diff --git a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_packaging_project_with_reference_assembly/b/b.csproj b/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_packaging_project_with_reference_assembly/b/b.csproj deleted file mode 100644 index ae4530b8..00000000 --- a/src/Build/NuGet.Build.Packaging.Tests/Scenarios/given_a_packaging_project_with_reference_assembly/b/b.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - - $(GuidB) - v4.6 - $(AssemblyName).xml - - - - - - \ No newline at end of file diff --git a/src/Build/NuGet.Build.Packaging.Tests/TargetsTests.cs b/src/Build/NuGet.Build.Packaging.Tests/TargetsTests.cs index 1c736ba1..9ae257ee 100644 --- a/src/Build/NuGet.Build.Packaging.Tests/TargetsTests.cs +++ b/src/Build/NuGet.Build.Packaging.Tests/TargetsTests.cs @@ -4,13 +4,12 @@ using Microsoft.Build.Construction; using Microsoft.Build.Evaluation; using Microsoft.Build.Execution; -using Microsoft.Build.Framework; using Xunit; using Xunit.Abstractions; namespace NuGet.Build.Packaging { - public class TargetsTests + public class TargetsTests { ITestOutputHelper output; @@ -22,7 +21,7 @@ public void IncludeFrameworkReferencesInPackage_is_not_true_for_build_primary_ou var project = new Project("NuGet.Build.Packaging.targets", new Dictionary { { "PrimaryOutputKind", "build" } - }, "14.0"); + }, null); Assert.NotEqual("true", project.GetPropertyValue("IncludeFrameworkReferencesInPackage")); } @@ -33,7 +32,7 @@ public void IncludeFrameworkReferencesInPackage_is_not_true_for_tool_primary_out var project = new Project("NuGet.Build.Packaging.targets", new Dictionary { { "PrimaryOutputKind", "tool" } - }, "14.0"); + }, null); Assert.NotEqual("true", project.GetPropertyValue("IncludeFrameworkReferencesInPackage")); } @@ -44,7 +43,7 @@ public void IncludeFrameworkReferencesInPackage_is_not_true_for_tools_primary_ou var project = new Project("NuGet.Build.Packaging.targets", new Dictionary { { "PrimaryOutputKind", "tools" } - }, "14.0"); + }, null); Assert.NotEqual("true", project.GetPropertyValue("IncludeFrameworkReferencesInPackage")); } @@ -55,7 +54,7 @@ public void IncludeFrameworkReferencesInPackage_is_true_for_primary_output_lib() var project = new Project("NuGet.Build.Packaging.targets", new Dictionary { { "PrimaryOutputKind", "lib" } - }, "14.0"); + }, null); Assert.Equal("true", project.GetPropertyValue("IncludeFrameworkReferencesInPackage")); } @@ -65,7 +64,7 @@ public void IncludeFrameworkReferencesInPackage_is_true_for_default_primary_outp { var project = new Project("NuGet.Build.Packaging.targets", new Dictionary { - }, "14.0"); + }, null); Assert.Equal("true", project.GetPropertyValue("IncludeFrameworkReferencesInPackage")); } @@ -76,7 +75,7 @@ public void IncludeFrameworkReferencesInPackage_is_not_true_for_compat_istool() var project = new Project("NuGet.Build.Packaging.targets", new Dictionary { { "IsTool", "true" } - }, "14.0"); + }, null); Assert.NotEqual("true", project.GetPropertyValue("IncludeFrameworkReferencesInPackage")); } @@ -87,7 +86,7 @@ public void PackOnBuild_defaults_to_true_for_compat_GeneratePackageOnBuild_true( var project = new Project("NuGet.Build.Packaging.targets", new Dictionary { { "GeneratePackageOnBuild", "true" } - }, "14.0"); + }, null); Assert.Equal("true", project.GetPropertyValue("PackOnBuild")); } diff --git a/src/Build/NuGet.Build.Packaging.Tests/Utilities/ManifestContentFilesComparer.cs b/src/Build/NuGet.Build.Packaging.Tests/Utilities/ManifestContentFilesComparer.cs index ce7f6fa9..10bba742 100644 --- a/src/Build/NuGet.Build.Packaging.Tests/Utilities/ManifestContentFilesComparer.cs +++ b/src/Build/NuGet.Build.Packaging.Tests/Utilities/ManifestContentFilesComparer.cs @@ -1,11 +1,10 @@ using System; using System.Collections.Generic; using NuGet.Packaging; -using NuGet.Packaging.Core; namespace NuGet.Build.Packaging { - public class ManifestContentFilesComparer : IEqualityComparer + class ManifestContentFilesComparer : IEqualityComparer { public static ManifestContentFilesComparer Default { get; } = new ManifestContentFilesComparer(); diff --git a/src/Build/NuGet.Build.Packaging.Tests/Utilities/ManifestFileComparer.cs b/src/Build/NuGet.Build.Packaging.Tests/Utilities/ManifestFileComparer.cs index c5ee4b46..7d972c78 100644 --- a/src/Build/NuGet.Build.Packaging.Tests/Utilities/ManifestFileComparer.cs +++ b/src/Build/NuGet.Build.Packaging.Tests/Utilities/ManifestFileComparer.cs @@ -1,11 +1,10 @@ using System; using System.Collections.Generic; using NuGet.Packaging; -using NuGet.Packaging.Core; namespace NuGet.Build.Packaging { - public class ManifestFileComparer : IEqualityComparer + class ManifestFileComparer : IEqualityComparer { public static ManifestFileComparer Default { get; } = new ManifestFileComparer(); diff --git a/src/Build/NuGet.Build.Packaging.Tests/Utilities/MockBuildEngine.cs b/src/Build/NuGet.Build.Packaging.Tests/Utilities/MockBuildEngine.cs index a81c6579..9e90bf9a 100644 --- a/src/Build/NuGet.Build.Packaging.Tests/Utilities/MockBuildEngine.cs +++ b/src/Build/NuGet.Build.Packaging.Tests/Utilities/MockBuildEngine.cs @@ -10,7 +10,7 @@ namespace Microsoft.Build.Framework /// Fake build engine for unit testing Tasks without spinning up /// MSBuild. /// - public class MockBuildEngine : IBuildEngine + class MockBuildEngine : IBuildEngine { bool trace = false; ITestOutputHelper output; diff --git a/src/Build/NuGet.Build.Packaging.Tests/Utilities/PackageDependencyComparer.cs b/src/Build/NuGet.Build.Packaging.Tests/Utilities/PackageDependencyComparer.cs index e4724cc6..3045db78 100644 --- a/src/Build/NuGet.Build.Packaging.Tests/Utilities/PackageDependencyComparer.cs +++ b/src/Build/NuGet.Build.Packaging.Tests/Utilities/PackageDependencyComparer.cs @@ -4,7 +4,7 @@ namespace NuGet.Build.Packaging { - public class PackageDependencyComparer : IEqualityComparer + class PackageDependencyComparer : IEqualityComparer { public static PackageDependencyComparer Default { get; } = new PackageDependencyComparer(); diff --git a/src/Build/NuGet.Build.Packaging.Tests/Utilities/PackageDependencyGroupComparer.cs b/src/Build/NuGet.Build.Packaging.Tests/Utilities/PackageDependencyGroupComparer.cs index fb38b74e..27cc430b 100644 --- a/src/Build/NuGet.Build.Packaging.Tests/Utilities/PackageDependencyGroupComparer.cs +++ b/src/Build/NuGet.Build.Packaging.Tests/Utilities/PackageDependencyGroupComparer.cs @@ -5,7 +5,7 @@ namespace NuGet.Build.Packaging { - public class PackageDependencyGroupComparer : IEqualityComparer + class PackageDependencyGroupComparer : IEqualityComparer { public static PackageDependencyGroupComparer Default { get; } = new PackageDependencyGroupComparer(); diff --git a/src/Build/NuGet.Build.Packaging.Tests/Utilities/TargetFrameworks.cs b/src/Build/NuGet.Build.Packaging.Tests/Utilities/TargetFrameworks.cs index 8f0886b9..86fcb725 100644 --- a/src/Build/NuGet.Build.Packaging.Tests/Utilities/TargetFrameworks.cs +++ b/src/Build/NuGet.Build.Packaging.Tests/Utilities/TargetFrameworks.cs @@ -1,12 +1,6 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace NuGet.Build.Packaging +namespace NuGet.Build.Packaging { - public static class TargetFrameworks + static class TargetFrameworks { public const string NET45 = ".NETFramework,Version=v4.5"; public const string NET46 = ".NETFramework,Version=v4.6"; diff --git a/src/Build/NuGet.Build.Packaging.Tests/Utilities/TaskItemExtensions.cs b/src/Build/NuGet.Build.Packaging.Tests/Utilities/TaskItemExtensions.cs index 75ed6c9b..7a718b93 100644 --- a/src/Build/NuGet.Build.Packaging.Tests/Utilities/TaskItemExtensions.cs +++ b/src/Build/NuGet.Build.Packaging.Tests/Utilities/TaskItemExtensions.cs @@ -1,15 +1,9 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Microsoft.Build.Framework; +using Microsoft.Build.Framework; using NuGet.Packaging; -using Xunit; namespace NuGet.Build.Packaging { - public static class TaskItemExtensions + static class TaskItemExtensions { /// /// Checks if the given item has metadata key/values matching the diff --git a/src/Build/NuGet.Build.Packaging.Tests/Utilities/TestOutputLogger.cs b/src/Build/NuGet.Build.Packaging.Tests/Utilities/TestOutputLogger.cs index 5f71071d..6fd4dad7 100644 --- a/src/Build/NuGet.Build.Packaging.Tests/Utilities/TestOutputLogger.cs +++ b/src/Build/NuGet.Build.Packaging.Tests/Utilities/TestOutputLogger.cs @@ -5,7 +5,7 @@ /// /// xunit logger > MSBuild logger /// -public class TestOutputLogger : ILogger +class TestOutputLogger : ILogger { ITestOutputHelper output; diff --git a/src/Build/NuGet.Build.Packaging.Tests/UtilitiesTests.cs b/src/Build/NuGet.Build.Packaging.Tests/UtilitiesTests.cs index af5aa232..92fc9b26 100644 --- a/src/Build/NuGet.Build.Packaging.Tests/UtilitiesTests.cs +++ b/src/Build/NuGet.Build.Packaging.Tests/UtilitiesTests.cs @@ -1,20 +1,11 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.Versioning; -using System.Text; -using System.Threading.Tasks; +using System.Runtime.Versioning; using Microsoft.Build.Utilities; -using Newtonsoft.Json.Linq; -using NuGet.Build.Packaging.Tasks; -using NuGet.Frameworks; -using NuGet.ProjectManagement; using Xunit; using Metadata = System.Collections.Generic.Dictionary; namespace NuGet.Build.Packaging { - public class UtilitiesTests + public class UtilitiesTests { [Fact] public void when_getting_target_framework_then_fallback_to_tfm() diff --git a/src/Build/NuGet.Build.Packaging.Tests/given_a_complex_pack.cs b/src/Build/NuGet.Build.Packaging.Tests/given_a_complex_pack.cs index d2154505..03765df2 100644 --- a/src/Build/NuGet.Build.Packaging.Tests/given_a_complex_pack.cs +++ b/src/Build/NuGet.Build.Packaging.Tests/given_a_complex_pack.cs @@ -1,24 +1,23 @@ using System.Linq; using Microsoft.Build.Execution; -using Microsoft.Build.Framework; -using NuGet.Build.Packaging.Tasks; using NuGet.Frameworks; -using NuGet.Packaging; using Xunit; using Xunit.Abstractions; namespace NuGet.Build.Packaging { - public class given_a_complex_pack + public class given_a_complex_pack { ITestOutputHelper output; public given_a_complex_pack(ITestOutputHelper output) { this.output = output; - } + Builder.BuildScenario(nameof(given_a_complex_pack), target: "Restore", output: output) + .AssertSuccess(output); + } - [Fact] + [Fact] public void when_getting_package_target_path_then_gets_package_metadata() { var result = Builder.BuildScenario(nameof(given_a_complex_pack), new { Configuration = "Release" }, projectName: "a", target: "GetPackageTargetPath", output: output); @@ -42,19 +41,19 @@ public void when_preparing_a_then_contains_assemblies_and_direct_dependency() Assert.Contains(result.Items, item => item.Matches(new { - PackagePath = @"lib\net45\a.dll", + PackagePath = @"lib\net472\a.dll", })); Assert.Contains(result.Items, item => item.Matches(new { - PackagePath = @"lib\net45\a.xml", + PackagePath = @"lib\net472\a.xml", })); Assert.Contains(result.Items, item => item.Matches(new { - PackagePath = @"lib\net45\e.dll", + PackagePath = @"lib\net472\e.dll", })); Assert.Contains(result.Items, item => item.Matches(new { - PackagePath = @"lib\net45\e.xml", + PackagePath = @"lib\net472\e.xml", })); Assert.Contains(result.Items, item => item.Matches(new { @@ -78,19 +77,19 @@ public void when_preparing_b_then_contains_assemblies_and_direct_dependency() Assert.Contains(result.Items, item => item.Matches(new { - PackagePath = @"lib\net45\b.dll", + PackagePath = @"lib\net472\b.dll", })); Assert.Contains(result.Items, item => item.Matches(new { - PackagePath = @"lib\net45\b.xml", + PackagePath = @"lib\net472\b.xml", })); Assert.Contains(result.Items, item => item.Matches(new { - PackagePath = @"lib\net45\d.dll", + PackagePath = @"lib\net472\d.dll", })); Assert.Contains(result.Items, item => item.Matches(new { - PackagePath = @"lib\net45\d.xml", + PackagePath = @"lib\net472\d.xml", })); Assert.Contains(result.Items, item => item.Matches(new { @@ -165,13 +164,13 @@ public void when_packing_a_then_contains_assemblies_and_direct_dependency() var manifest = result.Items[0].GetManifest(); - Assert.Contains(manifest.Files, file => file.Target == @"lib\net45\a.dll"); - Assert.Contains(manifest.Files, file => file.Target == @"lib\net45\a.xml"); - Assert.Contains(manifest.Files, file => file.Target == @"lib\net45\e.dll"); - Assert.Contains(manifest.Files, file => file.Target == @"lib\net45\e.xml"); + Assert.Contains(manifest.Files, file => file.Target == @"lib\net472\a.dll"); + Assert.Contains(manifest.Files, file => file.Target == @"lib\net472\a.xml"); + Assert.Contains(manifest.Files, file => file.Target == @"lib\net472\e.dll"); + Assert.Contains(manifest.Files, file => file.Target == @"lib\net472\e.xml"); Assert.Contains(manifest.Metadata.DependencyGroups, group => - group.TargetFramework.Equals(NuGetFramework.Parse("net45")) && + group.TargetFramework.Equals(NuGetFramework.Parse("net472")) && group.Packages.Any(dep => dep.Id == "B" && dep.VersionRange.OriginalString == "2.0.0")); } @@ -184,13 +183,13 @@ public void when_packing_b_then_contains_assemblies_and_direct_dependency() var manifest = result.Items[0].GetManifest(); - Assert.Contains(manifest.Files, file => file.Target == @"lib\net45\b.dll"); - Assert.Contains(manifest.Files, file => file.Target == @"lib\net45\b.xml"); - Assert.Contains(manifest.Files, file => file.Target == @"lib\net45\d.dll"); - Assert.Contains(manifest.Files, file => file.Target == @"lib\net45\d.xml"); + Assert.Contains(manifest.Files, file => file.Target == @"lib\net472\b.dll"); + Assert.Contains(manifest.Files, file => file.Target == @"lib\net472\b.xml"); + Assert.Contains(manifest.Files, file => file.Target == @"lib\net472\d.dll"); + Assert.Contains(manifest.Files, file => file.Target == @"lib\net472\d.xml"); Assert.Contains(manifest.Metadata.DependencyGroups, group => - group.TargetFramework.Equals(NuGetFramework.Parse("net45")) && + group.TargetFramework.Equals(NuGetFramework.Parse("net472")) && group.Packages.Any(dep => dep.Id == "C" && dep.VersionRange.OriginalString == "3.0.0")); } diff --git a/src/Build/NuGet.Build.Packaging.Tests/given_a_custom_build_project.cs b/src/Build/NuGet.Build.Packaging.Tests/given_a_custom_build_project.cs index 3e608742..72f407c6 100644 --- a/src/Build/NuGet.Build.Packaging.Tests/given_a_custom_build_project.cs +++ b/src/Build/NuGet.Build.Packaging.Tests/given_a_custom_build_project.cs @@ -1,11 +1,9 @@ -using System.Linq; -using Microsoft.Build.Execution; -using Xunit; +using Xunit; using Xunit.Abstractions; namespace NuGet.Build.Packaging { - public class given_a_custom_build_project + public class given_a_custom_build_project { ITestOutputHelper output; diff --git a/src/Build/NuGet.Build.Packaging.Tests/given_a_library_with_config_dependencies.cs b/src/Build/NuGet.Build.Packaging.Tests/given_a_library_with_config_dependencies.cs deleted file mode 100644 index 846ee029..00000000 --- a/src/Build/NuGet.Build.Packaging.Tests/given_a_library_with_config_dependencies.cs +++ /dev/null @@ -1,106 +0,0 @@ -using System.Linq; -using Microsoft.Build.Execution; -using Microsoft.Build.Framework; -using Xunit; -using Xunit.Abstractions; - -namespace NuGet.Build.Packaging -{ - public class given_a_library_with_config_dependencies - { - ITestOutputHelper output; - - public given_a_library_with_config_dependencies(ITestOutputHelper output) - { - this.output = output; - } - - [Fact] - public void when_getting_package_contents_then_does_not_contain_development_dependency() - { - var result = Builder.BuildScenario(nameof(given_a_library_with_config_dependencies), output: output); - - result.AssertSuccess(output); - - Assert.DoesNotContain(result.Items, item => item.Matches(new - { - Kind = PackageItemKind.Dependency, - Identity = "IFluentInterface", - })); - } - - [Fact] - public void when_getting_package_contents_then_can_remove_arbitrary_dependencies() - { - var result = Builder.BuildScenario(nameof(given_a_library_with_config_dependencies), output: output); - - result.AssertSuccess(output); - - Assert.DoesNotContain(result.Items, item => item.Matches(new - { - Kind = PackageItemKind.Dependency, - Identity = "Microsoft.CodeAnalysis.Analyzers", - })); - Assert.DoesNotContain(result.Items, item => item.Matches(new - { - Kind = PackageItemKind.Dependency, - Identity = "Microsoft.CodeAnalysis.Common", - })); - Assert.DoesNotContain(result.Items, item => item.Matches(new - { - Kind = PackageItemKind.Dependency, - Identity = "Microsoft.CodeAnalysis.CSharp", - })); - Assert.DoesNotContain(result.Items, item => item.Matches(new - { - Kind = PackageItemKind.Dependency, - Identity = "Microsoft.CodeAnalysis.CSharp.Workspaces", - })); - Assert.DoesNotContain(result.Items, item => item.Matches(new - { - Kind = PackageItemKind.Dependency, - Identity = "Microsoft.CodeAnalysis.VisualBasic", - })); - Assert.DoesNotContain(result.Items, item => item.Matches(new - { - Kind = PackageItemKind.Dependency, - Identity = "Microsoft.CodeAnalysis.VisualBasic.Workspaces", - })); - Assert.DoesNotContain(result.Items, item => item.Matches(new - { - Kind = PackageItemKind.Dependency, - Identity = "Microsoft.CodeAnalysis.Workspaces.Common", - })); - } - - [Fact] - public void when_getting_package_contents_then_contains_package_reference_to_nuget() - { - var result = Builder.BuildScenario(nameof(given_a_library_with_config_dependencies), output: output); - - result.AssertSuccess(output); - - Assert.Contains(result.Items, item => item.Matches(new - { - Kind = PackageItemKind.Dependency, - Identity = "Newtonsoft.Json", - })); - } - - [Fact] - public void when_not_inferring_legacy_package_references_then_does_not_contain_package_reference_to_nuget() - { - var result = Builder.BuildScenario(nameof(given_a_library_with_config_dependencies), - properties: new { InferLegacyPackageReferences = false }, - output: output); - - result.AssertSuccess(output); - - Assert.DoesNotContain(result.Items, item => item.Matches(new - { - Kind = PackageItemKind.Dependency, - Identity = "Newtonsoft.Json", - })); - } - } -} diff --git a/src/Build/NuGet.Build.Packaging.Tests/given_a_library_with_content.cs b/src/Build/NuGet.Build.Packaging.Tests/given_a_library_with_content.cs index a4af60e1..755b7143 100644 --- a/src/Build/NuGet.Build.Packaging.Tests/given_a_library_with_content.cs +++ b/src/Build/NuGet.Build.Packaging.Tests/given_a_library_with_content.cs @@ -1,13 +1,11 @@ using System.IO; -using System.Linq; using Microsoft.Build.Execution; -using NuGet.Build.Packaging.Properties; using Xunit; using Xunit.Abstractions; namespace NuGet.Build.Packaging { - public class given_a_library_with_content + public class given_a_library_with_content { ITestOutputHelper output; @@ -166,7 +164,7 @@ public void content_no_copy_with_contentFiles_dir_fails() }); Assert.Equal(TargetResultCode.Failure, result.ResultCode); - Assert.True(result.Logger.Errors.Any(e => e.Code == nameof(Strings.ErrorCode.NG0013))); + Assert.Contains(result.Logger.Errors, e => e.Code == nameof(ThisAssembly.Strings.ErrorCode.NG0013)); } [Fact] diff --git a/src/Build/NuGet.Build.Packaging.Tests/given_a_library_with_json_dependencies.cs b/src/Build/NuGet.Build.Packaging.Tests/given_a_library_with_json_dependencies.cs deleted file mode 100644 index 46f5af17..00000000 --- a/src/Build/NuGet.Build.Packaging.Tests/given_a_library_with_json_dependencies.cs +++ /dev/null @@ -1,72 +0,0 @@ -using System.Linq; -using Microsoft.Build.Execution; -using Microsoft.Build.Framework; -using Xunit; -using Xunit.Abstractions; - -namespace NuGet.Build.Packaging -{ - public class given_a_library_with_json_dependencies - { - ITestOutputHelper output; - - public given_a_library_with_json_dependencies(ITestOutputHelper output) - { - this.output = output; - } - - [Fact] - public void when_getting_package_contents_then_can_remove_development_dependency() - { - var result = Builder.BuildScenario(nameof(given_a_library_with_json_dependencies), output: output); - - result.AssertSuccess(output); - - Assert.DoesNotContain(result.Items, item => item.Matches(new - { - Kind = PackageItemKind.Dependency, - Identity = "IFluentInterface", - })); - } - - [Fact] - public void when_getting_package_contents_then_contains_package_reference_to_nuget() - { - var result = Builder.BuildScenario(nameof(given_a_library_with_json_dependencies), output: output); - - result.AssertSuccess(output); - - Assert.Contains(result.Items, item => item.Matches(new - { - Kind = PackageItemKind.Dependency, - Identity = "Newtonsoft.Json", - })); - Assert.Contains(result.Items, item => item.Matches(new - { - Kind = PackageItemKind.Dependency, - Identity = "Microsoft.CodeAnalysis", - })); - } - - [Fact] - public void when_not_inferring_legacy_package_references_then_does_not_contain_package_reference_to_nuget() - { - var result = Builder.BuildScenario(nameof(given_a_library_with_config_dependencies), - properties: new { InferLegacyPackageReferences = false }, - output: output); - - result.AssertSuccess(output); - - Assert.DoesNotContain(result.Items, item => item.Matches(new - { - Kind = PackageItemKind.Dependency, - Identity = "Newtonsoft.Json", - })); - Assert.DoesNotContain(result.Items, item => item.Matches(new - { - Kind = PackageItemKind.Dependency, - Identity = "Microsoft.CodeAnalysis", - })); - } - } -} diff --git a/src/Build/NuGet.Build.Packaging.Tests/given_a_library_with_non_nugetized_reference.cs b/src/Build/NuGet.Build.Packaging.Tests/given_a_library_with_non_nugetized_reference.cs index e388a2cf..e32cfd14 100644 --- a/src/Build/NuGet.Build.Packaging.Tests/given_a_library_with_non_nugetized_reference.cs +++ b/src/Build/NuGet.Build.Packaging.Tests/given_a_library_with_non_nugetized_reference.cs @@ -1,17 +1,10 @@ -using System; -using System.Linq; -using System.Reflection; -using System.Threading; -using Microsoft.Build.Execution; -using Microsoft.Build.Framework; -using NuGet.Build.Packaging.Tasks; +using Microsoft.Build.Execution; using Xunit; using Xunit.Abstractions; -using Xunit.Sdk; namespace NuGet.Build.Packaging { - public class given_a_library_with_non_nugetized_reference + public class given_a_library_with_non_nugetized_reference { ITestOutputHelper output; diff --git a/src/Build/NuGet.Build.Packaging.Tests/given_a_library_with_private_assets_reference.cs b/src/Build/NuGet.Build.Packaging.Tests/given_a_library_with_private_assets_reference.cs index eca97122..86ab0c4e 100644 --- a/src/Build/NuGet.Build.Packaging.Tests/given_a_library_with_private_assets_reference.cs +++ b/src/Build/NuGet.Build.Packaging.Tests/given_a_library_with_private_assets_reference.cs @@ -1,12 +1,9 @@ -using System.Linq; -using Microsoft.Build.Execution; -using Microsoft.Build.Framework; -using Xunit; +using Xunit; using Xunit.Abstractions; namespace NuGet.Build.Packaging { - public class given_a_library_with_private_assets_reference + public class given_a_library_with_private_assets_reference { ITestOutputHelper output; diff --git a/src/Build/NuGet.Build.Packaging.Tests/given_a_localized_library.cs b/src/Build/NuGet.Build.Packaging.Tests/given_a_localized_library.cs index c9cd2384..871b734a 100644 --- a/src/Build/NuGet.Build.Packaging.Tests/given_a_localized_library.cs +++ b/src/Build/NuGet.Build.Packaging.Tests/given_a_localized_library.cs @@ -1,11 +1,10 @@ using System.Linq; -using Microsoft.Build.Execution; using Xunit; using Xunit.Abstractions; namespace NuGet.Build.Packaging { - public class given_a_localized_library + public class given_a_localized_library { ITestOutputHelper output; @@ -21,7 +20,7 @@ public void when_getting_package_contents_then_contains_localized_resources() result.AssertSuccess(output); - Assert.True(result.Items.Any(i => i.GetMetadata("PackagePath") == "lib\\net45\\es-AR\\library.resources.dll")); + Assert.Contains(result.Items, i => i.GetMetadata("PackagePath") == "lib\\net45\\es-AR\\library.resources.dll"); } } } diff --git a/src/Build/NuGet.Build.Packaging.Tests/given_a_multi_platform_solution.cs b/src/Build/NuGet.Build.Packaging.Tests/given_a_multi_platform_solution.cs index 48eccbc7..e3e578a1 100644 --- a/src/Build/NuGet.Build.Packaging.Tests/given_a_multi_platform_solution.cs +++ b/src/Build/NuGet.Build.Packaging.Tests/given_a_multi_platform_solution.cs @@ -1,24 +1,20 @@ -using System.Linq; -using Microsoft.Build.Execution; -using Microsoft.Build.Framework; -using NuGet.Build.Packaging.Tasks; -using NuGet.Frameworks; -using NuGet.Packaging; -using Xunit; +using Xunit; using Xunit.Abstractions; namespace NuGet.Build.Packaging { - public class given_a_multi_platform_solution + public class given_a_multi_platform_solution { ITestOutputHelper output; public given_a_multi_platform_solution(ITestOutputHelper output) { this.output = output; - } + Builder.BuildScenario(nameof(given_a_multi_platform_solution), target: "Restore", output: output) + .AssertSuccess(output); + } - [Fact] + [Fact] public void then_includes_primary_output_from_platforms() { var result = Builder.BuildScenario(nameof(given_a_multi_platform_solution), output: output); @@ -27,15 +23,15 @@ public void then_includes_primary_output_from_platforms() Assert.Contains(result.Items, item => item.Matches(new { - PackagePath = @"lib\net46\Forms.dll" + PackagePath = @"lib\net472\Forms.dll" })); Assert.Contains(result.Items, item => item.Matches(new { - PackagePath = @"lib\ios10\Forms.dll" + PackagePath = @"lib\xamarinios10\Forms.dll" })); Assert.Contains(result.Items, item => item.Matches(new { - PackagePath = @"lib\android70\Forms.dll" + PackagePath = @"lib\monoandroid90\Forms.dll" })); } @@ -48,16 +44,16 @@ public void then_includes_direct_dependency_from_platforms() Assert.Contains(result.Items, item => item.Matches(new { - PackagePath = @"lib\net46\Common.dll" - })); + PackagePath = @"lib\net472\Common.dll" + })); Assert.Contains(result.Items, item => item.Matches(new { - PackagePath = @"lib\ios10\Common.dll" - })); + PackagePath = @"lib\xamarinios10\Common.dll" + })); Assert.Contains(result.Items, item => item.Matches(new { - PackagePath = @"lib\android70\Common.dll" - })); + PackagePath = @"lib\monoandroid90\Common.dll" + })); } [Fact] @@ -69,16 +65,16 @@ public void then_includes_platform_and_language_quickstart_content() Assert.Contains(result.Items, item => item.Matches(new { - PackagePath = @"contentFiles\cs\android70\quickstart\sample.cs" - })); + PackagePath = @"contentFiles\cs\monoandroid90\quickstart\sample.cs" + })); Assert.Contains(result.Items, item => item.Matches(new { - PackagePath = @"contentFiles\vb\android70\quickstart\sample.vb" - })); + PackagePath = @"contentFiles\vb\monoandroid90\quickstart\sample.vb" + })); Assert.Contains(result.Items, item => item.Matches(new { - PackagePath = @"contentFiles\fs\android70\quickstart\sample.fs" - })); + PackagePath = @"contentFiles\fs\monoandroid90\quickstart\sample.fs" + })); } [Fact] diff --git a/src/Build/NuGet.Build.Packaging.Tests/given_a_packaging_project.cs b/src/Build/NuGet.Build.Packaging.Tests/given_a_packaging_project.cs index f2dda5f9..f97497cd 100644 --- a/src/Build/NuGet.Build.Packaging.Tests/given_a_packaging_project.cs +++ b/src/Build/NuGet.Build.Packaging.Tests/given_a_packaging_project.cs @@ -1,16 +1,9 @@ -using System.Linq; -using System.Reflection; -using System.Threading; -using Microsoft.Build.Execution; -using Microsoft.Build.Framework; -using NuGet.Build.Packaging.Tasks; -using Xunit; +using Xunit; using Xunit.Abstractions; -using Xunit.Sdk; namespace NuGet.Build.Packaging { - public class given_a_packaging_project + public class given_a_packaging_project { ITestOutputHelper output; diff --git a/src/Build/NuGet.Build.Packaging.Tests/given_a_packaging_project_with_netstandard.cs b/src/Build/NuGet.Build.Packaging.Tests/given_a_packaging_project_with_netstandard.cs index c7a8bf15..5cb82f1f 100644 --- a/src/Build/NuGet.Build.Packaging.Tests/given_a_packaging_project_with_netstandard.cs +++ b/src/Build/NuGet.Build.Packaging.Tests/given_a_packaging_project_with_netstandard.cs @@ -1,12 +1,11 @@ -using System.Diagnostics; -using Xunit; +using Xunit; using Xunit.Abstractions; namespace NuGet.Build.Packaging { - // NOTE: not added to the main project because it's built using MSBuild 14 and it's not working - // by adding binding redirects, appdomain isolation, etc. :( - public class given_a_packaging_project_with_netstandard + // NOTE: not added to the main project because it's built using MSBuild 14 and it's not working + // by adding binding redirects, appdomain isolation, etc. :( + public class given_a_packaging_project_with_netstandard { ITestOutputHelper output; diff --git a/src/Build/NuGet.Build.Packaging.Tests/given_a_packaging_project_with_reference_assembly.cs b/src/Build/NuGet.Build.Packaging.Tests/given_a_packaging_project_with_reference_assembly.cs deleted file mode 100644 index adc037b4..00000000 --- a/src/Build/NuGet.Build.Packaging.Tests/given_a_packaging_project_with_reference_assembly.cs +++ /dev/null @@ -1,37 +0,0 @@ -using Xunit; -using Xunit.Abstractions; - -namespace NuGet.Build.Packaging -{ - public class given_a_packaging_project_with_reference_assembly - { - ITestOutputHelper output; - - public given_a_packaging_project_with_reference_assembly(ITestOutputHelper output) - { - this.output = output; - } - - [Fact] - public void when_getting_contents_then_includes_reference_assembly() - { - var result = Builder.BuildScenario(nameof(given_a_packaging_project_with_reference_assembly), target: "GetPackageContents", output: output); - - result.AssertSuccess(output); - - Assert.Contains(result.Items, item => item.Matches(new - { - PackagePath = @"lib\portable45-net45+win8+wp8+wpa81\b.dll", - })); - Assert.Contains(result.Items, item => item.Matches(new - { - Kind = PackageItemKind.Lib, - Identity = @"obj\a\Profile259\bin\b.dll", - })); - Assert.Contains(result.Items, item => item.Matches(new - { - PackagePath = @"lib\net46\b.dll", - })); - } - } -} diff --git a/src/Build/NuGet.Build.Packaging.Tests/given_an_empty_library_project.cs b/src/Build/NuGet.Build.Packaging.Tests/given_an_empty_library_project.cs index f8735968..f94b2d2d 100644 --- a/src/Build/NuGet.Build.Packaging.Tests/given_an_empty_library_project.cs +++ b/src/Build/NuGet.Build.Packaging.Tests/given_an_empty_library_project.cs @@ -1,11 +1,10 @@ -using System.Linq; -using Microsoft.Build.Execution; +using Microsoft.Build.Execution; using Xunit; using Xunit.Abstractions; namespace NuGet.Build.Packaging { - public class given_an_empty_library_project + public class given_an_empty_library_project { ITestOutputHelper output; diff --git a/src/Build/NuGet.Build.Packaging.Tests/given_duplicate_package_files.cs b/src/Build/NuGet.Build.Packaging.Tests/given_duplicate_package_files.cs index 05493fae..c351a905 100644 --- a/src/Build/NuGet.Build.Packaging.Tests/given_duplicate_package_files.cs +++ b/src/Build/NuGet.Build.Packaging.Tests/given_duplicate_package_files.cs @@ -64,7 +64,7 @@ public void real_duplicates_fail() // A distinct Readme.txt is generated by a.csproj and b.csproj but both have the // same PackagePath so we can't disambiguate after hashing the contents. - Assert.True(result.Logger.Errors.Any(e => e.Message.Contains("Readme.txt"))); + Assert.Contains(result.Logger.Errors, e => e.Message.Contains("Readme.txt")); } } } \ No newline at end of file diff --git a/src/Build/NuGet.Build.Packaging.sln b/src/Build/NuGet.Build.Packaging.sln deleted file mode 100644 index bffa5833..00000000 --- a/src/Build/NuGet.Build.Packaging.sln +++ /dev/null @@ -1,52 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26602.0 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NuGet.Build.Packaging.Tasks", "NuGet.Build.Packaging.Tasks\NuGet.Build.Packaging.Tasks.csproj", "{A3D231D7-31E4-4A70-8CD1-7246C7D069F6}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{BD16CBB5-BD47-4CC3-A9FD-7F1B9077455D}" - ProjectSection(SolutionItems) = preProject - ..\..\.editorconfig = ..\..\.editorconfig - ..\..\appveyor.yml = ..\..\appveyor.yml - ..\..\build.cmd = ..\..\build.cmd - ..\..\build.proj = ..\..\build.proj - ..\..\GitInfo.txt = ..\..\GitInfo.txt - ..\GlobalAssemblyInfo.cs = ..\GlobalAssemblyInfo.cs - ..\NuGet.Build.Packaging.Shared.props = ..\NuGet.Build.Packaging.Shared.props - ..\NuGet.Build.Packaging.Shared.targets = ..\NuGet.Build.Packaging.Shared.targets - NuGet.Build.Packaging.Tasks.Shared.targets = NuGet.Build.Packaging.Tasks.Shared.targets - ..\NuGet.Config = ..\NuGet.Config - ..\..\packages.config = ..\..\packages.config - ..\PackageVersion.targets = ..\PackageVersion.targets - EndProjectSection -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NuGet.Build.Packaging.Tests", "NuGet.Build.Packaging.Tests\NuGet.Build.Packaging.Tests.csproj", "{212952C3-22F5-4263-BF9B-B17316B3B3CA}" - ProjectSection(ProjectDependencies) = postProject - {A3D231D7-31E4-4A70-8CD1-7246C7D069F6} = {A3D231D7-31E4-4A70-8CD1-7246C7D069F6} - EndProjectSection -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ApiIntersect", "..\..\external\ApiIntersect\ApiIntersect\ApiIntersect.csproj", "{CD767D93-6C99-4D6A-A303-3C139A73400E}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {A3D231D7-31E4-4A70-8CD1-7246C7D069F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A3D231D7-31E4-4A70-8CD1-7246C7D069F6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A3D231D7-31E4-4A70-8CD1-7246C7D069F6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A3D231D7-31E4-4A70-8CD1-7246C7D069F6}.Release|Any CPU.Build.0 = Release|Any CPU - {212952C3-22F5-4263-BF9B-B17316B3B3CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {212952C3-22F5-4263-BF9B-B17316B3B3CA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {212952C3-22F5-4263-BF9B-B17316B3B3CA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {212952C3-22F5-4263-BF9B-B17316B3B3CA}.Release|Any CPU.Build.0 = Release|Any CPU - {CD767D93-6C99-4D6A-A303-3C139A73400E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CD767D93-6C99-4D6A-A303-3C139A73400E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CD767D93-6C99-4D6A-A303-3C139A73400E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CD767D93-6C99-4D6A-A303-3C139A73400E}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Build/NuGet.Build.Packaging.vssettings b/src/Build/NuGet.Build.Packaging.vssettings deleted file mode 100644 index 4dd8b6fb..00000000 --- a/src/Build/NuGet.Build.Packaging.vssettings +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - 2 - 4 - true - 4 - - - 4 - 4 - true - - - 0 - 1 - 0 - 1 - 1 - 0 - 1 - 1 - 1 - 1 - 0 - 0 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 0 - 1 - 0 - 1 - 0 - 0 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 1 - 1 - - - - diff --git a/src/Build/Sample/NuGet.Restore.targets b/src/Build/Sample/NuGet.Restore.targets deleted file mode 100644 index 5bcc1700..00000000 --- a/src/Build/Sample/NuGet.Restore.targets +++ /dev/null @@ -1,108 +0,0 @@ - - - - $(MSBuildThisFileDirectory).nuget - https://dist.nuget.org/win-x86-commandline/latest/nuget.exe - $(NuGetPath)\nuget.exe - mono - $(TMPDIR) - https://raw.githubusercontent.com/kzu/NuGet.Restore/master/ - $(BaseUrl)curl.exe - -k -f -L - "$(TEMP)\curl.exe" $(CurlArgs) - curl $(CurlArgs) - $(MSBuildThisFilename)$(MSBuildThisFileExtension) - - - - - - - - Restore - -verbosity quiet - - - - - - - - - - $([System.IO.Path]::GetDirectoryName('$(SolutionPath)')) - - - - <_NuGet>$(NuGet.Replace('$(RestoreDir)', '').TrimStart('/').TrimStart('\')) - - - - - - - - - - - - - - - <_RestoreSolution Condition=" '$(OS)' != 'Unix' ">$(_RestoreSolution.Replace('$(RestoreDir)', '').TrimStart('/').TrimStart('\')) - <_RestoreOutput Condition=" '$(OS)' != 'Unix' And '$(_RestoreOutput)' != ''">$(_RestoreOutput.Replace('$(RestoreDir)', '').TrimStart('/').TrimStart('\')) - - <_RestoreCommand Condition=" '$(_RestoreCommand)' == '' ">Restore - - - - - - - - - - - - - - - - - - - - - - @(ETag) - $(ETag.Substring(5).Trim().TrimStart('"').TrimEnd('"')) - <Namespace Prefix='msb' Uri='http://schemas.microsoft.com/developer/msbuild/2003'/> - $(MSBuildThisFileFullPath) - - - - - - - - - - - - - - - - - - %WINDIR%\System32\WindowsPowerShell\v1.0\powershell.exe - - - - - true - 9d67f0c15f481ff2da50c51a8635ac9d27c533c8 - - \ No newline at end of file diff --git a/src/Build/Sample/project.json b/src/Build/Sample/project.json deleted file mode 100644 index c1536a9a..00000000 --- a/src/Build/Sample/project.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "supports": {}, - "dependencies": { - "GitInfo": "1.1.32", - "JsonPoke.MSBuild": "1.0.7", - "Microsoft.NETCore.Portable.Compatibility": "1.0.1", - "NETStandard.Library": "1.6.0", - "Newtonsoft.Json": "9.0.1", - "NuGet.Build.Packaging": "0.1.202" - }, - "frameworks": { - "netstandard1.4": {} - } -} \ No newline at end of file diff --git a/src/Build/msbuild.rsp b/src/Build/msbuild.rsp deleted file mode 100644 index 20e44845..00000000 --- a/src/Build/msbuild.rsp +++ /dev/null @@ -1,2 +0,0 @@ -/p:PackOnBuild=true -/p:PackageOutputPath=..\..\..\out \ No newline at end of file diff --git a/src/Directory.Build.props b/src/Directory.Build.props new file mode 100644 index 00000000..fe511b4b --- /dev/null +++ b/src/Directory.Build.props @@ -0,0 +1,33 @@ + + + + kzu + NuGetizer + + false + Apache-2.0 + + 42.42.42 + $(Version) + + true + true + + $(MSBuildThisFileDirectory)..\bin + + embedded + true + Preview + + false + $(DefaultItemExcludes);*.binlog;*.zip;*.rsp + + + + false + true + + + + + \ No newline at end of file diff --git a/src/Directory.Build.targets b/src/Directory.Build.targets index e4ef0cd2..0f431a33 100644 --- a/src/Directory.Build.targets +++ b/src/Directory.Build.targets @@ -1,76 +1,85 @@ - - + - - true - true + + $(IntermediateOutputPath)PackageItemKind.g$(DefaultLanguageSourceExtension) + - Microsoft - Microsoft NuGet Packaging - Copyright © 2016 - + + + + + + + false + true + + + + $(LocalAppData)\NuGet\v3-cache + + $(IsPackable) + + $(UserProfile)\.nuget\packages + - - - + + + - - - - $([MSBuild]::Add('$(GitCommits)', '1')) - - + + + + $(Description) - - - - - - $(GitSemVerDashLabel)-pr$(BUILD_SOURCEBRANCH.Substring(10).TrimEnd('/merge')) - $(GitSemVerDashLabel)-pr$(APPVEYOR_PULL_REQUEST_NUMBER) + Built from $(RepositoryUrl)/tree/$(SourceRevisionId.Substring(0, 9)) + + + $(RepositoryUrl) + $(Description) + + - - <_IndexOfBranchSlash>$(GitBranch.LastIndexOf('/')) - <_IndexOfBranchSubstring>$([MSBuild]::Add('$(_IndexOfBranchSlash)', '1')) - <_GitBranch Condition="'$(_IndexOfBranchSlash)' != '0'">$(GitBranch.Substring($(_IndexOfBranchSubstring))) - <_GitBranch Condition="'$(_IndexOfBranchSlash)' == '0'">$(GitBranch) + + + <_ExistingPackage Include="$(PackageOutputPath)\$(PackageId)*.nupkg" /> + <_PackageToDelete Include="@(_ExistingPackage)" Condition="$([System.Text.RegularExpressions.Regex]::IsMatch('%(Filename)', '$(PackageId)\.\d\.\d\.\d.*'))" /> + + + + + + - - -$(_GitBranch) - $(_GitBranch). - $(SemVerMetadata)sha.$(GitCommit) + + + + $(NuGetCache)\$(PackageId.ToLowerInvariant()) + - - $(GitBaseVersionMajor).$(GitBaseVersionMinor).$(GitBaseVersionPatch)$(GitSemVerDashLabel).$(GitCommits)+$(SemVerMetadata) - - $(GitSemVerMajor).$(GitSemVerMinor).$(GitSemVerPatch)+$(SemVerMetadata) - $(GitBaseVersionMajor).$(GitBaseVersionMinor).$(GitBaseVersionPatch) - $(GitSemVerMajor).$(GitSemVerMinor).$(GitSemVerPatch) - $(PackageVersion) - - + + + + - - - - - - - - - - - - - + + + + + \ No newline at end of file diff --git a/src/GlobalAssemblyInfo.cs b/src/GlobalAssemblyInfo.cs deleted file mode 100644 index d74ed735..00000000 --- a/src/GlobalAssemblyInfo.cs +++ /dev/null @@ -1,45 +0,0 @@ -#pragma warning disable 0436 - -using System.Reflection; -using NuGet.Build.Packaging; - -[assembly: AssemblyCompany ("Microsoft")] -[assembly: AssemblyProduct ("Microsoft NuGet Packaging")] -[assembly: AssemblyCopyright ("Copyright © 2016")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] -[assembly: AssemblyTitle(ThisAssembly.Project.AssemblyName)] - - -#if DEBUG -[assembly: AssemblyConfiguration ("DEBUG")] -#else -[assembly: AssemblyConfiguration ("RELEASE")] -#endif - -[assembly: AssemblyVersion(ThisAssembly.SimpleVersion)] -[assembly: AssemblyFileVersion(ThisAssembly.FullVersion)] -[assembly: AssemblyInformationalVersion(ThisAssembly.InformationalVersion)] - -namespace NuGet.Build.Packaging -{ - partial class ThisAssembly - { - /// - /// Simple release-like version number, with just major, minor and ending up in '0'. - /// - public const string SimpleVersion = Git.SemVer.Major + "." + Git.SemVer.Minor + ".0"; - - /// - /// Full version, including commits since base version file, like 4.0.598 - /// - public const string FullVersion = SimpleVersion + "." + Git.SemVer.Patch; - - /// - /// Full version, plus branch and commit short sha. - /// - public const string InformationalVersion = FullVersion + "-" + Git.Branch + "+" + Git.Commit; - } -} - -#pragma warning restore 0436 \ No newline at end of file diff --git a/src/Icons/NuGet.Packaging.ico b/src/Icons/NuGet.Packaging.ico deleted file mode 100644 index 5df2ab2e..00000000 Binary files a/src/Icons/NuGet.Packaging.ico and /dev/null differ diff --git a/src/NuGet.Build.Packaging.Shared.props b/src/NuGet.Build.Packaging.Shared.props deleted file mode 100644 index 0455cbd4..00000000 --- a/src/NuGet.Build.Packaging.Shared.props +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - false - false - - Debug - AnyCPU - $(MSBuildProjectName) - NuGet.Build.Packaging - - bin\$(Configuration)\ - Library - Properties - 512 - true - true - full - 1692;$(NoWarn) - None - $(RootNamespace) - false - false - - - - - true - true - $(MSBuildThisFileDirectory)PublicKey.snk - - - - $(DefineConstants);RELEASE - RELEASE - true - - - - $(DefineConstants);DEBUG - DEBUG - false - - - - - - - - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - true - - - \ No newline at end of file diff --git a/src/NuGet.Build.Packaging.Shared.targets b/src/NuGet.Build.Packaging.Shared.targets deleted file mode 100644 index eeb7a7c6..00000000 --- a/src/NuGet.Build.Packaging.Shared.targets +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - true - - diff --git a/src/NuGet.Config b/src/NuGet.Config index fe59ee84..5a57b062 100644 --- a/src/NuGet.Config +++ b/src/NuGet.Config @@ -3,7 +3,7 @@ - + diff --git a/src/NuGet.Restore.targets b/src/NuGet.Restore.targets deleted file mode 100644 index f8c6dfe8..00000000 --- a/src/NuGet.Restore.targets +++ /dev/null @@ -1,108 +0,0 @@ - - - - $(MSBuildThisFileDirectory).nuget - https://dist.nuget.org/win-x86-commandline/latest/nuget.exe - $(NuGetPath)\nuget.exe - mono - $(TMPDIR) - https://raw.githubusercontent.com/kzu/NuGet.Restore/master/ - $(BaseUrl)curl.exe - -k -f -L - "$(TEMP)\curl.exe" $(CurlArgs) - curl $(CurlArgs) - $(MSBuildThisFilename)$(MSBuildThisFileExtension) - - - - - - - - Restore - -verbosity quiet - - - - - - - - - - $([System.IO.Path]::GetDirectoryName('$(SolutionPath)')) - - - - <_NuGet>$(NuGet.Replace('$(RestoreDir)', '').TrimStart('/').TrimStart('\')) - - - - - - - - - - - - - - - <_RestoreSolution Condition=" '$(OS)' != 'Unix' ">$(_RestoreSolution.Replace('$(RestoreDir)', '').TrimStart('/').TrimStart('\')) - <_RestoreOutput Condition=" '$(OS)' != 'Unix' And '$(_RestoreOutput)' != ''">$(_RestoreOutput.Replace('$(RestoreDir)', '').TrimStart('/').TrimStart('\')) - - <_RestoreCommand Condition=" '$(_RestoreCommand)' == '' ">Restore - - - - - - - - - - - - - - - - - - - - - - @(ETag) - $(ETag.Substring(5).Trim().TrimStart('"').TrimEnd('"')) - <Namespace Prefix='msb' Uri='http://schemas.microsoft.com/developer/msbuild/2003'/> - $(MSBuildThisFileFullPath) - - - - - - - - - - - - - - - - - - %WINDIR%\System32\WindowsPowerShell\v1.0\powershell.exe - - - - - true - 9d67f0c15f481ff2da50c51a8635ac9d27c533c8 - - \ No newline at end of file diff --git a/src/PublicKey.snk b/src/PublicKey.snk deleted file mode 100644 index 110b59c7..00000000 Binary files a/src/PublicKey.snk and /dev/null differ diff --git a/src/Build/Sample/Before.Sample.sln.targets b/src/Sample/Before.Sample.sln.targets similarity index 100% rename from src/Build/Sample/Before.Sample.sln.targets rename to src/Sample/Before.Sample.sln.targets diff --git a/src/Build/Sample/NuGet.Config b/src/Sample/NuGet.Config similarity index 58% rename from src/Build/Sample/NuGet.Config rename to src/Sample/NuGet.Config index 68b80d04..a8b57b2b 100644 --- a/src/Build/Sample/NuGet.Config +++ b/src/Sample/NuGet.Config @@ -3,11 +3,6 @@ - - - - - \ No newline at end of file diff --git a/src/Build/Sample/Properties/AssemblyInfo.cs b/src/Sample/Properties/AssemblyInfo.cs similarity index 100% rename from src/Build/Sample/Properties/AssemblyInfo.cs rename to src/Sample/Properties/AssemblyInfo.cs diff --git a/src/Build/Sample/Sample.csproj b/src/Sample/Sample.csproj similarity index 100% rename from src/Build/Sample/Sample.csproj rename to src/Sample/Sample.csproj diff --git a/src/Build/Sample/Sample.props b/src/Sample/Sample.props similarity index 100% rename from src/Build/Sample/Sample.props rename to src/Sample/Sample.props diff --git a/src/Build/Sample/Sample.sln b/src/Sample/Sample.sln similarity index 100% rename from src/Build/Sample/Sample.sln rename to src/Sample/Sample.sln diff --git a/src/Build/Sample/Sample.targets b/src/Sample/Sample.targets similarity index 100% rename from src/Build/Sample/Sample.targets rename to src/Sample/Sample.targets diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/AnalyzerReferencesService.cs b/src/VisualStudio/NuGet.Packaging.VisualStudio.15/AnalyzerReferencesService.cs deleted file mode 100644 index c612ade6..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/AnalyzerReferencesService.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using EnvDTE; -using VSLangProj; -using VSLangProj140; - -namespace NuGet.Packaging.VisualStudio -{ - class AnalyzerReferencesService : AnalyzerReferences - { - Lazy project; - - public AnalyzerReferencesService(Lazy project) - { - this.project = project; - } - - public void Add(string bstrPath) - { - } - - public void Remove(string bstrPath) - { - } - - public string Item(object index) - { - return null; - } - - public IEnumerator GetEnumerator() - { - yield break; - } - - public DTE DTE => project.Value.DTE; - - public dynamic Parent => project.Value; - - public Project ContainingProject => project.Value.Project; - - public int Count => 0; - } -} diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/Commands.vsct b/src/VisualStudio/NuGet.Packaging.VisualStudio.15/Commands.vsct deleted file mode 100644 index f05e8bba..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/Commands.vsct +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/Contracts.cs b/src/VisualStudio/NuGet.Packaging.VisualStudio.15/Contracts.cs deleted file mode 100644 index e8e6b6f8..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/Contracts.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace NuGet.Packaging.VisualStudio -{ - class Contracts - { - public const string ProjectSystem_VSProject = "Microsoft.VisualStudio.ProjectSystem.VSLangProject.VSProject"; - } -} diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/NuGet.Packaging.VisualStudio.15.csproj b/src/VisualStudio/NuGet.Packaging.VisualStudio.15/NuGet.Packaging.VisualStudio.15.csproj deleted file mode 100644 index fa175735..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/NuGet.Packaging.VisualStudio.15.csproj +++ /dev/null @@ -1,138 +0,0 @@ - - - - 14.0 - 14.0 - - - - - {82b43b9b-a64c-4715-b499-d71e9ca2bd60};{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - {CD844274-2306-4273-8D2C-E1B040457D79} - NuGet.Packaging.VisualStudio - NuGet.Packaging.VisualStudio.15 - v4.6 - NuGetizer3000-VS2017.vsix - true - false - - - - - - - - - - - - - - - - - - - True - - - True - - - True - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 2000 - Designer - - - - - {9617edcd-23bb-41ea-827d-f5729d45b0af} - NuGet.Packaging.VisualStudio - DebugSymbolsProjectOutputGroup - BuiltProjectOutputGroup%3bDebugSymbolsProjectOutputGroup%3bGetCopyToOutputDirectoryItems%3bSatelliteDllsProjectOutputGroup - - - - - true - Designer - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/NuGet.Packaging.VisualStudio.15.targets b/src/VisualStudio/NuGet.Packaging.VisualStudio.15/NuGet.Packaging.VisualStudio.15.targets deleted file mode 100644 index 0cbd7543..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/NuGet.Packaging.VisualStudio.15.targets +++ /dev/null @@ -1,6 +0,0 @@ - - - - true - - \ No newline at end of file diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/NuGetVSProject.cs b/src/VisualStudio/NuGet.Packaging.VisualStudio.15/NuGetVSProject.cs deleted file mode 100644 index 1f2af2ff..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/NuGetVSProject.cs +++ /dev/null @@ -1,96 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using EnvDTE; -using VSLangProj; -using System.Runtime.InteropServices; -using System.ComponentModel.Composition; -using Microsoft.VisualStudio.ProjectSystem; -using VSLangProj150; -using VSLangProj140; -using VSLangProj80; -using Merq; - -namespace NuGet.Packaging.VisualStudio -{ - [Export(Contracts.ProjectSystem_VSProject, typeof(VSProject))] - [AppliesTo(Constants.NuProjCapability)] - [ComVisible(true)] - [Order(1)] // This Project needs to be exported before the built-in (OAVSProject) provided by VS - class NuGetVSProject : VSProject, VSProject4 - { - readonly Lazy innerProject; - readonly Lazy packageReferences; - readonly Lazy references; - readonly Lazy events2; - readonly Lazy analyzerReferences; - - [ImportingConstructor] - public NuGetVSProject( - [ImportMany(Contracts.ProjectSystem_VSProject)] IEnumerable> projects, - Lazy projectLockService, - Lazy asyncManager) - { - innerProject = new Lazy(() => projects - .Where(x => x.Metadata.AppliesTo != Constants.NuProjCapability) - .Select(x => x.Value) - .FirstOrDefault()); - - packageReferences = new Lazy(() => new PackageReferencesService(this, projectLockService, asyncManager)); - references = new Lazy(() => new ReferencesWrapper(innerProject, packageReferences)); - events2 = new Lazy(() => new ProjectEventsService(innerProject)); - analyzerReferences = new Lazy(() => new AnalyzerReferencesService(innerProject)); - } - - VSProject InnerProject => innerProject.Value; - - public BuildManager BuildManager => InnerProject.BuildManager; - - public DTE DTE => InnerProject.DTE; - - public VSProjectEvents Events => InnerProject.Events; - - public Imports Imports => InnerProject.Imports; - - public Project Project => InnerProject.Project; - - public References References => references.Value; - //public References References => InnerProject.References; - - public string TemplatePath => InnerProject.TemplatePath; - - public ProjectItem WebReferencesFolder => InnerProject.WebReferencesFolder; - - public bool WorkOffline - { - get { return InnerProject.WorkOffline; } - set { InnerProject.WorkOffline = value; } - } - - public PackageReferences PackageReferences => packageReferences.Value; - - public dynamic PublishManager => null; - - public VSProjectEvents2 Events2 => events2.Value; - - public AnalyzerReferences AnalyzerReferences => analyzerReferences.Value; - - public ProjectItem AddWebReference(string bstrUrl) => InnerProject.AddWebReference(bstrUrl); - - public void CopyProject(string bstrDestFolder, string bstrDestUNCPath, prjCopyProjectOption copyProjectOption, string bstrUsername, string bstrPassword) => - InnerProject.CopyProject(bstrDestFolder, bstrDestUNCPath, copyProjectOption, bstrUsername, bstrPassword); - - public ProjectItem CreateWebReferencesFolder() => InnerProject.CreateWebReferencesFolder(); - - public void Exec(prjExecCommand command, int bSuppressUI, object varIn, out object pVarOut) => - InnerProject.Exec(command, bSuppressUI, varIn, out pVarOut); - - public void GenerateKeyPairFiles(string strPublicPrivateFile, string strPublicOnlyFile = "0") => - InnerProject.GenerateKeyPairFiles(strPublicPrivateFile, strPublicOnlyFile); - - public string GetUniqueFilename(object pDispatch, string bstrRoot, string bstrDesiredExt) => - InnerProject.GetUniqueFilename(pDispatch, bstrRoot, bstrDesiredExt); - - public void Refresh() => InnerProject.Refresh(); - } -} diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/PackageReferencesService.cs b/src/VisualStudio/NuGet.Packaging.VisualStudio.15/PackageReferencesService.cs deleted file mode 100644 index 844cc8be..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/PackageReferencesService.cs +++ /dev/null @@ -1,159 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using EnvDTE; -using VSLangProj150; -using VSLangProj; -using Microsoft.VisualStudio.ProjectSystem.Properties; -using Microsoft.VisualStudio.ProjectSystem; -using Merq; -using System.Collections.Concurrent; - -namespace NuGet.Packaging.VisualStudio -{ - class PackageReferencesService : PackageReferences - { - const string VersionMetadataName = "Version"; - - readonly VSProject vsProject; - readonly Lazy projectLockService; - readonly Lazy asyncManager; - - public PackageReferencesService( - VSProject vsProject, - Lazy projectLockService, - Lazy asyncManager) - { - this.vsProject = vsProject; - this.projectLockService = projectLockService; - this.asyncManager = asyncManager; - } - - IProjectLockService ProjectLockService => projectLockService.Value; - - IAsyncManager AsyncManager => asyncManager.Value; - - public Project ContainingProject => vsProject.Project; - - public DTE DTE => vsProject.DTE; - - public Array InstalledPackages => GetPackageReferences().Select(x => x.EvaluatedInclude).ToArray(); - - Microsoft.Build.Evaluation.ProjectItem GetPackageReference(string packageName) => - GetPackageReferences().FirstOrDefault(x => x.EvaluatedInclude == packageName); - - IEnumerable GetPackageReferences() => - ExecuteLockAction(project => - project.GetItems(Constants.PackageReferenceItemName), - defaultValue: Enumerable.Empty()); - - void ExecuteLockAction(Action callback, LockType lockType = LockType.Read) => - ExecuteLockAction(project => { callback(project); return true; }, lockType); - - TResult ExecuteLockAction(Func callback, LockType lockType = LockType.Read, TResult defaultValue = default(TResult)) - { - var context = ContainingProject as IVsBrowseObjectContext; - if (context == null) - context = ContainingProject.Object as IVsBrowseObjectContext; - - if (context != null) - { - return AsyncManager.Run(async () => - { - if (lockType == LockType.Read) - { - using (var access = await ProjectLockService.ReadLockAsync()) - { - var configuredProject = await context.UnconfiguredProject.GetSuggestedConfiguredProjectAsync(); - - var project = await access.GetProjectAsync(configuredProject); - - return callback(project); - } - } - else - { - using (var access = await ProjectLockService.WriteLockAsync()) - { - var configuredProject = await context.UnconfiguredProject.GetSuggestedConfiguredProjectAsync(); - - var project = await access.GetProjectAsync(configuredProject); - - return callback(project); - } - } - }); - } - - return defaultValue; - } - - public dynamic Parent => vsProject; - - public void AddOrUpdate(string bstrName, string bstrVersion, Array pbstrMetadataElements, Array pbstrMetadataValues) - { - var item = GetPackageReference(bstrName); - ExecuteLockAction(project => - { - if (item == null) - { - item = project.AddItem(Constants.PackageReferenceItemName, bstrName).First(); - } - - item.SetMetadataValue(VersionMetadataName, bstrVersion); - for (int i = 0; i < pbstrMetadataElements.Length; i++) - item.SetMetadataValue((string)pbstrMetadataElements.GetValue(i), (string)pbstrMetadataValues.GetValue(i)); - - // Hack/fix for: https://github.com/NuGet/Home/issues/4125#issuecomment-282023729 - if (bstrName == Constants.NuGet.BuildPackagingId) - item.SetMetadataValue("PrivateAssets", "all"); - - }, lockType: LockType.Write); - } - - public void Remove(string bstrName) - { - var item = GetPackageReference(bstrName); - if (item != null) - { - ExecuteLockAction(project => - { - project.RemoveItem(item); - }, lockType: LockType.Write); - } - } - - public bool TryGetReference(string bstrName, Array parrbstrDesiredMetadata, out string pbstrVersion, out Array pbstrMetadataElements, out Array pbstrMetadataValues) - { - var version = default(string); - var metadata = new Dictionary(); - - var item = GetPackageReference(bstrName); - if (item != null) - { - ExecuteLockAction(project => - { - version = item.GetMetadataValue(VersionMetadataName); - - foreach (string metadataName in parrbstrDesiredMetadata) - if (!metadata.ContainsKey(metadataName)) - metadata.Add(metadataName, item.GetMetadataValue(metadataName)); - }); - } - - pbstrVersion = version; - pbstrMetadataElements = metadata.Any() ? metadata.Keys.ToArray() : null; - pbstrMetadataValues = metadata.Any() ? metadata.Values.ToArray() : null; - - return item != null; - } - - enum LockType - { - Read, - Write - } - } -} diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/ProjectEventsService.cs b/src/VisualStudio/NuGet.Packaging.VisualStudio.15/ProjectEventsService.cs deleted file mode 100644 index 47ec2a51..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/ProjectEventsService.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using VSLangProj; -using VSLangProj80; - -namespace NuGet.Packaging.VisualStudio -{ - class ProjectEventsService : VSProjectEvents2 - { - Lazy project; - - public ProjectEventsService(Lazy project) - { - this.project = project; - } - - public ReferencesEvents ReferencesEvents => project.Value.Events.ReferencesEvents; - - public BuildManagerEvents BuildManagerEvents => project.Value.Events.BuildManagerEvents; - - public ImportsEvents ImportsEvents => project.Value.Events.ImportsEvents; - - public VSLangProjWebReferencesEvents VSLangProjWebReferencesEvents => null; - } -} diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/ProjectSystem/GlobalPropertiesProvider.cs b/src/VisualStudio/NuGet.Packaging.VisualStudio.15/ProjectSystem/GlobalPropertiesProvider.cs deleted file mode 100644 index 939e7fd6..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/ProjectSystem/GlobalPropertiesProvider.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Microsoft.VisualStudio.Threading; -using System.Collections.Immutable; -using System.Threading; -using System.ComponentModel.Composition; -using Microsoft.VisualStudio.ProjectSystem; -using System.IO; -using Microsoft.VisualStudio.ProjectSystem.Build; - -namespace NuGet.Packaging.VisualStudio -{ - [Export(typeof(IProjectGlobalPropertiesProvider))] - //[AppliesTo(NuProjCapabilities.NuProj)] - [AppliesTo("")] - class GlobalPropertiesProvider : StaticGlobalPropertiesProviderBase - { - [ImportingConstructor] - internal GlobalPropertiesProvider(IProjectService projectService) - : base(projectService.Services) - { } - - public override Task> GetGlobalPropertiesAsync(CancellationToken cancellationToken) => - Task.FromResult>( - Empty.PropertiesMap.SetItem( - Constants.NuGetAuthoringPathPropertyName, - Path.Combine(Path.GetDirectoryName(this.GetType().Assembly.Location), "Targets"))); - } -} \ No newline at end of file diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/ProjectSystem/NuProjCapabilities.cs b/src/VisualStudio/NuGet.Packaging.VisualStudio.15/ProjectSystem/NuProjCapabilities.cs deleted file mode 100644 index a9746bdc..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/ProjectSystem/NuProjCapabilities.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Microsoft.VisualStudio.ProjectSystem; - -namespace NuGet.Packaging.VisualStudio -{ - internal static class NuProjCapabilities - { - public const string NuProj = "PackagingProject"; - public const string OpenProjectFile = nameof(OpenProjectFile); - public const string DependenciesTree = nameof(DependenciesTree); - - public const string DefaultCapabilities = - ProjectCapabilities.HandlesOwnReload + "; " + - OpenProjectFile + ";" + - ProjectCapabilities.ProjectConfigurationsInferredFromUsage + - DependenciesTree; - } -} \ No newline at end of file diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/ProjectSystem/NuProjConfiguredProject.cs b/src/VisualStudio/NuGet.Packaging.VisualStudio.15/ProjectSystem/NuProjConfiguredProject.cs deleted file mode 100644 index 76bea3a5..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/ProjectSystem/NuProjConfiguredProject.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using System.ComponentModel.Composition; -using System.Diagnostics.CodeAnalysis; - -using Microsoft.VisualStudio.ProjectSystem; - -namespace NuGet.Packaging.VisualStudio -{ - [Export] - [AppliesTo(NuProjCapabilities.NuProj)] - internal sealed class NuProjConfiguredProject - { - [Import] - [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "MEF")] - public ConfiguredProject ConfiguredProject { get; private set; } - - [Import] - [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "MEF")] - public Lazy Properties { get; private set; } - } -} diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/ProjectSystem/NuProjProjectProperties.cs b/src/VisualStudio/NuGet.Packaging.VisualStudio.15/ProjectSystem/NuProjProjectProperties.cs deleted file mode 100644 index 36d98283..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/ProjectSystem/NuProjProjectProperties.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System.ComponentModel.Composition; -using Microsoft.VisualStudio.ProjectSystem; -using Microsoft.VisualStudio.ProjectSystem.Properties; - -namespace NuGet.Packaging.VisualStudio -{ - /// - /// Provides rule-based property access. - /// - [Export] - [AppliesTo(NuProjCapabilities.NuProj)] - internal partial class NuProjProjectProperties : StronglyTypedPropertyAccess - { - /// - /// Initializes a new instance of the class. - /// - [ImportingConstructor] - public NuProjProjectProperties([Import] ConfiguredProject configuredProject) - : base(configuredProject) - { - } - - /// - /// Initializes a new instance of the class. - /// - public NuProjProjectProperties(ConfiguredProject configuredProject, string file, string itemType, string itemName) - : base(configuredProject, file, itemType, itemName) - { - } - - /// - /// Initializes a new instance of the class. - /// - public NuProjProjectProperties(ConfiguredProject configuredProject, IProjectPropertiesContext projectPropertiesContext) - : base(configuredProject, projectPropertiesContext) - { - } - - /// - /// Initializes a new instance of the class. - /// - public NuProjProjectProperties(ConfiguredProject configuredProject, UnconfiguredProject unconfiguredProject) - : base(configuredProject, unconfiguredProject) - { - } - } -} diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/ProjectSystem/NuProjProjectTreeModifier.cs b/src/VisualStudio/NuGet.Packaging.VisualStudio.15/ProjectSystem/NuProjProjectTreeModifier.cs deleted file mode 100644 index 4c9e4165..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/ProjectSystem/NuProjProjectTreeModifier.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System.ComponentModel.Composition; - -using Microsoft.VisualStudio.Imaging; -using Microsoft.VisualStudio.ProjectSystem; - -namespace NuGet.Packaging.VisualStudio -{ - [Export(typeof(IProjectTreePropertiesProvider))] - [AppliesTo(NuProjCapabilities.NuProj)] - internal sealed class NuProjProjectTreeModifier : IProjectTreePropertiesProvider - { - [Import] - public UnconfiguredProject UnconfiguredProject { get; set; } - - public void CalculatePropertyValues(IProjectTreeCustomizablePropertyContext propertyContext, IProjectTreeCustomizablePropertyValues propertyValues) - { - if (propertyValues != null) - { - if (propertyValues.Flags.Contains(ProjectTreeFlags.Common.ProjectRoot)) - { - // Set the icon - // propertyValues.Icon = KnownMonikers.NuGet.ToProjectSystemType(); - } - } - } - } -} diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/ProjectSystem/NuProjUnconfiguredProject.cs b/src/VisualStudio/NuGet.Packaging.VisualStudio.15/ProjectSystem/NuProjUnconfiguredProject.cs deleted file mode 100644 index 051cc1b8..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/ProjectSystem/NuProjUnconfiguredProject.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System.ComponentModel.Composition; - -using Microsoft.VisualStudio.ProjectSystem; -using Microsoft.VisualStudio.ProjectSystem.VS; - -namespace NuGet.Packaging.VisualStudio -{ - [Export] - [AppliesTo(NuProjCapabilities.NuProj)] - [ProjectTypeRegistration(Guids.ProjectTypeGuid, - "NuGet", - "#2", - Constants.ProjectExtension, - Constants.Language, - Guids.PackageGuid, - PossibleProjectExtensions = Constants.ProjectExtension, - ProjectTemplatesDir = @"..\..\Templates\Projects\NuProj", - Capabilities = NuProjCapabilities.DefaultCapabilities)] - internal sealed class NuProjUnconfiguredProject - { - [Import] - public UnconfiguredProject UnconfiguredProject { get; private set; } - - [Import] - public ActiveConfiguredProject NuProjActiveConfiguredProject { get; private set; } - - [Import] - public ConfiguredProject ActiveConfiguredProject - { - get { return NuProjActiveConfiguredProject.Value.ConfiguredProject; } - } - } -} \ No newline at end of file diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/ProjectSystem/NuProjValidProjectReferenceChecker.cs b/src/VisualStudio/NuGet.Packaging.VisualStudio.15/ProjectSystem/NuProjValidProjectReferenceChecker.cs deleted file mode 100644 index 1accc43e..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/ProjectSystem/NuProjValidProjectReferenceChecker.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System; -using System.ComponentModel.Composition; -using System.Diagnostics.CodeAnalysis; -using System.Threading.Tasks; -using System.Linq; -using System.Collections.Immutable; -using Microsoft.VisualStudio.ProjectSystem; -using Microsoft.VisualStudio.ProjectSystem.References; -using System.Collections.Generic; - -namespace NuGet.Packaging.VisualStudio -{ - [Export(typeof(IValidProjectReferenceChecker))] - [Order(1000)] - [AppliesTo(NuProjCapabilities.NuProj)] - public class NuProjValidProjectReferenceChecker : IValidProjectReferenceChecker - { - // This import must be present so that this part applies to a specific project. - [Import] - [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")] - public UnconfiguredProject UnconfiguredProject { get; set; } - - public Task CanAddProjectReferenceAsync(object referencedProject) => - Task.FromResult(CanAddProjectReference(referencedProject)); - - public Task CanAddProjectReferencesAsync(IImmutableSet referencedProjects) => - Task.FromResult( - new CanAddProjectReferencesResult( - ImmutableDictionary.Empty.AddRange( - referencedProjects.Select(x => - new KeyValuePair(x, CanAddProjectReference(x))) - ), null)); - - public Task CanBeReferencedAsync(object referencingProject) => - Task.FromResult(SupportedCheckResult.Supported); - - SupportedCheckResult CanAddProjectReference(object referencedProject) => SupportedCheckResult.Supported; - } -} \ No newline at end of file diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/ProjectSystem/ProjectProperties.cs b/src/VisualStudio/NuGet.Packaging.VisualStudio.15/ProjectSystem/ProjectProperties.cs deleted file mode 100644 index 75c3b821..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/ProjectSystem/ProjectProperties.cs +++ /dev/null @@ -1,48 +0,0 @@ -namespace NuGet.Packaging.VisualStudio -{ - using System; - using System.Collections.Generic; - using System.ComponentModel.Composition; - using System.Linq; - using System.Text; - using System.Threading.Tasks; - using Microsoft.VisualStudio.ProjectSystem; - using Microsoft.VisualStudio.ProjectSystem.Properties; - - [Export] - internal partial class ProjectProperties : StronglyTypedPropertyAccess - { - /// - /// Initializes a new instance of the class. - /// - [ImportingConstructor] - public ProjectProperties(ConfiguredProject configuredProject) - : base(configuredProject) - { - } - - /// - /// Initializes a new instance of the class. - /// - public ProjectProperties(ConfiguredProject configuredProject, string file, string itemType, string itemName) - : base(configuredProject, file, itemType, itemName) - { - } - - /// - /// Initializes a new instance of the class. - /// - public ProjectProperties(ConfiguredProject configuredProject, IProjectPropertiesContext projectPropertiesContext) - : base(configuredProject, projectPropertiesContext) - { - } - - /// - /// Initializes a new instance of the class. - /// - public ProjectProperties(ConfiguredProject configuredProject, UnconfiguredProject unconfiguredProject) - : base(configuredProject, unconfiguredProject) - { - } - } -} diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/Properties/AssemblyInfo.cs b/src/VisualStudio/NuGet.Packaging.VisualStudio.15/Properties/AssemblyInfo.cs deleted file mode 100644 index cd162e39..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,30 +0,0 @@ -using NuGet.Build.Packaging; -using System.Reflection; -using System.Runtime.CompilerServices; - -[assembly: Microsoft.VisualStudio.Shell.ProvideCodeBase(CodeBase = @"$PackageFolder$\NuGet.Packaging.VisualStudio.dll")] - -[assembly: InternalsVisibleTo("NuGet.Packaging.VisualStudio.UnitTests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100653a25b8db304651a28d6a28454d201a4372d811143c969b92141cd87ffaa48d4e69f98d70d3ac689f69b673afcd44526a75903782c13573022fcd7fe05289af2abf5f7c195159650a974b8cc05eba30717bcfd882bf168690e4daaa4e1dd0aa393a420cf2d6ab2e89b286f81416f96737ae524039dbd0ff3d008e3dd8ec8de7")] -[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2,PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")] - -[assembly: AssemblyCompany("Microsoft")] -[assembly: AssemblyProduct("Microsoft NuGet Packaging")] -[assembly: AssemblyCopyright("Copyright © 2016")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] -[assembly: AssemblyTitle(ThisAssembly.Project.AssemblyName)] - - -#if DEBUG -[assembly: AssemblyConfiguration("DEBUG")] -#else -[assembly: AssemblyConfiguration ("RELEASE")] -#endif - -[assembly: AssemblyVersion("1.0.0")] -[assembly: AssemblyFileVersion("1.0.0")] -[assembly: AssemblyInformationalVersion( - ThisAssembly.Git.SemVer.Major + "." + - ThisAssembly.Git.SemVer.Minor + "." + - ThisAssembly.Git.SemVer.Patch + "-" + - ThisAssembly.Git.Branch + "+" + ThisAssembly.Git.Commit)] \ No newline at end of file diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/ReferenceWrapper.cs b/src/VisualStudio/NuGet.Packaging.VisualStudio.15/ReferenceWrapper.cs deleted file mode 100644 index f6ce23b5..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/ReferenceWrapper.cs +++ /dev/null @@ -1,121 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using EnvDTE; -using VSLangProj; -using VSLangProj150; -using VSLangProj80; - -namespace NuGet.Packaging.VisualStudio -{ - class ReferenceWrapper : Reference6 - { - Reference3 reference; - Lazy packageReferences; - - public ReferenceWrapper(Reference3 reference, Lazy packageReferences) - { - this.reference = reference; - this.packageReferences = packageReferences; - } - - public void Remove() => reference.Remove(); - - public void GetMetadata(Array parrbstrDesiredMetadata, out Array pparrbstrMetadataElements, out Array pparrbstrMetadataValues) - { - string version; - packageReferences.Value.TryGetReference(Name, parrbstrDesiredMetadata, out version, out pparrbstrMetadataElements, out pparrbstrMetadataValues); - } - - public void AddOrUpdateMetadata(Array parrbstrMetadataElements, Array parrbstrMetadataValues) - { - packageReferences.Value.AddOrUpdate(Name, Version, parrbstrMetadataElements, parrbstrMetadataValues); - } - - public DTE DTE => reference.DTE; - - public References Collection => reference.Collection; - - public Project ContainingProject => reference.ContainingProject; - - public string Name => reference.Name; - - public prjReferenceType Type => reference.Type; - - public string Identity => reference.Identity; - - public string Path => reference.Path; - - public string Description => reference.Description; - - public string Culture => reference.Culture; - - public int MajorVersion => reference.MajorVersion; - - public int MinorVersion => reference.MinorVersion; - - public int RevisionNumber => reference.RevisionNumber; - - public int BuildNumber => reference.BuildNumber; - - public bool StrongName => reference.StrongName; - - public Project SourceProject => reference.SourceProject; - - public bool CopyLocal - { - get { return reference.CopyLocal; } - set { reference.CopyLocal = value; } - } - - public dynamic get_Extender(string ExtenderName) => reference.Extender[ExtenderName]; - - public dynamic ExtenderNames => reference.ExtenderNames; - - public string ExtenderCATID => reference.ExtenderCATID; - - public string PublicKeyToken => reference.PublicKeyToken; - - public string Version => reference.Version; - - public string RuntimeVersion => reference.RuntimeVersion; - - public bool SpecificVersion - { - get { return reference.SpecificVersion; } - set { reference.SpecificVersion = value; } - } - - public string SubType - { - get { return reference.SubType; } - set { reference.SubType = value; } - } - - public bool Isolated - { - get { return reference.Isolated; } - set { reference.Isolated = value; } - } - - public string Aliases - { - get { return reference.Aliases; } - set { reference.Aliases = value; } - } - - public uint RefType => reference.RefType; - - public bool AutoReferenced => reference.AutoReferenced; - - public bool Resolved => reference.Resolved; - - public bool EmbedInteropTypes { get; set; } - - public Array ExpandedSdkReferences => null; - - public Reference Group => null; - } -} diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/ReferencesWrapper.cs b/src/VisualStudio/NuGet.Packaging.VisualStudio.15/ReferencesWrapper.cs deleted file mode 100644 index aa284fe5..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/ReferencesWrapper.cs +++ /dev/null @@ -1,68 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using EnvDTE; -using VSLangProj; -using VSLangProj80; -using VSLangProj150; -using System.Collections.Concurrent; - -namespace NuGet.Packaging.VisualStudio -{ - public class ReferencesWrapper : References - { - Lazy project; - Lazy packageReferences; - ConcurrentDictionary referenceWrappers = new ConcurrentDictionary(); - - public ReferencesWrapper(Lazy project, Lazy packageReferences) - { - this.project = project; - this.packageReferences = packageReferences; - } - - VSProject Project => project.Value; - - public Reference Item(object index) => - GetReferenceWrapperOrDefault(Project.References.Item(index)); - - Reference GetReferenceWrapperOrDefault(Reference reference) - { - var reference3 = reference as Reference3; - - if (reference3 != null) - return referenceWrappers.GetOrAdd(reference3, r => new ReferenceWrapper(r, packageReferences)); - - return reference; - } - - public IEnumerator GetEnumerator() - { - foreach (Reference reference in Project.References) - yield return GetReferenceWrapperOrDefault(reference); - } - - public Reference Find(string bstrIdentity) => - GetReferenceWrapperOrDefault(Project.References.Find(bstrIdentity)); - - public Reference Add(string bstrPath) => - GetReferenceWrapperOrDefault(Project.References.Add(bstrPath)); - - public Reference AddActiveX(string bstrTypeLibGuid, int lMajorVer = 0, int lMinorVer = 0, int lLocaleId = 0, string bstrWrapperTool = "") => - GetReferenceWrapperOrDefault(Project.References.AddActiveX(bstrTypeLibGuid, lMajorVer, lMinorVer, lLocaleId, bstrWrapperTool)); - - public Reference AddProject(Project pProject) => - GetReferenceWrapperOrDefault(Project.References.AddProject(pProject)); - - public DTE DTE => Project.References.DTE; - - public object Parent => Project.References.Parent; - - public Project ContainingProject => Project.References.ContainingProject; - - public int Count => Project.References.Count; - } -} diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/TemplateWizard.cs b/src/VisualStudio/NuGet.Packaging.VisualStudio.15/TemplateWizard.cs deleted file mode 100644 index e59ca277..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/TemplateWizard.cs +++ /dev/null @@ -1,47 +0,0 @@ -using Microsoft.VisualStudio.TemplateWizard; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using EnvDTE; -using System.IO; - -namespace NuGet.Packaging.VisualStudio -{ - public class TemplateWizard : IWizard - - { - public void BeforeOpeningFile(ProjectItem projectItem) - { - } - - public void ProjectFinishedGenerating(Project project) - { - try - { - // HACK: For now the NuGet.VisualStudio.TemplateWizard fails to install the packages - // if the base intermediate output path (obj) directory is not already created - // So adding this check/fix until the issue can be resolved - var baseIntermediateOutputPath = Path.Combine(Path.GetDirectoryName(project.FullName), "obj"); - if (!Directory.Exists(baseIntermediateOutputPath)) - Directory.CreateDirectory(baseIntermediateOutputPath); - } - catch { } - } - - public void ProjectItemFinishedGenerating(ProjectItem projectItem) - { - } - - public void RunFinished() - { - } - - public void RunStarted(object automationObject, Dictionary replacementsDictionary, WizardRunKind runKind, object[] customParams) - { - } - - public bool ShouldAddProjectItem(string filePath) => true; - } -} diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/Templates/Projects/CSharp/Cross-Platform/MultiPlatformLibrary/MultiPlatformLibrary.vstemplate b/src/VisualStudio/NuGet.Packaging.VisualStudio.15/Templates/Projects/CSharp/Cross-Platform/MultiPlatformLibrary/MultiPlatformLibrary.vstemplate deleted file mode 100644 index 43b74b4d..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/Templates/Projects/CSharp/Cross-Platform/MultiPlatformLibrary/MultiPlatformLibrary.vstemplate +++ /dev/null @@ -1,27 +0,0 @@ - - - - Class Library (Multi-Platform) - A project template for creating cross platform library projects and its corresponding NuGet packages - - NuGet.Packaging.VisualStudio.MultiPlatformLibrary - CSharp - 2.0 - 700 - 1 - true - Library - true - true - - - - - - NuGet.Packaging.VisualStudio, Version=1.0.0.0, Culture=neutral, PublicKeyToken=44c0b6b1fa7a936a - NuGet.Packaging.VisualStudio.MultiPlatformWizard - - \ No newline at end of file diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/Templates/Projects/CSharp/Package-Workaround/Package.nuproj b/src/VisualStudio/NuGet.Packaging.VisualStudio.15/Templates/Projects/CSharp/Package-Workaround/Package.nuproj deleted file mode 100644 index 7d2509bf..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/Templates/Projects/CSharp/Package-Workaround/Package.nuproj +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - Debug - AnyCPU - - - Release - AnyCPU - - - - $safeprojectname$ - 1.0.0 - $projectname$ - $username$ - $username$ - $projectname$ - $projectname$ - - - - Copyright © $username$ - $safeprojectname$ - - - bin\$(Configuration)\ - - - - true - PreserveNewest - - - - - \ No newline at end of file diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/Templates/Projects/CSharp/Package-Workaround/Package.vstemplate b/src/VisualStudio/NuGet.Packaging.VisualStudio.15/Templates/Projects/CSharp/Package-Workaround/Package.vstemplate deleted file mode 100644 index 7f2711e9..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/Templates/Projects/CSharp/Package-Workaround/Package.vstemplate +++ /dev/null @@ -1,39 +0,0 @@ - - - - Package - A project template for creating NuGet packages (*.nupkg files) - - NuGet.Packaging.VisualStudio.Package - - CSharp - 2.0 - 700 - true - 1 - true - NuGetPackage - true - true - - true - - - - Readme.txt - - - - NuGet.Packaging.VisualStudio.15, Version=1.0.0.0, Culture=neutral, PublicKeyToken=44c0b6b1fa7a936a - NuGet.Packaging.VisualStudio.TemplateWizard - - - NuGet.VisualStudio.Interop, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - NuGet.VisualStudio.TemplateWizard - - - - - - - \ No newline at end of file diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/Templates/Projects/CSharp/Package-Workaround/Readme.txt b/src/VisualStudio/NuGet.Packaging.VisualStudio.15/Templates/Projects/CSharp/Package-Workaround/Readme.txt deleted file mode 100644 index db4dccde..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/Templates/Projects/CSharp/Package-Workaround/Readme.txt +++ /dev/null @@ -1,9 +0,0 @@ -# $projectname$ Readme - -Building this project will create a .nupkg containing just this Readme file. - -It's always a good idea to provide a more useful package to your users, -alongside a nice descriptive Readme like this one that will open automatically -when the add your package to a project. - -Happy nugetizing! \ No newline at end of file diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/Templates/Projects/Nuget/Package/Package.nuproj b/src/VisualStudio/NuGet.Packaging.VisualStudio.15/Templates/Projects/Nuget/Package/Package.nuproj deleted file mode 100644 index c04cb78e..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/Templates/Projects/Nuget/Package/Package.nuproj +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - $safeprojectname$ - 1.0.0 - $projectname$ - $username$ - $username$ - $projectname$ - $projectname$ - - - - Copyright © $username$ - $safeprojectname$ - - PackageReference - netstandard1.0 - net11;net20;net35;net40;net403;net45;net451;net452;net46;net461;net462;net47;net471;netcore;netcore45;netcore451;netcore50;win8;win81;win10;sl4;sl5;wp;wp7;wp75;wp8;wp81;wpa81;uap;uap10;netstandard1.0;netstandard1.1;netstandard1.2;netstandard1.3;netstandard1.4;netstandard1.5;netstandard1.6;netstandard2.0;netcoreapp1.0;netcoreapp2.0;monoandroid;monotouch;monomac;xamarinios;xamarinmac;xamarinpsthree;xamarinpsfour;xamarinpsvita;xamarinwatchos;xamarintvos;xamarinxboxthreesixty;xamarinxboxone - - Debug - bin\$(Configuration)\ - - - - - - - - - - - - diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/Templates/Projects/Nuget/Package/Package.vstemplate b/src/VisualStudio/NuGet.Packaging.VisualStudio.15/Templates/Projects/Nuget/Package/Package.vstemplate deleted file mode 100644 index ef2e016b..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/Templates/Projects/Nuget/Package/Package.vstemplate +++ /dev/null @@ -1,36 +0,0 @@ - - - - Package - A project template for creating NuGet packages (*.nupkg files) - - NuGet.Packaging.VisualStudio.Package - NuGet - 2.0 - 700 - true - 1 - true - NuGetPackage - true - true - - - - Readme.txt - - - - NuGet.Packaging.VisualStudio.15, Version=1.0.0.0, Culture=neutral, PublicKeyToken=44c0b6b1fa7a936a - NuGet.Packaging.VisualStudio.TemplateWizard - - - NuGet.VisualStudio.Interop, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - NuGet.VisualStudio.TemplateWizard - - - - - - - \ No newline at end of file diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/Templates/Projects/Nuget/Package/Readme.txt b/src/VisualStudio/NuGet.Packaging.VisualStudio.15/Templates/Projects/Nuget/Package/Readme.txt deleted file mode 100644 index d686b21b..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/Templates/Projects/Nuget/Package/Readme.txt +++ /dev/null @@ -1,9 +0,0 @@ -# $projectname$ Readme - -Building this project will create a .nupkg containing just this Readme file. - -It's always a good idea to provide a more useful package to your users, -alongside a nice descriptive Readme like this one that will open automatically -when they add your package to a project. - -Happy nugetizing! \ No newline at end of file diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/Templates/Projects/PortableClassLibrary/PortableClassLibrary.csproj b/src/VisualStudio/NuGet.Packaging.VisualStudio.15/Templates/Projects/PortableClassLibrary/PortableClassLibrary.csproj deleted file mode 100644 index de8bcc4e..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/Templates/Projects/PortableClassLibrary/PortableClassLibrary.csproj +++ /dev/null @@ -1,60 +0,0 @@ - - - - - Debug - AnyCPU - {$guid1$} - Library - Properties - $safeprojectname$ - $safeprojectname$ - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Profile111 - v4.5 - - - true - full - false - bin\Debug\ - DEBUG;TRACE$defineconstantswithprefix$ - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE$defineconstantswithprefix$ - prompt - 4 - - - $safeprojectname$ - 1.0.0 - $projectname$ - $username$ - $username$ - $projectname$ - $projectname$ - - - - Copyright © $username$ - $safeprojectname$ - - - - - - - - \ No newline at end of file diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/Templates/Projects/PortableClassLibrary/assemblyinfo.cs b/src/VisualStudio/NuGet.Packaging.VisualStudio.15/Templates/Projects/PortableClassLibrary/assemblyinfo.cs deleted file mode 100644 index c761b2f9..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/Templates/Projects/PortableClassLibrary/assemblyinfo.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.Resources; -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("$projectname$")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("$registeredorganization$")] -[assembly: AssemblyProduct("$projectname$")] -[assembly: AssemblyCopyright("Copyright © $registeredorganization$ $year$")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] -[assembly: NeutralResourcesLanguage("en")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/Templates/Projects/PortableClassLibrary/class1.cs b/src/VisualStudio/NuGet.Packaging.VisualStudio.15/Templates/Projects/PortableClassLibrary/class1.cs deleted file mode 100644 index 1cb7629d..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/Templates/Projects/PortableClassLibrary/class1.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace $safeprojectname$ -{ - public $if$ ('$outputtypewinmdobj$' == 'true')sealed $endif$class Class1 - { - } -} diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/Templates/Projects/PortableClassLibrary/csPortableClassLibrary.vstemplate b/src/VisualStudio/NuGet.Packaging.VisualStudio.15/Templates/Projects/PortableClassLibrary/csPortableClassLibrary.vstemplate deleted file mode 100644 index 7ca02809..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/Templates/Projects/PortableClassLibrary/csPortableClassLibrary.vstemplate +++ /dev/null @@ -1,34 +0,0 @@ - - - - Class Library (Portable with NuGet support) - A project template for creating portable class libraries with NuGet support - - NuGet.Packaging.VisualStudio.Portable - CSharp - ClassLibrary - true - true - 4.0 - true - - - - AssemblyInfo.cs - Class1.cs - - - - NuGet.Packaging.VisualStudio.15, Version=1.0.0.0, Culture=neutral, PublicKeyToken=44c0b6b1fa7a936a - NuGet.Packaging.VisualStudio.TemplateWizard - - - NuGet.VisualStudio.Interop, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - NuGet.VisualStudio.TemplateWizard - - - - - - - \ No newline at end of file diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/VSPackage.resx b/src/VisualStudio/NuGet.Packaging.VisualStudio.15/VSPackage.resx deleted file mode 100644 index 4e233ae8..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/VSPackage.resx +++ /dev/null @@ -1,145 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - NuGet.Packaging - - - NuGet.Packaging Project Files (*.nuproj);*.nuproj - - - NuGet Package - - - A project template for creating NuGet packages (*.nupkg files) - - - NuGet Package (Portable) - - - A project template for creating NuGet packages (*.nupkg files) - - - NuGet.Packaging Items - - - - ..\..\Icons\NuGet.Packaging.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - \ No newline at end of file diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/app.config b/src/VisualStudio/NuGet.Packaging.VisualStudio.15/app.config deleted file mode 100644 index 35a0fa53..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/app.config +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/source.extension.vsixmanifest b/src/VisualStudio/NuGet.Packaging.VisualStudio.15/source.extension.vsixmanifest deleted file mode 100644 index 841ae506..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio.15/source.extension.vsixmanifest +++ /dev/null @@ -1,24 +0,0 @@ - - - - - NuGetizer-3000 - NuGet Package Authoring Tools - LICENSE.txt - - - - - - - - - - - - - - - - - diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio.Shared.targets b/src/VisualStudio/NuGet.Packaging.VisualStudio.Shared.targets deleted file mode 100644 index 795ea439..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio.Shared.targets +++ /dev/null @@ -1,144 +0,0 @@ - - - - $(MSBuildThisFileDirectory)VisualStudio.snk - false - true - - - - - false - true - - Program - $(MSBuildProgramFiles32)\Microsoft Visual Studio $(VisualStudioVersion)\Common7\IDE\devenv.exe - $(VsInstallRoot)\Common7\IDE\devenv.exe - /rootsuffix exp - <Namespace Prefix='vs' Uri='http://schemas.microsoft.com/developer/vstemplate/2005'/> - - - - - ResolveReferences; - $(MarkupCompilePass2ForMainAssemblyDependsOn) - - - - - - - AssemblyName - - - - - - - %(Filename)%(Extension) - true - Packages - - - - - - <_NuGetizerPackage Include="$(Out)\*.nupkg" /> - <_CurrentNuGetizerPackage Include="@(_NuGetizerPackage)" - Condition="$([System.String]::New('%(Filename)').Replace('NuGet.Build.Packaging.', '')) == '$(PackageVersion)'" /> - - - - <_NuGetizerPackageExists Condition="'@(_NuGetizerPackage -> Count())' != '0'">true - <_CurrentNuGetizerPackageExists Condition="'@(_CurrentNuGetizerPackage -> Count())' != '0'">true - - - - - - - - - - - - $(GitSemVerMajor).$(GitSemVerMinor).$(GitSemVerPatch) - - - - - - PrepareForBuild; - CopyOutOfDateSmartTemplateContent; - SetVersion; - FindTemplates; - UpdateTemplatePackages - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - True - - - True - - - True - - - - - - - - true - true - - - - - - \ No newline at end of file diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio.Shared/NuGet.Packaging.VisualStudio.Shared.projitems b/src/VisualStudio/NuGet.Packaging.VisualStudio.Shared/NuGet.Packaging.VisualStudio.Shared.projitems deleted file mode 100644 index ecb65715..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio.Shared/NuGet.Packaging.VisualStudio.Shared.projitems +++ /dev/null @@ -1,14 +0,0 @@ - - - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - true - 70d9bbbc-b982-4210-9f66-5a02aea268fe - - - NuGet.Packaging.VisualStudio.Shared - - - - - \ No newline at end of file diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio.Shared/NuGet.Packaging.VisualStudio.Shared.shproj b/src/VisualStudio/NuGet.Packaging.VisualStudio.Shared/NuGet.Packaging.VisualStudio.Shared.shproj deleted file mode 100644 index 58f4dad9..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio.Shared/NuGet.Packaging.VisualStudio.Shared.shproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - 70d9bbbc-b982-4210-9f66-5a02aea268fe - 14.0 - - - - - - - - diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio.Shared/NugetizerPackage.cs b/src/VisualStudio/NuGet.Packaging.VisualStudio.Shared/NugetizerPackage.cs deleted file mode 100644 index d84463d2..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio.Shared/NugetizerPackage.cs +++ /dev/null @@ -1,94 +0,0 @@ -namespace NuGet.Packaging.VisualStudio -{ - using System; - using System.Runtime.InteropServices; - using Microsoft.VisualStudio.Shell; - using System.ComponentModel.Design; - using Microsoft.VisualStudio.ComponentModelHost; - using Microsoft.VisualStudio; - using Clide; - using Microsoft.VisualStudio.Shell.Interop; - - [Guid(Guids.PackageGuid)] - [PackageRegistration(UseManagedResourcesOnly = true)] - [ProvideUIContextRule( - Constants.UIContext.AddPlatformImplementation, - name: "Portable Class Library UI Context", - expression: "SolutionExistsAndNotBuildingAndNotDebugging & IsPortableClassLibrary", - termNames: new[] { "SolutionExistsAndNotBuildingAndNotDebugging", "IsPortableClassLibrary" }, - termValues: new[] { VSConstants.UICONTEXT.SolutionExistsAndNotBuildingAndNotDebugging_string, "ActiveProjectFlavor:786C830F-07A1-408B-BD7F-6EE04809D6DB" })] - [ProvideUIContextRule( - Constants.UIContext.NuProj, - name: "NuProj Exists", - expression: "NuProj", - termNames: new[] { "NuProj" }, - termValues: new[] { "SolutionHasProjectCapability:" + Constants.NuProjCapability })] - [ProvideMenuResource("2000", 3)] - [ProvideBindingPath] - public sealed class NuGetizerPackage : Package - { - static readonly Guid NuGetPackageGuid = new Guid("5fcc8577-4feb-4d04-ad72-d6c629b083cc"); - - IDisposable[] extenderProviders = new IDisposable[0]; - - protected override void Initialize() - { - base.Initialize(); - - //RegisterProjectFactory(new NuProjFlavoredProjectFactory(this)); - RegisterCommands(); - - // These crash VS, investigating at vsixdisc DL - //var extenders = this.GetService(); - //if (extenders != null) - //{ - // extenderProviders = new IDisposable[] - // { - // new LibraryProjectExtenderProvider(extenders), - // new NoneItemExtenderProvider(extenders), - // new ProjectReferenceExtenderProvider(extenders), - // }; - //} - } - - public IServiceProvider GetLoadedPackage(Guid packageId) - { - try - { - var vsPackage = default(IVsPackage); - - var vsShell = GetService(typeof(SVsShell)) as IVsShell; - vsShell.IsPackageLoaded(ref packageId, out vsPackage); - - if (vsPackage == null) - ErrorHandler.ThrowOnFailure(vsShell.LoadPackage(ref packageId, out vsPackage)); - - return (IServiceProvider)vsPackage; - } - catch { return null; } - } - - protected override void Dispose(bool disposing) - { - base.Dispose(disposing); - if (disposing) - { - foreach (var disposable in extenderProviders) - { - disposable.Dispose(); - } - } - } - - void RegisterCommands() - { - var componentModel = this.GetService(typeof(SComponentModel)) as IComponentModel; - var menuCommandService = this.GetService(typeof(IMenuCommandService)) as OleMenuCommandService; - - var commands = componentModel.DefaultExportProvider.GetExportedValues(); - - foreach (var command in commands) - menuCommandService.AddCommand(command); - } - } -} diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio.UnitTests/NuGet.Packaging.VisualStudio.UnitTests.csproj b/src/VisualStudio/NuGet.Packaging.VisualStudio.UnitTests/NuGet.Packaging.VisualStudio.UnitTests.csproj deleted file mode 100644 index e58e2421..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio.UnitTests/NuGet.Packaging.VisualStudio.UnitTests.csproj +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - {AED0CC61-5461-4AF7-921E-8C292B44D0F5} - NuGet.Packaging.VisualStudio.UnitTests - NuGet.Packaging.VisualStudio.UnitTests - v4.6 - - - - - - - - - - - - - - - - - - - {9617edcd-23bb-41ea-827d-f5729d45b0af} - NuGet.Packaging.VisualStudio - - - - - - - - - - - \ No newline at end of file diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio.UnitTests/Wizards/MultiPlatformWizardSpec.cs b/src/VisualStudio/NuGet.Packaging.VisualStudio.UnitTests/Wizards/MultiPlatformWizardSpec.cs deleted file mode 100644 index 93f942f1..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio.UnitTests/Wizards/MultiPlatformWizardSpec.cs +++ /dev/null @@ -1,133 +0,0 @@ -using Clide; -using Microsoft.VisualStudio.Shell.Interop; -using Microsoft.VisualStudio.TemplateWizard; -using Moq; -using System.Collections.Generic; -using System.Linq; -using Xunit; - -namespace NuGet.Packaging.VisualStudio.UnitTests.Wizards -{ - public class MultiPlatformWizardSpec - { - Mock solutionExplorer = new Mock(); - Mock platformProvider = new Mock(); - Mock uiShell = new Mock(); - - [Fact] - public void when_wizard_is_started_with_default_values_then_models_are_created() - { - var wizard = new MultiPlatformWizard( - platformProvider.Object, solutionExplorer.Object, uiShell.Object); - wizard.ShowDialog = false; - - wizard.RunStarted(null, new Dictionary(), WizardRunKind.AsNewProject, null); - - Assert.NotNull(wizard.ViewModel); - } - - [Fact] - public void when_wizard_is_started_then_supported_platforms_are_added() - { - var wizard = new MultiPlatformWizard( - platformProvider.Object, solutionExplorer.Object, uiShell.Object); - wizard.ShowDialog = false; - - platformProvider - .Setup(x => x.GetSupportedPlatforms()) - .Returns(new[] - { - new PlatformViewModel { DisplayName = "Foo" } - }); - - wizard.RunStarted(null, new Dictionary(), WizardRunKind.AsNewProject, null); - - Assert.Equal(1, wizard.ViewModel.Platforms.Count); - Assert.Equal("Foo", wizard.ViewModel.Platforms.Single().DisplayName); - } - - [Fact] - public void when_wizard_is_finished_then_selected_platforms_are_unfolded() - { - var wizard = new MultiPlatformWizard( - platformProvider.Object, solutionExplorer.Object, uiShell.Object); - - var solution = new Mock(); - var solutionAsProjectContainer = new Mock(); - - solution - .Setup(x => x.As()) - .Returns(solutionAsProjectContainer.Object); - - solutionExplorer - .Setup(x => x.Solution) - .Returns(solution.Object); - - platformProvider - .Setup(x => x.GetSupportedPlatforms()) - .Returns(new[] - { - new PlatformViewModel { Id = "Xamarin.iOS" }, - new PlatformViewModel { Id = "Xamarin.Android" } - }); - - wizard.SolutionDirectory = @"c:\src\App"; - wizard.SafeProjectName = "App"; - - wizard.ViewModel = new MultiPlatformViewModel(); - wizard.ViewModel.Platforms.Add(new PlatformViewModel { Id = "Xamarin.iOS", IsSelected = true }); - wizard.ViewModel.Platforms.Add(new PlatformViewModel { Id = "Xamarin.Android", IsSelected = false }); - - var sharedProject = new Mock(); - var nuGetProject = new Mock(); - var nuGetProjectAsRefrenceContainer = new Mock(); - nuGetProject.Setup(x => x.As()).Returns(nuGetProjectAsRefrenceContainer.Object); - var iosProject = new Mock(); - var iosProjectAsReferenceContainer = new Mock(); - iosProject.Setup(x => x.As()).Returns(iosProjectAsReferenceContainer.Object); - - solutionAsProjectContainer - .Setup(x => x.UnfoldTemplate( - Constants.Templates.SharedProject, It.IsAny(), It.IsAny())) - .Returns(sharedProject.Object); - - solutionAsProjectContainer - .Setup(x => x.UnfoldTemplate( - Constants.Templates.NuGetPackage, It.IsAny(), It.IsAny())) - .Returns(nuGetProject.Object); - - solutionAsProjectContainer - .Setup(x => x.UnfoldTemplate( - Constants.Templates.IOS, It.IsAny(), It.IsAny())) - .Returns(iosProject.Object); - - wizard.RunFinished(); - - // Verify that the IOS project has been unfolded - solutionAsProjectContainer.Verify(x => x.UnfoldTemplate("Xamarin.iOS.Library", @"App.iOS", It.IsAny())); - // Verify that the Android project has been unfolded - solutionAsProjectContainer.Verify(x => x.UnfoldTemplate("Xamarin.Android.ClassLibrary", It.IsAny(), It.IsAny()), Times.Never); - - // iOS project references the shared project - iosProjectAsReferenceContainer.Verify(x => x.AddReference(sharedProject.Object)); - // NuGet project references the iOS project - nuGetProjectAsRefrenceContainer.Verify(x => x.AddReference(iosProject.Object)); - } - - [Fact] - public void when_parsing_parameters_then_builtin_parameres_are_parsed() - { - var wizard = new MultiPlatformWizard(); - - wizard.ParseParameters(new Dictionary - { - {"author$", "Microsoft" }, - {"$safeprojectname$", "foo" }, - {"$solutiondirectory$", @"c:\foo" }, - }); - - Assert.Equal("foo", wizard.SafeProjectName); - Assert.Equal(@"c:\foo", wizard.SolutionDirectory); - } - } -} diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio.UnitTests/app.config b/src/VisualStudio/NuGet.Packaging.VisualStudio.UnitTests/app.config deleted file mode 100644 index 079920a1..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio.UnitTests/app.config +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio.sln b/src/VisualStudio/NuGet.Packaging.VisualStudio.sln deleted file mode 100644 index 5608d2cb..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio.sln +++ /dev/null @@ -1,49 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26510.0 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NuGet.Packaging.VisualStudio", "NuGet.Packaging.VisualStudio\NuGet.Packaging.VisualStudio.csproj", "{9617EDCD-23BB-41EA-827D-F5729D45B0AF}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NuGet.Packaging.VisualStudio.UnitTests", "NuGet.Packaging.VisualStudio.UnitTests\NuGet.Packaging.VisualStudio.UnitTests.csproj", "{AED0CC61-5461-4AF7-921E-8C292B44D0F5}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{B6FDDFD1-0254-44F4-B631-1FC78865773A}" - ProjectSection(SolutionItems) = preProject - ..\..\appveyor.yml = ..\..\appveyor.yml - ..\..\build.proj = ..\..\build.proj - ..\NuGet.Build.Packaging.Shared.props = ..\NuGet.Build.Packaging.Shared.props - ..\NuGet.Build.Packaging.Shared.targets = ..\NuGet.Build.Packaging.Shared.targets - NuGet.Packaging.VisualStudio.Shared.targets = NuGet.Packaging.VisualStudio.Shared.targets - EndProjectSection -EndProject -Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "NuGet.Packaging.VisualStudio.Shared", "NuGet.Packaging.VisualStudio.Shared\NuGet.Packaging.VisualStudio.Shared.shproj", "{70D9BBBC-B982-4210-9F66-5A02AEA268FE}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NuGet.Packaging.VisualStudio.15", "NuGet.Packaging.VisualStudio.15\NuGet.Packaging.VisualStudio.15.csproj", "{CD844274-2306-4273-8D2C-E1B040457D79}" -EndProject -Global - GlobalSection(SharedMSBuildProjectFiles) = preSolution - NuGet.Packaging.VisualStudio.Shared\NuGet.Packaging.VisualStudio.Shared.projitems*{70d9bbbc-b982-4210-9f66-5a02aea268fe}*SharedItemsImports = 13 - NuGet.Packaging.VisualStudio.Shared\NuGet.Packaging.VisualStudio.Shared.projitems*{cd844274-2306-4273-8d2c-e1b040457d79}*SharedItemsImports = 4 - EndGlobalSection - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {9617EDCD-23BB-41EA-827D-F5729D45B0AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9617EDCD-23BB-41EA-827D-F5729D45B0AF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9617EDCD-23BB-41EA-827D-F5729D45B0AF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9617EDCD-23BB-41EA-827D-F5729D45B0AF}.Release|Any CPU.Build.0 = Release|Any CPU - {AED0CC61-5461-4AF7-921E-8C292B44D0F5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AED0CC61-5461-4AF7-921E-8C292B44D0F5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AED0CC61-5461-4AF7-921E-8C292B44D0F5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AED0CC61-5461-4AF7-921E-8C292B44D0F5}.Release|Any CPU.Build.0 = Release|Any CPU - {CD844274-2306-4273-8D2C-E1B040457D79}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CD844274-2306-4273-8D2C-E1B040457D79}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CD844274-2306-4273-8D2C-E1B040457D79}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CD844274-2306-4273-8D2C-E1B040457D79}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio/BuildService.cs b/src/VisualStudio/NuGet.Packaging.VisualStudio/BuildService.cs deleted file mode 100644 index e1846af6..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio/BuildService.cs +++ /dev/null @@ -1,71 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.ComponentModel.Composition; -using Clide; -using Microsoft.VisualStudio.Shell; -using Microsoft.VisualStudio.Shell.Interop; -using Microsoft.VisualStudio; - -namespace NuGet.Packaging.VisualStudio -{ - [Export(typeof(IBuildService))] - [PartCreationPolicy(CreationPolicy.Shared)] - public class BuildService : IBuildService, IVsUpdateSolutionEvents - { - const string PackOnBuildFilename = ".packonbuild"; - - readonly uint updateSolutionEventsCookie; - readonly IVsSolutionBuildManager2 buildManager; - - List cleanupFilesOnBuildDone = new List(); - - [ImportingConstructor] - public BuildService([Import(typeof(SVsServiceProvider))] IServiceProvider serviceProvider) - { - buildManager = serviceProvider.GetService(); - buildManager.AdviseUpdateSolutionEvents(this, out updateSolutionEventsCookie); - } - - public void Pack(IProjectNode project) - { - var hierarchy = project.AsVsHierarchy(); - if (hierarchy != null) - { - var targetPackOnBuildFile = Path.Combine( - Path.GetDirectoryName(project.PhysicalPath), PackOnBuildFilename); - - // Write the .packonbuild empty file which is used by the targets - // to override the PackOnBuild property and generate the .nupkg - if (!File.Exists(targetPackOnBuildFile)) - File.WriteAllText(targetPackOnBuildFile, string.Empty); - - cleanupFilesOnBuildDone.Add(targetPackOnBuildFile); - - buildManager.StartSimpleUpdateProjectConfiguration(hierarchy, null, null, - (uint)(VSSOLNBUILDUPDATEFLAGS.SBF_OPERATION_FORCE_UPDATE | VSSOLNBUILDUPDATEFLAGS.SBF_OPERATION_BUILD), 0, 0); - } - } - - int IVsUpdateSolutionEvents.OnActiveProjectCfgChange(IVsHierarchy pIVsHierarchy) => VSConstants.S_OK; - - int IVsUpdateSolutionEvents.UpdateSolution_Begin(ref int pfCancelUpdate) => VSConstants.S_OK; - - int IVsUpdateSolutionEvents.UpdateSolution_Cancel() => VSConstants.S_OK; - - int IVsUpdateSolutionEvents.UpdateSolution_Done(int fSucceeded, int fModified, int fCancelCommand) - { - // Once the build is done, delete the .packonbuild files - foreach (var file in cleanupFilesOnBuildDone) - if (File.Exists(file)) - File.Delete(file); - - cleanupFilesOnBuildDone.Clear(); - - return VSConstants.S_OK; - } - - int IVsUpdateSolutionEvents.UpdateSolution_StartUpdate(ref int pfCancelUpdate) => VSConstants.S_OK; - } -} \ No newline at end of file diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio/Commands.cs b/src/VisualStudio/NuGet.Packaging.VisualStudio/Commands.cs deleted file mode 100644 index 1d7f1ebf..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio/Commands.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; -using System.ComponentModel.Design; - -namespace NuGet.Packaging.VisualStudio -{ - class Commands - { - public static readonly CommandID CreateNuGetPackageCommandId = - new CommandID(new Guid(Guids.CommandSetGuid), 0x0100); - - public static readonly CommandID AddPlatformImplementationCommandId = - new CommandID(new Guid(Guids.CommandSetGuid), 0x0101); - } -} \ No newline at end of file diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio/Commands/AddPlatformImplementationCommand.cs b/src/VisualStudio/NuGet.Packaging.VisualStudio/Commands/AddPlatformImplementationCommand.cs deleted file mode 100644 index 9e33092d..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio/Commands/AddPlatformImplementationCommand.cs +++ /dev/null @@ -1,119 +0,0 @@ -using System.Linq; -using System.ComponentModel.Composition; -using Clide; -using System.Windows; -using Microsoft.VisualStudio.Shell; -using NuGet.VisualStudio; - -namespace NuGet.Packaging.VisualStudio -{ - [Export(typeof(DynamicCommand))] - class AddPlatformImplementationCommand : DynamicCommand - { - readonly ISolutionExplorer solutionExplorer; - readonly IDialogService dialogService; - readonly IPlatformProvider platformProvider; - readonly IVsPackageInstaller packageInstaller; - readonly IVsPackageInstallerServices packageInstallerServices; - - [ImportingConstructor] - public AddPlatformImplementationCommand( - ISolutionExplorer solutionExplorer, - IPlatformProvider platformProvider, - IDialogService dialogService, - IVsPackageInstaller packageInstaller, - IVsPackageInstallerServices packageInstallerServices) - : base(Commands.AddPlatformImplementationCommandId) - { - this.solutionExplorer = solutionExplorer; - this.platformProvider = platformProvider; - this.dialogService = dialogService; - this.packageInstaller = packageInstaller; - this.packageInstallerServices = packageInstallerServices; - } - - protected override void Execute() - { - var context = new SolutionContext(solutionExplorer); - context.Initialize(solutionExplorer.Solution.ActiveProject); - - var viewModel = new AddPlatformImplementationViewModel(); - - foreach (var platform in platformProvider.GetSupportedPlatforms()) - { - platform.IsEnabled = context.GetProjectNode(platform) == null; - viewModel.Platforms.Add(platform); - } - - if (!viewModel.Platforms.Any(x => x.IsEnabled)) - { - MessageBox.Show( - "The available platform projects are already present in the current solution. Please select a different library or remove any of the platform projects.", - "Add Platform Implementation", - MessageBoxButton.OK, - MessageBoxImage.Exclamation); - - return; - } - - viewModel.IsSharedProjectEnabled = context.SharedProject == null; - - var view = new AddPlatformImplementationView(); - view.DataContext = viewModel; - - if (dialogService.ShowDialog(view) == true) - { - if (context.SharedProject == null && viewModel.UseSharedProject) - { - context.SharedProject = solutionExplorer.Solution.UnfoldTemplate( - Constants.Templates.SharedProject, context.SharedProjectName); - } - - if (context.NuGetProject == null) - { - context.NuGetProject = solutionExplorer.Solution.UnfoldTemplate( - Constants.Templates.NuGetPackage, context.NuGetProjectName); - } - - context.NuGetProject.AddReference(context.SelectedProject); - - EnsureBuildPackagingNugetInstalled(context.SelectedProject); - - foreach (var selectedPlatform in viewModel.Platforms.Where(x => x.IsEnabled && x.IsSelected)) - { - var projectName = context.GetTargetProjectName(selectedPlatform); - var project = context.GetProjectNode(projectName); - - if (project == null) - project = solutionExplorer.Solution.UnfoldTemplate( - Constants.Templates.GetPlatformTemplate(selectedPlatform.Id), - projectName); - - EnsureBuildPackagingNugetInstalled(project); - - if (context.SharedProject != null && viewModel.UseSharedProject) - project.AddReference(context.SharedProject); - - context.NuGetProject.AddReference(project); - } - } - } - - void EnsureBuildPackagingNugetInstalled(IProjectNode project) - { - var dteProject = project.As(); - - if (!packageInstallerServices.IsBuildPackagingNuGetInstalled(dteProject)) - packageInstaller.InstallBuildPackagingNuget(dteProject); - } - - IProjectNode ActiveProject => solutionExplorer.Solution.ActiveProject; - - protected override void CanExecute(OleMenuCommand command) => - command.Enabled = command.Visible = CanExecute(); - - bool CanExecute() => - KnownUIContexts.SolutionExistsAndNotBuildingAndNotDebuggingContext.IsActive && - ActiveProject.Supports(Constants.PortableClassLibraryCapability); - } -} \ No newline at end of file diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio/Commands/CreateNuGetPackageCommand.cs b/src/VisualStudio/NuGet.Packaging.VisualStudio/Commands/CreateNuGetPackageCommand.cs deleted file mode 100644 index d09f6514..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio/Commands/CreateNuGetPackageCommand.cs +++ /dev/null @@ -1,81 +0,0 @@ -using Clide; -using EnvDTE; -using Microsoft.VisualStudio.Shell; -using Microsoft.VisualStudio.Shell.Interop; -using NuGet.Build.Packaging; -using NuGet.VisualStudio; -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition; - -namespace NuGet.Packaging.VisualStudio -{ - [Export(typeof(DynamicCommand))] - class CreateNuGetPackageCommand : DynamicCommand - { - const string PackTargetName = "Pack"; - - readonly ISolutionExplorer solutionExplorer; - readonly IDialogService dialogService; - readonly IVsPackageInstaller packageInstaller; - readonly IVsPackageInstallerServices packageInstallerServices; - readonly IBuildService buildService; - - [ImportingConstructor] - public CreateNuGetPackageCommand( - ISolutionExplorer solutionExplorer, - IDialogService dialogService, - IVsPackageInstaller packageInstaller, - IVsPackageInstallerServices packageInstallerServices, - IBuildService msBuildService) - : base(Commands.CreateNuGetPackageCommandId) - { - this.solutionExplorer = solutionExplorer; - this.dialogService = dialogService; - this.packageInstaller = packageInstaller; - this.packageInstallerServices = packageInstallerServices; - this.buildService = msBuildService; - } - - protected override void Execute() - { - if (ActiveProject == null) - return; - - var project = ActiveProject.As(); - var vsBuildPropertyStorage = ActiveProject.AsVsHierarchy() as IVsBuildPropertyStorage; - if (vsBuildPropertyStorage != null) - { - var storage = new BuildPropertyStorage(vsBuildPropertyStorage); - var viewModel = new PackageMetadataViewModel(storage); - - if (!packageInstallerServices.IsBuildPackagingNuGetInstalled(project)) - { - // Provide default values for required fields/properties - viewModel.PackageId = project.Name; - viewModel.PackageVersion = "1.0.0"; - viewModel.Description = project.Name; - viewModel.Authors = "MyCompany"; - } - - var view = new PackageMetadataView() { DataContext = viewModel }; - if (dialogService.ShowDialog(view) == true) - { - storage.CommitChanges(); - - if (!packageInstallerServices.IsBuildPackagingNuGetInstalled(project)) - packageInstaller.InstallBuildPackagingNuget(project); - - buildService.Pack(ActiveProject); - } - } - } - - protected override void CanExecute(OleMenuCommand command) => - command.Enabled = command.Visible = CanExecute(); - - IProjectNode ActiveProject => solutionExplorer.Solution.ActiveProject; - - bool CanExecute() => KnownUIContexts.SolutionExistsAndNotBuildingAndNotDebuggingContext.IsActive && ActiveProject != null; - } -} \ No newline at end of file diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio/Commands/DynamicCommand.cs b/src/VisualStudio/NuGet.Packaging.VisualStudio/Commands/DynamicCommand.cs deleted file mode 100644 index 2f821f54..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio/Commands/DynamicCommand.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; -using System.ComponentModel.Design; -using Microsoft.VisualStudio.Shell; - -namespace NuGet.Packaging.VisualStudio -{ - public abstract class DynamicCommand : OleMenuCommand - { - public DynamicCommand(CommandID id) - : base(OnExecute, id) - { - BeforeQueryStatus += new EventHandler(OnBeforeQueryStatus); - } - - void OnBeforeQueryStatus(object sender, EventArgs e) - { - CanExecute(sender as OleMenuCommand); - } - - static void OnExecute(object sender, EventArgs e) - { - var command = sender as DynamicCommand; - if (command != null) - command.Execute(); - } - - protected virtual void CanExecute(OleMenuCommand command) - { - command.Enabled = command.Visible = command.Supported = true; - } - - protected abstract void Execute(); - } -} \ No newline at end of file diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio/Constants.cs b/src/VisualStudio/NuGet.Packaging.VisualStudio/Constants.cs deleted file mode 100644 index dae800d4..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio/Constants.cs +++ /dev/null @@ -1,79 +0,0 @@ -namespace NuGet.Packaging.VisualStudio -{ - using BuildPaclagingAssembly = NuGet.Build.Packaging.ThisAssembly; - - public class Constants - { - public const string NuProjCapability = "PackagingProject"; - - public const string PortableClassLibraryCapability = "MultiTarget"; - - /// - /// The file extension of this project type. No preceding period. - /// - public const string ProjectExtension = "nuproj"; - public const string ProjectFileExtension = "." + ProjectExtension; - - public const string Language = "NuGet"; - public const string NuGetAuthoringPathPropertyName = "NuGetAuthoringPath"; - - public const string PackageReferenceItemName = "PackageReference"; - - public class UIContext - { - public const string AddPlatformImplementation = "2590DF87-84EB-487A-A1FF-160BEAF4F9CA"; - public const string NuProj = "41F43535-FCA3-4171-8009-59A5116F71B4"; - } - - public class NuGet - { - // TODO: We need to generate these values automatically - public const string RepositoryId = "NuGet.Packaging"; - public const string BuildPackagingId = "NuGet.Build.Packaging"; - public const string BuildPackagingVersion = BuildPaclagingAssembly.Project.Properties.PackageVersion; - } - - public class Platforms - { - public const string IOS = "Xamarin.iOS"; - public const string Android = "Xamarin.Android"; - } - - public class Suffixes - { - public static readonly string IOS = Resources.IOS_Suffix; - public static readonly string Android = Resources.Android_Suffix; - public static readonly string NuGetPackage = "NuGet"; - public static readonly string SharedProject = "Shared"; - - public static string GetSuffixForPlatform(string platformId) - { - if (string.Equals(Platforms.IOS, platformId, System.StringComparison.OrdinalIgnoreCase)) - return IOS; - if (string.Equals(Platforms.Android, platformId, System.StringComparison.OrdinalIgnoreCase)) - return Android; - - return null; - } - } - - public class Templates - { - public const string IOS = "Xamarin.iOS.Library"; - public const string Android = "Xamarin.Android.ClassLibrary"; - public const string NuGetPackage = "NuGet.Packaging.VisualStudio.Package"; - public const string SharedProject = "Microsoft.CS.SharedProject"; - public const string PortableClassLibrary = "NuGet.Packaging.VisualStudio.Portable"; - - public static string GetPlatformTemplate(string platformId) - { - switch (platformId) - { - case Platforms.IOS: return IOS; - case Platforms.Android: return Android; - default: return null; - } - } - } - } -} diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio/Converters/ExtendedBooleanToVisiblityConverter.cs b/src/VisualStudio/NuGet.Packaging.VisualStudio/Converters/ExtendedBooleanToVisiblityConverter.cs deleted file mode 100644 index 522a8729..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio/Converters/ExtendedBooleanToVisiblityConverter.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Windows; -using System.Windows.Data; - -namespace NuGet.Packaging.VisualStudio -{ - public class ExtendedBooleanToVisiblityConverter : IValueConverter - { - public bool VisibleIfFalse { get; set; } - public bool HiddenInsteadOfCollapsed { get; set; } - - public object Convert (object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) - { - return (value is bool && ((bool)value != VisibleIfFalse)) ? Visibility.Visible : (HiddenInsteadOfCollapsed ? Visibility.Hidden : Visibility.Collapsed); - } - - public object ConvertBack (object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) - { - return (value is Visibility && (Visibility)value == Visibility.Visible) != VisibleIfFalse; - } - } -} \ No newline at end of file diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio/Converters/InverseBooleanConverter.cs b/src/VisualStudio/NuGet.Packaging.VisualStudio/Converters/InverseBooleanConverter.cs deleted file mode 100644 index 5e145cc5..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio/Converters/InverseBooleanConverter.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Data; - -namespace NuGet.Packaging.VisualStudio -{ - public class InverseBooleanConverter : IValueConverter - { - public object Convert (object value, Type targetType, object parameter, CultureInfo culture) - { - return ! (bool) value; - } - - public object ConvertBack (object value, Type targetType, object parameter, CultureInfo culture) - { - return !(bool)value; - } - } -} diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio/Converters/ValueToVisibilityConverter.cs b/src/VisualStudio/NuGet.Packaging.VisualStudio/Converters/ValueToVisibilityConverter.cs deleted file mode 100644 index a279e89c..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio/Converters/ValueToVisibilityConverter.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Windows; -using System.Windows.Data; - -namespace NuGet.Packaging.VisualStudio -{ - public class ValueToVisibilityConverter : IValueConverter - { - public bool VisibleIfFalse { get; set; } - public bool HiddenInsteadOfCollapsed { get; set; } - - // Adapts to the given type taking as true: - // string if it's not null or empty. - // other type if it's not null. - public object Convert (object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) - { - bool boolValue = true; - if (value is bool) { - boolValue = (bool)value; - } else if (value is string) { - boolValue = !string.IsNullOrEmpty (value as string); - } else boolValue = value != null; - - return ((boolValue != VisibleIfFalse) ? Visibility.Visible : (HiddenInsteadOfCollapsed ? Visibility.Hidden : Visibility.Collapsed)); - } - - // Always return a boolean - public object ConvertBack (object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) - { - return (value is Visibility && (Visibility)value == Visibility.Visible) != VisibleIfFalse; - } - } -} \ No newline at end of file diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio/DialogService.cs b/src/VisualStudio/NuGet.Packaging.VisualStudio/DialogService.cs deleted file mode 100644 index d4a13641..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio/DialogService.cs +++ /dev/null @@ -1,37 +0,0 @@ -using Microsoft.VisualStudio.Shell; -using Microsoft.VisualStudio.Shell.Interop; -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; - -namespace NuGet.Packaging.VisualStudio -{ - [Export(typeof(IDialogService))] - class DialogService : IDialogService - { - readonly IVsUIShell uiShell; - - [ImportingConstructor] - public DialogService([Import(typeof(SVsServiceProvider))] IServiceProvider serviceProvider) - { - this.uiShell = serviceProvider.GetService(); - } - - public bool ShowConfirmationMessage(string message) => - System.Windows.Forms.MessageBox.Show( - message, - Resources.DefaultDialogCaption, - System.Windows.Forms.MessageBoxButtons.OKCancel) == System.Windows.Forms.DialogResult.OK; - - public bool? ShowDialog(T dialog) where T : Window - { - uiShell.SetOwner(dialog); - - return dialog.ShowDialog(); - } - } -} diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio/ExtenderProviders/IVsBuildPropertyStorageExtensions.cs b/src/VisualStudio/NuGet.Packaging.VisualStudio/ExtenderProviders/IVsBuildPropertyStorageExtensions.cs deleted file mode 100644 index d3228ee0..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio/ExtenderProviders/IVsBuildPropertyStorageExtensions.cs +++ /dev/null @@ -1,109 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Microsoft.VisualStudio; -using Microsoft.VisualStudio.Shell.Interop; - -namespace NuGet.Packaging.VisualStudio -{ - static class IVsBuildPropertyStorageExtensions - { - public static bool GetItemAttribute(this IVsBuildPropertyStorage propertyStorage, uint item, string name, bool defaultValue) - { - string value; - bool result; - if (ErrorHandler.Succeeded(propertyStorage.GetItemAttribute(item, name, out value)) && - bool.TryParse(value, out result)) - { - return result; - } - - return defaultValue; - } - - public static void SetItemAttribute(this IVsBuildPropertyStorage propertyStorage, uint item, string name, bool value, bool defaultValue) - { - if (value != defaultValue) - { - propertyStorage.SetItemAttribute(item, name, value.ToString().ToLowerInvariant()); - } - else - { - propertyStorage.SetItemAttribute(item, name, null); - } - } - - public static bool GetGlobalProperty(this IVsBuildPropertyStorage propertyStorage, string propertyName, bool defaultValue) - { - var value = propertyStorage.GetGlobalProperty(propertyName, defaultValue.ToString(CultureInfo.InvariantCulture).ToLowerInvariant()); - bool result; - if (!bool.TryParse(value, out result)) - { - return defaultValue; - } - - return result; - } - - public static void SetGlobalProperty(this IVsBuildPropertyStorage propertyStorage, string propertyName, bool value, bool defaultValue) - { - propertyStorage.SetGlobalProperty(propertyName, - value.ToString(CultureInfo.InvariantCulture).ToLowerInvariant(), - defaultValue.ToString(CultureInfo.InvariantCulture).ToLowerInvariant()); - } - - public static string GetGlobalProperty(this IVsBuildPropertyStorage propertyStorage, string propertyName, string defaultValue) - { - string value; - - // Get the evaluated property value with null condition. - // Why null and not String.Empty? - // There is performance and (functionality implications) for String.Empty condition. - // String.Empty will force us to reevaluate the project with Config = "" and Platform = "", read the value, - // and reevaluate back. This ensures that only not conditional property value is read.But the price is we reevaluating twice. - // "null" means we will just read the value using the current evaluation setitings. - // If property is defined in "gobal" secitopn this is the same. - // If property is "overriden" in "confug" section it will in fact get this value, - // but apart that the contract is already broken, that would be the value - // that will be assigned during build for task to access anyway so it will be the "truth". - int hr = propertyStorage.GetPropertyValue(propertyName, null, (uint)_PersistStorageType.PST_PROJECT_FILE, out value); - if (!ErrorHandler.Succeeded(hr) || string.IsNullOrEmpty(value)) - { - return defaultValue; - } - - return value; - } - - public static void SetGlobalProperty(this IVsBuildPropertyStorage propertyStorage, string propertyName, string value, string defaultValue) - { - if (string.IsNullOrEmpty(value) || value == defaultValue) - { - //propertyStorage.RemoveProperty( - // propertyName, - // string.Empty, - // (uint)_PersistStorageType.PST_PROJECT_FILE); - - // Removing the value never works, so it's worse to leave it empty than to serialize the - // default value, I think. - propertyStorage.SetPropertyValue( - propertyName, - string.Empty, - (uint)_PersistStorageType.PST_PROJECT_FILE, - defaultValue); - } - else - { - // Set the property with String.Empty condition to ensure it's global (not configuration scoped). - propertyStorage.SetPropertyValue( - propertyName, - string.Empty, - (uint)_PersistStorageType.PST_PROJECT_FILE, - value); - } - } - } -} diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio/ExtenderProviders/LibraryProjectExtender.cs b/src/VisualStudio/NuGet.Packaging.VisualStudio/ExtenderProviders/LibraryProjectExtender.cs deleted file mode 100644 index adc4e525..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio/ExtenderProviders/LibraryProjectExtender.cs +++ /dev/null @@ -1,260 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Globalization; -using System.Linq; -using System.Runtime.InteropServices; -using System.Text; -using System.Threading.Tasks; -using EnvDTE; -using Microsoft.VisualStudio; -using Microsoft.VisualStudio.Shell.Interop; - -namespace NuGet.Packaging.VisualStudio.ExtenderProviders -{ - [ComVisible(true)] - [ClassInterface(ClassInterfaceType.AutoDispatch)] - public class LibraryProjectExtender - { - const string CategoryName = "NuGet"; - const string BuildCategoryName = "NuGet Build"; - - readonly IVsBuildPropertyStorage propertyStorage; - readonly IExtenderSite site; - readonly int cookie; - - internal LibraryProjectExtender(IVsHierarchy hierarchy, IExtenderSite site, int cookie) - { - propertyStorage = (IVsBuildPropertyStorage)hierarchy; - this.site = site; - this.cookie = cookie; - } - - public void Dispose() - { - site.NotifyDelete(cookie); - } - - [DefaultValue(true)] - [Description("Whether to include the primary outputs of this project in the package. Defaults to 'true'.")] - [DisplayName("Include Outputs")] - [Category(BuildCategoryName)] - public bool IncludeOutputsInPackage - { - get { return propertyStorage.GetGlobalProperty(nameof(IncludeOutputsInPackage), true); } - set { propertyStorage.SetGlobalProperty(nameof(IncludeOutputsInPackage), value, true); } - } - - [DefaultValue(true)] - [Description("Whether to include symbols in the package if 'Include Outputs' is 'true'. Defaults to 'true' for debug builds, 'false' otherwise.")] - [DisplayName("Include Symbols")] - [Category(BuildCategoryName)] - public bool IncludeSymbolsInPackage - { - get { return propertyStorage.GetGlobalProperty(nameof(IncludeSymbolsInPackage), true); } - set { propertyStorage.SetGlobalProperty(nameof(IncludeSymbolsInPackage), value, true); } - } - - [DefaultValue(true)] - [Description("Whether to include the content items in the package. Defaults to 'true'.")] - [DisplayName("Include Content")] - [Category(BuildCategoryName)] - public bool IncludeContentInPackage - { - get { return propertyStorage.GetGlobalProperty(nameof(IncludeContentInPackage), true); } - set { propertyStorage.SetGlobalProperty(nameof(IncludeContentInPackage), value, true); } - } - - [DefaultValue(true)] - [Description("Whether to include the referenced framework assemblies as dependencies in the package. Defaults to 'true'.")] - [DisplayName("Include Framework References")] - [Category(BuildCategoryName)] - public bool IncludeFrameworkReferencesInPackage - { - get { return propertyStorage.GetGlobalProperty(nameof(IncludeFrameworkReferencesInPackage), true); } - set { propertyStorage.SetGlobalProperty(nameof(IncludeFrameworkReferencesInPackage), value, true); } - } - - [DefaultValue("")] - [Description("The output directory for the generated NuGet package. Defaults to the project's $(OutputPath) property.")] - [DisplayName("Output Path")] - [Category(BuildCategoryName)] - public string PackageOutputPath - { - get { return propertyStorage.GetGlobalProperty(nameof(PackageOutputPath), ""); } - set { propertyStorage.SetGlobalProperty(nameof(PackageOutputPath), value, ""); } - } - - [DefaultValue(false)] - [Description("Specifies if the output NuGet package should be generated on build. Only applies to projects that have a package Id set.")] - [DisplayName("Pack on Build")] - [Category(BuildCategoryName)] - public bool PackOnBuild - { - get { return propertyStorage.GetGlobalProperty(nameof(PackOnBuild), false); } - set { propertyStorage.SetGlobalProperty(nameof(PackOnBuild), value, false); } - } - - [DefaultValue("")] - [Description("Package identifier.")] - [DisplayName("Id")] - [Category(CategoryName)] - public string PackageId - { - get { return propertyStorage.GetGlobalProperty(nameof(PackageId), ""); } - set { propertyStorage.SetGlobalProperty(nameof(PackageId), value, ""); } - } - - [DefaultValue("")] - [Description("Package version.")] - [DisplayName("Version")] - [Category(CategoryName)] - public string PackageVersion - { - get { return propertyStorage.GetGlobalProperty(nameof(PackageVersion), ""); } - set { propertyStorage.SetGlobalProperty(nameof(PackageVersion), value, ""); } - } - - [DefaultValue(false)] - [Description("Specifies if the project generates a development dependency package.")] - [DisplayName("Is Development Dependency")] - [Category(CategoryName)] - public bool IsDevelopmentDependency - { - get { return propertyStorage.GetGlobalProperty(nameof(IsDevelopmentDependency), false); } - set { propertyStorage.SetGlobalProperty(nameof(IsDevelopmentDependency), value, false); } - } - - [DefaultValue("")] - [Category(CategoryName)] - public string Authors - { - get { return propertyStorage.GetGlobalProperty(nameof(Authors), ""); } - set { propertyStorage.SetGlobalProperty(nameof(Authors), value, ""); } - } - - [DefaultValue("")] - [Category(CategoryName)] - public string Title - { - get { return propertyStorage.GetGlobalProperty(nameof(Title), ""); } - set { propertyStorage.SetGlobalProperty(nameof(Title), value, ""); } - } - - [DefaultValue("")] - [Category(CategoryName)] - public string Description - { - get { return propertyStorage.GetGlobalProperty(nameof(Description), ""); } - set { propertyStorage.SetGlobalProperty(nameof(Description), value, ""); } - } - - [DefaultValue("")] - [Category(CategoryName)] - public string Summary - { - get { return propertyStorage.GetGlobalProperty(nameof(Summary), ""); } - set { propertyStorage.SetGlobalProperty(nameof(Summary), value, ""); } - } - - [DefaultValue("")] - [DisplayName("Language")] - [Category(CategoryName)] - public string NeutralLanguage - { - get { return propertyStorage.GetGlobalProperty(nameof(NeutralLanguage), ""); } - set { propertyStorage.SetGlobalProperty(nameof(NeutralLanguage), value, ""); } - } - - [DefaultValue("")] - [Category(CategoryName)] - public string Copyright - { - get { return propertyStorage.GetGlobalProperty(nameof(Copyright), ""); } - set { propertyStorage.SetGlobalProperty(nameof(Copyright), value, ""); } - } - - [DefaultValue(false)] - [DisplayName("Require License Acceptance")] - [Category(CategoryName)] - public bool PackageRequireLicenseAcceptance - { - get { return propertyStorage.GetGlobalProperty(nameof(PackageRequireLicenseAcceptance), false); } - set { propertyStorage.SetGlobalProperty(nameof(PackageRequireLicenseAcceptance), value, false); } - } - - [DefaultValue("")] - [DisplayName("License Url")] - [Category(CategoryName)] - public string PackageLicenseUrl - { - get { return propertyStorage.GetGlobalProperty(nameof(PackageLicenseUrl), ""); } - set { propertyStorage.SetGlobalProperty(nameof(PackageLicenseUrl), value, ""); } - } - - [DefaultValue("")] - [DisplayName("Project Url")] - [Category(CategoryName)] - public string PackageProjectUrl - { - get { return propertyStorage.GetGlobalProperty(nameof(PackageProjectUrl), ""); } - set { propertyStorage.SetGlobalProperty(nameof(PackageProjectUrl), value, ""); } - } - - [DefaultValue("")] - [DisplayName("Icon Url")] - [Category(CategoryName)] - public string PackageIconUrl - { - get { return propertyStorage.GetGlobalProperty(nameof(PackageIconUrl), ""); } - set { propertyStorage.SetGlobalProperty(nameof(PackageIconUrl), value, ""); } - } - - [DefaultValue("")] - [Description("A space-delimited list of tags and keywords that describe the package.")] - [DisplayName("Tags")] - [Category(CategoryName)] - public string PackageTags - { - get { return propertyStorage.GetGlobalProperty(nameof(PackageTags), ""); } - set { propertyStorage.SetGlobalProperty(nameof(PackageTags), value, ""); } - } - - [DefaultValue("")] - [DisplayName("Release Notes")] - [Category(CategoryName)] - public string PackageReleaseNotes - { - get { return propertyStorage.GetGlobalProperty(nameof(PackageReleaseNotes), ""); } - set { propertyStorage.SetGlobalProperty(nameof(PackageReleaseNotes), value, ""); } - } - - [DefaultValue("")] - [DisplayName("Repository Url")] - [Category(CategoryName)] - public string RepositoryUrl - { - get { return propertyStorage.GetGlobalProperty(nameof(RepositoryUrl), ""); } - set { propertyStorage.SetGlobalProperty(nameof(RepositoryUrl), value, ""); } - } - - [DefaultValue("")] - [DisplayName("Repository Type")] - [Category(CategoryName)] - public string RepositoryType - { - get { return propertyStorage.GetGlobalProperty(nameof(RepositoryType), ""); } - set { propertyStorage.SetGlobalProperty(nameof(RepositoryType), value, ""); } - } - - [DefaultValue("")] - [Description("A comma-delimited list of package types that indicate how a package is intended to be used, such as 'Dependency' and 'DotnetCliTool'.")] - [DisplayName("Package Types")] - [Category(CategoryName)] - public string PackageTypes - { - get { return propertyStorage.GetGlobalProperty(nameof(PackageTypes), ""); } - set { propertyStorage.SetGlobalProperty(nameof(PackageTypes), value, ""); } - } - } -} diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio/ExtenderProviders/LibraryProjectExtenderProvider.cs b/src/VisualStudio/NuGet.Packaging.VisualStudio/ExtenderProviders/LibraryProjectExtenderProvider.cs deleted file mode 100644 index 70d3b358..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio/ExtenderProviders/LibraryProjectExtenderProvider.cs +++ /dev/null @@ -1,95 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using EnvDTE; -using Microsoft.VisualStudio; -using Microsoft.VisualStudio.Shell.Interop; -using VSLangProj; - -namespace NuGet.Packaging.VisualStudio.ExtenderProviders -{ - public class LibraryProjectExtenderProvider : EnvDTE.IExtenderProvider, EnvDTE80.IInternalExtenderProvider, IDisposable - { - internal const string ExtenderName = nameof(LibraryProjectExtender); - static bool inCanExtend = false; - - static ISet CategoryIds => new HashSet(new[] - { - PrjBrowseObjectCATID.prjCATIDCSharpProjectBrowseObject, - PrjBrowseObjectCATID.prjCATIDVBProjectBrowseObject, - }, StringComparer.OrdinalIgnoreCase); - - static bool IsSupportedCATID(string ExtenderCATID) => CategoryIds.Contains(ExtenderCATID); - - readonly ObjectExtenders extenders; - readonly int[] cookies; - - public LibraryProjectExtenderProvider(ObjectExtenders extenders) - { - this.extenders = extenders; - cookies = CategoryIds - .Select(catId => this.extenders.RegisterExtenderProvider(catId, ExtenderName, this)) - .ToArray(); - } - - public void Dispose() - { - foreach (var cookie in cookies) - { - extenders.UnregisterExtenderProvider(cookie); - } - } - - public bool CanExtend(string ExtenderCATID, string ExtenderName, object ExtendeeObject) - { - // check if provider can create extender for the given - // ExtenderCATID, ExtenderName, and Extendee instance - var extendeeCATIDProp = TypeDescriptor.GetProperties(ExtendeeObject)["ExtenderCATID"]; - - //Recursion Guard: We need to check the "Build Action" property in HasContentBuildAction. - //However, accessing this property will cause the Extender list to be built again, meaning - //that VS will call into our CanExtend method again. In this case, just return false. - if (inCanExtend) return false; - - inCanExtend = true; - var returnValue = ExtenderName.Equals(LibraryProjectExtenderProvider.ExtenderName) - && IsSupportedCATID(ExtenderCATID) - && extendeeCATIDProp != null - && IsSupportedCATID(extendeeCATIDProp.GetValue(ExtendeeObject).ToString()); - - inCanExtend = false; - - return returnValue; - } - - public object GetExtender(string ExtenderCATID, - string ExtenderName, - object ExtendeeObject, - IExtenderSite ExtenderSite, - int Cookie) - { - if (CanExtend(ExtenderCATID, ExtenderName, ExtendeeObject)) - { - var browseObject = ExtendeeObject as IVsBrowseObject; - if (browseObject != null) - { - IVsHierarchy hierarchy; - uint itemId; - int hr = browseObject.GetProjectItem(out hierarchy, out itemId); - if (ErrorHandler.Succeeded(hr) && hierarchy != null) - { - return new LibraryProjectExtender(hierarchy, ExtenderSite, Cookie); - } - } - } - - return null; - } - - public object GetExtenderNames(string ExtenderCATID, object ExtendeeObject) - { - return new string[] { ExtenderName }; - } - } -} diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio/ExtenderProviders/NoneItemExtender.cs b/src/VisualStudio/NuGet.Packaging.VisualStudio/ExtenderProviders/NoneItemExtender.cs deleted file mode 100644 index 16750503..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio/ExtenderProviders/NoneItemExtender.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System; -using System.ComponentModel; -using System.Runtime.InteropServices; -using EnvDTE; -using Microsoft.VisualStudio.Shell.Interop; - -namespace NuGet.Packaging.VisualStudio.ExtenderProviders -{ - [ComVisible(true)] - [ClassInterface(ClassInterfaceType.AutoDispatch)] - public class NoneItemExtender : IDisposable - { - const string CategoryName = "NuGet"; - - readonly IVsBuildPropertyStorage propertyStorage; - readonly uint item; - readonly IExtenderSite site; - readonly int cookie; - - public NoneItemExtender(IVsHierarchy hierarchy, uint item, IExtenderSite site, int cookie) - { - propertyStorage = (IVsBuildPropertyStorage)hierarchy; - this.item = item; - this.site = site; - this.cookie = cookie; - } - - public void Dispose() - { - site.NotifyDelete(cookie); - } - - [DefaultValue(false)] - [Description("Specifies whether the file will be included in the package. Supported for None items only.")] - [DisplayName("Include in Package")] - [Category(CategoryName)] - public bool IncludeInPackage - { - get { return propertyStorage.GetItemAttribute(item, nameof(IncludeInPackage), false); } - set { propertyStorage.SetItemAttribute(item, nameof(IncludeInPackage), value, false); } - } - } -} diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio/ExtenderProviders/NoneItemExtenderProvider.cs b/src/VisualStudio/NuGet.Packaging.VisualStudio/ExtenderProviders/NoneItemExtenderProvider.cs deleted file mode 100644 index 566762cb..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio/ExtenderProviders/NoneItemExtenderProvider.cs +++ /dev/null @@ -1,91 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using EnvDTE; -using Microsoft.VisualStudio; -using Microsoft.VisualStudio.Shell.Interop; - -namespace NuGet.Packaging.VisualStudio.ExtenderProviders -{ - public class NoneItemExtenderProvider : EnvDTE.IExtenderProvider, EnvDTE80.IInternalExtenderProvider, IDisposable - { - internal const string ExtenderName = nameof(NoneItemExtender); - static bool inCanExtend = false; - - static ISet CategoryIds => new HashSet(new[] - { - VSConstants.CATID.CSharpFileProperties_string, - VSConstants.CATID.VBFileProperties_string, - }, StringComparer.OrdinalIgnoreCase); - - static bool IsSupportedCATID(string ExtenderCATID) => CategoryIds.Contains(ExtenderCATID); - - readonly ObjectExtenders extenders; - readonly int[] cookies; - - public NoneItemExtenderProvider(ObjectExtenders extenders) - { - this.extenders = extenders; - cookies = CategoryIds - .Select(catId => this.extenders.RegisterExtenderProvider(catId, ExtenderName, this)) - .ToArray(); - } - - public void Dispose() - { - foreach (var cookie in cookies) - { - extenders.UnregisterExtenderProvider(cookie); - } - } - - public bool CanExtend(string ExtenderCATID, string ExtenderName, object ExtendeeObject) - { - // check if provider can create extender for the given - // ExtenderCATID, ExtenderName, and Extendee instance - var extendeeCATIDProp = TypeDescriptor.GetProperties(ExtendeeObject)["ExtenderCATID"]; - - //Recursion Guard: We need to check the "Build Action" property in HasContentBuildAction. - //However, accessing this property will cause the Extender list to be built again, meaning - //that VS will call into our CanExtend method again. In this case, just return false. - if (inCanExtend) return false; - - inCanExtend = true; - bool returnValue = ExtenderName.Equals(NoneItemExtenderProvider.ExtenderName) - && IsSupportedCATID(ExtenderCATID) - && extendeeCATIDProp != null - && IsSupportedCATID(extendeeCATIDProp.GetValue(ExtendeeObject).ToString()); - - inCanExtend = false; - - return returnValue; - } - - public object GetExtender(string ExtenderCATID, - string ExtenderName, - object ExtendeeObject, - EnvDTE.IExtenderSite ExtenderSite, - int Cookie) - { - NoneItemExtender extender = null; - if (CanExtend(ExtenderCATID, ExtenderName, ExtendeeObject)) - { - var browseObject = ExtendeeObject as IVsBrowseObject; - if (browseObject != null) - { - IVsHierarchy hierarchyItem; - uint itemId; - browseObject.GetProjectItem(out hierarchyItem, out itemId); - extender = new NoneItemExtender(hierarchyItem, itemId, ExtenderSite, Cookie); - } - } - return extender; - } - - public object GetExtenderNames(string ExtenderCATID, object ExtendeeObject) - { - return new string[] { ExtenderName }; - } - } -} diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio/ExtenderProviders/ProjectReferenceExtender.cs b/src/VisualStudio/NuGet.Packaging.VisualStudio/ExtenderProviders/ProjectReferenceExtender.cs deleted file mode 100644 index d2e98e53..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio/ExtenderProviders/ProjectReferenceExtender.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System; -using System.ComponentModel; -using System.Runtime.InteropServices; -using EnvDTE; -using Microsoft.VisualStudio.Shell.Interop; - -namespace NuGet.Packaging.VisualStudio.ExtenderProviders -{ - [ComVisible(true)] - [ClassInterface(ClassInterfaceType.AutoDispatch)] - public class ProjectReferenceExtender : IDisposable - { - const string CategoryName = "NuGet"; - - readonly IVsBuildPropertyStorage propertyStorage; - readonly uint item; - readonly IExtenderSite site; - readonly int cookie; - - public ProjectReferenceExtender(IVsHierarchy hierarchy, uint item, IExtenderSite site, int cookie) - { - propertyStorage = (IVsBuildPropertyStorage)hierarchy; - this.item = item; - this.site = site; - this.cookie = cookie; - } - - public void Dispose() - { - site.NotifyDelete(cookie); - } - - [DefaultValue(true)] - [Description("Specifies whether the referenced project will be included in the package.")] - [DisplayName("Include in Package")] - [Category(CategoryName)] - public bool IncludeInPackage - { - get { return propertyStorage.GetItemAttribute(item, nameof(IncludeInPackage), true); } - set { propertyStorage.SetItemAttribute(item, nameof(IncludeInPackage), value, true); } - } - } -} diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio/ExtenderProviders/ProjectReferenceExtenderProvider.cs b/src/VisualStudio/NuGet.Packaging.VisualStudio/ExtenderProviders/ProjectReferenceExtenderProvider.cs deleted file mode 100644 index a6edb773..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio/ExtenderProviders/ProjectReferenceExtenderProvider.cs +++ /dev/null @@ -1,98 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using EnvDTE; -using Microsoft.VisualStudio; -using Microsoft.VisualStudio.Shell.Interop; -using VSLangProj; - -namespace NuGet.Packaging.VisualStudio.ExtenderProviders -{ - public class ProjectReferenceExtenderProvider : EnvDTE.IExtenderProvider, EnvDTE80.IInternalExtenderProvider, IDisposable - { - internal const string ExtenderName = nameof(ProjectReferenceExtender); - static bool inCanExtend = false; - - public static ISet CategoryIds => new HashSet(new[] - { - PrjBrowseObjectCATID.prjCATIDCSharpReferenceBrowseObject, - PrjBrowseObjectCATID.prjCATIDVBReferenceBrowseObject, - }, StringComparer.OrdinalIgnoreCase); - - static bool IsSupportedCATID(string ExtenderCATID) => CategoryIds.Contains(ExtenderCATID); - - readonly ObjectExtenders extenders; - readonly int[] cookies; - - public ProjectReferenceExtenderProvider(ObjectExtenders extenders) - { - this.extenders = extenders; - cookies = CategoryIds - .Select(catId => this.extenders.RegisterExtenderProvider(catId, ExtenderName, this)) - .ToArray(); - } - - public void Dispose() - { - foreach (var cookie in cookies) - { - extenders.UnregisterExtenderProvider(cookie); - } - } - - public bool CanExtend(string ExtenderCATID, string ExtenderName, object ExtendeeObject) - { - // check if provider can create extender for the given - // ExtenderCATID, ExtenderName, and Extendee instance - PropertyDescriptor extendeeCATIDProp = TypeDescriptor.GetProperties(ExtendeeObject)["ExtenderCATID"]; - PropertyDescriptor extendeeSourceProjectProp = TypeDescriptor.GetProperties(ExtendeeObject)["SourceProject"]; - - //Recursion Guard: We need to check the "Build Action" property in HasContentBuildAction. - //However, accessing this property will cause the Extender list to be built again, meaning - //that VS will call into our CanExtend method again. In this case, just return false. - if (inCanExtend) return false; - - inCanExtend = true; - bool returnValue = ExtenderName.Equals(ProjectReferenceExtenderProvider.ExtenderName) - && IsSupportedCATID(ExtenderCATID) - && extendeeCATIDProp != null - && extendeeSourceProjectProp != null - && IsSupportedCATID(extendeeCATIDProp.GetValue(ExtendeeObject).ToString()) - && extendeeSourceProjectProp.GetValue(ExtendeeObject) != null; - - inCanExtend = false; - - return returnValue; - } - - public object GetExtender(string ExtenderCATID, - string ExtenderName, - object ExtendeeObject, - IExtenderSite ExtenderSite, - int Cookie) - { - ProjectReferenceExtender extender = null; - if (CanExtend(ExtenderCATID, ExtenderName, ExtendeeObject)) - { - IVsBrowseObject browseObject = ExtendeeObject as IVsBrowseObject; - if (browseObject != null) - { - IVsHierarchy hierarchyItem = null; - uint itemId = VSConstants.VSITEMID_NIL; - - //get the hierarchy item (the item id will be wrong if the reference is not shown) - browseObject.GetProjectItem(out hierarchyItem, out itemId); - - extender = new ProjectReferenceExtender(hierarchyItem, itemId, ExtenderSite, Cookie); - } - } - return extender; - } - - public object GetExtenderNames(string ExtenderCATID, object ExtendeeObject) - { - return new string[] { ExtenderName }; - } - } -} diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio/Extensions/IProjectNodeExtensions.cs b/src/VisualStudio/NuGet.Packaging.VisualStudio/Extensions/IProjectNodeExtensions.cs deleted file mode 100644 index 4b2f17b9..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio/Extensions/IProjectNodeExtensions.cs +++ /dev/null @@ -1,44 +0,0 @@ -using Microsoft.VisualStudio; -using Microsoft.VisualStudio.Shell.Interop; -using NuGet.Packaging.VisualStudio; -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Clide -{ - static class IProjectNodeExtensions - { - public static void OpenNuSpecPropertyPage(this IProjectNode project) - { - var hierarchy = project.AsVsHierarchy(); - - Guid projectDesignerEditorGuid; - ErrorHandler.ThrowOnFailure( - hierarchy.GetGuidProperty( - VSConstants.VSITEMID_ROOT, - (int)__VSHPROPID2.VSHPROPID_ProjectDesignerEditor, - out projectDesignerEditorGuid)); - - var vsProject = hierarchy as IVsProject2; - - IVsWindowFrame frame; - ErrorHandler.ThrowOnFailure( - vsProject.ReopenItem( - VSConstants.VSITEMID_ROOT, - ref projectDesignerEditorGuid, - null, - Guid.Empty, - new IntPtr(-1), - out frame)); - - object docView; - ErrorHandler.ThrowOnFailure( - frame.GetProperty((int)__VSFPROPID.VSFPROPID_DocView, out docView)); - - var multiViewDocView = docView as IVsMultiViewDocumentView; - ErrorHandler.ThrowOnFailure( - multiViewDocView.ActivateLogicalView(new Guid(Guids.NuSpecPropertyPageGuid))); - } - } -} diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio/Extensions/IVsPackageInstallerExtensions.cs b/src/VisualStudio/NuGet.Packaging.VisualStudio/Extensions/IVsPackageInstallerExtensions.cs deleted file mode 100644 index 78b7e5c3..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio/Extensions/IVsPackageInstallerExtensions.cs +++ /dev/null @@ -1,25 +0,0 @@ -using EnvDTE; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace NuGet.VisualStudio -{ - static class IVsPackageInstallerExtensions - { - public static void InstallBuildPackagingNuget(this IVsPackageInstaller packageInstaller, Project project) => - packageInstaller.InstallPackagesFromVSExtensionRepository( - NuGet.Packaging.VisualStudio.Constants.NuGet.RepositoryId, - false, - true, - project, - new Dictionary - { - { - NuGet.Packaging.VisualStudio.Constants.NuGet.BuildPackagingId , - NuGet.Packaging.VisualStudio.Constants.NuGet.BuildPackagingVersion } - }); - } -} diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio/Extensions/IVsPackageInstallerServicesExtensions.cs b/src/VisualStudio/NuGet.Packaging.VisualStudio/Extensions/IVsPackageInstallerServicesExtensions.cs deleted file mode 100644 index 7352572c..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio/Extensions/IVsPackageInstallerServicesExtensions.cs +++ /dev/null @@ -1,15 +0,0 @@ -using EnvDTE; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace NuGet.VisualStudio -{ - static class IVsPackageInstallerServicesExtensions - { - public static bool IsBuildPackagingNuGetInstalled(this IVsPackageInstallerServices packageInstallerServices, Project project) => - packageInstallerServices.IsPackageInstalled(project, NuGet.Packaging.VisualStudio.Constants.NuGet.BuildPackagingId); - } -} diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio/Extensions/IVsUIShellExtensions.cs b/src/VisualStudio/NuGet.Packaging.VisualStudio/Extensions/IVsUIShellExtensions.cs deleted file mode 100644 index ecc89120..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio/Extensions/IVsUIShellExtensions.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using Microsoft.VisualStudio.Shell.Interop; -using System.Windows.Interop; -using Microsoft.VisualStudio; - -namespace NuGet.Packaging.VisualStudio -{ - static class IVsUIShellExtensions - { - internal static void SetOwner(this IVsUIShell uiShell, Window dialog) - { - IntPtr owner; - if (ErrorHandler.Succeeded(uiShell.GetDialogOwnerHwnd(out owner))) - { - new WindowInteropHelper(dialog).Owner = owner; - dialog.WindowStartupLocation = WindowStartupLocation.CenterScreen; - dialog.ShowInTaskbar = false; - } - } - } -} \ No newline at end of file diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio/FodyWeavers.xml b/src/VisualStudio/NuGet.Packaging.VisualStudio/FodyWeavers.xml deleted file mode 100644 index bb0f322e..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio/FodyWeavers.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio/Guids.cs b/src/VisualStudio/NuGet.Packaging.VisualStudio/Guids.cs deleted file mode 100644 index 86f8e69c..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio/Guids.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace NuGet.Packaging.VisualStudio -{ - public class Guids - { - public const string PackageGuid = "e57e2daf-a455-45db-962e-31b1c9c70860"; - public const string CommandSetGuid = "589286D3-5755-4E34-A8E4-0A7B670AF60A"; - public const string ProjectTypeGuid = "5dd5e4fa-cb73-4610-85ab-557b54e96aa9"; - - public const string FlavoredProjectTypeGuid = "267351FF-295D-442E-9F4C-B541870C8060"; - public const string NuSpecPropertyPageGuid = "E2461DC6-E818-4508-915A-5AA564F5A91E"; - } -} \ No newline at end of file diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio/IBuildService.cs b/src/VisualStudio/NuGet.Packaging.VisualStudio/IBuildService.cs deleted file mode 100644 index 0e1f3449..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio/IBuildService.cs +++ /dev/null @@ -1,9 +0,0 @@ -using Clide; - -namespace NuGet.Packaging.VisualStudio -{ - public interface IBuildService - { - void Pack(IProjectNode project); - } -} \ No newline at end of file diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio/IDialogService.cs b/src/VisualStudio/NuGet.Packaging.VisualStudio/IDialogService.cs deleted file mode 100644 index e9352f9f..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio/IDialogService.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; - -namespace NuGet.Packaging.VisualStudio -{ - interface IDialogService - { - bool ShowConfirmationMessage(string message); - bool? ShowDialog(T dialog) where T : Window; - } -} diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio/MoveProjectItemsToProjectVisitor.cs b/src/VisualStudio/NuGet.Packaging.VisualStudio/MoveProjectItemsToProjectVisitor.cs deleted file mode 100644 index d913cd87..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio/MoveProjectItemsToProjectVisitor.cs +++ /dev/null @@ -1,153 +0,0 @@ -using Clide; -using System; -using System.Linq; -using System.Collections.Generic; - -namespace NuGet.Packaging.VisualStudio -{ - class MoveProjectItemsToProjectVisitor : ISolutionVisitor - { - readonly Stack stack; - readonly List nodesToBeDeleted; - readonly Func filterItem = x => false; // null filter - - public MoveProjectItemsToProjectVisitor(IProjectNode targetProject, Func filterItem = null) - { - stack = new Stack(); - stack.Push(targetProject); - - if (filterItem != null) - this.filterItem = filterItem; - - nodesToBeDeleted = new List(); - } - - public bool VisitEnter(IProjectNode project) => true; - - public bool VisitEnter(IFolderNode folder) - { - if (filterItem(folder)) - return false; - - var parent = stack.Peek(); - - var targetFolder = parent - .Nodes - .FirstOrDefault(x => string.Equals(x.Name, folder.Name, StringComparison.OrdinalIgnoreCase)); - - if (targetFolder == null) - targetFolder = parent.As().CreateFolder(folder.Name); - - stack.Push(targetFolder); - - return true; - } - - public bool VisitEnter(IItemNode item) - { - if (filterItem(item)) - return false; - - var parent = stack.Peek(); - - var targetItem = parent - .Nodes - .OfType() - .FirstOrDefault(x => string.Equals(x.Name, item.Name, StringComparison.OrdinalIgnoreCase)); - - // Delete the existing item in the target project - if (targetItem != null) - targetItem.Delete(); - - // And add the new one - parent.As().AddItem(item.PhysicalPath); - - return false; - } - - public bool VisitEnter(IReferencesNode references) => false; - - public bool VisitEnter(IReferenceNode reference) => false; - - public bool VisitEnter(IGenericNode node) => true; - - public bool VisitLeave(IFolderNode folder) - { - if (filterItem(folder)) - return false; - - stack.Pop(); - nodesToBeDeleted.Add(folder); - - return true; - } - - public bool VisitLeave(IReferencesNode references) => true; - - public bool VisitLeave(IGenericNode node) => true; - - public bool VisitLeave(IReferenceNode reference) => false; - - public bool VisitLeave(IItemNode item) - { - if (filterItem(item)) - return false; - - nodesToBeDeleted.Add(item); - return false; - } - - public bool VisitLeave(IProjectNode project) - { - // Once the project has been processed, delete all nodes - // in order to avoid CollectionModified exception - foreach (var node in nodesToBeDeleted) - { - var deletableNode = node.As(); - if (deletableNode != null) - { - try - { - deletableNode.Delete(); - } - catch - { - // Ignore? - } - } - } - - return false; - } - - public bool VisitEnter(ISolutionItemNode solutionItem) - { - throw new NotSupportedException(); - } - - public bool VisitEnter(ISolutionFolderNode solutionFolder) - { - throw new NotSupportedException(); - } - - public bool VisitEnter(ISolutionNode solution) - { - throw new NotSupportedException(); - } - - public bool VisitLeave(ISolutionFolderNode solutionFolder) - { - throw new NotSupportedException(); - } - - public bool VisitLeave(ISolutionItemNode solutionItem) - { - throw new NotSupportedException(); - } - - public bool VisitLeave(ISolutionNode solution) - { - throw new NotSupportedException(); - } - } -} \ No newline at end of file diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio/NuGet.Packaging.VisualStudio.csproj b/src/VisualStudio/NuGet.Packaging.VisualStudio/NuGet.Packaging.VisualStudio.csproj deleted file mode 100644 index 91c62672..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio/NuGet.Packaging.VisualStudio.csproj +++ /dev/null @@ -1,226 +0,0 @@ - - - - - - {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - {9617EDCD-23BB-41EA-827D-F5729D45B0AF} - NuGet.Packaging.VisualStudio - NuGet.Packaging.VisualStudio - v4.6 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Designer - ResXFileCodeGenerator - Resources.Designer.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - MultiPlatformView.xaml - - - - - PackageMetadataView.xaml - - - - - - AddPlatformImplementationView.xaml - - - - - NuGet.Packaging.VisualStudio.Shared.targets - - - Designer - - - PreserveNewest - true - - - PreserveNewest - true - Designer - - - True - True - Resources.resx - - - - - - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - Designer - PreserveNewest - - - Designer - PreserveNewest - - - Designer - PreserveNewest - - - Designer - PreserveNewest - - - Designer - PreserveNewest - - - Designer - PreserveNewest - - - Designer - PreserveNewest - - - Designer - PreserveNewest - - - Designer - PreserveNewest - - - Designer - PreserveNewest - - - Designer - PreserveNewest - - - Designer - PreserveNewest - - - Designer - PreserveNewest - - - Designer - PreserveNewest - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - - - - - - LICENSE.txt - Always - true - - - - - \ No newline at end of file diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio/NuGet.Packaging.VisualStudio.targets b/src/VisualStudio/NuGet.Packaging.VisualStudio/NuGet.Packaging.VisualStudio.targets deleted file mode 100644 index 1b1ea93d..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio/NuGet.Packaging.VisualStudio.targets +++ /dev/null @@ -1,29 +0,0 @@ - - - - - true - - - - - - - True - - - True - - - - - - - - true - true - - - - - \ No newline at end of file diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio/Properties/AssemblyInfo.cs b/src/VisualStudio/NuGet.Packaging.VisualStudio/Properties/AssemblyInfo.cs deleted file mode 100644 index cd162e39..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,30 +0,0 @@ -using NuGet.Build.Packaging; -using System.Reflection; -using System.Runtime.CompilerServices; - -[assembly: Microsoft.VisualStudio.Shell.ProvideCodeBase(CodeBase = @"$PackageFolder$\NuGet.Packaging.VisualStudio.dll")] - -[assembly: InternalsVisibleTo("NuGet.Packaging.VisualStudio.UnitTests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100653a25b8db304651a28d6a28454d201a4372d811143c969b92141cd87ffaa48d4e69f98d70d3ac689f69b673afcd44526a75903782c13573022fcd7fe05289af2abf5f7c195159650a974b8cc05eba30717bcfd882bf168690e4daaa4e1dd0aa393a420cf2d6ab2e89b286f81416f96737ae524039dbd0ff3d008e3dd8ec8de7")] -[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2,PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")] - -[assembly: AssemblyCompany("Microsoft")] -[assembly: AssemblyProduct("Microsoft NuGet Packaging")] -[assembly: AssemblyCopyright("Copyright © 2016")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] -[assembly: AssemblyTitle(ThisAssembly.Project.AssemblyName)] - - -#if DEBUG -[assembly: AssemblyConfiguration("DEBUG")] -#else -[assembly: AssemblyConfiguration ("RELEASE")] -#endif - -[assembly: AssemblyVersion("1.0.0")] -[assembly: AssemblyFileVersion("1.0.0")] -[assembly: AssemblyInformationalVersion( - ThisAssembly.Git.SemVer.Major + "." + - ThisAssembly.Git.SemVer.Minor + "." + - ThisAssembly.Git.SemVer.Patch + "-" + - ThisAssembly.Git.Branch + "+" + ThisAssembly.Git.Commit)] \ No newline at end of file diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio/Resources.Designer.cs b/src/VisualStudio/NuGet.Packaging.VisualStudio/Resources.Designer.cs deleted file mode 100644 index 04770e63..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio/Resources.Designer.cs +++ /dev/null @@ -1,324 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace NuGet.Packaging.VisualStudio { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("NuGet.Packaging.VisualStudio.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized string similar to The NuProj targets need to be added to the selected project before being able to build a NuGet package. Do you want to continue?. - /// - internal static string AddNuProjToLibrary { - get { - return ResourceManager.GetString("AddNuProjToLibrary", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Xamarin.Android. - /// - internal static string Android_DisplayName { - get { - return ResourceManager.GetString("Android_DisplayName", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Android. - /// - internal static string Android_Suffix { - get { - return ResourceManager.GetString("Android_Suffix", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Application. - /// - internal static string Application { - get { - return ResourceManager.GetString("Application", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Application Icon. - /// - internal static string ApplicationIcon { - get { - return ResourceManager.GetString("ApplicationIcon", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Sets the .ico file to use as your application icon.. - /// - internal static string ApplicationIconDescription { - get { - return ResourceManager.GetString("ApplicationIconDescription", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Assembly Name. - /// - internal static string AssemblyName { - get { - return ResourceManager.GetString("AssemblyName", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The name of the output file that will hold assembly metadata.. - /// - internal static string AssemblyNameDescription { - get { - return ResourceManager.GetString("AssemblyNameDescription", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to NuGet Packaging. - /// - internal static string DefaultDialogCaption { - get { - return ResourceManager.GetString("DefaultDialogCaption", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Default Namespace. - /// - internal static string DefaultNamespace { - get { - return ResourceManager.GetString("DefaultNamespace", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Specifies the default namespace for added items, such as classes, that are added via the Add New Item Dialog Box.. - /// - internal static string DefaultNamespaceDescription { - get { - return ResourceManager.GetString("DefaultNamespaceDescription", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to General. - /// - internal static string GeneralCaption { - get { - return ResourceManager.GetString("GeneralCaption", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Xamarin.iOS. - /// - internal static string IOS_DisplayName { - get { - return ResourceManager.GetString("IOS_DisplayName", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to iOS. - /// - internal static string IOS_Suffix { - get { - return ResourceManager.GetString("IOS_Suffix", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Failed to add reference {0} to {1}. - /// - internal static string IProjectNodeExtensions_AddSharedProjectReferenceFailed { - get { - return ResourceManager.GetString("IProjectNodeExtensions_AddSharedProjectReferenceFailed", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to NuSpec. - /// - internal static string NuSpecPropertyPageTitle { - get { - return ResourceManager.GetString("NuSpecPropertyPageTitle", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Output File. - /// - internal static string OutputFile { - get { - return ResourceManager.GetString("OutputFile", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The name of the project's primary output file.. - /// - internal static string OutputFileDescription { - get { - return ResourceManager.GetString("OutputFileDescription", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Output Type. - /// - internal static string OutputType { - get { - return ResourceManager.GetString("OutputType", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The type of application to build.. - /// - internal static string OutputTypeDescription { - get { - return ResourceManager.GetString("OutputTypeDescription", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Project. - /// - internal static string Project { - get { - return ResourceManager.GetString("Project", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Project File. - /// - internal static string ProjectFile { - get { - return ResourceManager.GetString("ProjectFile", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The name of the file containing build, configuration, and other information about the project.. - /// - internal static string ProjectFileDescription { - get { - return ResourceManager.GetString("ProjectFileDescription", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Project Folder. - /// - internal static string ProjectFolder { - get { - return ResourceManager.GetString("ProjectFolder", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The absolute location of the project.. - /// - internal static string ProjectFolderDescription { - get { - return ResourceManager.GetString("ProjectFolderDescription", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Startup Object. - /// - internal static string StartupObject { - get { - return ResourceManager.GetString("StartupObject", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The name of the class that contains the static Main method that you want called when you launch your application.. - /// - internal static string StartupObjectDescription { - get { - return ResourceManager.GetString("StartupObjectDescription", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Target Framework Moniker. - /// - internal static string TargetFrameworkMoniker { - get { - return ResourceManager.GetString("TargetFrameworkMoniker", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The version of the Common Language Runtime to use for output assembly.. - /// - internal static string TargetFrameworkMonikerDescription { - get { - return ResourceManager.GetString("TargetFrameworkMonikerDescription", resourceCulture); - } - } - } -} diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio/Resources.resx b/src/VisualStudio/NuGet.Packaging.VisualStudio/Resources.resx deleted file mode 100644 index 7bb6ac67..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio/Resources.resx +++ /dev/null @@ -1,207 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - The NuProj targets need to be added to the selected project before being able to build a NuGet package. Do you want to continue? - - - Xamarin.Android - - - Android - - - Application - - - Application Icon - - - Sets the .ico file to use as your application icon. - - - Assembly Name - - - The name of the output file that will hold assembly metadata. - - - NuGet Packaging - - - Default Namespace - - - Specifies the default namespace for added items, such as classes, that are added via the Add New Item Dialog Box. - - - General - - - Xamarin.iOS - - - iOS - - - Failed to add reference {0} to {1} - - - NuSpec - - - Output File - - - The name of the project's primary output file. - - - Output Type - - - The type of application to build. - - - Project - - - Project File - - - The name of the file containing build, configuration, and other information about the project. - - - Project Folder - - - The absolute location of the project. - - - Startup Object - - - The name of the class that contains the static Main method that you want called when you launch your application. - - - Target Framework Moniker - - - The version of the Common Language Runtime to use for output assembly. - - \ No newline at end of file diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio/Rules/AssemblyReference.xaml b/src/VisualStudio/NuGet.Packaging.VisualStudio/Rules/AssemblyReference.xaml deleted file mode 100644 index e378a9e9..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio/Rules/AssemblyReference.xaml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio/Rules/PackageFile.xaml b/src/VisualStudio/NuGet.Packaging.VisualStudio/Rules/PackageFile.xaml deleted file mode 100644 index fc64ad97..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio/Rules/PackageFile.xaml +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio/Rules/PackageReference.xaml b/src/VisualStudio/NuGet.Packaging.VisualStudio/Rules/PackageReference.xaml deleted file mode 100644 index cc800e1b..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio/Rules/PackageReference.xaml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio/Rules/ProjectItemsSchema.xaml b/src/VisualStudio/NuGet.Packaging.VisualStudio/Rules/ProjectItemsSchema.xaml deleted file mode 100644 index 781e0fc7..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio/Rules/ProjectItemsSchema.xaml +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio/Rules/ProjectReference.xaml b/src/VisualStudio/NuGet.Packaging.VisualStudio/Rules/ProjectReference.xaml deleted file mode 100644 index 610f4cde..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio/Rules/ProjectReference.xaml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio/Rules/ResolvedAssemblyReference.xaml b/src/VisualStudio/NuGet.Packaging.VisualStudio/Rules/ResolvedAssemblyReference.xaml deleted file mode 100644 index 80659940..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio/Rules/ResolvedAssemblyReference.xaml +++ /dev/null @@ -1,122 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio/Rules/ResolvedPackageReference.xaml b/src/VisualStudio/NuGet.Packaging.VisualStudio/Rules/ResolvedPackageReference.xaml deleted file mode 100644 index 3c378379..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio/Rules/ResolvedPackageReference.xaml +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio/Rules/ResolvedProjectReference.xaml b/src/VisualStudio/NuGet.Packaging.VisualStudio/Rules/ResolvedProjectReference.xaml deleted file mode 100644 index a7c04d29..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio/Rules/ResolvedProjectReference.xaml +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio/Rules/content.xaml b/src/VisualStudio/NuGet.Packaging.VisualStudio/Rules/content.xaml deleted file mode 100644 index 3777e421..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio/Rules/content.xaml +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio/Rules/folder.xaml b/src/VisualStudio/NuGet.Packaging.VisualStudio/Rules/folder.xaml deleted file mode 100644 index d2cd3997..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio/Rules/folder.xaml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio/Rules/general.browseobject.xaml b/src/VisualStudio/NuGet.Packaging.VisualStudio/Rules/general.browseobject.xaml deleted file mode 100644 index e3159c50..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio/Rules/general.browseobject.xaml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio/Rules/general.xaml b/src/VisualStudio/NuGet.Packaging.VisualStudio/Rules/general.xaml deleted file mode 100644 index 9212b91d..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio/Rules/general.xaml +++ /dev/null @@ -1,227 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio/Rules/none.xaml b/src/VisualStudio/NuGet.Packaging.VisualStudio/Rules/none.xaml deleted file mode 100644 index 0d9044d1..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio/Rules/none.xaml +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio/Rules/scc.xaml b/src/VisualStudio/NuGet.Packaging.VisualStudio/Rules/scc.xaml deleted file mode 100644 index 7970b7f2..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio/Rules/scc.xaml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio/SolutionContext.cs b/src/VisualStudio/NuGet.Packaging.VisualStudio/SolutionContext.cs deleted file mode 100644 index aaf5b33f..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio/SolutionContext.cs +++ /dev/null @@ -1,62 +0,0 @@ -using Clide; -using System.Collections.Generic; -using System.IO; -using System.Linq; - -namespace NuGet.Packaging.VisualStudio -{ - class SolutionContext - { - readonly ISolutionExplorer solutionExplorer; - - public SolutionContext(ISolutionExplorer solutionExplorer) - { - this.solutionExplorer = solutionExplorer; - } - - public void Initialize(IProjectNode baseProject) - { - SelectedProject = baseProject; - - BaseProjectName = SelectedProject.Name; - - var projects = solutionExplorer.Solution.FindProjects().ToList(); - - // TODO - // Rather than hardcoding a convention for the shared project name, - // is there a way we can instead annotate it with some MSBuild property - // that will flag it as "the one" we used before? - // This would allow users to rename/move the project freely, - // which would make the feature more resilient. - SharedProjectName = BaseProjectName + "." + Constants.Suffixes.SharedProject; - SharedProject = GetProjectNode(projects, SharedProjectName); - - NuGetProjectName = BaseProjectName + "." + Constants.Suffixes.NuGetPackage; - NuGetProject = GetProjectNode(projects, NuGetProjectName); - } - - public IProjectNode SelectedProject { get; set; } - - public string BaseProjectName { get; set; } - - public string SharedProjectName { get; set; } - - public IProjectNode SharedProject { get; set; } - - public string NuGetProjectName { get; set; } - - public IProjectNode NuGetProject { get; set; } - - IProjectNode GetProjectNode(IEnumerable projects, string projectName) => - projects.FirstOrDefault(x => x.Name == projectName); - - public IProjectNode GetProjectNode(string projectName) => - GetProjectNode(solutionExplorer.Solution.FindProjects(), projectName); - - public IProjectNode GetProjectNode(PlatformViewModel platform) => - GetProjectNode(solutionExplorer.Solution.FindProjects(), GetTargetProjectName(platform)); - - public string GetTargetProjectName(PlatformViewModel platform) => - BaseProjectName + "." + Constants.Suffixes.GetSuffixForPlatform(platform.Id); - } -} diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio/Targets/NuGet.Packaging.Authoring.props b/src/VisualStudio/NuGet.Packaging.VisualStudio/Targets/NuGet.Packaging.Authoring.props deleted file mode 100644 index 4f8d27ec..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio/Targets/NuGet.Packaging.Authoring.props +++ /dev/null @@ -1,16 +0,0 @@ - - - - true - - \ No newline at end of file diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio/Targets/NuGet.Packaging.Authoring.targets b/src/VisualStudio/NuGet.Packaging.VisualStudio/Targets/NuGet.Packaging.Authoring.targets deleted file mode 100644 index 508df46b..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio/Targets/NuGet.Packaging.Authoring.targets +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - $(MSBuildThisFileDirectory)..\Rules\ - PackageReference - - - net11;net20;net35;net40;net403;net45;net451;net452;net46;net461;net462;netcore;netcore45;netcore451;netcore50;win8;win81;win10;sl4;sl5;wp;wp7;wp75;wp8;wp81;wpa81;uap;uap10;netstandard1.0;netstandard1.1;netstandard1.2;netstandard1.3;netstandard1.4;netstandard1.5;netstandard1.6;netstandard2.0;netcoreapp1.0;netcoreapp2.0;monoandroid;monotouch;monomac;xamarinios;xamarinmac;xamarinpsthree;xamarinpsfour;xamarinpsvita;xamarinwatchos;xamarintvos;xamarinxboxthreesixty;xamarinxboxone - - - - - Project - - - Invisible - - - Project;File - - - BrowseObject - - - File;BrowseObject - - - - - - ;BrowseObject - - - - ProjectSubscriptionService;BrowseObject - - - - - ;BrowseObject - - - - ProjectSubscriptionService;BrowseObject - - - - - ProjectSubscriptionService;BrowseObject - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio/Theme/Brushes.cs b/src/VisualStudio/NuGet.Packaging.VisualStudio/Theme/Brushes.cs deleted file mode 100644 index 31843c91..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio/Theme/Brushes.cs +++ /dev/null @@ -1,53 +0,0 @@ -using Microsoft.VisualStudio.Shell; - -namespace NuGet.Packaging.VisualStudio.Theme -{ - public static class Brushes - { - // Window - public static object WindowForegroundKey { get { return VsBrushes.WindowTextKey; } } - public static object WindowBackgroundKey { get { return VsBrushes.ToolWindowBackgroundKey; } } - public static object WindowBorderKey { get { return VsBrushes.ToolWindowBorderKey; } } - public static object WindowKey { get { return VsBrushes.WindowKey; } } - public static object WindowGrayTextKey { get { return VsBrushes.GrayTextKey; } } - - // Panel - public static object PanelBackground { get { return VsBrushes.PanelGradientLightKey; } } - - // Editor - public static object EditorBackgroundKey { get { return VsBrushes.DesignerBackgroundKey; } } - - //ToolBar - public static object ToolBarBackgroundKey { get { return VsBrushes.CommandBarGradientBeginKey; } } - public static object ToolBarBorderKey { get { return VsBrushes.CommandBarBorderKey; } } - public static object ToolBarSeparatorKey { get { return VsBrushes.CommandBarToolBarSeparatorKey; } } - - // EditableControl - public static object EditableControlBackgroundKey { get { return VsBrushes.ComboBoxBackgroundKey; } } - public static object EditableControlTextKey { get { return VsBrushes.ToolWindowTextKey; } } - public static object EditableControlBorderKey { get { return VsBrushes.ComboBoxBorderKey; } } - public static object EditableControlGlyphKey { get { return VsBrushes.ComboBoxGlyphKey; } } - - // EditableControlDisabled - public static object EditableControlDisabledBackgroundKey { get { return VsBrushes.ComboBoxDisabledBackgroundKey; } } - public static object EditableControlDisabledTextKey { get { return VsBrushes.ToolWindowTextKey; } } - public static object EditableControlDisabledBorderKey { get { return VsBrushes.ComboBoxDisabledBorderKey; } } - public static object EditableControlDisabledGlyphKey { get { return VsBrushes.ComboBoxDisabledGlyphKey; } } - - public static object EditableControlMouseOverBackgroundKey { get { return VsBrushes.ComboBoxMouseOverBackgroundEndKey; } } - public static object EditableControlMouseOverTextKey { get { return VsBrushes.ToolWindowTextKey; } } - public static object EditableControlMouseOverBorderKey { get { return VsBrushes.ComboBoxMouseOverBorderKey; } } - public static object EditableControlMouseOverGlyphKey { get { return VsBrushes.ComboBoxMouseOverGlyphKey; } } - - // EditableControlMouseDown - public static object EditableControlMouseDownBackgroundKey { get { return VsBrushes.ComboBoxMouseDownBackgroundKey; } } - public static object EditableControlMouseDownTextKey { get { return VsBrushes.ToolWindowTextKey; } } - public static object EditableControlMouseDownBorderKey { get { return VsBrushes.ComboBoxMouseDownBorderKey; } } - public static object EditableControlMouseDownGlyphKey { get { return VsBrushes.ToolWindowTextKey; } } - - // Info - public static object InfoBackgroundKey { get { return VsBrushes.InfoBackgroundKey; } } - public static object InfoTextKey { get { return VsBrushes.InfoTextKey; } } - - } -} diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio/Theme/Colors.cs b/src/VisualStudio/NuGet.Packaging.VisualStudio/Theme/Colors.cs deleted file mode 100644 index 6cc124b8..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio/Theme/Colors.cs +++ /dev/null @@ -1,52 +0,0 @@ -using Microsoft.VisualStudio.Shell; - -namespace NuGet.Packaging.VisualStudio.Theme -{ - public static class Colors - { - // Window - public static object WindowForegroundKey { get { return VsColors.WindowTextKey; } } - public static object WindowBackgroundKey { get { return VsColors.ToolWindowBackgroundKey; } } - public static object WindowBorderKey { get { return VsColors.ToolWindowBorderKey; } } - public static object WindowKey { get { return VsColors.WindowKey; } } - public static object WindowGrayTextKey { get { return VsColors.GrayTextKey; } } - - // Panel - public static object PanelBackground { get { return VsColors.PanelGradientLightKey; } } - - // Editor - public static object EditorBackgroundKey { get { return VsColors.DesignerBackgroundKey; } } - - //ToolBar - public static object ToolBarBackgroundKey { get { return VsColors.CommandBarGradientBeginKey; } } - public static object ToolBarBorderKey { get { return VsColors.CommandBarBorderKey; } } - public static object ToolBarSeparatorKey { get { return VsColors.CommandBarToolBarSeparatorKey; } } - - // EditableControl - public static object EditableControlBackgroundKey { get { return VsColors.ComboBoxBackgroundKey; } } - public static object EditableControlTextKey { get { return VsColors.ToolWindowTextKey; } } - public static object EditableControlBorderKey { get { return VsColors.ComboBoxBorderKey; } } - public static object EditableControlGlyphKey { get { return VsColors.ComboBoxGlyphKey; } } - - // EditableControlDisabled - public static object EditableControlDisabledBackgroundKey { get { return VsColors.ComboBoxDisabledBackgroundKey; } } - public static object EditableControlDisabledTextKey { get { return VsColors.ToolWindowTextKey; } } - public static object EditableControlDisabledBorderKey { get { return VsColors.ComboBoxDisabledBorderKey; } } - public static object EditableControlDisabledGlyphKey { get { return VsColors.ComboBoxDisabledGlyphKey; } } - - public static object EditableControlMouseOverBackgroundKey { get { return VsColors.ComboBoxMouseOverBackgroundEndKey; } } - public static object EditableControlMouseOverTextKey { get { return VsColors.ToolWindowTextKey; } } - public static object EditableControlMouseOverBorderKey { get { return VsColors.ComboBoxMouseOverBorderKey; } } - public static object EditableControlMouseOverGlyphKey { get { return VsColors.ComboBoxMouseOverGlyphKey; } } - - // EditableControlMouseDown - public static object EditableControlMouseDownBackgroundKey { get { return VsColors.ComboBoxMouseDownBackgroundKey; } } - public static object EditableControlMouseDownTextKey { get { return VsColors.ToolWindowTextKey; } } - public static object EditableControlMouseDownBorderKey { get { return VsColors.ComboBoxMouseDownBorderKey; } } - public static object EditableControlMouseDownGlyphKey { get { return VsColors.ToolWindowTextKey; } } - - // Info - public static object InfoBackgroundKey { get { return VsColors.InfoBackgroundKey; } } - public static object InfoTextKey { get { return VsColors.InfoTextKey; } } - } -} diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio/Theme/Theme.xaml b/src/VisualStudio/NuGet.Packaging.VisualStudio/Theme/Theme.xaml deleted file mode 100644 index 086fa878..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio/Theme/Theme.xaml +++ /dev/null @@ -1,162 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio/Theme/ThemedButton.xaml b/src/VisualStudio/NuGet.Packaging.VisualStudio/Theme/ThemedButton.xaml deleted file mode 100644 index ce2d4ca6..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio/Theme/ThemedButton.xaml +++ /dev/null @@ -1,148 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio/Theme/ThemedComboBox.xaml b/src/VisualStudio/NuGet.Packaging.VisualStudio/Theme/ThemedComboBox.xaml deleted file mode 100644 index 6668c8fa..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio/Theme/ThemedComboBox.xaml +++ /dev/null @@ -1,262 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio/Theme/ThemedRadioButton.xaml b/src/VisualStudio/NuGet.Packaging.VisualStudio/Theme/ThemedRadioButton.xaml deleted file mode 100644 index 00ae94b0..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio/Theme/ThemedRadioButton.xaml +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/VisualStudio/NuGet.Packaging.VisualStudio/Views/AddPlatformImplementationView.xaml b/src/VisualStudio/NuGet.Packaging.VisualStudio/Views/AddPlatformImplementationView.xaml deleted file mode 100644 index 49194884..00000000 --- a/src/VisualStudio/NuGet.Packaging.VisualStudio/Views/AddPlatformImplementationView.xaml +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -