Skip to content

Commit

Permalink
Nug tools (Azure#6499)
Browse files Browse the repository at this point in the history
* initial set of changes for using nuget

* more settings updates. Removing irrelevant properties

* adding skip test for all test projects that were skipped earlier. removing irrelevant props, targets. Removed implicit executing init as default targets

* making init target not to download legacy toolset

* mac testing updates

* fixing keyvault projects to remove unnecessary imports

* fixing indentation for yml files

* updating nuget package for new directory structure

* disabling failing tests

* adding missing files
  • Loading branch information
shahabhijeet authored Jun 10, 2019
1 parent 8ecf475 commit 7087f15
Show file tree
Hide file tree
Showing 54 changed files with 257 additions and 130 deletions.
41 changes: 33 additions & 8 deletions .azure-pipelines/mgmt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,20 @@ jobs:
LoggingArgs: '/flp:Summary;Verbosity=minimal;LogFile=msbuild.sum /flp1:warningsonly;logfile=msbuild.wrn /flp2:errorsonly;logfile=msbuild.err'

steps:
- task: CmdLine@1
inputs:
filename: C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.2 Tools\sn.exe
arguments: -Vr *,31bf3856ad364e35
displayName: 'Disable strong name verification'
# - task: CmdLine@1
# inputs:
# filename: C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.2 Tools\sn.exe
# arguments: -Vr *,31bf3856ad364e35
# displayName: 'Disable strong name verification'

- task: MSBuild@1
inputs:
solution: build.proj
displayName: 'Install build tools'
- task: MSBuild@1
inputs:
solution: build.proj
msbuildArguments: /t:RunTests /clp:ShowTimestamp $(LoggingArgs) /p:IgnorePathTokens="$(IgnoreBuildTokens)"
msbuildArguments: /t:RunTests /clp:ShowTimestamp $(LoggingArgs) /p:IgnorePathTokens="$(IgnoreBuildTokens)" /p:UseLegacyDirStructure=true /p:SkipTests=true
displayName: 'Build and Run tests'
- task: PublishTestResults@2
condition: succeededOrFailed()
Expand All @@ -52,12 +53,36 @@ jobs:
displayName: 'Use .NET Core sdk $(DotNetCoreVersion)'
inputs:
version: '$(DotNetCoreVersion)'
- script: './tools/linuxScripts/runNetCoreSdkTests.sh'
displayName: 'Build and test on Non-windows machine'

- task: DotNetCoreCLI@1
inputs:
command: msbuild
solution: build.proj
arguments: /t:RunTests /clp:ShowTimestamp $(LoggingArgs) /p:IgnorePathTokens="$(IgnoreBuildTokens)" /p:UseLegacyDirStructure=true /p:SkipTests=true
displayName: 'Ubuntu Build and Run tests'
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFiles: '**/*.trx'
testRunTitle: 'Ubuntu Test Results'
testResultsFormat: 'VSTest'
mergeTestResults: true

# - job: Ubuntu_Build
# pool:
# vmImage: 'ubuntu-16.04'

# steps:
# - task: DotNetCoreInstaller@0
# displayName: 'Use .NET Core sdk $(DotNetCoreVersion)'
# inputs:
# version: '$(DotNetCoreVersion)'
# - script: './tools/linuxScripts/runNetCoreSdkTests.sh'
# displayName: 'Build and test on Non-windows machine'
# - task: PublishTestResults@2
# condition: succeededOrFailed()
# inputs:
# testResultsFiles: '**/*.trx'
# testRunTitle: 'Ubuntu Test Results'
# testResultsFormat: 'VSTest'
# mergeTestResults: true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ tools/Microsoft.WindowsAzure.Build.Tasks/packages/
PublishedNugets/
src/NuGet.Config
tools/7-zip/
#tools/LocalNugetFeed/Microsoft.Internal.NetSdkBuild.Mgmt.Tools.*.nupkg

[Tt]est[Rr]esult
[Bb]uild[Ll]og.*
Expand Down
3 changes: 0 additions & 3 deletions AzSdk.props

This file was deleted.

5 changes: 3 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
<PropertyGroup>
<RepoRoot>$(MSBuildThisFileDirectory)</RepoRoot>
<RepoEngPath>$(MSBuildThisFileDirectory)eng</RepoEngPath>
<RepoSrcPath>$(RepoRoot)src/SDKs</RepoSrcPath>
<RepoSrcPath>$(RepoRoot)src</RepoSrcPath>
<RepoSdkPath>$(RepoRoot)src/SDKs</RepoSdkPath>
<IsClientLibrary Condition="'$(IsClientLibrary)' == '' and $(MSBuildProjectName.StartsWith('Azure.'))">true</IsClientLibrary>
<IsDataPlaneProject Condition="'$(IsDataPlaneProject)' == '' and '$(IsClientLibrary)' == 'true'">true</IsDataPlaneProject>
<IsDataPlaneProject Condition="'$(IsDataPlaneProject)' == '' and $(MSBuildProjectDirectory.Contains('data-plane'))">true</IsDataPlaneProject>
</PropertyGroup>

<Import Project="$(RepoEngPath)\Directory.Build.Mgmt.props" Condition="'$(IsDataPlaneProject)' != 'true'" />
<Import Project="$(RepoEngPath)\mgmt\Directory.Build.Mgmt.props" Condition="'$(IsDataPlaneProject)' != 'true'" />
<Import Project="$(RepoEngPath)\Directory.Build.Data.props" Condition="'$(IsDataPlaneProject)' == 'true'" />
</Project>
2 changes: 1 addition & 1 deletion Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(RepoEngPath)\Directory.Build.Mgmt.targets" Condition="'$(IsDataPlaneProject)' != 'true'" />
<Import Project="$(RepoEngPath)\mgmt\Directory.Build.Mgmt.targets" Condition="'$(IsDataPlaneProject)' != 'true'" />
<Import Project="$(RepoEngPath)\Directory.Build.Data.targets" Condition="'$(IsDataPlaneProject)' == 'true'" />
</Project>
14 changes: 13 additions & 1 deletion NuGet.Config
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,16 @@
<add key="roslyn" value="https://dotnet.myget.org/F/roslyn-tools/api/v3/index.json" />
<add key="azure-sdk-tools" value="https://azuresdkartifacts.blob.core.windows.net/azure-sdk-tools/index.json" />
</packageSources>
</configuration>
<config>
<add key="globalPackagesFolder" value="restoredPackages" />
<add key="RestorePackagesPath" value="restoredPackages" />
</config>

<packageRestore>
<!-- Allow NuGet to download missing packages -->
<add key="enabled" value="True" />

<!-- Automatically check for missing packages during build in Visual Studio -->
<add key="automatic" value="True" />
</packageRestore>
</configuration>
3 changes: 0 additions & 3 deletions build.proj
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<Project DefaultTargets="Init" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="Directory.Build.props" />
<Import Project="test.props" />
<Import Project="AzSdk.props" />
<Import Project="Directory.Build.targets" />
<Import Project="$(NetSdkBuildTargetsDir)\core\_build.proj" Condition=" Exists('$(NetSdkBuildTargetsDir)\core\_build.proj') "/>
</Project>
17 changes: 0 additions & 17 deletions eng/AzSdk.reference.targets

This file was deleted.

15 changes: 0 additions & 15 deletions eng/AzSdk.test.reference.targets

This file was deleted.

33 changes: 0 additions & 33 deletions eng/Directory.Build.Mgmt.props

This file was deleted.

4 changes: 0 additions & 4 deletions eng/Directory.Build.Mgmt.targets

This file was deleted.

40 changes: 40 additions & 0 deletions eng/mgmt/AzSdk.reference.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Rest.ClientRuntime.Azure" Version="[3.3.19, 4.0.0)" />
<PackageReference Include="Microsoft.Rest.ClientRuntime" Version="[2.3.19, 3.0.0)" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0-preview.1" PrivateAssets="All" />
</ItemGroup>

<PropertyGroup>
<SdkTargetFx>net452;net461;netstandard1.4;netstandard2.0</SdkTargetFx>
</PropertyGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.4' ">
<PackageReference Include="System.Net.Http" Version="4.3.0"/>
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
<PackageReference Include="System.Net.Http" Version="4.3.0"/>
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net452' ">
<PackageReference Include="System.Net.Http" Version="4.3.0"/>
<PackageReference Include="Newtonsoft.Json" Version="6.0.8" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net461' ">
<Reference Include="System.Net" />
<Reference Include="System.Net.Http" />
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
</ItemGroup>
<PropertyGroup>
<EnablePreBuildTarget Condition=" '$(EnablePreBuildTarget)' == '' ">true</EnablePreBuildTarget>
<EnablePostBuildTarget Condition=" '$(EnablePostBuildTarget)' == '' ">true</EnablePostBuildTarget>
</PropertyGroup>

</Project>
15 changes: 15 additions & 0 deletions eng/mgmt/AzSdk.test.reference.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<TargetFrameworks>netcoreapp2.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.Test.HttpRecorder" Version="[1.13.3, 2.0.0)" />
<PackageReference Include="Microsoft.Rest.ClientRuntime.Azure.TestFramework" Version="[1.7.6, 2.0.0)" />
<PackageReference Include="Microsoft.Azure.ResourceManager" Version="[1.1.0-preview]" />
<PackageReference Include="xunit" Version="2.3.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.7.0" />
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0-preview.1" PrivateAssets="All" />
</ItemGroup>
</Project>
4 changes: 4 additions & 0 deletions eng/mgmt/Directory.Build.Mgmt.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(RepoRoot)\tools\bootstrapTools\bootstrap.targets" />
<Import Project="CI.Bootstrap.targets" Sdk="Microsoft.Internal.NetSdkBuild.Mgmt.Tools" Version="0.10.0" />
</Project>
8 changes: 8 additions & 0 deletions eng/mgmt/Directory.Build.Mgmt.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- <Import Project="$(NetSdkBuildTargetsDir)\core\_Directory.Build.targets" Condition=" Exists('$(NetSdkBuildTargetsDir)\core\_Directory.Build.targets') "/>
<Import Project="$(LibraryToolsFolder)\bootstrapTools\bootstrap.targets" /> -->

<Target Name="initt">
<Message Text="Init target called" />
</Target>
</Project>
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="$([MSBuild]::GetPathOfFileAbove('AzSdk.props'))" />
<PropertyGroup>
<Description>Microsoft Azure Key Vault WebKey Class Library</Description>
<AssemblyTitle>Microsoft Azure Key Vault WebKey</AssemblyTitle>
Expand Down
6 changes: 5 additions & 1 deletion src/AzSdk.reference.props
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetPathOfFileAbove('AzSdk.props'))" />
<PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Rest.ClientRuntime.Azure" Version="[3.3.19, 4.0.0)" />
<PackageReference Include="Microsoft.Rest.ClientRuntime" Version="[2.3.19, 3.0.0)" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0-preview.1" PrivateAssets="All" />
</ItemGroup>

