Skip to content

Split SDK out into it's own project #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/ResourceManager/Storage/Stack/AzureRM.Storage.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ CLRVersion = '4.0'
# ProcessorArchitecture = ''

# Modules that must be imported into the global environment prior to importing this module
RequiredModules = @(@{ModuleName = 'AzureRM.Profile'; ModuleVersion = '5.3.4'; },
RequiredModules = @(@{ModuleName = 'AzureRM.Profile'; ModuleVersion = '5.3.4'; },
@{ModuleName = 'Azure.Storage'; ModuleVersion = '4.1.1'; })

# Assemblies that must be loaded prior to importing this module
Expand All @@ -73,11 +73,11 @@ NestedModules = @('.\Microsoft.Azure.Commands.Management.Storage.dll')
FunctionsToExport = @()

# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
CmdletsToExport = 'Get-AzureRmStorageAccount', 'Get-AzureRmStorageAccountKey',
'New-AzureRmStorageAccount', 'New-AzureRmStorageAccountKey',
'Remove-AzureRmStorageAccount', 'Set-AzureRmCurrentStorageAccount',
'Set-AzureRmStorageAccount',
'Get-AzureRmStorageAccountNameAvailability',
CmdletsToExport = 'Get-AzureRmStorageAccount', 'Get-AzureRmStorageAccountKey',
'New-AzureRmStorageAccount', 'New-AzureRmStorageAccountKey',
'Remove-AzureRmStorageAccount', 'Set-AzureRmCurrentStorageAccount',
'Set-AzureRmStorageAccount',
'Get-AzureRmStorageAccountNameAvailability',
'Get-AzureRmStorageUsage'

# Variables to export from this module
Expand Down Expand Up @@ -119,7 +119,7 @@ PrivateData = @{
# ExternalModuleDependencies = ''

} # End of PSData hashtable

} # End of PrivateData hashtable

