Skip to content

Commit

Permalink
chore: using package.json for versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
Rockstrip authored May 22, 2023
1 parent ae2ac5c commit d0ba42e
Show file tree
Hide file tree
Showing 20 changed files with 28 additions and 4 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions Assets/RudderStack/UnitySDK/Resources/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"version": "2.0.0.beta.1-Test",
"description": "Rudder is a platform for collecting, storing and routing customer event data to dozens of tools"
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion Assets/RudderStack/UnitySDK/Scripts/Client/RSAnalytics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
using Examples.RudderStack.Unity;
using JetBrains.Annotations;
using Newtonsoft.Json;
using RudderStack.Flush;
Expand All @@ -15,8 +16,17 @@ namespace RudderStack.Unity
public class RSAnalytics
{
private static RSClient _client;
public static string VERSION = "2.0.0.beta.1";
public static string VERSION;

static RSAnalytics()
{
var package = JsonConvert.DeserializeObject<RSPackage>(Resources.Load("package").ToString());
if(package != null)
VERSION = package.Version;
else
Debug.LogError("Cannot read package.json in Resources. Please, reimport the project to restore this file");
}

public static RSClient Client
{
get => _client;
Expand Down
8 changes: 8 additions & 0 deletions Assets/RudderStack/UnitySDK/Scripts/Models/RSPackage.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace RudderStack.Unity
{
public class RSPackage
{
public string Version;
public string Description;
}
}
3 changes: 3 additions & 0 deletions Assets/RudderStack/UnitySDK/Scripts/Models/RSPackage.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified Assets/TextMesh Pro/Documentation/TextMesh Pro User Guide 2016.pdf
Binary file not shown.
Binary file modified Assets/TextMesh Pro/Fonts/LiberationSans.ttf
Binary file not shown.
Binary file modified Assets/TextMesh Pro/Sprites/EmojiOne.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d0ba42e

Please sign in to comment.