Skip to content

Commit

Permalink
Tests enabled, added signing support (#3091)
Browse files Browse the repository at this point in the history
* Tests enabled, added signing support

* enabling restore

* fixing xml namespaces
  • Loading branch information
shahabhijeet authored Apr 18, 2017
1 parent 9b0c880 commit 879aa45
Show file tree
Hide file tree
Showing 10 changed files with 288 additions and 117 deletions.
29 changes: 6 additions & 23 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
<NuGetCommand>&quot;$(LibraryToolsFolder)\nuget.exe&quot;</NuGetCommand>
<ImportDirectoryBuildTargets>true</ImportDirectoryBuildTargets>
</PropertyGroup>
<PropertyGroup>
<!--OnPremiseBuildTasks is not a good name, but CI server is using that, will update across soon-->
<CIToolsPath>$(OnPremiseBuildTasks)</CIToolsPath>
<OnPremiseBuild Condition=" Exists($(OnPremiseBuildTasks)) ">true</OnPremiseBuild>
<OnPremiseBuild Condition=" ! Exists($(OnPremiseBuildTasks)) ">false</OnPremiseBuild>
</PropertyGroup>

<PropertyGroup>
<BuildInParallel>true</BuildInParallel>
Expand All @@ -37,17 +43,6 @@
<SdkCommonRootDir>$(LibraryRoot)src\UpgradeVS17\SdkCommon\ClientRuntime</SdkCommonRootDir>
</PropertyGroup>


<!--
<Import Project="tools\buildTargets\common.Build.props"/>
<Import Project="tools\buildTargets\common.NugetPackage.props" />
<Import Project="tools\buildTargets\common.targets" />
<Import Project="tools\buildTargets\testTargets\test.Build.props" Condition=" '$(TestProjectType)' == 'true' "/>
-->




<Target Name="PublishLocal">
<Exec Command="$(NuGetCommand) push &quot;$(PackageOutputDir)\%(SdkNuGetPackage.Identity).%(SdkNuGetPackage.PackageVersion).nupkg&quot; $(NuGetKey)$(ActualSource)"
IgnoreExitCode="true"
Expand All @@ -59,15 +54,3 @@
<Import Project="tools\buildTargets\common.Build.props"/>
<Import Project="tools\buildTargets\common.NugetPackage.props" />
</Project>

<!--
<Import Project="$([MSBuild]::GetPathOfFileAbove('reference.props'))" />
<Set this true only if you want to test the code sign workflow locally>
<DelaySign Condition =" '$(DelaySign)' == '' ">false</DelaySign>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<FxTargetList>portable;net40;net45</FxTargetList>
<FxTargetList Condition=" '$(Scope)' == 'authentication' ">net45</FxTargetList>
<ZipExeFolder>$(LibraryToolsFolder)\7-Zip</ZipExeFolder>
<ZipExe>$(ZipExeFolder)\7z.exe</ZipExe>
<NuGetCommand>&quot;$(LibraryToolsFolder)\nuget.exe&quot;</NuGetCommand>
-->
8 changes: 1 addition & 7 deletions build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,5 @@
<Target Name="Restore" DependsOnTargets="$(RestoreTraversedProjectsDependsOn)" />
<Target Name="Build" DependsOnTargets="Restore;$(BuildTraversedProjectsDependsOn)" />
<Target Name="Rebuild" DependsOnTargets="Clean;Build" />

<!--
<Target Name="Clean" DependsOnTargets="$(CleanTraversedProjectsDependsOn)" />
<Target Name="Build" DependsOnTargets="$(RestoreTraversedProjectsDependsOn);$(BuildTraversedProjectsDependsOn)" />
<Target Name="Restore" DependsOnTargets="$(RestoreTraversedProjectsDependsOn)" />
<Target Name="Rebuild" DependsOnTargets="Clean;Build" />
-->
<Target Name="FullBuild" DependsOnTargets="Rebuild;Test" />
</Project>
5 changes: 2 additions & 3 deletions dirs.proj
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="src\dirs.proj" />
<!-- Import Condition="Exists('\dir.proj')" Project="\dir.proj" / -->
</Project>
<Import Project="src\dirs.proj" />
</Project>
34 changes: 23 additions & 11 deletions src/SDKs/dirs.proj
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="SDKProject">
<ProjectToBuild Include="$(MSBuildThisFileDirectory)AnalysisServices\Management.Analysis\Microsoft.Azure.Management.Analysis.csproj" />
<ProjectToBuild Include="$(MSBuildThisFileDirectory)AnalysisServices\Management.Analysis\Microsoft.Azure.Management.Analysis.csproj" />
<ProjectToBuild Include="$(MSBuildThisFileDirectory)Authorization\Management.Authorization\Microsoft.Azure.Management.Authorization.csproj" />
<ProjectToBuild Include="$(MSBuildThisFileDirectory)Automation\Management.Automation\Microsoft.Azure.Management.Automation.csproj" />

<ProjectToBuild Include="$(MSBuildThisFileDirectory)Batch\Management\Management.Batch\Microsoft.Azure.Management.Batch.csproj" />
<ProjectToBuild Include="$(MSBuildThisFileDirectory)Billing\Management.Billing\Microsoft.Azure.Management.Billing.csproj" />
<ProjectToBuild Include="$(MSBuildThisFileDirectory)Cdn\Management.Cdn\Microsoft.Azure.Management.Cdn.csproj" />
Expand Down Expand Up @@ -42,22 +43,21 @@
<ProjectToBuild Include="$(MSBuildThisFileDirectory)Storage\Management.Storage\Microsoft.Azure.Management.Storage.csproj" />
<ProjectToBuild Include="$(MSBuildThisFileDirectory)TrafficManager\Management.TrafficManager\Microsoft.Azure.Management.TrafficManager.csproj" />
<ProjectToBuild Include="$(MSBuildThisFileDirectory)WebSites\Management.Websites\Microsoft.Azure.Management.Websites.csproj" />

<!--

<!--
<ProjectToBuild Include="$(MSBuildThisFileDirectory)Automation\Management.Automation\Microsoft.Azure.Management.Automation.csproj" />
<ProjectToBuild Include="$(MSBuildThisFileDirectory)Authorization\Management.Authorization\Microsoft.Azure.Management.Sql.csproj" />
<ProjectToBuild Include="$(MSBuildThisFileDirectory)\Authorization.Tests\Microsoft.Rest.ClientRuntime.Azure.csproj" />
-->
</ItemGroup>


<ItemGroup Label="TestSDKProject">
<ProjectToBuild Include="$(MSBuildThisFileDirectory)AnalysisServices\**\*Tests.csproj" ProjectType="Test"/>

<ProjectToBuild Include="$(MSBuildThisFileDirectory)Authorization\**\*Tests.csproj" ProjectType="Test"/>
<ProjectToBuild Include="$(MSBuildThisFileDirectory)Automation\**\*Tests.csproj" ProjectType="Test"/>

<ProjectToBuild Include="$(MSBuildThisFileDirectory)Batch\Management\**\*Tests.csproj" ProjectType="Test"/>
<ProjectToBuild Include="$(MSBuildThisFileDirectory)Billing\**\*Tests.csproj" ProjectType="Test"/>
<ProjectToBuild Include="$(MSBuildThisFileDirectory)Cdn\**\*Tests.csproj" ProjectType="Test"/>
Expand All @@ -77,19 +77,18 @@
<ProjectToBuild Include="$(MSBuildThisFileDirectory)MachineLearning\**\*Tests.csproj" ProjectType="Test"/>
<ProjectToBuild Include="$(MSBuildThisFileDirectory)Logic\**\*Tests.csproj" ProjectType="Test"/>
<ProjectToBuild Include="$(MSBuildThisFileDirectory)Media\**\*Tests.csproj" ProjectType="Test"/>
<!-- <ProjectToBuild Include="$(MSBuildThisFileDirectory)Monitor\**\*Tests.csproj" ProjectType="Test"/> -->

<ProjectToBuild Include="$(MSBuildThisFileDirectory)Network\**\*Tests.csproj" ProjectType="Test"/>
<ProjectToBuild Include="$(MSBuildThisFileDirectory)NotificationHubs\**\*Tests.csproj" ProjectType="Test"/>
<ProjectToBuild Include="$(MSBuildThisFileDirectory)OperationalInsights\**\*Tests.csproj" ProjectType="Test"/>
<ProjectToBuild Include="$(MSBuildThisFileDirectory)PowerBIEmbedded\Management.PowerBIEmbedded\**\*Tests.csproj" ProjectType="Test"/>
<!-- <ProjectToBuild Include="$(MSBuildThisFileDirectory)RecoveryServices\**\*Tests.csproj" ProjectType="Test"/> -->
<ProjectToBuild Include="$(MSBuildThisFileDirectory)RecoveryServices.Backup\**\*Tests.csproj" ProjectType="Test"/>
<ProjectToBuild Include="$(MSBuildThisFileDirectory)RedisCache\**\*Tests.csproj" ProjectType="Test"/>
<ProjectToBuild Include="$(MSBuildThisFileDirectory)Relay\**\*Tests.csproj" ProjectType="Test"/>
<ProjectToBuild Include="$(MSBuildThisFileDirectory)Resource\**\*Tests.csproj" ProjectType="Test"/>
<ProjectToBuild Include="$(MSBuildThisFileDirectory)Scheduler\**\*Tests.csproj" ProjectType="Test"/>
<ProjectToBuild Include="$(MSBuildThisFileDirectory)Search\Management\**\*Tests.csproj" ProjectType="Test"/>
<!-- <ProjectToBuild Include="$(MSBuildThisFileDirectory)Search\DataPlane\**\*Tests.csproj" ProjectType="Test"/> -->

<ProjectToBuild Include="$(MSBuildThisFileDirectory)ServerManagement\**\*Tests.csproj" ProjectType="Test"/>
<ProjectToBuild Include="$(MSBuildThisFileDirectory)ServiceBus\**\*Tests.csproj" ProjectType="Test"/>
<ProjectToBuild Include="$(MSBuildThisFileDirectory)ServiceFabric\**\*Tests.csproj" ProjectType="Test"/>
Expand All @@ -98,5 +97,18 @@
<ProjectToBuild Include="$(MSBuildThisFileDirectory)TrafficManager\**\*Tests.csproj" ProjectType="Test"/>
<ProjectToBuild Include="$(MSBuildThisFileDirectory)WebSites\**\*Tests.csproj" ProjectType="Test"/>

</ItemGroup>
</ItemGroup>

<!--
<ProjectToBuild Include="$(MSBuildThisFileDirectory)Monitor\**\*Tests.csproj" ProjectType="Test"/>
<ProjectToBuild Include="$(MSBuildThisFileDirectory)RecoveryServices\**\*Tests.csproj" ProjectType="Test"/>
<ProjectToBuild Include="$(MSBuildThisFileDirectory)Search\DataPlane\**\*Tests.csproj" ProjectType="Test"/>
-->

<ItemGroup>
<DoNotRunTests Include="$(MSBuildThisFileDirectory)Authorization\**\*Tests.csproj" />
<DoNotRunTests Include="$(MSBuildThisFileDirectory)Automation\**\*Tests.csproj" ProjectType="Test"/>
<DoNotRunTests Include="$(MSBuildThisFileDirectory)RedisCache\**\*Tests.csproj" ProjectType="Test"/>
</ItemGroup>
</Project>

7 changes: 1 addition & 6 deletions src/dirs.proj
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--<Import Project="SdkCommon\dirs.proj" />-->
<Import Project="Sdks\dirs.proj" />
<!--
<Import Project="SdkCommon\dirs.proj" />
<Import Condition="Exists('Profiles\dir.proj')" Project="Profiles\dirs.proj" />
<Import Condition="Exists('SdkCommon\dir.proj')" Project="SdkCommon\dirs.proj" />
<Import Condition="Exists('SDKs\dir.proj')" Project="SDKs\dirs.proj" />
-->
</Project>
59 changes: 59 additions & 0 deletions tools/buildTargets/additional.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--
<Import Project="$(MSBuildExtensionsPath)\..\Common7\IDE\CommonExtensions\Microsoft\NuGet\NuGet.targets"/>
<Import Condition=" $(OnPremiseBuild) " Project="$(CIToolsPath)\Microsoft.WindowsAzure.Build.OnPremise.msbuild" />
<Import Project="$(MSBuildExtensionsPath)\..\Common7\IDE\CommonExtensions\Microsoft\NuGet\NuGet.targets" />
<Import Project="$(MSBuildExtensionsPath)\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets" />
-->
<Target Name="PreBuildStaticAnalysis" DependsOnTargets="$(PreBuildStaticAnalysisTargets)">
<!--
<MSBuild Targets="GetPackageReferences"
Projects="@(ProjectToBuild)"
ContinueOnError="ErrorAndStop">
<Output TaskParameter="TargetOutputs" ItemName="OtherProjectReferences" />
</MSBuild>
<MSBuild Targets="GetOutputPath"
Projects="@(SDKProject)"
ContinueOnError="ErrorAndStop">
<Output TaskParameter="TargetOutputs" ItemName="OutPutFilesToSign" />
</MSBuild>
<ItemGroup>
<FilesToSign Include="@(OutPutFilesToSign)"/>
</ItemGroup>
<Message Text="@(OutPutFilesToSign)" />
<Message Text="@(OtherProjectReferences)" />
-->
<!--<Error Condition=" '@(OtherProjectReferences)' != '' " Text="Contains Project References, build cannot continue. Please remove all Project references from CI builds" />-->


</Target>



<Target Name="GetPackageReferences" Returns="@(ProjectReference)" />
<Target Name="GetOutputPath" Returns="$(OutputPath)\$(AssemblyName).dll" />


<Target Name="PrintStuff">
<Message Text="ProgFiles .... $(ProgramFiles)" />
<Message Text="$(MSBuildExtensionsPath)" />
<!--
<Message Text="%(VsIDENugetPackageReference.Identity) and %(VsIDENugetPackageReference.Version) "/>
<Message Text="%(VsIDEProjectReference.Identity) "/>
-->

</Target>

<Target Name="GetWellKnownProperties">

</Target>

<!--
<Target Name="_SplitProjectReferencesByFileExistence">
</Target>
-->
</Project>
124 changes: 60 additions & 64 deletions tools/buildTargets/common.targets
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--
<Import Project="$(MSBuildExtensionsPath)\..\Common7\IDE\CommonExtensions\Microsoft\NuGet\NuGet.targets"/>
<Import Condition=" $(OnPremiseBuild) " Project="$(CIToolsPath)\Microsoft.WindowsAzure.Build.OnPremise.msbuild" />
<Import Project="$(MSBuildExtensionsPath)\..\Common7\IDE\CommonExtensions\Microsoft\NuGet\NuGet.targets" />
<Import Project="$(MSBuildExtensionsPath)\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets" />
-->

<Import Project="common.tasks"/>
<Import Project="signing.targets"/>
<PropertyGroup>
<NetFx452>net452</NetFx452>
<NetStd14>netstandard1.4</NetStd14>
</PropertyGroup>
<!--<ItemGroup>
<FilesToSign/>
</ItemGroup>-->

<PropertyGroup>
<PreBuildStaticAnalysisTargets>
BuildCiSign;
BuildMsBuildTask;
CategorizeProjects;
</PreBuildStaticAnalysisTargets>
</PropertyGroup>
Expand All @@ -19,6 +23,9 @@
PreBuildStaticAnalysis;
<!-- RestoreLatestProjects; -->
BuildLatestProjects;
PreSign;
Sign;
PostSign;
Package
</BuildTraversedProjectsDependsOn>

Expand Down Expand Up @@ -72,24 +79,51 @@
<!-- $(MSBuildProjectDefaultTargets)-->
<LatestProjectDefaultBuildTarget Condition=" '$(LatestProjectDefaultBuildTarget)' == '' ">Build</LatestProjectDefaultBuildTarget>
</PropertyGroup>


<Message Text="Building SDK Projects ..... @(SDKProject)" />
<MSBuild Targets="$(LatestProjectDefaultBuildTarget)"
Projects="@(SDKProject)"
BuildInParallel="$(BuildInParallel)"
ContinueOnError="ErrorAndStop" />
<Message Text="Building SDK Projects ..... @(SDKProject)" />
<MSBuild Targets="Build"
Projects="@(SDKProject)"
Properties="TargetFramework=$(NetFx452)"
BuildInParallel="$(BuildInParallel)"
ContinueOnError="ErrorAndStop">
<Output TaskParameter="TargetOutputs" ItemName="net452Assemblies" />
</MSBuild>

<MSBuild Targets="Build"
Projects="@(SDKProject)"
Properties="TargetFramework=$(NetStd14)"
BuildInParallel="$(BuildInParallel)"
ContinueOnError="ErrorAndStop">
<Output TaskParameter="TargetOutputs" ItemName="netStd14Assemblies" />
</MSBuild>

<!--BuildInParallel="$(BuildInParallel)"-->
<!--<Properties="GeneratePackageOnBuild=true;IncludeSymbols=true">-->
<ItemGroup>
<FilesToSign Include="@(net452Assemblies);@(netStd14Assemblies)" />
</ItemGroup>

<Message Text="Building SDKTest Projects ....... @(SDKTestProject)" />
<MSBuild Targets="$(LatestProjectDefaultBuildTarget)"
Projects="@(SDKTestProject)"
Condition=" '$(SkipBuildingTestProjects)' != 'false' "
ContinueOnError="ErrorAndStop" />

<!--<Properties="GeneratePackageOnBuild=true;IncludeSymbols=true">-->

ContinueOnError="ErrorAndStop">
</MSBuild>
</Target>

<Target Name="Test" DependsOnTargets="PreBuildStaticAnalysis">
<Message Text="Executing Tests......"/>
<ItemGroup>
<FinalTestsToRun Include="@(SDKTestProject)"/>
<FinalTestsToRun Remove="@(DoNotRunTests)" />
</ItemGroup>
<Message Text="Final Tests to run.... @(FinalTestsToRun)" />
<Exec Command="dotnet test %(FinalTestsToRun.Identity) -l trx;LogFileName=$(LibraryRoot)TestResults\%(FinalTestsToRun.Filename).trx --no-build" Condition="@(FinalTestsToRun) != ''" ContinueOnError="false" WorkingDirectory="%(FinalTestsToRun.RootDir)%(FinalTestsToRun.Directory)" />
</Target>

<!--
$(LibraryRoot)\TestResults\%(SDKTestProject.Filename).trx
-->
<Target Name="Package">
<Message Text="Packaging..... @(SDKProject)"/>
<MSBuild
Expand All @@ -105,54 +139,16 @@

</Target>

<Target Name="PublishNugetPackage">

</Target>

<Target Name="PreBuildStaticAnalysis" DependsOnTargets="$(PreBuildStaticAnalysisTargets)">
<!--
<MSBuild Targets="GetPackageReferences"
Projects="@(ProjectToBuild)"
ContinueOnError="ErrorAndStop">
<Output TaskParameter="TargetOutputs" ItemName="OtherProjectReferences" />
</MSBuild>
<Error Condition=" '@(OtherProjectReferences)' != '' " Text="Contains Project References, build cannot continue. Please remove all Project references from CI builds" />
-->
</Target>

<Target Name="GetPackageReferences" Returns="@(ProjectReference)" />

<Target Name="CategorizeProjects">
<Message Text="Categorizing...."/>
<ItemGroup>
<SDKProject Include="%(ProjectToBuild.Identity)" Condition=" '%(ProjectToBuild.ProjectType)' != 'Test' "/>
<SDKTestProject Include="%(ProjectToBuild.Identity)" Condition=" '%(ProjectToBuild.ProjectType)' == 'Test' "/>
</ItemGroup>

<Message Text="Building SDK Projects ..... @(SDKProject)" />

<Message Text="Building Test Projects ..... @(SDKTestProject)" />

</Target>

<Target Name="PrintStuff">
<Message Text="ProgFiles .... $(ProgramFiles)" />
<Message Text="$(MSBuildExtensionsPath)" />
<!--
<Message Text="%(VsIDENugetPackageReference.Identity) and %(VsIDENugetPackageReference.Version) "/>
<Message Text="%(VsIDEProjectReference.Identity) "/>
-->

<Message Text="Categorizing...."/>
<ItemGroup>
<SDKProject Include="%(ProjectToBuild.Identity)" Condition=" '%(ProjectToBuild.ProjectType)' != 'Test' "/>
<SDKTestProject Include="%(ProjectToBuild.Identity)" Condition=" '%(ProjectToBuild.ProjectType)' == 'Test' "/>
</ItemGroup>
<Message Text="Building SDK Projects ..... @(SDKProject)" />
<Message Text="Building Test Projects ..... @(SDKTestProject)" />
</Target>

<Target Name="GetWellKnownProperties">

<Target Name="PreBuildStaticAnalysis" DependsOnTargets="$(PreBuildStaticAnalysisTargets)">
</Target>

<Target Name="_SplitProjectReferencesByFileExistence">
<!-- Noop -->
</Target>


</Project>
</Project>
Loading

0 comments on commit 879aa45

Please sign in to comment.