Skip to content

Commit d304238

Browse files
Replace expressions nuget package with stripped down library (Azure#182)
* Pull in expressions library as-is * Strip out unused bits * Remove private nuget feed references * Address PR feedback
1 parent 53c3543 commit d304238

16 files changed

+474
-26
lines changed

.github/workflows/build.yml

-10
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,6 @@ jobs:
4343
with:
4444
dotnet-version: 3.1.301
4545

46-
- name: Update NuGet config
47-
# workaround for bug in setup-dotnet action (the config samples for authenticated feeds don't work)
48-
# encryption does not work on Linux or MacOS
49-
run: dotnet nuget update source Official --username bicep --password ${{ secrets.MSAZURE_NUGET_AUTH }} --valid-authentication-types=basic --configfile ./NuGet.config --store-password-in-clear-text
50-
5146
- name: Build
5247
run: dotnet build --configuration ${{ matrix.configuration }}
5348

@@ -119,11 +114,6 @@ jobs:
119114
with:
120115
dotnet-version: 3.1.301
121116

122-
- name: Update NuGet config
123-
# workaround for bug in setup-dotnet action (the config samples for authenticated feeds don't work)
124-
# encryption does not work on Linux or MacOS
125-
run: dotnet nuget update source Official --username bicep --password ${{ secrets.MSAZURE_NUGET_AUTH }} --valid-authentication-types=basic --configfile ./NuGet.config --store-password-in-clear-text
126-
127117
- name: Setup Node.js
128118
uses: actions/[email protected]
129119
with:

Bicep.sln

+9
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bicep.Core.Samples", "src\B
2929
EndProject
3030
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bicep.Cli.UnitTests", "src\Bicep.Cli.UnitTests\Bicep.Cli.UnitTests.csproj", "{29A1AE2B-D47D-41DD-9824-279475D9B6C2}"
3131
EndProject
32+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{9EA83F16-962D-4596-A6E0-DCFF2D8E1FA3}"
33+
EndProject
34+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Arm.Expression", "src\Arm.Expression\Arm.Expression.csproj", "{3229C864-9524-4FDB-BE76-3714ABE7F4E2}"
35+
EndProject
3236
Global
3337
GlobalSection(SolutionConfigurationPlatforms) = preSolution
3438
Debug|Any CPU = Debug|Any CPU
@@ -71,6 +75,10 @@ Global
7175
{29A1AE2B-D47D-41DD-9824-279475D9B6C2}.Debug|Any CPU.Build.0 = Debug|Any CPU
7276
{29A1AE2B-D47D-41DD-9824-279475D9B6C2}.Release|Any CPU.ActiveCfg = Release|Any CPU
7377
{29A1AE2B-D47D-41DD-9824-279475D9B6C2}.Release|Any CPU.Build.0 = Release|Any CPU
78+
{3229C864-9524-4FDB-BE76-3714ABE7F4E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
79+
{3229C864-9524-4FDB-BE76-3714ABE7F4E2}.Debug|Any CPU.Build.0 = Debug|Any CPU
80+
{3229C864-9524-4FDB-BE76-3714ABE7F4E2}.Release|Any CPU.ActiveCfg = Release|Any CPU
81+
{3229C864-9524-4FDB-BE76-3714ABE7F4E2}.Release|Any CPU.Build.0 = Release|Any CPU
7482
EndGlobalSection
7583
GlobalSection(SolutionProperties) = preSolution
7684
HideSolutionNode = FALSE
@@ -85,6 +93,7 @@ Global
8593
{F7B0F06D-56CE-4F4A-8EF9-ED6EC3D77EE7} = {76F6CBAF-FE81-4B56-B0DB-DE6FD7174771}
8694
{A2E4B91C-3B7F-4CB1-B482-BE40F7709EB5} = {FE323E78-E865-46E2-859A-E4F6FB312C0F}
8795
{29A1AE2B-D47D-41DD-9824-279475D9B6C2} = {B02251C3-B01E-40EB-B145-2B03F25FE653}
96+
{3229C864-9524-4FDB-BE76-3714ABE7F4E2} = {9EA83F16-962D-4596-A6E0-DCFF2D8E1FA3}
8897
EndGlobalSection
8998
GlobalSection(ExtensibilityGlobals) = postSolution
9099
SolutionGuid = {21F77282-91E7-4304-B1EF-FADFA4F39E37}

NuGet.config

-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,5 @@
33
<packageSources>
44
<clear />
55
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
6-
<add key="Official" value="https://pkgs.dev.azure.com/msazure/_packaging/Official/nuget/v3/index.json" />
76
</packageSources>
87
</configuration>
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>netstandard2.0</TargetFramework>
5+
<Nullable>disable</Nullable>
6+
</PropertyGroup>
7+
8+
<ItemGroup>
9+
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
10+
</ItemGroup>
11+
12+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// ----------------------------------------------------------------------------
2+
// Copyright (c) Microsoft Corporation. All rights reserved.
3+
// ----------------------------------------------------------------------------
4+
5+
namespace Arm.Expression.Configuration
6+
{
7+
/// <summary>
8+
/// Expression serializer settings.
9+
/// </summary>
10+
public class ExpressionSerializerSettings
11+
{
12+
/// <summary>
13+
/// Gets or sets a value indicating whether the expression serializer will include the outer [ and ]
14+
/// characters when serializing a LanguageExpression. This setting is ignored if the serializer decides to serialize
15+
/// the expression into a single string literal.
16+
/// </summary>
17+
public bool IncludeOuterSquareBrackets { get; set; } = true;
18+
19+
/// <summary>
20+
/// Gets or sets a value indicating whether the expression serializer will serialize a single string literal
21+
/// expression as a string
22+
/// </summary>
23+
public ExpressionSerializerSingleStringHandling SingleStringHandling { get; set; } = ExpressionSerializerSingleStringHandling.SerializeAsJTokenExpression;
24+
}
25+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// ----------------------------------------------------------------------------
2+
// Copyright (c) Microsoft Corporation. All rights reserved.
3+
// ----------------------------------------------------------------------------
4+
5+
namespace Arm.Expression.Configuration
6+
{
7+
/// <summary>
8+
/// Configures how expression serializer handles single string literal expressions.
9+
/// </summary>
10+
public enum ExpressionSerializerSingleStringHandling
11+
{
12+
/// <summary>
13+
/// Not specified.
14+
/// </summary>
15+
NotSpecified = 0,
16+
17+
/// <summary>
18+
/// Serializes the single string literal as a string literal expression of the form
19+
/// ['string contents']. This is the default behavior. The behavior does not apply for
20+
/// Language expressions that are not a single JTokenExpression with a string value.
21+
/// </summary>
22+
SerializeAsJTokenExpression = 1,
23+
24+
/// <summary>
25+
/// Serializes the single string literal as a string value. If the string begins with a
26+
/// [ character, it will be escaped with [[. The behavior does not apply for
27+
/// Language expressions that are not a single JTokenExpression with a string value.
28+
/// </summary>
29+
SerializeAsString = 2,
30+
}
31+
}

0 commit comments

Comments
 (0)