Skip to content

Commit

Permalink
Fix build of mgmt libraries with new tools
Browse files Browse the repository at this point in the history
- Fixes the Azure.Core issue which shouldn't be included in mgmt libraries
- Fix long path issues with location services by renaming namespace
- Fix output paths to go under artifacts folders
  • Loading branch information
weshaggard committed Jun 13, 2019
1 parent 11ee2d9 commit 34ca9b1
Show file tree
Hide file tree
Showing 13 changed files with 42 additions and 34 deletions.
27 changes: 27 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,33 @@
<IsDataPlaneProject Condition="'$(IsDataPlaneProject)' == '' and $(MSBuildProjectDirectory.Contains('data-plane'))">true</IsDataPlaneProject>
</PropertyGroup>

<!-- Setup default project properties -->
<PropertyGroup>
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
<Platform Condition="'$(Platform)' == ''">AnyCPU</Platform>
<PlatformName Condition="'$(PlatformName)' == ''">$(Platform)</PlatformName>
</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>

<Import Project="$(RepoEngPath)\mgmt\Directory.Build.Mgmt.props" Condition="'$(IsDataPlaneProject)' != 'true'" />
<Import Project="$(RepoEngPath)\Directory.Build.Data.props" Condition="'$(IsDataPlaneProject)' == 'true'" />
</Project>
23 changes: 0 additions & 23 deletions eng/Directory.Build.Data.props
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
<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>
<!--
Disable NuGet Pack warning that the version is SemVer 2.0.
Expand Down Expand Up @@ -52,26 +49,6 @@
<DefineConstants Condition="'$(IsTargetingNetFx)' == 'true'">$(DefineConstants);FullNetFx</DefineConstants>
</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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,16 @@ public StaticAnalysisUnitTests(ITestOutputHelper testOutputHelper)
{
this.testOutputHelper = testOutputHelper;

this.sourceLocation = @"../../../../../sdk/batch/Microsoft.Azure.Batch/src";
this.sourceLocation = GetSourceDirectory();
this.proxySourceLocation = Path.Combine(this.sourceLocation, GeneratedProtocolFolder);
}

private string GetSourceDirectory([System.Runtime.CompilerServices.CallerFilePath] string sourceFilePath = "")
{
System.Console.WriteLine($"SFP2: {sourceFilePath}");
return Path.Combine(Path.GetDirectoryName(sourceFilePath), "..", "..", "src");
}

[Fact]
[Trait(TestTraits.Duration.TraitName, TestTraits.Duration.Values.VeryShortDuration)]
public void ExceptionsThrownDirectlyByRestProxyDontChange()
Expand Down Expand Up @@ -140,7 +146,7 @@ public void DotWaitAndDotResultAreNeverUsed()
//Remove the two we expect
results.Remove(results.First(r => r.File.Contains("UtilitiesInternal.cs")));
results.Remove(results.First(r => r.File.Contains("SynchronousMethodExceptionBehavior.cs")));

foreach (SourceParserResult parserResult in results)
{
this.testOutputHelper.WriteLine("Found .Wait or .Result in {0} at {1} -- {2}", parserResult.File, parserResult.LineNumber, parserResult.Match);
Expand All @@ -161,7 +167,7 @@ private static string GetExceptionCaptureRegex(string exceptionNameCaptureGroup)
//\\s+(?<{0}>\\w+?)\\( - find everything after the "new" in the previous part of the expression which is a
// "word" character (alphanumeric), and comes before the next "(" character
// and store it in the group named "ExceptionName"

string pattern = string.Format("(?<!//.*?)(throw\\s+?new\\s+(\\w+\\.)*(?<{0}>\\w+?)\\()", exceptionNameCaptureGroup);

return pattern;
Expand Down
2 changes: 1 addition & 1 deletion sdk/keyvault/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PropertyGroup Condition="'$(IsDataPlane)' == 'true'">
<VersionPrefix>3.0.3</VersionPrefix>
<PackageTags>Microsoft Azure Key Vault;Key Vault;REST HTTP client;azureofficial;windowsazureofficial</PackageTags>
<PackageReleaseNotes>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
using System.Net;
using Xunit;

namespace LocationBasedServicesServices.Tests
namespace LBS.Tests
{
// aad tenant id: 72f988bf-86f1-41af-91ab-2d7cd011db47
// aad application identity: 26ba1730-4c7c-4099-84b8-ec115a357455
Expand Down
10 changes: 4 additions & 6 deletions sdk/storage/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
-->
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory).., Directory.Build.props))\Directory.Build.props" />

<PropertyGroup>
<PropertyGroup Condition="'$(IsClientLibrary)' == 'true'">
<!--
We're currently on 1.0.0-preview.X and we'll share this version number
across all Storage projects until the need to version independently arises.
Expand Down Expand Up @@ -34,20 +34,18 @@
<DefineConstants>DEBUG;$(DefineConstants)</DefineConstants>
</PropertyGroup>

<Import Project="$(MSBuildThisFileDirectory)..\core\Azure.Core\src\Azure.Core.props" />

<Import Condition="'$(IsClientLibrary)' == 'true'" Project="$(MSBuildThisFileDirectory)..\core\Azure.Core\src\Azure.Core.props" />

<!-- Add references for CLIENT LIBRARY projects -->
<ItemGroup Condition="'$(IsTestProject)' != 'true'">
<ItemGroup Condition="'$(IsTestProject)' != 'true' and '$(IsClientLibrary)' == 'true'">
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>


<!-- Add references for TEST projects -->
<ItemGroup Condition="'$(IsTestProject)' == 'true'">
<ItemGroup Condition="'$(IsTestProject)' == 'true' and '$(IsClientLibrary)' == 'true'">
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="MSTest.TestAdapter" />
<PackageReference Include="MSTest.TestFramework" />
Expand Down

0 comments on commit 34ca9b1

Please sign in to comment.