Skip to content

Commit

Permalink
Restructure the .NET build
Browse files Browse the repository at this point in the history
This moves the .NET code under src\dotnet we will likely do something
similar for the other languages but just .NET for now.

Add basic support for building .NET libraries.
- Include strong name support with new full key
- Include common props/targets mostly copied from azure-sdk-for-net repo
- scope dotnet build pipeline to only windows build and test
  • Loading branch information
weshaggard committed Apr 5, 2019
1 parent 2ac63c5 commit 898abdd
Show file tree
Hide file tree
Showing 17 changed files with 89 additions and 17 deletions.
18 changes: 2 additions & 16 deletions .azure-pipelines/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,8 @@ jobs:

- job: 'Test'

strategy:
maxParallel: $[ variables['MaxParallelTestJobs'] ]
matrix:
Linux:
OSName: 'Linux'
OSVmImage: 'ubuntu-16.04'
Windows:
OSName: 'Windows'
OSVmImage: 'vs2017-win2016'
MacOs:
OSName: 'MacOS'
OSVmImage: 'macOS-10.13'

pool:
vmImage: '$(OSVmImage)'
vmImage: 'vs2017-win2016'

steps:
- task: DotNetCoreInstaller@0
Expand All @@ -59,7 +46,6 @@ jobs:

- task: DotNetCoreCLI@2
displayName: 'Build & Test'
# condition: eq(variables['System.TeamProject'], 'public')
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_CLI_TELEMETRY_OPTOUT: 1
Expand All @@ -73,6 +59,6 @@ jobs:
condition: succeededOrFailed()
inputs:
testResultsFiles: '**/*.trx'
testRunTitle: '$(OSName) DotNet $(DotNetCoreVersion)'
testRunTitle: 'Windows DotNet $(DotNetCoreVersion)'
testResultsFormat: 'VSTest'
mergeTestResults: true
8 changes: 8 additions & 0 deletions Directory.Build.props
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">
<PropertyGroup>
<RepoRoot>$(MSBuildThisFileDirectory)</RepoRoot>
<RepoEngPath>$(MSBuildThisFileDirectory)eng</RepoEngPath>
</PropertyGroup>

<Import Project="$(RepoEngPath)/Directory.Build.props" />
</Project>
3 changes: 3 additions & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(RepoEngPath)/Directory.Build.targets" />
</Project>
2 changes: 1 addition & 1 deletion eng/dotnet.proj → dotnet.proj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Project Sdk="Microsoft.Build.Traversal">
<ItemGroup>
<ProjectReference Include="$(RepoRoot)\**\*.csproj" />
<ProjectReference Include="src\dotnet\**\*.csproj" />
</ItemGroup>
</Project>
Binary file added eng/AzureSDKToolsKey.snk
Binary file not shown.
54 changes: 54 additions & 0 deletions eng/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Setup default project properties -->
<PropertyGroup>
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
<Platform Condition="'$(Platform)' == ''">AnyCPU</Platform>
<PlatformName Condition="'$(PlatformName)' == ''">$(Platform)</PlatformName>
<LangVersion>latest</LangVersion>
<SignAssembly>true</SignAssembly>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>

<!-- TargetFramework default properties -->
<PropertyGroup>
<IsTargetingNetFx Condition="$(TargetFramework.StartsWith('net4'))">true</IsTargetingNetFx>
<IsTargetingNetStandard Condition="$(TargetFramework.StartsWith('netstandard'))">true</IsTargetingNetStandard>
<IsTargetingNetCoreApp Condition="$(TargetFramework.StartsWith('netcoreapp'))">true</IsTargetingNetCoreApp>
</PropertyGroup>

<!-- Setup common output paths -->
<PropertyGroup>
<ArtifactsDir Condition="'$(ArtifactsDir)' == ''">$(RepoRoot)artifacts\</ArtifactsDir>
<ArtifactsObjDir>$(ArtifactsDir)obj\</ArtifactsObjDir>
<ArtifactsBinDir>$(ArtifactsDir)bin\</ArtifactsBinDir>
<ArtifactsPackagesDir>$(ArtifactsDir)packages\$(Configuration)\</ArtifactsPackagesDir>

<OutDirName Condition="'$(OutDirName)' == ''">$(MSBuildProjectName)</OutDirName>

<BaseOutputPath Condition="'$(BaseOutputPath)' == ''">$([System.IO.Path]::GetFullPath('$(ArtifactsBinDir)$(OutDirName)\'))</BaseOutputPath>
<OutputPath Condition="'$(PlatformName)' == 'AnyCPU'">$(BaseOutputPath)$(Configuration)\</OutputPath>
<OutputPath Condition="'$(PlatformName)' != 'AnyCPU'">$(BaseOutputPath)$(PlatformName)\$(Configuration)\</OutputPath>

<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)' == ''">$([System.IO.Path]::GetFullPath('$(ArtifactsObjDir)$(OutDirName)\'))</BaseIntermediateOutputPath>
<IntermediateOutputPath Condition="'$(PlatformName)' == 'AnyCPU'">$(BaseIntermediateOutputPath)$(Configuration)\</IntermediateOutputPath>
<IntermediateOutputPath Condition="'$(PlatformName)' != 'AnyCPU'">$(BaseIntermediateOutputPath)$(PlatformName)\$(Configuration)\</IntermediateOutputPath>

<PackageOutputPath>$(ArtifactsPackagesDir)</PackageOutputPath>
</PropertyGroup>

<!-- Common library and package properties -->
<PropertyGroup>
<Company>Microsoft Corporation</Company>
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
<Authors>Microsoft</Authors>
<Product>Azure .NET SDK - Tools</Product>
<PackageIconUrl>http://go.microsoft.com/fwlink/?LinkID=288890</PackageIconUrl>
<RepositoryUrl>https://github.com/Azure/azure-sdk-tools</RepositoryUrl>
<PackageProjectUrl>$(RepositoryUrl)</PackageProjectUrl>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<NeutralLanguage>en-US</NeutralLanguage>
</PropertyGroup>

</Project>
21 changes: 21 additions & 0 deletions eng/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<PropertyGroup>
<IsTestProject Condition="'$(IsTestProject)' == '' and $(MSBuildProjectName.EndsWith('.Tests'))">true</IsTestProject>
</PropertyGroup>

<PropertyGroup Condition="'$(IsTestProject)' == 'true' or '$(IsTestHelperLibrary)' == 'true'">
<IsPackable>false</IsPackable>
<SignAssembly>false</SignAssembly>

<!-- Disable running of tests for test helper libraries -->
<IsTestProject Condition="'$(IsTestHelperLibrary)' == 'true'">false</IsTestProject>
</PropertyGroup>

<PropertyGroup Condition="'$(SignAssembly)' != 'false'">
<SignAssembly>true</SignAssembly>
<DelaySign>false</DelaySign>
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)AzureSDKToolsKey.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

</Project>

0 comments on commit 898abdd

Please sign in to comment.