Skip to content

Commit

Permalink
fix: roblox types assembly paths
Browse files Browse the repository at this point in the history
  • Loading branch information
R-unic committed Jul 21, 2024
1 parent 18a7e6a commit 1f40874
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 15 deletions.
10 changes: 5 additions & 5 deletions RobloxCS/Transpiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,16 @@ private CSharpCompilation CompileASTs()

private void CopyIncludedLua()
{
var runtimeDirectory = Utility.GetRuntimeDirectory();
if (runtimeDirectory == null)
var rbxcsDirectory = Utility.GetRbxcsDirectory();
if (rbxcsDirectory == null)
{
Logger.CompilerError("Failed to find Roblox runtime library");
Logger.CompilerError("Failed to find RobloxCS directory");
return;
}

var includeDirectory = Utility.FixPathSep(Path.Combine(runtimeDirectory, _includeFolderName));
var includeDirectory = Utility.FixPathSep(Path.Combine(rbxcsDirectory, _includeFolderName));
var destinationIncludeDirectory = includeDirectory
.Replace(runtimeDirectory, _inputDirectory)
.Replace(rbxcsDirectory, _inputDirectory)
.Replace(_includeFolderName, _includeFolderName.ToLower());

try
Expand Down
5 changes: 1 addition & 4 deletions RobloxCS/TranspilerUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,7 @@ public static SyntaxTree ParseTree(string source, string sourceFile = "TestFile.

private static List<PortableExecutableReference> GetCompilationReferences()
{
var rbxcsDirectory = Utility.GetRbxcsDirectory();
var tfm = Utility.GetTargetFramework();
var runtimeLibPath = Utility.FixPathSep(string.Join('/', rbxcsDirectory, Utility.RuntimeAssemblyName));
var runtimeLibAssemblyPath = string.Join('/', runtimeLibPath, "bin", "Release", tfm, Utility.RuntimeAssemblyName + ".dll");
var runtimeLibAssemblyPath = string.Join('/', Utility.GetAssemblyDirectory(), Utility.RuntimeAssemblyName + ".dll");
if (!File.Exists(runtimeLibAssemblyPath))
{
var directoryName = Path.GetDirectoryName(runtimeLibAssemblyPath);
Expand Down
6 changes: 0 additions & 6 deletions RobloxCS/Utility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,6 @@ public static bool IsDebug()
#endif
}

public static string? GetRuntimeDirectory()
{
var repoDirectory = GetRbxcsDirectory();
return repoDirectory == null ? null : FixPathSep(Path.Combine(repoDirectory, RuntimeAssemblyName));
}

public static string? GetRbxcsDirectory()
{
var directoryName = Path.GetDirectoryName(Path.GetDirectoryName(Path.GetDirectoryName(Path.GetDirectoryName(GetAssemblyDirectory())))); // pretend like this isn't here lol
Expand Down

0 comments on commit 1f40874

Please sign in to comment.