# HelpInfo URI of this module
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@
<Project>{a50ab133-5c04-4a17-9054-f8343683ec23}</Project>
<Name>Commands.Management.Storage</Name>
</ProjectReference>
<ProjectReference Include="..\SDK\StorageSDK.csproj">
<Project>{ccc1f6c7-e2ce-47b3-bd64-8efd17823e20}</Project>
<Name>StorageSDK</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="packages.config">
Expand Down Expand Up @@ -195,4 +199,4 @@
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,17 @@ public void RunPsTestWorkflow(
string callingClassType,
string mockName)
{
Dictionary<string, string> d = new Dictionary<string, string>();
d.Add("Microsoft.Resources", null);
d.Add("Microsoft.Features", null);
d.Add("Microsoft.Authorization", null);
d.Add("Microsoft.Compute", null);
var providersToIgnore = new Dictionary<string, string>();
providersToIgnore.Add("Microsoft.Azure.Management.Resources.ResourceManagementClient", "2016-02-01");
providersToIgnore.Add("Microsoft.Azure.Management.ResourceManager.ResourceManagementClient", "2016-02-01");
providersToIgnore.Add("Microsoft.Azure.Management.Storage.StorageManagementClient", "2016-01-01");
Dictionary<string, string> d = new Dictionary<string, string> {
{ "Microsoft.Resources", null },
{ "Microsoft.Features", null },
{ "Microsoft.Authorization", null },
{ "Microsoft.Compute", null }
};
var providersToIgnore = new Dictionary<string, string> {
{ "Microsoft.Azure.Management.Resources.ResourceManagementClient", "2016-02-01" },
{ "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient", "2016-02-01" },
{ "Microsoft.Azure.Management.Storage.StorageManagementClient", "2016-01-01" }
};

HttpMockServer.Matcher = new PermissiveRecordMatcherWithApiExclusion(true, d, providersToIgnore);

Expand All @@ -93,10 +95,7 @@ public void RunPsTestWorkflow(

this.csmTestFactory = new CSMTestEnvironmentFactory();

if(initialize != null)
{
initialize(this.csmTestFactory);
}
initialize?.Invoke(this.csmTestFactory);

SetupManagementClients(context);

Expand Down Expand Up @@ -127,10 +126,7 @@ public void RunPsTestWorkflow(
}
finally
{
if(cleanup !=null)
{
cleanup();
}
cleanup?.Invoke();
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,13 @@
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<!-- We Moved this to a project we build: Microsoft.Azure.Management.Storage.6.4.0-preview -->
<Reference Include="Microsoft.Azure.KeyVault.Core">
<HintPath>..\..\..\..\packages\Microsoft.Azure.KeyVault.Core.1.0.0\lib\net40\Microsoft.Azure.KeyVault.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<!-- <Reference Include="Microsoft.Azure.Management.Storage, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lest keep the commented out SDK reference, so that we could easily remember what we copied here

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We didn't copy anything, this was never released remember?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was network module.. this one we copied and modified for common runtime changes

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean? We have a "Generated" directory. Are you saying we did release this specific C# SDK for storage?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that version is not compatible with common runtime client libraries

<HintPath>..\..\..\..\packages\Microsoft.Azure.Management.Storage.6.4.0-preview\lib\net452\Microsoft.Azure.Management.Storage.dll</HintPath>
</Reference>
-->
<Reference Include="Microsoft.Data.Edm">
<HintPath>..\..\..\..\packages\Microsoft.Data.Edm.5.6.4\lib\net40\Microsoft.Data.Edm.dll</HintPath>
<HintPath>..\..\..\..\packages\Microsoft.Data.Edm.5.8.2\lib\net40\Microsoft.Data.Edm.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Data.OData">
Expand All @@ -75,9 +72,8 @@
<HintPath>..\..\..\..\packages\WindowsAzure.Storage.8.6.0\lib\net45\Microsoft.WindowsAzure.Storage.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<Reference Include="System.Spatial">
<HintPath>..\..\..\..\packages\System.Spatial.5.6.4\lib\net40\System.Spatial.dll</HintPath>
<HintPath>..\..\..\..\packages\System.Spatial.5.8.2\lib\net40\System.Spatial.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>
Expand All @@ -97,42 +93,6 @@
<Compile Include="..\..\..\..\Common\Commands.Common.Storage\Adapters\WindowsAzure.Storage.8\LazyAzureStorageContext.cs">
<Link>Common\LazyAzureStorageContext.cs</Link>
</Compile>
<Compile Include="Generated\IStorageAccountsOperations.cs" />
<Compile Include="Generated\IStorageManagementClient.cs" />
<Compile Include="Generated\IUsageOperations.cs" />
<Compile Include="Generated\Models\AccessTier.cs" />
<Compile Include="Generated\Models\AccountStatus.cs" />
<Compile Include="Generated\Models\CheckNameAvailabilityResult.cs" />
<Compile Include="Generated\Models\CustomDomain.cs" />
<Compile Include="Generated\Models\Encryption.cs" />
<Compile Include="Generated\Models\EncryptionService.cs" />
<Compile Include="Generated\Models\EncryptionServices.cs" />
<Compile Include="Generated\Models\Endpoints.cs" />
<Compile Include="Generated\Models\KeyPermission.cs" />
<Compile Include="Generated\Models\Kind.cs" />
<Compile Include="Generated\Models\Page.cs" />
<Compile Include="Generated\Models\ProvisioningState.cs" />
<Compile Include="Generated\Models\Reason.cs" />
<Compile Include="Generated\Models\Resource.cs" />
<Compile Include="Generated\Models\Sku.cs" />
<Compile Include="Generated\Models\SkuName.cs" />
<Compile Include="Generated\Models\SkuTier.cs" />
<Compile Include="Generated\Models\StorageAccount.cs" />
<Compile Include="Generated\Models\StorageAccountCheckNameAvailabilityParameters.cs" />
<Compile Include="Generated\Models\StorageAccountCreateParameters.cs" />
<Compile Include="Generated\Models\StorageAccountKey.cs" />
<Compile Include="Generated\Models\StorageAccountListKeysResult.cs" />
<Compile Include="Generated\Models\StorageAccountRegenerateKeyParameters.cs" />
<Compile Include="Generated\Models\StorageAccountUpdateParameters.cs" />
<Compile Include="Generated\Models\Usage.cs" />
<Compile Include="Generated\Models\UsageListResult.cs" />
<Compile Include="Generated\Models\UsageName.cs" />
<Compile Include="Generated\Models\UsageUnit.cs" />
<Compile Include="Generated\StorageAccountsOperations.cs" />
<Compile Include="Generated\StorageAccountsOperationsExtensions.cs" />
<Compile Include="Generated\StorageManagementClient.cs" />
<Compile Include="Generated\UsageOperations.cs" />
<Compile Include="Generated\UsageOperationsExtensions.cs" />
<Compile Include="Models\PSStorageAccount.cs" />
<Compile Include="Models\PSUsage.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
Expand Down Expand Up @@ -182,6 +142,10 @@
<Project>{3819d8a7-c62c-4c47-8ddd-0332d9ce1252}</Project>
<Name>Commands.ResourceManager.Common</Name>
</ProjectReference>
<ProjectReference Include="..\SDK\StorageSDK.csproj">
<Project>{ccc1f6c7-e2ce-47b3-bd64-8efd17823e20}</Project>
<Name>StorageSDK</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\..\..\..\..\tools\Common.Dependencies.targets" />
Expand All @@ -191,4 +155,4 @@
</ItemGroup>
<Copy SourceFiles="@(MarkdownFiles)" DestinationFolder="$(OutputPath)\help\" ContinueOnError="false" />
</Target>
</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

using System.Collections;
using System.Management.Automation;
//using Microsoft.Azure.Commands.Tags.Model;
using Microsoft.Azure.Commands.ResourceManager.Common.Tags;
using Microsoft.Azure.Management.Storage;
using Microsoft.Azure.Management.Storage.Models;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Azure.KeyVault.Core" version="1.0.0" targetFramework="net45" />
<package id="Microsoft.Data.Edm" version="5.8.2" targetFramework="net452" />
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this?

<package id="Microsoft.Data.OData" version="5.8.2" targetFramework="net452" />
<package id="Microsoft.Data.Services.Client" version="5.8.2" targetFramework="net452" />
<package id="System.Spatial" version="5.8.2" targetFramework="net452" />
<package id="WindowsAzure.Storage" version="8.6.0" targetFramework="net452" />
</packages>
<package id="Microsoft.Data.Edm" version="5.8.2" targetFramework="net40" />
<package id="Microsoft.Data.OData" version="5.8.2" targetFramework="net40" />
<package id="Microsoft.Data.Services.Client" version="5.8.2" targetFramework="net40" />
<package id="System.Spatial" version="5.8.2" targetFramework="net40" />
<package id="WindowsAzure.Storage" version="8.6.0" targetFramework="net45" />
</packages>
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ namespace Microsoft.Azure.Management.Storage.Models
{
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.Runtime.Serialization;

/// <summary>
Expand Down
50 changes: 50 additions & 0 deletions src/ResourceManager/Storage/Stack/SDK/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------------------------------------------------------------

using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Microsoft.Azure.Management.Storage")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Microsoft.Azure.Management.Storage")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("15fc0119-dd3b-4167-b458-7202c89d397d")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("1.0.0")]
[assembly: AssemblyFileVersion("1.0.0")]
73 changes: 73 additions & 0 deletions src/ResourceManager/Storage/Stack/SDK/StorageSDK.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />

<PropertyGroup>
<Configurations>Debug;Release</Configurations>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform>AnyCPU</Platform>
<ProjectGuid>ccc1f6c7-e2ce-47b3-bd64-8efd17823e20</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Microsoft.Azure.Management.Storage</RootNamespace>
<AssemblyName>Microsoft.Azure.Management.Storage</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\..\..\</SolutionDir>
<RestorePackages>true</RestorePackages>
<CodeAnalysisAdditionalOptions>/assemblyCompareMode:StrongNameIgnoringVersion</CodeAnalysisAdditionalOptions>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\..\..\Stack\Debug\ResourceManager\AzureResourceManager\StorageSDK\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<RunCodeAnalysis>true</RunCodeAnalysis>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>


<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<OutputPath>..\..\..\..\Stack\Release\ResourceManager\AzureResourceManager\StorageSDK</OutputPath>
<DefineConstants>TRACE;SIGN</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>MSSharedLibKey.snk</AssemblyOriginatorKeyFile>
<DelaySign>true</DelaySign>
<Prefer32Bit>false</Prefer32Bit></PropertyGroup>

<ItemGroup>
<Compile Include="Generated\**\*.cs" />
</ItemGroup>

<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Net" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Runtime.Serialization" />

<Reference Include="Microsoft.Rest.ClientRuntime, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\..\..\packages\Microsoft.Rest.ClientRuntime.2.3.11\lib\net452\Microsoft.Rest.ClientRuntime.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Rest.ClientRuntime.Azure, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.3.3.12\lib\net452\Microsoft.Rest.ClientRuntime.Azure.dll</HintPath>
</Reference>
</ItemGroup>

<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
7 changes: 7 additions & 0 deletions src/ResourceManager/Storage/Stack/SDK/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Net.Http" version="2.2.28" targetFramework="net45" />
<package id="Microsoft.Rest.ClientRuntime" version="2.3.11" targetFramework="net452" />
<package id="Microsoft.Rest.ClientRuntime.Azure" version="3.3.12" targetFramework="net452" />>
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net45" />
</packages>
Loading