Last active
January 20, 2016 13:31
-
-
Save sliekens/5f406d7ce7f8a2576d27 to your computer and use it in GitHub Desktop.
BuildPackage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Target Name="AfterBuild" DependsOnTargets="BuildPackage" /> | |
<Target Name="BuildPackage" DependsOnTargets="BuildPackageCore" Outputs="$(Packages)" Condition=" '$(BuildPackage)' == 'True' " /> | |
<Target Name="BuildPackageCore"> | |
<PropertyGroup> | |
<!-- Escape the OutDir's trailing slash --> | |
<_PackagesOutDir Condition="HasTrailingSlash('$(OutDir)')">"$(OutDir)\"</_PackagesOutDir> | |
<_PackagesOutDir Condition="!HasTrailingSlash('$(OutDir)')">"$(OutDir)\\"</_PackagesOutDir> | |
</PropertyGroup> | |
<Exec ContinueOnError="ErrorAndContinue" ConsoleToMSBuild="True" Command=""$(SolutionDir)tools\nuget.exe" pack "$(MSBuildThisFileFullPath)" -Symbols -IncludeReferencedProjects -OutputDirectory $(_PackagesOutDir) -Properties Configuration=$(Configuration)"> | |
<Output TaskParameter="ConsoleOutput" ItemName="_out" /> | |
</Exec> | |
<PropertyGroup> | |
<_Pattern><![CDATA[Successfully created package '(?<package>.+)'.]]></_Pattern> | |
</PropertyGroup> | |
<ItemGroup> | |
<_Matches Include="$([System.Text.RegularExpressions.Regex]::Match('%(_out.Identity)', '$(_Pattern)').Groups['package'].Value)" Condition="$([System.Text.RegularExpressions.Regex]::IsMatch('%(_out.Identity)', '$(_Pattern)'))" /> | |
</ItemGroup> | |
<PropertyGroup> | |
<Packages>@(_Matches->'%(FullPath)')</Packages> | |
</PropertyGroup> | |
<WriteLinesToFile Lines="$(Packages)" File="$(IntermediateOutputPath)$(CleanFile)" /> | |
</Target> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment