diff options
author | Jose <jose@zeroc.com> | 2018-11-12 13:22:03 +0100 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2018-11-12 13:22:03 +0100 |
commit | 0a509937d204cebdccda96d91e2f5660748ae1fe (patch) | |
tree | e4794b0c4c045b9db515827f486fa6ff65c9e374 /php | |
parent | Fixed rare race condition which could trigger an assert on OA destruction, fi... (diff) | |
download | ice-0a509937d204cebdccda96d91e2f5660748ae1fe.tar.bz2 ice-0a509937d204cebdccda96d91e2f5660748ae1fe.tar.xz ice-0a509937d204cebdccda96d91e2f5660748ae1fe.zip |
Add support to build PHP NuGet packages
Diffstat (limited to 'php')
-rw-r--r-- | php/msbuild/ice.nuget.targets | 35 | ||||
-rw-r--r-- | php/msbuild/ice.proj | 81 | ||||
-rw-r--r-- | php/msbuild/zeroc.ice.php.nuspec | 17 |
3 files changed, 124 insertions, 9 deletions
diff --git a/php/msbuild/ice.nuget.targets b/php/msbuild/ice.nuget.targets new file mode 100644 index 00000000000..fadb47e6052 --- /dev/null +++ b/php/msbuild/ice.nuget.targets @@ -0,0 +1,35 @@ +<Project DefaultTargets="NugetPack" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <IceSrcRootDir>$(MSBuildThisFileDirectory)..\</IceSrcRootDir> + </PropertyGroup> + + <ItemGroup> + <Libraries Include="$(IceSrcRootDir)..\php\lib\$(Platform)\$(Configuration)\php_ice.dll; + $(IceSrcRootDir)..\php\lib\$(Platform)\$(Configuration)\php_ice_nts.dll" /> + <Libraries Include="$(IceSrcRootDir)..\cpp\bin\$(Platform)\$(Configuration)\ice37.dll; + $(IceSrcRootDir)..\cpp\bin\$(Platform)\$(Configuration)\icessl37.dll; + $(IceSrcRootDir)..\cpp\bin\$(Platform)\$(Configuration)\icediscovery37.dll; + $(IceSrcRootDir)..\cpp\bin\$(Platform)\$(Configuration)\icelocatordiscovery37.dll; + $(IceSrcRootDir)..\cpp\msbuild\packages\bzip2.$(PlatformToolset).1.0.6.10\build\native\bin\$(Platform)\$(Configuration)\bzip2.dll"/> + </ItemGroup> + + <!-- For PHP we use Slice compiler from x64 Release builds --> + <ItemGroup Condition="'$(Platform)|$(Configuration)' == 'x64|Release'"> + <SliceCompilers Include="$(IceSrcRootDir)..\cpp\bin\x64\Release\slice2php.exe; + $(IceSrcRootDir)..\cpp\bin\x64\Release\slice2html.exe" /> + + <PhpSources Include="$(IceSrcRootDir)..\php\lib\**\*.php" /> + + <Slices Include="$(IceSrcRootDir)..\slice\**\*.ice" + Exclude="$(IceSrcRootDir)..\slice\IceDiscovery\*.ice; + $(IceSrcRootDir)..\slice\IceLocatorDiscovery\*.ice"/> + </ItemGroup> + + <!-- Copy required files to the package specific directories --> + <Target Name="NugetPack"> + <Copy SourceFiles="@(Libraries)" DestinationFolder="$(PackageDirectory)\lib\$(Platform)\$(Configuration)"/> + <Copy SourceFiles="@(PhpSources)" DestinationFolder="$(PackageDirectory)\lib\%(PhpSources.RecursiveDir)"/> + <Copy SourceFiles="@(Slices)" DestinationFolder="$(PackageDirectory)\slice\%(Slices.RecursiveDir)"/> + <Copy SourceFiles="@(SliceCompilers)" DestinationFolder="$(PackageDirectory)\tools"/> + </Target> +</Project> diff --git a/php/msbuild/ice.proj b/php/msbuild/ice.proj index 9ac3fd36a9b..ae10f66cba8 100644 --- a/php/msbuild/ice.proj +++ b/php/msbuild/ice.proj @@ -11,22 +11,24 @@ <!-- Ice for PHP configurations --> <PropertyGroup> - <CppDistTargets>c++98\slice2php;c++98\icessl;c++98\icediscovery;c++98\icelocatordiscovery</CppDistTargets> + <CppDistTargets>c++98\slice2php;c++98\slice2html;c++98\icessl;c++98\icediscovery;c++98\icelocatordiscovery</CppDistTargets> <CppConfiguration Condition="'$(Configuration)' == 'NTS-Debug' or '$(Configuration)' == 'Debug'">Debug</CppConfiguration> <CppConfiguration Condition="'$(Configuration)' == 'NTS-Release' or '$(Configuration)' == 'Release'">Release</CppConfiguration> + <BuildWithPhpVersion Condition="'$(BuildWithPhpVersion)' == '' and '$(DefaultPlatformToolset)' == 'v141'">7.2</BuildWithPhpVersion> + <BuildWithPhpVersion Condition="'$(BuildWithPhpVersion)' == '' and '$(DefaultPlatformToolset)' == 'v140'">7.1</BuildWithPhpVersion> </PropertyGroup> <Target Name="NuGetRestore" DependsOnTargets="GetNuGet"> <!-- Restore NuGet packages to build Ice for PHP distribution --> <Exec Command="$(NuGetExe) restore $(MSBuildThisFileDirectory)ice.sln" Condition="'$(ICE_BIN_DIST)' != 'all'"/> - <Exec Command="$(NuGetExe) install zeroc.ice.v140 -OutputDirectory $(MSBuildThisFileDirectory)\packages -Version $(IceJSONVersion)" + <Exec Command="$(NuGetExe) install zeroc.ice.$(DefaultPlatformToolSet) -OutputDirectory $(MSBuildThisFileDirectory)\packages -Version $(IceJSONVersion)" Condition="'$(ICE_BIN_DIST)' == 'cpp'"/> </Target> <Choose> <When Condition="'$(ICE_BIN_DIST)' == 'cpp'"> <PropertyGroup> - <IceHome>$(MSBuildThisFileDirectory)\packages\zeroc.ice.v140.$(IceJSONVersion)</IceHome> + <IceHome>$(MSBuildThisFileDirectory)\packages\zeroc.ice.$(DefaultPlatformToolSet).$(IceJSONVersion)</IceHome> <IceToolsPath>$(IceHome)\tools</IceToolsPath> </PropertyGroup> </When> @@ -43,12 +45,58 @@ </Otherwise> </Choose> + <Choose> + <!-- + If BuildAllConfigurations is set to yes we build all configurations that are + part of the binary distribution, otherwise we just build the given platform + and configuration. + --> + <When Condition="'$(BuildAllConfigurations)' == 'yes'"> + <PropertyGroup> + <DefaultBuild>x64|Release</DefaultBuild> + </PropertyGroup> + <!-- Ice for C++ configurations --> + <ItemGroup> + <CppDistSolution Include="$(MSBuildThisFileDirectory)..\..\cpp\msbuild\ice.$(DefaultPlatformToolset).sln"> + <Properties>Configuration=Release;Platform=Win32</Properties> + </CppDistSolution> + <CppDistSolution Include="$(MSBuildThisFileDirectory)..\..\cpp\msbuild\ice.$(DefaultPlatformToolset).sln"> + <Properties>Configuration=Release;Platform=x64</Properties> + </CppDistSolution> + + <DistSolution Include="ice.sln"> + <Properties>Configuration=Release;Platform=Win32;BuildWithPhpVersion=$(BuildWithPhpVersion)</Properties> + </DistSolution> + <DistSolution Include="ice.sln"> + <Properties>Configuration=NTS-Release;Platform=Win32;BuildWithPhpVersion=$(BuildWithPhpVersion)</Properties> + </DistSolution> + + <DistSolution Include="ice.sln"> + <Properties>Configuration=Release;Platform=x64;BuildWithPhpVersion=$(BuildWithPhpVersion)</Properties> + </DistSolution> + <DistSolution Include="ice.sln"> + <Properties>Configuration=NTS-Release;Platform=x64;BuildWithPhpVersion=$(BuildWithPhpVersion)</Properties> + </DistSolution> + </ItemGroup> + </When> + <Otherwise> + <ItemGroup> + <CppDistSolution Include="$(MSBuildThisFileDirectory)..\..\cpp\msbuild\ice.$(DefaultPlatformToolset).sln"> + <Properties>Configuration=$(CppConfiguration);Platform=$(Platform)</Properties> + </CppDistSolution> + <DistSolution Include="ice.sln"> + <Properties>Configuration=$(Configuration);Platform=$(Platform);BuildWithPhpVersion=$(BuildWithPhpVersion)</Properties> + </DistSolution> + </ItemGroup> + </Otherwise> + </Choose> + <Target Name="BuildCppDist" Condition="'$(ICE_BIN_DIST)' != 'cpp'"> <Exec Command="$(NuGetExe) restore $(MSBuildThisFileDirectory)..\..\cpp\msbuild\ice.$(DefaultPlatformToolset).sln"/> - <MSBuild Projects="$(MSBuildThisFileDirectory)..\..\cpp\msbuild\ice.$(DefaultPlatformToolset).sln" + <MSBuild Projects="@(CppDistSolution)" Targets="$(CppDistTargets)" BuildInParallel="true" - Properties="Platform=$(Platform);Configuration=$(CppConfiguration)" /> + Properties="%(Properties)" /> </Target> <Target Name="BuildDist" DependsOnTargets="NuGetRestore;BuildCppDist" Condition="'$(ICE_BIN_DIST)' != 'all'"> @@ -56,8 +104,8 @@ Properties="IceHome=$(IceHome);IceToolsPath=$(IceToolsPath)" Targets="SliceCompile"/> - <MSBuild Projects="ice.sln" - Properties="Configuration=$(Configuration);Platform=$(Platform)" /> + <MSBuild Projects="@(DistSolution)" + Properties="%(Properties)" /> </Target> <Target Name="CleanDist" Condition="'$(ICE_BIN_DIST)' != 'all'"> @@ -65,9 +113,9 @@ Properties="IceHome=$(IceHome);IceToolsPath=$(IceToolsPath)" Targets="SliceCompileClean"/> - <MSBuild Projects="ice.sln" + <MSBuild Projects="@(DistSolution)" BuildInParallel="true" - Properties="Configuration=$(Configuration);Platform=$(Platform)" + Properties="%(Properties)" Targets="Clean" /> </Target> @@ -84,4 +132,19 @@ Properties="IceHome=$(IceHome);IceToolsPath=$(IceToolsPath)" Targets="SliceCompileClean"/> </Target> + + <Target Name="NuGetPack" DependsOnTargets="BuildDist"> + <RemoveDir Directories="zeroc.ice.php" /> + + <Copy SourceFiles="zeroc.ice.php.nuspec" DestinationFolder="zeroc.ice.php" /> + + <MSBuild Projects="ice.nuget.targets" + Properties="PackageDirectory=zeroc.ice.php;Platform=x64;Configuration=Release;PlatformToolset=$(DefaultPlatformToolset)"/> + <MSBuild Projects="ice.nuget.targets" + Properties="PackageDirectory=zeroc.ice.php;Platform=Win32;Configuration=Release;PlatformToolset=$(DefaultPlatformToolset)"/> + + <Copy SourceFiles="$(MSBuildThisFileDirectory)..\..\ICE_LICENSE" DestinationFiles="zeroc.ice.php\ICE_LICENSE.txt" /> + <Copy SourceFiles="$(MSBuildThisFileDirectory)..\..\LICENSE" DestinationFiles="zeroc.ice.php\LICENSE.txt" /> + + </Target> </Project> diff --git a/php/msbuild/zeroc.ice.php.nuspec b/php/msbuild/zeroc.ice.php.nuspec new file mode 100644 index 00000000000..746e0c8488c --- /dev/null +++ b/php/msbuild/zeroc.ice.php.nuspec @@ -0,0 +1,17 @@ +<?xml version="1.0"?> +<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"> + <metadata> + <id>zeroc.ice.ph</id> + <title>ZeroC Ice for PHP</title> + <version>3.7.1</version> + <authors>ZeroC</authors> + <copyright>Copyright (c) 2003-2018 ZeroC, Inc. All rights reserved</copyright> + <licenseUrl>https://raw.githubusercontent.com/zeroc-ice/ice/3.7/ICE_LICENSE</licenseUrl> + <projectUrl>https://github.com/zeroc-ice/ice</projectUrl> + <iconUrl>https://zeroc.com/images/logos/zeroc/zeroc_logo-64x64.png</iconUrl> + <requireLicenseAcceptance>false</requireLicenseAcceptance> + <description>Ice for PHP SDK. Ice is a comprehensive RPC framework that helps you network your software with minimal effort.</description> + <releaseNotes>https://doc.zeroc.com/display/Rel/Ice+3.7.1+Release+Notes</releaseNotes> + <tags>ice</tags> + </metadata> +</package> |