Skip to content

Commit

Permalink
feat: Support version in generate script (box/box-codegen#418)
Browse files Browse the repository at this point in the history
  • Loading branch information
box-sdk-build committed Mar 5, 2024
1 parent 6778e77 commit 5d6a85e
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .codegen.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "engineHash": "1ec6b5f", "specHash": "b2f7568", "version": "0.1.0" }
{ "engineHash": "be0f8b2", "specHash": "b2f7568", "version": "0.1.0" }
34 changes: 34 additions & 0 deletions .versionrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"types": [
{
"type": "feat",
"section": "New Features and Enhancements",
"hidden": false
},
{
"type": "fix",
"section": "Bug Fixes",
"hidden": false
},
{
"type": "chore",
"hidden": true
},
{
"type": "docs",
"hidden": true
},
{
"type": "style",
"hidden": true
},
{
"type": "refactor",
"hidden": true
},
{
"type": "test",
"hidden": true
}
]
}
2 changes: 1 addition & 1 deletion Box.Sdk.Gen/Box.Sdk.Gen.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Version>2.0.0</Version>
<Version>0.1.0</Version>
<Description>[Box Platform](https://box.dev) provides functionality to provide access to content stored within [Box](https://box.com). It provides endpoints for basic manipulation of files and folders, management of users within an enterprise, as well as more complex topics such as legal holds and retention policies.</Description>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<Nullable>enable</Nullable>
Expand Down
3 changes: 1 addition & 2 deletions Box.Sdk.Gen/Networking/SdkConsts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ namespace Fetch
{
internal static class SdkConsts
{
static string SdkVersion = "0.1.0";
static string RunTimeVersion = System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription;

static KeyValuePair<string, string> UserAgentHeader = new KeyValuePair<string, string>("User-Agent", $"box-dotnet-generated-sdk/{SdkVersion}");
static KeyValuePair<string, string> UserAgentHeader = new KeyValuePair<string, string>("User-Agent", $"box-dotnet-generated-sdk/{Version.sdkVersion}");
static KeyValuePair<string, string> BoxUAHeader = new KeyValuePair<string, string>("X-Box-UA", $"agent={UserAgentHeader.Value}; env=dotnet/{RunTimeVersion}");

internal static List<KeyValuePair<string, string>> AnalyticsHeaders = new List<KeyValuePair<string, string>>() { UserAgentHeader, BoxUAHeader };
Expand Down
9 changes: 9 additions & 0 deletions Box.Sdk.Gen/Networking/Version.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using System;

namespace Fetch
{
public static class Version
{
public static string sdkVersion = "0.1.0";
}
}

0 comments on commit 5d6a85e

Please sign in to comment.