Skip to content

Commit

Permalink
Switched from submodule to type nugets (#987)
Browse files Browse the repository at this point in the history
  • Loading branch information
majastrz authored Nov 24, 2020
1 parent faaa0b6 commit e9d9455
Show file tree
Hide file tree
Showing 9 changed files with 65 additions and 103 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule "bicep-types-az"]
path = bicep-types-az
url = https://github.com/Azure/bicep-types-az.git
36 changes: 3 additions & 33 deletions Bicep.sln
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,13 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bicep.LangServer.Integratio
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bicep.Cli.IntegrationTests", "src\Bicep.Cli.IntegrationTests\Bicep.Cli.IntegrationTests.csproj", "{34D7A843-55CB-4A3A-B268-2D4ABB7044D3}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Types", "Types", "{4BF029F4-21C7-4751-B3B1-0586AD17525D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bicep.SerializedTypes", "bicep-types-az\src\Bicep.SerializedTypes\Bicep.SerializedTypes.csproj", "{29A01BDE-25AB-44BA-8657-D5C66CBD519D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bicep.SerializedTypes.Az", "bicep-types-az\src\Bicep.SerializedTypes.Az\Bicep.SerializedTypes.Az.csproj", "{39F6D713-EF43-4A23-B101-9CF06C8471C8}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bicep.SerializedTypes.Az.UnitTests", "bicep-types-az\src\Bicep.SerializedTypes.Az.UnitTests\Bicep.SerializedTypes.Az.UnitTests.csproj", "{97A5C9AD-5043-42C7-B823-FE7C2C6D9C48}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bicep.SerializedTypes.UnitTests", "bicep-types-az\src\Bicep.SerializedTypes.UnitTests\Bicep.SerializedTypes.UnitTests.csproj", "{F7EF3463-D8D3-4C76-A743-D1BAF1D72AA0}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{61643BA1-BE82-4430-A3D3-CB7A16E747E3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bicep.Decompiler", "src\Bicep.Decompiler\Bicep.Decompiler.csproj", "{4CD48B4A-6297-49FC-90AC-5DF9213C1527}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bicep.Decompiler", "src\Bicep.Decompiler\Bicep.Decompiler.csproj", "{4CD48B4A-6297-49FC-90AC-5DF9213C1527}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bicep.Decompiler.IntegrationTests", "src\Bicep.Decompiler.IntegrationTests\Bicep.Decompiler.IntegrationTests.csproj", "{695560CE-C6C3-4FCD-A488-09F06E608297}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bicep.Decompiler.IntegrationTests", "src\Bicep.Decompiler.IntegrationTests\Bicep.Decompiler.IntegrationTests.csproj", "{695560CE-C6C3-4FCD-A488-09F06E608297}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bicep.Decompiler.UnitTests", "src\Bicep.Decompiler.UnitTests\Bicep.Decompiler.UnitTests.csproj", "{F3AF01F6-24E8-4129-80B6-84AC070B5C7D}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bicep.Decompiler.UnitTests", "src\Bicep.Decompiler.UnitTests\Bicep.Decompiler.UnitTests.csproj", "{F3AF01F6-24E8-4129-80B6-84AC070B5C7D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -101,22 +91,6 @@ Global
{34D7A843-55CB-4A3A-B268-2D4ABB7044D3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{34D7A843-55CB-4A3A-B268-2D4ABB7044D3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{34D7A843-55CB-4A3A-B268-2D4ABB7044D3}.Release|Any CPU.Build.0 = Release|Any CPU
{29A01BDE-25AB-44BA-8657-D5C66CBD519D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{29A01BDE-25AB-44BA-8657-D5C66CBD519D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{29A01BDE-25AB-44BA-8657-D5C66CBD519D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{29A01BDE-25AB-44BA-8657-D5C66CBD519D}.Release|Any CPU.Build.0 = Release|Any CPU
{39F6D713-EF43-4A23-B101-9CF06C8471C8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{39F6D713-EF43-4A23-B101-9CF06C8471C8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{39F6D713-EF43-4A23-B101-9CF06C8471C8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{39F6D713-EF43-4A23-B101-9CF06C8471C8}.Release|Any CPU.Build.0 = Release|Any CPU
{97A5C9AD-5043-42C7-B823-FE7C2C6D9C48}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{97A5C9AD-5043-42C7-B823-FE7C2C6D9C48}.Debug|Any CPU.Build.0 = Debug|Any CPU
{97A5C9AD-5043-42C7-B823-FE7C2C6D9C48}.Release|Any CPU.ActiveCfg = Release|Any CPU
{97A5C9AD-5043-42C7-B823-FE7C2C6D9C48}.Release|Any CPU.Build.0 = Release|Any CPU
{F7EF3463-D8D3-4C76-A743-D1BAF1D72AA0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F7EF3463-D8D3-4C76-A743-D1BAF1D72AA0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F7EF3463-D8D3-4C76-A743-D1BAF1D72AA0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F7EF3463-D8D3-4C76-A743-D1BAF1D72AA0}.Release|Any CPU.Build.0 = Release|Any CPU
{4CD48B4A-6297-49FC-90AC-5DF9213C1527}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4CD48B4A-6297-49FC-90AC-5DF9213C1527}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4CD48B4A-6297-49FC-90AC-5DF9213C1527}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -145,10 +119,6 @@ Global
{29A1AE2B-D47D-41DD-9824-279475D9B6C2} = {B02251C3-B01E-40EB-B145-2B03F25FE653}
{0DE47D02-2BBE-4352-9E38-79A374F9C41E} = {76F6CBAF-FE81-4B56-B0DB-DE6FD7174771}
{34D7A843-55CB-4A3A-B268-2D4ABB7044D3} = {B02251C3-B01E-40EB-B145-2B03F25FE653}
{29A01BDE-25AB-44BA-8657-D5C66CBD519D} = {4BF029F4-21C7-4751-B3B1-0586AD17525D}
{39F6D713-EF43-4A23-B101-9CF06C8471C8} = {4BF029F4-21C7-4751-B3B1-0586AD17525D}
{97A5C9AD-5043-42C7-B823-FE7C2C6D9C48} = {4BF029F4-21C7-4751-B3B1-0586AD17525D}
{F7EF3463-D8D3-4C76-A743-D1BAF1D72AA0} = {4BF029F4-21C7-4751-B3B1-0586AD17525D}
{4CD48B4A-6297-49FC-90AC-5DF9213C1527} = {61643BA1-BE82-4430-A3D3-CB7A16E747E3}
{695560CE-C6C3-4FCD-A488-09F06E608297} = {61643BA1-BE82-4430-A3D3-CB7A16E747E3}
{F3AF01F6-24E8-4129-80B6-84AC070B5C7D} = {61643BA1-BE82-4430-A3D3-CB7A16E747E3}
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ We are very happy to accept community contributions to Bicep, whether those are
* You are free to work on Bicep on any platform using any editor, but you may find it quickest to get started using [VSCode](https://code.visualstudio.com/Download) with the [C# extension](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csharp).
* Fork this repo (see [this forking guide](https://guides.github.com/activities/forking/) for more information).
* Checkout the repo locally with `git clone [email protected]:{your_username}/bicep.git`.
* Change into the bicep repo directory and run `git submodule update --init --recursive`.
* If `git status` shows untracked files in the `bicep-types-az` directory, remove the directory via `rm -r bicep-types-az` on Linux/Mac or `rmdir /S bicep-types-az` on Windows. (This is only needed once.)
* Build the .NET solution with `dotnet build`.

## Developing
Expand Down
1 change: 0 additions & 1 deletion bicep-types-az
Submodule bicep-types-az deleted from 38d035
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@
using Bicep.Core.Diagnostics;
using Bicep.Core.Resources;
using Bicep.Core.Semantics;
using Bicep.Core.Syntax;
using Bicep.Core.TypeSystem;
using Bicep.Core.TypeSystem.Az;
using Bicep.Core.UnitTests.Assertions;
using Bicep.Core.UnitTests.Utils;
using Bicep.SerializedTypes;
using Bicep.SerializedTypes.Az;
using Azure.Bicep.Types;
using Azure.Bicep.Types.Az;
using FluentAssertions;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
Expand Down Expand Up @@ -196,7 +195,7 @@ private static ITypeLoader CreateMockTypeLoader(ResourceTypeReference resourceTy
{
var serializedTypes = CreateSerializedTypes(resourceTypeReference);
var deserializedType = TypeSerializer.Deserialize(serializedTypes);
var resourceType = deserializedType.OfType<SerializedTypes.Concrete.ResourceType>().Single();
var resourceType = deserializedType.OfType<Azure.Bicep.Types.Concrete.ResourceType>().Single();

var mockTypeLocation = new TypeLocation();
var mockTypeLoader = new Mock<ITypeLoader>();
Expand All @@ -212,35 +211,35 @@ private static ITypeLoader CreateMockTypeLoader(ResourceTypeReference resourceTy

private static string CreateSerializedTypes(ResourceTypeReference resourceTypeReference)
{
var typeFactory = new SerializedTypes.Concrete.TypeFactory(Enumerable.Empty<SerializedTypes.Concrete.TypeBase>());
var stringType = typeFactory.Create(() => new SerializedTypes.Concrete.BuiltInType { Kind = SerializedTypes.Concrete.BuiltInTypeKind.String });
var apiVersionType = typeFactory.Create(() => new SerializedTypes.Concrete.StringLiteralType { Value = resourceTypeReference.ApiVersion });
var typeType = typeFactory.Create(() => new SerializedTypes.Concrete.StringLiteralType { Value = resourceTypeReference.FullyQualifiedType });
var propertiesType = typeFactory.Create(() => new SerializedTypes.Concrete.ObjectType
var typeFactory = new Azure.Bicep.Types.Concrete.TypeFactory(Enumerable.Empty<Azure.Bicep.Types.Concrete.TypeBase>());
var stringType = typeFactory.Create(() => new Azure.Bicep.Types.Concrete.BuiltInType { Kind = Azure.Bicep.Types.Concrete.BuiltInTypeKind.String });
var apiVersionType = typeFactory.Create(() => new Azure.Bicep.Types.Concrete.StringLiteralType { Value = resourceTypeReference.ApiVersion });
var typeType = typeFactory.Create(() => new Azure.Bicep.Types.Concrete.StringLiteralType { Value = resourceTypeReference.FullyQualifiedType });
var propertiesType = typeFactory.Create(() => new Azure.Bicep.Types.Concrete.ObjectType
{
Name = "Properties",
Properties = new Dictionary<string, SerializedTypes.Concrete.ObjectProperty>
Properties = new Dictionary<string, Azure.Bicep.Types.Concrete.ObjectProperty>
{
["readwrite"] = new SerializedTypes.Concrete.ObjectProperty { Type = typeFactory.GetReference(stringType), Flags = SerializedTypes.Concrete.ObjectPropertyFlags.None },
["readonly"] = new SerializedTypes.Concrete.ObjectProperty { Type = typeFactory.GetReference(stringType), Flags = SerializedTypes.Concrete.ObjectPropertyFlags.ReadOnly },
["writeonly"] = new SerializedTypes.Concrete.ObjectProperty { Type = typeFactory.GetReference(stringType), Flags = SerializedTypes.Concrete.ObjectPropertyFlags.WriteOnly },
["required"] = new SerializedTypes.Concrete.ObjectProperty { Type = typeFactory.GetReference(stringType), Flags = SerializedTypes.Concrete.ObjectPropertyFlags.Required },
["readwrite"] = new Azure.Bicep.Types.Concrete.ObjectProperty { Type = typeFactory.GetReference(stringType), Flags = Azure.Bicep.Types.Concrete.ObjectPropertyFlags.None },
["readonly"] = new Azure.Bicep.Types.Concrete.ObjectProperty { Type = typeFactory.GetReference(stringType), Flags = Azure.Bicep.Types.Concrete.ObjectPropertyFlags.ReadOnly },
["writeonly"] = new Azure.Bicep.Types.Concrete.ObjectProperty { Type = typeFactory.GetReference(stringType), Flags = Azure.Bicep.Types.Concrete.ObjectPropertyFlags.WriteOnly },
["required"] = new Azure.Bicep.Types.Concrete.ObjectProperty { Type = typeFactory.GetReference(stringType), Flags = Azure.Bicep.Types.Concrete.ObjectPropertyFlags.Required },
}
});
var bodyType = typeFactory.Create(() => new SerializedTypes.Concrete.ObjectType
var bodyType = typeFactory.Create(() => new Azure.Bicep.Types.Concrete.ObjectType
{
Name = resourceTypeReference.FormatName(),
Properties = new Dictionary<string, SerializedTypes.Concrete.ObjectProperty>
Properties = new Dictionary<string, Azure.Bicep.Types.Concrete.ObjectProperty>
{
["name"] = new SerializedTypes.Concrete.ObjectProperty { Type = typeFactory.GetReference(stringType), Flags = SerializedTypes.Concrete.ObjectPropertyFlags.DeployTimeConstant | SerializedTypes.Concrete.ObjectPropertyFlags.Required },
["type"] = new SerializedTypes.Concrete.ObjectProperty { Type = typeFactory.GetReference(typeType), Flags = SerializedTypes.Concrete.ObjectPropertyFlags.DeployTimeConstant | SerializedTypes.Concrete.ObjectPropertyFlags.ReadOnly },
["apiVersion"] = new SerializedTypes.Concrete.ObjectProperty { Type = typeFactory.GetReference(apiVersionType), Flags = SerializedTypes.Concrete.ObjectPropertyFlags.DeployTimeConstant | SerializedTypes.Concrete.ObjectPropertyFlags.ReadOnly },
["id"] = new SerializedTypes.Concrete.ObjectProperty { Type = typeFactory.GetReference(stringType), Flags = SerializedTypes.Concrete.ObjectPropertyFlags.DeployTimeConstant | SerializedTypes.Concrete.ObjectPropertyFlags.ReadOnly },
["properties"] = new SerializedTypes.Concrete.ObjectProperty { Type = typeFactory.GetReference(propertiesType), Flags = SerializedTypes.Concrete.ObjectPropertyFlags.Required },
["name"] = new Azure.Bicep.Types.Concrete.ObjectProperty { Type = typeFactory.GetReference(stringType), Flags = Azure.Bicep.Types.Concrete.ObjectPropertyFlags.DeployTimeConstant | Azure.Bicep.Types.Concrete.ObjectPropertyFlags.Required },
["type"] = new Azure.Bicep.Types.Concrete.ObjectProperty { Type = typeFactory.GetReference(typeType), Flags = Azure.Bicep.Types.Concrete.ObjectPropertyFlags.DeployTimeConstant | Azure.Bicep.Types.Concrete.ObjectPropertyFlags.ReadOnly },
["apiVersion"] = new Azure.Bicep.Types.Concrete.ObjectProperty { Type = typeFactory.GetReference(apiVersionType), Flags = Azure.Bicep.Types.Concrete.ObjectPropertyFlags.DeployTimeConstant | Azure.Bicep.Types.Concrete.ObjectPropertyFlags.ReadOnly },
["id"] = new Azure.Bicep.Types.Concrete.ObjectProperty { Type = typeFactory.GetReference(stringType), Flags = Azure.Bicep.Types.Concrete.ObjectPropertyFlags.DeployTimeConstant | Azure.Bicep.Types.Concrete.ObjectPropertyFlags.ReadOnly },
["properties"] = new Azure.Bicep.Types.Concrete.ObjectProperty { Type = typeFactory.GetReference(propertiesType), Flags = Azure.Bicep.Types.Concrete.ObjectPropertyFlags.Required },
},
});

typeFactory.Create(() => new SerializedTypes.Concrete.ResourceType
typeFactory.Create(() => new Azure.Bicep.Types.Concrete.ResourceType
{
Name = resourceTypeReference.FormatName(),
Body = typeFactory.GetReference(bodyType),
Expand Down
7 changes: 2 additions & 5 deletions src/Bicep.Core/Bicep.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,15 @@
<TargetFramework>netstandard2.1</TargetFramework>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="../../bicep-types-az/src/Bicep.SerializedTypes/Bicep.SerializedTypes.csproj" />
<ProjectReference Include="../../bicep-types-az/src/Bicep.SerializedTypes.Az/Bicep.SerializedTypes.Az.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="JetBrains.Annotations" Version="2020.1.0">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="System.Collections.Immutable" Version="5.0.0" />
<PackageReference Include="Azure.Deployments.Expression" Version="1.0.112" />
<PackageReference Include="Azure.Bicep.Types" Version="0.1.4" />
<PackageReference Include="Azure.Bicep.Types.Az" Version="0.1.4" />
</ItemGroup>

</Project>
Loading

0 comments on commit e9d9455

Please sign in to comment.