From d782e965bd25e2e40b42dd365fc8df70c03457c2 Mon Sep 17 00:00:00 2001 From: Wes Haggard Date: Wed, 12 Jun 2019 17:34:52 -0700 Subject: [PATCH] Fix build of mgmt libraries with new tools (#6554) - 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 --- Directory.Build.props | 27 +++++++++++++++++++ eng/Directory.Build.Data.props | 23 ---------------- .../UnitTests/StaticAnalysisUnitTests.cs | 12 ++++++--- sdk/keyvault/Directory.Build.props | 2 +- ...ocationBasedServicesAccountCreateTest.json | 0 ...ocationBasedServicesAccountDeleteTest.json | 0 ...ervicesAccountListByResourceGroupTest.json | 0 ...ServicesAccountListBySubscriptionTest.json | 0 ...ationBasedServicesAccountListKeysTest.json | 0 ...BasedServicesAccountRegenerateKeyTest.json | 0 ...ocationBasedServicesAccountUpdateTest.json | 0 .../LocationBasedServicesAccountTests.cs | 2 +- sdk/storage/Directory.Build.props | 10 +++---- 13 files changed, 42 insertions(+), 34 deletions(-) rename sdk/locationbasedservices/Microsoft.Azure.Management.LocationBasedServices/tests/SessionRecords/{LocationBasedServicesServices.Tests.LocationBasedServicesServicesAccountTests => LBS.Tests.LocationBasedServicesServicesAccountTests}/LocationBasedServicesAccountCreateTest.json (100%) rename sdk/locationbasedservices/Microsoft.Azure.Management.LocationBasedServices/tests/SessionRecords/{LocationBasedServicesServices.Tests.LocationBasedServicesServicesAccountTests => LBS.Tests.LocationBasedServicesServicesAccountTests}/LocationBasedServicesAccountDeleteTest.json (100%) rename sdk/locationbasedservices/Microsoft.Azure.Management.LocationBasedServices/tests/SessionRecords/{LocationBasedServicesServices.Tests.LocationBasedServicesServicesAccountTests => LBS.Tests.LocationBasedServicesServicesAccountTests}/LocationBasedServicesAccountListByResourceGroupTest.json (100%) rename sdk/locationbasedservices/Microsoft.Azure.Management.LocationBasedServices/tests/SessionRecords/{LocationBasedServicesServices.Tests.LocationBasedServicesServicesAccountTests => LBS.Tests.LocationBasedServicesServicesAccountTests}/LocationBasedServicesAccountListBySubscriptionTest.json (100%) rename sdk/locationbasedservices/Microsoft.Azure.Management.LocationBasedServices/tests/SessionRecords/{LocationBasedServicesServices.Tests.LocationBasedServicesServicesAccountTests => LBS.Tests.LocationBasedServicesServicesAccountTests}/LocationBasedServicesAccountListKeysTest.json (100%) rename sdk/locationbasedservices/Microsoft.Azure.Management.LocationBasedServices/tests/SessionRecords/{LocationBasedServicesServices.Tests.LocationBasedServicesServicesAccountTests => LBS.Tests.LocationBasedServicesServicesAccountTests}/LocationBasedServicesAccountRegenerateKeyTest.json (100%) rename sdk/locationbasedservices/Microsoft.Azure.Management.LocationBasedServices/tests/SessionRecords/{LocationBasedServicesServices.Tests.LocationBasedServicesServicesAccountTests => LBS.Tests.LocationBasedServicesServicesAccountTests}/LocationBasedServicesAccountUpdateTest.json (100%) diff --git a/Directory.Build.props b/Directory.Build.props index 817cde1c50367..7a393aa43af5e 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -9,6 +9,33 @@ true + + + Debug + AnyCPU + $(Platform) + + + + + $(RepoRoot)artifacts\ + $(ArtifactsDir)obj\ + $(ArtifactsDir)bin\ + $(ArtifactsDir)packages\$(Configuration)\ + + $(MSBuildProjectName) + + $([System.IO.Path]::GetFullPath('$(ArtifactsBinDir)$(OutDirName)\')) + $(BaseOutputPath)$(Configuration)\ + $(BaseOutputPath)$(PlatformName)\$(Configuration)\ + + $([System.IO.Path]::GetFullPath('$(ArtifactsObjDir)$(OutDirName)\')) + $(BaseIntermediateOutputPath)$(Configuration)\ + $(BaseIntermediateOutputPath)$(PlatformName)\$(Configuration)\ + + $(ArtifactsPackagesDir) + + diff --git a/eng/Directory.Build.Data.props b/eng/Directory.Build.Data.props index 0f7fa5eff26d3..23fafdb6dc7bb 100644 --- a/eng/Directory.Build.Data.props +++ b/eng/Directory.Build.Data.props @@ -1,9 +1,6 @@  - Debug - AnyCPU - $(Platform) latest - - $(RepoRoot)artifacts\ - $(ArtifactsDir)obj\ - $(ArtifactsDir)bin\ - $(ArtifactsDir)packages\$(Configuration)\ - - $(MSBuildProjectName) - - $([System.IO.Path]::GetFullPath('$(ArtifactsBinDir)$(OutDirName)\')) - $(BaseOutputPath)$(Configuration)\ - $(BaseOutputPath)$(PlatformName)\$(Configuration)\ - - $([System.IO.Path]::GetFullPath('$(ArtifactsObjDir)$(OutDirName)\')) - $(BaseIntermediateOutputPath)$(Configuration)\ - $(BaseIntermediateOutputPath)$(PlatformName)\$(Configuration)\ - - $(ArtifactsPackagesDir) - - Microsoft Corporation diff --git a/sdk/batch/Microsoft.Azure.Batch/tests/UnitTests/StaticAnalysisUnitTests.cs b/sdk/batch/Microsoft.Azure.Batch/tests/UnitTests/StaticAnalysisUnitTests.cs index 3f6b9a218b51a..6a49a167d3053 100644 --- a/sdk/batch/Microsoft.Azure.Batch/tests/UnitTests/StaticAnalysisUnitTests.cs +++ b/sdk/batch/Microsoft.Azure.Batch/tests/UnitTests/StaticAnalysisUnitTests.cs @@ -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() @@ -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); @@ -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("(?\\w+?)\\()", exceptionNameCaptureGroup); return pattern; diff --git a/sdk/keyvault/Directory.Build.props b/sdk/keyvault/Directory.Build.props index 64cab003cb996..63ad1043a8edb 100644 --- a/sdk/keyvault/Directory.Build.props +++ b/sdk/keyvault/Directory.Build.props @@ -1,5 +1,5 @@  - + 3.0.3 Microsoft Azure Key Vault;Key Vault;REST HTTP client;azureofficial;windowsazureofficial diff --git a/sdk/locationbasedservices/Microsoft.Azure.Management.LocationBasedServices/tests/SessionRecords/LocationBasedServicesServices.Tests.LocationBasedServicesServicesAccountTests/LocationBasedServicesAccountCreateTest.json b/sdk/locationbasedservices/Microsoft.Azure.Management.LocationBasedServices/tests/SessionRecords/LBS.Tests.LocationBasedServicesServicesAccountTests/LocationBasedServicesAccountCreateTest.json similarity index 100% rename from sdk/locationbasedservices/Microsoft.Azure.Management.LocationBasedServices/tests/SessionRecords/LocationBasedServicesServices.Tests.LocationBasedServicesServicesAccountTests/LocationBasedServicesAccountCreateTest.json rename to sdk/locationbasedservices/Microsoft.Azure.Management.LocationBasedServices/tests/SessionRecords/LBS.Tests.LocationBasedServicesServicesAccountTests/LocationBasedServicesAccountCreateTest.json diff --git a/sdk/locationbasedservices/Microsoft.Azure.Management.LocationBasedServices/tests/SessionRecords/LocationBasedServicesServices.Tests.LocationBasedServicesServicesAccountTests/LocationBasedServicesAccountDeleteTest.json b/sdk/locationbasedservices/Microsoft.Azure.Management.LocationBasedServices/tests/SessionRecords/LBS.Tests.LocationBasedServicesServicesAccountTests/LocationBasedServicesAccountDeleteTest.json similarity index 100% rename from sdk/locationbasedservices/Microsoft.Azure.Management.LocationBasedServices/tests/SessionRecords/LocationBasedServicesServices.Tests.LocationBasedServicesServicesAccountTests/LocationBasedServicesAccountDeleteTest.json rename to sdk/locationbasedservices/Microsoft.Azure.Management.LocationBasedServices/tests/SessionRecords/LBS.Tests.LocationBasedServicesServicesAccountTests/LocationBasedServicesAccountDeleteTest.json diff --git a/sdk/locationbasedservices/Microsoft.Azure.Management.LocationBasedServices/tests/SessionRecords/LocationBasedServicesServices.Tests.LocationBasedServicesServicesAccountTests/LocationBasedServicesAccountListByResourceGroupTest.json b/sdk/locationbasedservices/Microsoft.Azure.Management.LocationBasedServices/tests/SessionRecords/LBS.Tests.LocationBasedServicesServicesAccountTests/LocationBasedServicesAccountListByResourceGroupTest.json similarity index 100% rename from sdk/locationbasedservices/Microsoft.Azure.Management.LocationBasedServices/tests/SessionRecords/LocationBasedServicesServices.Tests.LocationBasedServicesServicesAccountTests/LocationBasedServicesAccountListByResourceGroupTest.json rename to sdk/locationbasedservices/Microsoft.Azure.Management.LocationBasedServices/tests/SessionRecords/LBS.Tests.LocationBasedServicesServicesAccountTests/LocationBasedServicesAccountListByResourceGroupTest.json diff --git a/sdk/locationbasedservices/Microsoft.Azure.Management.LocationBasedServices/tests/SessionRecords/LocationBasedServicesServices.Tests.LocationBasedServicesServicesAccountTests/LocationBasedServicesAccountListBySubscriptionTest.json b/sdk/locationbasedservices/Microsoft.Azure.Management.LocationBasedServices/tests/SessionRecords/LBS.Tests.LocationBasedServicesServicesAccountTests/LocationBasedServicesAccountListBySubscriptionTest.json similarity index 100% rename from sdk/locationbasedservices/Microsoft.Azure.Management.LocationBasedServices/tests/SessionRecords/LocationBasedServicesServices.Tests.LocationBasedServicesServicesAccountTests/LocationBasedServicesAccountListBySubscriptionTest.json rename to sdk/locationbasedservices/Microsoft.Azure.Management.LocationBasedServices/tests/SessionRecords/LBS.Tests.LocationBasedServicesServicesAccountTests/LocationBasedServicesAccountListBySubscriptionTest.json diff --git a/sdk/locationbasedservices/Microsoft.Azure.Management.LocationBasedServices/tests/SessionRecords/LocationBasedServicesServices.Tests.LocationBasedServicesServicesAccountTests/LocationBasedServicesAccountListKeysTest.json b/sdk/locationbasedservices/Microsoft.Azure.Management.LocationBasedServices/tests/SessionRecords/LBS.Tests.LocationBasedServicesServicesAccountTests/LocationBasedServicesAccountListKeysTest.json similarity index 100% rename from sdk/locationbasedservices/Microsoft.Azure.Management.LocationBasedServices/tests/SessionRecords/LocationBasedServicesServices.Tests.LocationBasedServicesServicesAccountTests/LocationBasedServicesAccountListKeysTest.json rename to sdk/locationbasedservices/Microsoft.Azure.Management.LocationBasedServices/tests/SessionRecords/LBS.Tests.LocationBasedServicesServicesAccountTests/LocationBasedServicesAccountListKeysTest.json diff --git a/sdk/locationbasedservices/Microsoft.Azure.Management.LocationBasedServices/tests/SessionRecords/LocationBasedServicesServices.Tests.LocationBasedServicesServicesAccountTests/LocationBasedServicesAccountRegenerateKeyTest.json b/sdk/locationbasedservices/Microsoft.Azure.Management.LocationBasedServices/tests/SessionRecords/LBS.Tests.LocationBasedServicesServicesAccountTests/LocationBasedServicesAccountRegenerateKeyTest.json similarity index 100% rename from sdk/locationbasedservices/Microsoft.Azure.Management.LocationBasedServices/tests/SessionRecords/LocationBasedServicesServices.Tests.LocationBasedServicesServicesAccountTests/LocationBasedServicesAccountRegenerateKeyTest.json rename to sdk/locationbasedservices/Microsoft.Azure.Management.LocationBasedServices/tests/SessionRecords/LBS.Tests.LocationBasedServicesServicesAccountTests/LocationBasedServicesAccountRegenerateKeyTest.json diff --git a/sdk/locationbasedservices/Microsoft.Azure.Management.LocationBasedServices/tests/SessionRecords/LocationBasedServicesServices.Tests.LocationBasedServicesServicesAccountTests/LocationBasedServicesAccountUpdateTest.json b/sdk/locationbasedservices/Microsoft.Azure.Management.LocationBasedServices/tests/SessionRecords/LBS.Tests.LocationBasedServicesServicesAccountTests/LocationBasedServicesAccountUpdateTest.json similarity index 100% rename from sdk/locationbasedservices/Microsoft.Azure.Management.LocationBasedServices/tests/SessionRecords/LocationBasedServicesServices.Tests.LocationBasedServicesServicesAccountTests/LocationBasedServicesAccountUpdateTest.json rename to sdk/locationbasedservices/Microsoft.Azure.Management.LocationBasedServices/tests/SessionRecords/LBS.Tests.LocationBasedServicesServicesAccountTests/LocationBasedServicesAccountUpdateTest.json diff --git a/sdk/locationbasedservices/Microsoft.Azure.Management.LocationBasedServices/tests/Tests/LocationBasedServicesAccountTests.cs b/sdk/locationbasedservices/Microsoft.Azure.Management.LocationBasedServices/tests/Tests/LocationBasedServicesAccountTests.cs index 1f4fef244c479..e2e2790e6fef5 100644 --- a/sdk/locationbasedservices/Microsoft.Azure.Management.LocationBasedServices/tests/Tests/LocationBasedServicesAccountTests.cs +++ b/sdk/locationbasedservices/Microsoft.Azure.Management.LocationBasedServices/tests/Tests/LocationBasedServicesAccountTests.cs @@ -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 diff --git a/sdk/storage/Directory.Build.props b/sdk/storage/Directory.Build.props index 1d555bb74d3a3..00e73a1de44cf 100644 --- a/sdk/storage/Directory.Build.props +++ b/sdk/storage/Directory.Build.props @@ -4,7 +4,7 @@ --> - + - + all runtime; build; native; contentfiles; analyzers - - +