Skip to content

Commit

Permalink
Compiling without the need for #r "netstandard.dll".
Browse files Browse the repository at this point in the history
  • Loading branch information
nojaf committed Feb 11, 2019
1 parent e7ce6f4 commit c2a45b8
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
13 changes: 13 additions & 0 deletions src/dotnet/Fable.Compiler/CLI/ProjectCracker.fs
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,19 @@ let getCrackedProjects (checker: FSharpChecker) (projFile: string) =
parsedOptions
|> List.map (function | ScriptOption.Dll dll -> Some dll | _ -> None)
|> List.choose id
|> fun dllRx ->
Array.fold (fun dllRs rf ->
if not (List.exists (fun r -> Path.GetFileNameWithoutExtension(r) = rf) dllRs) then
let dllPath = System.IO.Path.Combine(@"C:\Windows\Microsoft.NET\Framework64\v4.0.30319", sprintf "%s.dll" rf) // TODO: get path to full framework or mono
if System.IO.File.Exists(dllPath) |> not then
dllRs // System.Reflection.Metadata & System.Reflection.TypeExtensions don't exist in full framework.
// I think these Reflection APIs are in System.Reflection.dll and are found at runtime.
else
dllPath::dllRs
else
dllRs
) dllRx Fable.Repl.Metadata.references_core


let otherOptions =
parsedOptions
Expand Down
1 change: 1 addition & 0 deletions src/dotnet/Fable.Compiler/Fable.Compiler.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<PackageVersion>2.0.11</PackageVersion>
</PropertyGroup>
<ItemGroup>
<Compile Include="Metadata.fs" />
<Compile Include="Global/Fable.Core.fs" />
<Compile Include="Global/Prelude.fs" />
<Compile Include="Global/Compiler.fs" />
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions src/dotnet/Fable.Repl/Fable.Repl.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
</ItemGroup>

<ItemGroup>

<Compile Include="../Fable.Compiler/Global/Fable.Core.fs" />
<Compile Include="../Fable.Compiler/Global/Prelude.fs" />
<Compile Include="../Fable.Compiler/Global/Compiler.fs" />
Expand All @@ -30,7 +31,7 @@
<Compile Include="../Fable.Compiler/Transforms/FableTransforms.fs" />
<Compile Include="../Fable.Compiler/Transforms/Fable2Babel.fs" />
<Compile Include="../Fable.Compiler/Transforms/State.fs" />

<Compile Include="../Fable.Compiler/Metadata.fs"/>
<!--
<Compile Include="../Fable.Compiler/CLI/CLI.Util.fs" />
<Compile Include="../Fable.Compiler/CLI/Parser.fs" />
Expand All @@ -43,7 +44,6 @@
-->

<Compile Include="Interfaces.fs"/>
<Compile Include="Metadata.fs"/>
<Compile Include="Lexer.fs"/>
<Compile Include="Main.fs"/>
</ItemGroup>
Expand Down

0 comments on commit c2a45b8

Please sign in to comment.