Skip to content

Allowing linux builds (Currently filenotfound exception) #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions Server/ShaderlabVS.Data/ShaderlabDataManager.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics.Eventing.Reader;
using System.IO;
using System.Linq;
using System.Reflection;
Expand All @@ -12,15 +13,15 @@ namespace ShaderlabVS.Data
public class ShaderlabDataManager
{
#region Constants
public const string HLSL_CG_DATATYPE_DEFINATIONFILE = "Data\\HLSL_CG_datatype.def";
public const string HLSL_CG_FUNCTION_DEFINATIONFILE = "Data\\HLSL_CG_functions.def";
public const string HLSL_CG_KEYWORD_DEFINATIONFILE = "Data\\HLSL_CG_Keywords.def";

public const string UNITY3D_DATATYPE_DEFINATIONFILE = "Data\\Unity3D_datatype.def";
public const string UNITY3D_FUNCTION_DEFINATIONFILE = "Data\\Unity3D_functions.def";
public const string UNITY3D_KEYWORD_DEFINATIONFILE = "Data\\Unity3D_keywords.def";
public const string UNITY3D_MACROS_DEFINATIONFILE = "Data\\Unity3D_macros.def";
public const string UNITY3D_VALUES_DEFINATIONFILE = "Data\\Unity3D_values.def";
public static string HLSL_CG_DATATYPE_DEFINATIONFILE = "Data" + Path.DirectorySeparatorChar.ToString() + "HLSL_CG_datatype.def";
public static string HLSL_CG_FUNCTION_DEFINATIONFILE = "Data" + Path.DirectorySeparatorChar.ToString() + "HLSL_CG_functions.def";
public static string HLSL_CG_KEYWORD_DEFINATIONFILE = "Data" + Path.DirectorySeparatorChar.ToString() + "HLSL_CG_Keywords.def";

public static string UNITY3D_DATATYPE_DEFINATIONFILE = "Data" + Path.DirectorySeparatorChar.ToString() + "Unity3D_datatype.def";
public static string UNITY3D_FUNCTION_DEFINATIONFILE = "Data" + Path.DirectorySeparatorChar.ToString() + "Unity3D_functions.def";
public static string UNITY3D_KEYWORD_DEFINATIONFILE = "Data" + Path.DirectorySeparatorChar.ToString() + "Unity3D_keywords.def";
public static string UNITY3D_MACROS_DEFINATIONFILE = "Data" + Path.DirectorySeparatorChar.ToString() + "Unity3D_macros.def";
public static string UNITY3D_VALUES_DEFINATIONFILE = "Data" + Path.DirectorySeparatorChar.ToString() + "Unity3D_values.def";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can use Path.Combine here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me

#endregion

#region Properties
Expand Down Expand Up @@ -69,7 +70,7 @@ public static ShaderlabDataManager Instance

private ShaderlabDataManager()
{
string currentAssemblyDir = (new FileInfo(Assembly.GetExecutingAssembly().CodeBase.Substring(8))).DirectoryName;
string currentAssemblyDir = (new FileInfo(Assembly.GetExecutingAssembly().Location)).DirectoryName;
HLSLCGFunctions = DefinationDataProvider<HLSLCGFunction>.ProvideFromFile(Path.Combine(currentAssemblyDir, ShaderlabDataManager.HLSL_CG_FUNCTION_DEFINATIONFILE));

List<HLSLCGKeywords> hlslcgKeywords = DefinationDataProvider<HLSLCGKeywords>.ProvideFromFile(Path.Combine(currentAssemblyDir, ShaderlabDataManager.HLSL_CG_KEYWORD_DEFINATIONFILE));
Expand Down