-
Notifications
You must be signed in to change notification settings - Fork 44
/
ODataConnectedService.msbuild
129 lines (113 loc) · 7.09 KB
/
ODataConnectedService.msbuild
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="tools\ConnectedService.tasks.targets"/>
<UsingTask TaskName="SkipStrongNames.CheckSkipStrongNamesStatus" AssemblyFile="$(SkipStrongNamesExe)" />
<ItemGroup>
<SolutionsToBuild Include="ODataCodeGenTools.sln">
<BuildInParallel>$(BuildInParallel)</BuildInParallel>
</SolutionsToBuild>
</ItemGroup>
<PropertyGroup>
<ProjectGuid>{120146C7-7CFD-4857-ACC0-78C2CD83C2C2}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Release</Configuration>
<NuGetFolder>.nuget</NuGetFolder>
<NuGetExe>$(NuGetFolder)\NuGet.exe</NuGetExe>
<IntermediateOutputPath>$(MSBuildThisFileDirectory)obj\$(Configuration)</IntermediateOutputPath>
<OutputPath>$(MSBuildThisFileDirectory)bin\$(Configuration)</OutputPath>
<RunCodeAnalysis Condition=" '$(RunCodeAnalysis)' == ''">true</RunCodeAnalysis>
<UseDTTP Condition=" '$(UseDTTP)' == ''">false</UseDTTP>
<SkipStrongNamesExe>$(MSBuildThisFileDirectory)packages\Microsoft.Web.SkipStrongNames.1.0.0\tools\SkipStrongNames.exe</SkipStrongNamesExe>
<SkipStrongNamesXml>$(MSBuildThisFileDirectory)tools\SkipStrongNames.xml</SkipStrongNamesXml>
<AdditionalRestoreProps></AdditionalRestoreProps>
<VisualStudioVersion>14.0</VisualStudioVersion>
</PropertyGroup>
<PropertyGroup>
<BinScopeOutDir Condition="'$(BinScopeOutDir)' == ''">$(OutputPath)\BinScope</BinScopeOutDir>
<BinScopeTargetDir Condition="'$(BinScopeTarget)' == ''">$(IntermediateOutputPath)\BinScope</BinScopeTargetDir>
<BinScopeLogFile Condition="'$(BinScopeLogFile)' == ''">$(BinScopeOutDir)\BinScopeResults.xml</BinScopeLogFile>
</PropertyGroup>
<PropertyGroup>
<PoliCheckOutput>$(OutputPath)\PoliCheck\Output.xml</PoliCheckOutput>
<PoliCheckProperties>/f:"$(MSBuildThisFileDirectory)\src" /t:"9" /o:"$(PoliCheckOutput)" /ge:0 /pe:0 /fc:1 /xs:1 /sev:"1|2|3|4"</PoliCheckProperties>
</PropertyGroup>
<Target Name="DisableBuildVsix">
<Message Text="DisableBuildVsix in DTTP"/>
<Exec Command='copy .\src\ODataConnectedService.csproj .\src\ODataConnectedService.csproj.bak' />
<RegexReplace Condition="'$(UseDTTP)' == 'true'" Files=".\src\ODataConnectedService.csproj" Find=".*Import Project=.*Microsoft.VsSDK.targets".*/>" Replace=" " WarnOnNoMatch="true"/>
</Target>
<Target Name="RestoreSkipStrongNames" DependsOnTargets="DownloadNuGet">
<Exec Command='"$(NuGetExe)" restore .nuget\packages.config -PackagesDirectory packages -NonInteractive ^
-Verbosity detailed -ConfigFile .nuget\NuGet.Config' />
</Target>
<Target Name="EnableSkipStrongNames" DependsOnTargets="RestoreSkipStrongNames">
<Exec Command='"$(SkipStrongNamesExe)" -e "$(SkipStrongNamesXml)"' />
<CheckSkipStrongNamesStatus AssembliesFile="$(SkipStrongNamesXml)">
<Output TaskParameter="Status" PropertyName="Status" />
</CheckSkipStrongNamesStatus>
<Message Text="SkipStrongNames: $(Status)" Importance="High" />
</Target>
<Target Name="DisableSkipStrongNames" DependsOnTargets="RestoreSkipStrongNames">
<Exec Command='"$(SkipStrongNamesExe)" -d "$(SkipStrongNamesXml)"' />
<CheckSkipStrongNamesStatus AssembliesFile="$(SkipStrongNamesXml)">
<Output TaskParameter="Status" PropertyName="Status" />
</CheckSkipStrongNamesStatus>
<Message Text="SkipStrongNames: $(Status)" Importance="High" />
</Target>
<Target Name="DownloadNuGet" Condition=" '$(NotDownloadNuget)' != 'true' ">
<DownloadNuGet Condition="" OutputFileName="$(NuGetExe)" MinimumVersion="2.7.0" />
</Target>
<Target Name="RestorePackages" DependsOnTargets="DownloadNuGet">
<Message Text="Restoring NuGet packages..." Importance="High" />
<Exec Command='"$(NuGetExe)" restore "%(SolutionsToBuild.Identity)" -PackagesDirectory packages -NonInteractive ^
-Verbosity detailed -ConfigFile "$(MsBuildThisFileDirectory)$(NuGetFolder)\NuGet.Config" ^
-NoCache $(AdditionalRestoreProps)' />
</Target>
<Target Name="Build" DependsOnTargets="DisableBuildVsix;RestorePackages">
<Message Importance="High" Text="Build All Assemblies by ODataConnectedService.msbuild Configuration=$(Configuration);RunCodeAnalysis=$(RunCodeAnalysis);StyleCopEnabled=$(StyleCopEnabled);VisualStudioVersion=$(VisualStudioVersion);UseDTTP=$(UseDTTP);OutputPath=$(OutputPath)" />
<MSBuild
Projects="@(SolutionsToBuild)"
BuildInParallel="%(SolutionsToBuild.BuildInParallel)"
Targets="Build"
Condition=" '%(SolutionsToBuild.Portable)' != 'true' or '$(BuildPortable)' == 'true' "
Properties="Configuration=$(Configuration);RunCodeAnalysis=$(RunCodeAnalysis);StyleCopEnabled=$(StyleCopEnabled);VisualStudioVersion=$(VisualStudioVersion);UseDTTP=$(UseDTTP);OutputPath=$(OutputPath)" />
</Target>
<Target Name="RegexReplace" DependsOnTargets="Build" AfterTargets="Build">
<Message Text="RegexReplace ..."/>
<RegexReplace Condition="" Files="$(OutputPath)\source.extension.vsixmanifest" Find="Asset Type="Microsoft.VisualStudio.MefComponent.*/>" Replace="Asset Type="Microsoft.VisualStudio.MefComponent" Path="Microsoft.OData.ConnectedService.dll" />" WarnOnNoMatch="true"/>
</Target>
<Target Name="ProjectCopRun">
</Target>
<Target Name="BinScope">
<ItemGroup>
<BinScopeTargetFiles Include="$(OutputPath)Microsoft.OData.ConnectedService.dll;" />
</ItemGroup>
<RemoveDir Directories="$(BinScopeTargetDir)" />
<MakeDir Directories="$(BinScopeTargetDir)" />
<Copy SourceFiles="$(OutputPath)\Microsoft.OData.ConnectedService.dll" DestinationFolder="$(BinScopeTargetDir)" SkipUnchangedFiles="true" />
<Exec Command=""$(BinScopeEXE)" /target "$(BinScopeTargetDir)" /sympath "$(OutputPath)" /logfile "$(BinScopeLogFile)"" />
</Target>
<Target Name ="PoliCheck">
<ItemGroup>
<ObjFiles Include="$(MSBuildThisFileDirectory)\src\**\obj\**\*.*;"/>
</ItemGroup>
<Message Importance="High" Text="Delete Noise Files Before PoliCheck" />
<Delete Files="@(ObjFiles)"/>
<Exec Command='"$(PoliCheckExe)" $(PoliCheckProperties)'/>
</Target>
<Target Name="Clean">
<MSBuild
Projects="@(SolutionsToBuild)"
BuildInParallel="%(SolutionsToBuild.BuildInParallel)"
Targets="Clean"
Condition=" '%(SolutionsToBuild.Portable)' != 'true' or '$(BuildPortable)' == 'true' "
Properties="Configuration=$(Configuration);VisualStudioVersion=$(VisualStudioVersion)" />
<RemoveDir Directories="bin\$(Configuration);OutputPath=$(OutputPath)" />
</Target>
<Target Name="Rebuild" DependsOnTargets="RestorePackages">
<MSBuild
Projects="@(SolutionsToBuild)"
BuildInParallel="%(SolutionsToBuild.BuildInParallel)"
Targets="ReBuild"
Condition=" '%(SolutionsToBuild.Portable)' != 'true' or '$(BuildPortable)' == 'true' "
Properties="Configuration=$(Configuration);RunCodeAnalysis=$(RunCodeAnalysis);StyleCopEnabled=$(StyleCopEnabled);VisualStudioVersion=$(VisualStudioVersion);OutputPath=$(OutputPath);EnableProjectCop=false" />
</Target>
</Project>