-
Notifications
You must be signed in to change notification settings - Fork 778
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace expressions nuget package with stripped down library (#182)
* Pull in expressions library as-is * Strip out unused bits * Remove private nuget feed references * Address PR feedback
- Loading branch information
1 parent
53c3543
commit d304238
Showing
16 changed files
with
474 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,11 +43,6 @@ jobs: | |
with: | ||
dotnet-version: 3.1.301 | ||
|
||
- name: Update NuGet config | ||
# workaround for bug in setup-dotnet action (the config samples for authenticated feeds don't work) | ||
# encryption does not work on Linux or MacOS | ||
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 | ||
|
||
- name: Build | ||
run: dotnet build --configuration ${{ matrix.configuration }} | ||
|
||
|
@@ -119,11 +114,6 @@ jobs: | |
with: | ||
dotnet-version: 3.1.301 | ||
|
||
- name: Update NuGet config | ||
# workaround for bug in setup-dotnet action (the config samples for authenticated feeds don't work) | ||
# encryption does not work on Linux or MacOS | ||
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 | ||
|
||
- name: Setup Node.js | ||
uses: actions/[email protected] | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netstandard2.0</TargetFramework> | ||
<Nullable>disable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" /> | ||
</ItemGroup> | ||
|
||
</Project> |
25 changes: 25 additions & 0 deletions
25
src/Arm.Expression/Configuration/ExpressionSerializerSettings.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// ---------------------------------------------------------------------------- | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// ---------------------------------------------------------------------------- | ||
|
||
namespace Arm.Expression.Configuration | ||
{ | ||
/// <summary> | ||
/// Expression serializer settings. | ||
/// </summary> | ||
public class ExpressionSerializerSettings | ||
{ | ||
/// <summary> | ||
/// Gets or sets a value indicating whether the expression serializer will include the outer [ and ] | ||
/// characters when serializing a LanguageExpression. This setting is ignored if the serializer decides to serialize | ||
/// the expression into a single string literal. | ||
/// </summary> | ||
public bool IncludeOuterSquareBrackets { get; set; } = true; | ||
|
||
/// <summary> | ||
/// Gets or sets a value indicating whether the expression serializer will serialize a single string literal | ||
/// expression as a string | ||
/// </summary> | ||
public ExpressionSerializerSingleStringHandling SingleStringHandling { get; set; } = ExpressionSerializerSingleStringHandling.SerializeAsJTokenExpression; | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
src/Arm.Expression/Configuration/ExpressionSerializerSingleStringHandling.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// ---------------------------------------------------------------------------- | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// ---------------------------------------------------------------------------- | ||
|
||
namespace Arm.Expression.Configuration | ||
{ | ||
/// <summary> | ||
/// Configures how expression serializer handles single string literal expressions. | ||
/// </summary> | ||
public enum ExpressionSerializerSingleStringHandling | ||
{ | ||
/// <summary> | ||
/// Not specified. | ||
/// </summary> | ||
NotSpecified = 0, | ||
|
||
/// <summary> | ||
/// Serializes the single string literal as a string literal expression of the form | ||
/// ['string contents']. This is the default behavior. The behavior does not apply for | ||
/// Language expressions that are not a single JTokenExpression with a string value. | ||
/// </summary> | ||
SerializeAsJTokenExpression = 1, | ||
|
||
/// <summary> | ||
/// Serializes the single string literal as a string value. If the string begins with a | ||
/// [ character, it will be escaped with [[. The behavior does not apply for | ||
/// Language expressions that are not a single JTokenExpression with a string value. | ||
/// </summary> | ||
SerializeAsString = 2, | ||
} | ||
} |
Oops, something went wrong.