Jan Tattermusch | b5bf574 | 2015-04-10 18:24:35 -0700 | [diff] [blame^] | 1 | <%! |
| 2 | openssl_pkg_name = "openssl" |
| 3 | openssl_pkg_version = "1.0.2.1" |
| 4 | zlib_pkg_version = "1.2.8.7" |
| 5 | %>\ |
Jan Tattermusch | 8ab4538 | 2015-04-10 18:24:28 -0700 | [diff] [blame] | 6 | <%def name="gen_packages_config(packages)">\ |
| 7 | <?xml version="1.0" encoding="utf-8"?> |
| 8 | <packages> |
| 9 | % if 'openssl' in packages: |
Jan Tattermusch | b5bf574 | 2015-04-10 18:24:35 -0700 | [diff] [blame^] | 10 | <package id="${openssl_pkg_name}" version="${openssl_pkg_version}" targetFramework="Native" /> |
| 11 | <package id="${openssl_pkg_name}.redist" version="${openssl_pkg_version}" targetFramework="Native" /> |
Jan Tattermusch | 8ab4538 | 2015-04-10 18:24:28 -0700 | [diff] [blame] | 12 | % endif |
| 13 | % if 'zlib' in packages: |
Jan Tattermusch | b5bf574 | 2015-04-10 18:24:35 -0700 | [diff] [blame^] | 14 | <package id="zlib" version="${zlib_pkg_version}" targetFramework="Native" /> |
| 15 | <package id="zlib.redist" version="${zlib_pkg_version}" targetFramework="Native" /> |
Jan Tattermusch | 8ab4538 | 2015-04-10 18:24:28 -0700 | [diff] [blame] | 16 | % endif |
| 17 | </packages> |
Jan Tattermusch | b5bf574 | 2015-04-10 18:24:35 -0700 | [diff] [blame^] | 18 | </%def>\ |
| 19 | <%def name="gen_package_props(packages)">\ |
| 20 | % if 'openssl' in packages: |
| 21 | <Import Project="..\packages\${openssl_pkg_name}.${openssl_pkg_version}\build\native\${openssl_pkg_name}.props" Condition="Exists('..\packages\${openssl_pkg_name}.${openssl_pkg_version}\build\native\${openssl_pkg_name}.props')" /> |
| 22 | % endif |
| 23 | </%def>\ |
| 24 | <%def name="gen_package_targets(packages)">\ |
| 25 | % if 'zlib' in packages: |
| 26 | <Import Project="..\packages\zlib.redist.${zlib_pkg_version}\build\native\zlib.redist.targets" Condition="Exists('..\packages\zlib.redist.${zlib_pkg_version}\build\native\zlib.redist.targets')" /> |
| 27 | <Import Project="..\packages\zlib.${zlib_pkg_version}\build\native\zlib.targets" Condition="Exists('..\packages\zlib.${zlib_pkg_version}\build\native\zlib.targets')" /> |
| 28 | %endif |
| 29 | % if 'openssl' in packages: |
| 30 | <Import Project="..\packages\${openssl_pkg_name}.redist.${openssl_pkg_version}\build\native\${openssl_pkg_name}.redist.targets" Condition="Exists('..\packages\${openssl_pkg_name}.redist.${openssl_pkg_version}\build\native\${openssl_pkg_name}.redist.targets')" /> |
| 31 | <Import Project="..\packages\${openssl_pkg_name}.${openssl_pkg_version}\build\native\${openssl_pkg_name}.targets" Condition="Exists('..\packages\${openssl_pkg_name}.${openssl_pkg_version}\build\native\${openssl_pkg_name}.targets')" /> |
| 32 | % endif |
| 33 | </%def>\ |
| 34 | <%def name="gen_package_ensure(packages)">\ |
| 35 | % if packages: |
| 36 | <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> |
| 37 | <PropertyGroup> |
| 38 | <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> |
| 39 | </PropertyGroup> |
| 40 | % if 'zlib' in packages: |
| 41 | <Error Condition="!Exists('..\packages\zlib.redist.${zlib_pkg_version}\build\native\zlib.redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\zlib.redist.${zlib_pkg_version}\build\native\zlib.redist.targets'))" /> |
| 42 | <Error Condition="!Exists('..\packages\zlib.${zlib_pkg_version}\build\native\zlib.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\zlib.${zlib_pkg_version}\build\native\zlib.targets'))" /> |
| 43 | %endif |
| 44 | % if 'openssl' in packages: |
| 45 | <Error Condition="!Exists('..\packages\${openssl_pkg_name}.redist.${openssl_pkg_version}\build\native\${openssl_pkg_name}.redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\${openssl_pkg_name}.redist.${openssl_pkg_version}\build\native\${openssl_pkg_name}.redist.targets'))" /> |
| 46 | <Error Condition="!Exists('..\packages\${openssl_pkg_name}.${openssl_pkg_version}\build\native\${openssl_pkg_name}.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\${openssl_pkg_name}.${openssl_pkg_version}\build\native\${openssl_pkg_name}.props'))" /> |
| 47 | <Error Condition="!Exists('..\packages\${openssl_pkg_name}.${openssl_pkg_version}\build\native\${openssl_pkg_name}.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\${openssl_pkg_name}.${openssl_pkg_version}\build\native\${openssl_pkg_name}.targets'))" /> |
| 48 | %endif |
| 49 | </Target> |
| 50 | %endif |
| 51 | </%def>\ |