summaryrefslogtreecommitdiff
path: root/csharp/msbuild/ice.proj
blob: 9d04287d2c642e9b1217df2efa681075f23fe1e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <PropertyGroup Condition="'$(Configuration)' == ''">
      <Configuration>Debug</Configuration>
    </PropertyGroup>

    <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />

    <Import Project="$(MSBuildThisFileDirectory)\..\..\config\Ice.common.targets" />

    <Target Name="TestNugetRestore" DependsOnTargets="GetNuget" Condition="'$(ICE_BIN_DIST)' == 'all'">
      <Exec Command="$(NugetExe) restore $(MSBuildThisFileDirectory)ice.test.sln"/>
    </Target>

    <ItemGroup>
        <DistSolution Include="ice.sln">
          <Properties>Configuration=$(Configuration);Platform=Any CPU</Properties>
        </DistSolution>

        <TestSoution Include="ice.test.sln">
          <Properties>Configuration=$(Configuration.Replace("-Managed", ""));Platform=Any CPU</Properties>
        </TestSoution>
    </ItemGroup>

    <Target Name="BuildDist" Condition="'$(ICE_BIN_DIST)' != 'all'">
        <MSBuild Projects="@(DistSolution)"
                 BuildInParallel="true"
                 Properties="%(Properties)"/>
    </Target>

    <Target Name="CleanDist" Condition="'$(ICE_BIN_DIST)' != 'all'">
        <MSBuild Projects="@(DistSolution)"
                 BuildInParallel="true"
                 Properties="%(Properties)"
                 Targets="Clean" />
    </Target>

    <Target Name="Build" DependsOnTargets="TestNugetRestore;BuildDist">
        <MSBuild Projects="@(TestSoution)"
                 BuildInParallel="true"
                 Properties="%(Properties)" />
    </Target>

    <Target Name="Clean" DependsOnTargets="CleanDist">
        <MSBuild Projects="@(TestSoution)" BuildInParallel="true" Targets="Clean" Properties="%(Properties)" />
    </Target>

    <Import Project="$(MSBuildThisFileDirectory)ice.common.targets" />

    <Target Name="NugetPack" DependsOnTargets="BuildDist">
        <RemoveDir Directories="zeroc.ice.net" />
        <MSBuild Projects="ice.nuget.targets"
                 Properties="PackageDirectory=zeroc.ice.net"/>

        <Copy SourceFiles="zeroc.ice.net.nuspec"
              DestinationFolder="zeroc.ice.net" />

        <!-- Generate iceboxnet.exe.config with the correct assembly 
             pulbic key token and assembly paths -->
        <GetPublicKeyToken AssemblyFile="$(MSBuildThisFileDirectory)..\Assemblies\Ice.dll">
          <Output TaskParameter="PublicKeyToken" PropertyName="PublicKeyToken"/>
        </GetPublicKeyToken>

        <WriteFileWithReplacements InputFile="$(MSBuildThisFileDirectory)iceboxnet.exe.config"
                                   OutputFile="$(MSBuildThisFileDirectory)zeroc.ice.net\tools\iceboxnet.exe.config"
                                   Tokens="@PublicKeyToken@;@AssemblyDir@"
                                   Replacements="$(PublicKeyToken);..\lib"/>

        <!-- Copy bzip2 native dll next to iceboxnet.exe -->
        <Copy SourceFiles="$(MSBuildThisFileDirectory)..\..\cpp\msbuild\packages\bzip2.v140.1.0.6.4\build\native\bin\x64\Release\bzip2.dll"
              DestinationFiles="$(MSBuildThisFileDirectory)zeroc.ice.net\tools\bzip2.dll" />

        <Copy SourceFiles="zeroc.ice.net.props"
              DestinationFiles="zeroc.ice.net\build\zeroc.ice.net.props" />

        <Exec Command="$(NugetExe) pack -NoPackageAnalysis -NonInteractive"
              WorkingDirectory="zeroc.ice.net"/>
    </Target>
</Project>