<PropertyGroup>
Expand Down Expand Up @@ -33,4 +36,5 @@
<EnablePreBuildTarget Condition=" '$(EnablePreBuildTarget)' == '' ">true</EnablePreBuildTarget>
<EnablePostBuildTarget Condition=" '$(EnablePostBuildTarget)' == '' ">true</EnablePostBuildTarget>
</PropertyGroup>

</Project>
12 changes: 6 additions & 6 deletions src/AzSdk.test.reference.props
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetPathOfFileAbove('test.props'))" />

<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<TargetFrameworks>netcoreapp2.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.Test.HttpRecorder" Version="[1.13.3, 2.0.0)" />
<PackageReference Include="Microsoft.Rest.ClientRuntime.Azure.TestFramework" Version="[1.7.6, 2.0.0)" />
<PackageReference Include="Microsoft.Azure.ResourceManager" Version="[1.1.0-preview]" />

<!-- This is needed for discovering tests in test explorer -->
<PackageReference Include="System.Runtime.InteropServices" Version="4.3.0" />
<PackageReference Include="xunit" Version="2.3.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.7.0" />
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0-preview.1" PrivateAssets="All" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
<Version>1.0.0</Version>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>

<PropertyGroup>
<ExcludeFromBuild>true</ExcludeFromBuild>
<ExcludeFromTest>true</ExcludeFromTest>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Fabric.Admin\Microsoft.AzureStack.Management.Fabric.Admin.csproj" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
<VersionPrefix>1.0.0-preview</VersionPrefix>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup>
<ExcludeFromBuild>true</ExcludeFromBuild>
<ExcludeFromTest>true</ExcludeFromTest>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.Management.ResourceManager" Version="[1.6.0-preview, 2.0.0)" />
<!-- Enable below line in local to work around the bug that cannot find test cases -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
<Copyright>Copyright © MSIT 2013</Copyright>
<SignAssembly>false</SignAssembly>
</PropertyGroup>
<PropertyGroup>
<ExcludeFromBuild>true</ExcludeFromBuild>
<ExcludeFromTest>true</ExcludeFromTest>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.Management.ResourceManager" Version="[1.6.0-preview,2.0.0)" />
<ProjectReference Include="..\Management.Batch\Microsoft.Azure.Management.Batch.csproj" />
Expand Down
4 changes: 4 additions & 0 deletions src/SDKs/Billing/Billing.Tests/Billing.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
<Version>1.0.0</Version>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup>
<ExcludeFromBuild>true</ExcludeFromBuild>
<ExcludeFromTest>true</ExcludeFromTest>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Management.Billing\Microsoft.Azure.Management.Billing.csproj" />
</ItemGroup>
Expand Down
5 changes: 4 additions & 1 deletion src/SDKs/Compute/Compute.Tests/Compute.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
<AssemblyName>Compute.Tests</AssemblyName>
<VersionPrefix>1.0.0-preview</VersionPrefix>
</PropertyGroup>

<PropertyGroup>
<ExcludeFromBuild>true</ExcludeFromBuild>
<ExcludeFromTest>true</ExcludeFromTest>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.Management.Storage" Version="4.2.0-preview" />
<PackageReference Include="Microsoft.Azure.Management.Network" Version="19.3.0-preview" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
<Version>1.0.0</Version>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup>
<ExcludeFromBuild>true</ExcludeFromBuild>
<ExcludeFromTest>true</ExcludeFromTest>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Azure.Management.ResourceManager" Version="1.6.0-preview" />
Expand Down
Loading

0 comments on commit 7087f15

Please sign in to comment.