From 43c6a359844b4664cc83e2326fe80e52b7249afd Mon Sep 17 00:00:00 2001 From: Verdonck Date: Fri, 15 Feb 2019 14:14:36 +0100 Subject: [PATCH] Remove fable-metadata dependency. --- package.json | 1 - src/dotnet/Fable.Compiler/CLI/ProjectCracker.fs | 9 ++++----- yarn.lock | 5 ----- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index ede3cee0ff..a9648b9979 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,6 @@ "fable-compiler": "^2.1.0-beta-003", "fable-loader": "^2.0.0", "fable-splitter": "^2.0.1", - "fable-metadata": "1.0.0-beta-002", "mocha": "^5.2.0", "shelljs": "^0.8.3", "terser": "^3.10.0", diff --git a/src/dotnet/Fable.Compiler/CLI/ProjectCracker.fs b/src/dotnet/Fable.Compiler/CLI/ProjectCracker.fs index aa170d4ff7..e4580ad3ff 100644 --- a/src/dotnet/Fable.Compiler/CLI/ProjectCracker.fs +++ b/src/dotnet/Fable.Compiler/CLI/ProjectCracker.fs @@ -11,7 +11,7 @@ open Microsoft.FSharp.Compiler.SourceCodeServices open Fable open Dotnet.ProjInfo.Workspace open Dotnet.ProjInfo.Workspace.FCS -open System.Runtime.InteropServices +open System.Reflection let isSystemPackage (pkgName: string) = @@ -302,6 +302,7 @@ type ScriptOption = let getCrackedProjects (checker: FSharpChecker) (projFile: string) (rootDir: string) = match (Path.GetExtension projFile).ToLower() with | ".fsx" -> + let fsprojOptions = getProjectOptionsFromScript checker projFile let parsedOptions = fsprojOptions.OtherOptions @@ -317,7 +318,7 @@ let getCrackedProjects (checker: FSharpChecker) (projFile: string) (rootDir: str ) let dllReferences = - let (/) a b = Path.Combine(a,b) + let netcoreappPath = Path.GetDirectoryName(typeof.GetTypeInfo().Assembly.Location) parsedOptions |> List.map (function | ScriptOption.Dll dll -> Some dll | _ -> None) @@ -325,9 +326,7 @@ let getCrackedProjects (checker: FSharpChecker) (projFile: string) (rootDir: str |> fun dllRx -> Array.fold (fun dllRs rf -> if not (List.exists (fun r -> Path.GetFileNameWithoutExtension(r) = rf) dllRs) then - let dllPath = - rootDir / "node_modules" / "fable-metadata" / "lib" / (sprintf "%s.dll" rf) - + let dllPath = Path.Combine(netcoreappPath, (sprintf "%s.dll" rf)) dllPath::dllRs else dllRs diff --git a/yarn.lock b/yarn.lock index a8f5464324..d6d1d71fac 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2692,11 +2692,6 @@ fable-loader@^2.0.0: dependencies: fable-utils "^1.1.0" -fable-metadata@1.0.0-beta-002: - version "1.0.0-beta-002" - resolved "https://registry.yarnpkg.com/fable-metadata/-/fable-metadata-1.0.0-beta-002.tgz#17c49a0e96413406e864ccb08cc2b11fc1adb9e9" - integrity sha512-PVDgurXItCEYLjzJAQRls/e5mfXsPbo7LrGIj5m2Iy8gztQMXHI4i1Tc3rY+kLAcLd9wgMGgaMBxAbahwQclWA== - fable-splitter@^2.0.1: version "2.0.2" resolved "https://registry.yarnpkg.com/fable-splitter/-/fable-splitter-2.0.2.tgz#64d281ccc703f502fd5862d108613cee0408cd03"