Skip to content

Commit

Permalink
remove some of those hardcoded paths and build a self contained appli…
Browse files Browse the repository at this point in the history
…cation.
  • Loading branch information
matthid committed Jun 30, 2016
1 parent db57c60 commit cf807d3
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 87 deletions.
20 changes: 13 additions & 7 deletions src/app/Fake.netcore/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@
"netstandard1.3"
]
}
},
"runtimes": {
"win7-x86": { },
"win7-x64": { },
"osx.10.11-x64": { },
"ubuntu.14.04-x64": { }
},
"frameworks": {
"net46": {
Expand All @@ -53,7 +59,7 @@
"System.Core": ""
}
},
"netcoreapp1.0": {
"netstandard1.6": {
"buildOptions": {
"define": [
"NETSTANDARD1_5"
Expand All @@ -67,29 +73,29 @@
"Mono.Cecil": "0.9.6.0",
"FakeLib.netcore": "1.0.0-alpha4",
"CommandLine.DotNetCore": "1.0.0",
"System.Console": "4.0.0-rc2-24027",
"System.Console": "4.0.0",
"System.IO.FileSystem": "4.0.1",
"System.Diagnostics.Tracing": "4.1.0",
"System.Net.NameResolution": "4.0.0",
"System.Net.Primitives": "4.0.11",
"System.Threading.ThreadPool": "4.0.10",
"System.Diagnostics.TraceSource": "4.0.0",
"System.Reflection": "4.1.0",
"System.Reflection.Metadata": "1.4.1-beta-24227-04",
"System.Reflection.TypeExtensions": "4.1.0",
"System.Reflection.Primitives": "4.0.1",
"System.Runtime": "4.1.0",
"System.Runtime.Loader": "4.0.0",
"System.Runtime.Extensions": "4.1.0",
"Microsoft.FSharp.Core.netcore": "1.0.0-alpha-*",
"Microsoft.FSharp.Core.netcore": "1.0.0-alpha-160509",
"FSharp.Compiler.Service.netcore": "1.0.0-alpha-00001",
"FSharp.Compiler.Service.ProjectCracker.netcore": "1.0.0-alpha-00001",
"System.Security.Cryptography.Primitives": "4.0.0",
"System.Security.Cryptography.Algorithms": "4.2.0",
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0-rc2-3002702"

"version": "1.0.0-rc2-3002702"
}
}
}
}
}
}
93 changes: 13 additions & 80 deletions src/app/FakeLib/FSIHelper.fs
Original file line number Diff line number Diff line change
Expand Up @@ -463,92 +463,25 @@ let private handleCaching printDetails (session:IFsiSession) fsiErrorOutput (cac
let private runScriptUncached (useCache, scriptPath, fsiOptions) printDetails cacheInfo out err =
let options = FsiOptions.ofArgs fsiOptions
#if NETSTANDARD1_5
let basePath = System.AppContext.BaseDirectory
let references =
[ @"Microsoft.CSharp\4.0.1-rc2-24027\ref\netstandard1.0\Microsoft.CSharp.dll"
@"Microsoft.FSharp.Core.netcore\1.0.0-alpha-160509\lib\netstandard1.5\FSharp.Core.dll"
@"Microsoft.VisualBasic\10.0.1-rc2-24027\ref\netstandard1.1\Microsoft.VisualBasic.dll"
@"Microsoft.Win32.Primitives\4.0.1-rc2-24027\ref\netstandard1.3\Microsoft.Win32.Primitives.dll"
@"System.AppContext\4.1.0-rc2-24027\ref\netstandard1.5\System.AppContext.dll"
@"System.Buffers\4.0.0-rc2-24027\lib\netstandard1.1\System.Buffers.dll"
@"System.Collections\4.0.11\ref\netstandard1.3\System.Collections.dll"
@"System.Collections.Concurrent\4.0.12-rc2-24027\ref\netstandard1.3\System.Collections.Concurrent.dll"
@"System.Collections.Immutable\1.2.0-rc2-24027\lib\netstandard1.0\System.Collections.Immutable.dll"
@"System.ComponentModel\4.0.1-rc2-24027\ref\netstandard1.0\System.ComponentModel.dll"
@"System.ComponentModel.Annotations\4.1.0-rc2-24027\ref\netstandard1.4\System.ComponentModel.Annotations.dll"
@"System.Console\4.0.0-rc2-24027\ref\netstandard1.3\System.Console.dll"
@"System.Diagnostics.Debug\4.0.11\ref\netstandard1.3\System.Diagnostics.Debug.dll"
@"System.Diagnostics.DiagnosticSource\4.0.0-rc2-24027\lib\netstandard1.3\System.Diagnostics.DiagnosticSource.dll"
@"System.Diagnostics.Process\4.1.0-rc2-24027\ref\netstandard1.4\System.Diagnostics.Process.dll"
@"System.Diagnostics.Tools\4.0.1-rc2-24027\ref\netstandard1.0\System.Diagnostics.Tools.dll"
@"System.Diagnostics.TraceSource\4.0.0\ref\netstandard1.3\System.Diagnostics.TraceSource.dll"
@"System.Diagnostics.Tracing\4.1.0-rc2-24027\ref\netstandard1.5\System.Diagnostics.Tracing.dll"
@"System.Dynamic.Runtime\4.0.11-rc2-24027\ref\netstandard1.3\System.Dynamic.Runtime.dll"
@"System.Globalization\4.0.11\ref\netstandard1.3\System.Globalization.dll"
@"System.Globalization.Calendars\4.0.1-rc2-24027\ref\netstandard1.3\System.Globalization.Calendars.dll"
@"System.Globalization.Extensions\4.0.1-rc2-24027\ref\netstandard1.3\System.Globalization.Extensions.dll"
@"System.IO\4.1.0\ref\netstandard1.5\System.IO.dll"
@"System.IO.Compression\4.1.0-rc2-24027\ref\netstandard1.3\System.IO.Compression.dll"
@"System.IO.Compression.ZipFile\4.0.1-rc2-24027\ref\netstandard1.3\System.IO.Compression.ZipFile.dll"
@"System.IO.FileSystem\4.0.1-rc2-24027\ref\netstandard1.3\System.IO.FileSystem.dll"
@"System.IO.FileSystem.Primitives\4.0.1-rc2-24027\ref\netstandard1.3\System.IO.FileSystem.Primitives.dll"
@"System.IO.FileSystem.Watcher\4.0.0-rc2-24027\ref\netstandard1.3\System.IO.FileSystem.Watcher.dll"
@"System.IO.MemoryMappedFiles\4.0.0-rc2-24027\ref\netstandard1.3\System.IO.MemoryMappedFiles.dll"
@"System.IO.UnmanagedMemoryStream\4.0.1-rc2-24027\ref\netstandard1.3\System.IO.UnmanagedMemoryStream.dll"
@"System.Linq\4.1.0-rc2-24027\ref\netstandard1.5\System.Linq.dll"
@"System.Linq.Expressions\4.0.11-rc2-24027\ref\netstandard1.3\System.Linq.Expressions.dll"
@"System.Linq.Parallel\4.0.1-rc2-24027\ref\netstandard1.1\System.Linq.Parallel.dll"
@"System.Linq.Queryable\4.0.1-rc2-24027\ref\netstandard1.0\System.Linq.Queryable.dll"
@"System.Net.Http\4.0.1-rc2-24027\ref\netstandard1.1\System.Net.Http.dll"
@"System.Net.NameResolution\4.0.0-rc2-24027\ref\netstandard1.3\System.Net.NameResolution.dll"
@"System.Net.Primitives\4.0.11-rc2-24027\ref\netstandard1.3\System.Net.Primitives.dll"
@"System.Net.Requests\4.0.11-rc2-24027\ref\netstandard1.3\System.Net.Requests.dll"
@"System.Net.Security\4.0.0-rc2-24027\ref\netstandard1.3\System.Net.Security.dll"
@"System.Net.Sockets\4.1.0-rc2-24027\ref\netstandard1.3\System.Net.Sockets.dll"
@"System.Net.WebHeaderCollection\4.0.1-rc2-24027\ref\netstandard1.3\System.Net.WebHeaderCollection.dll"
@"System.Numerics.Vectors\4.1.1-rc2-24027\ref\netstandard1.1\System.Numerics.Vectors.dll"
@"System.ObjectModel\4.0.12-rc2-24027\ref\netstandard1.3\System.ObjectModel.dll"
@"System.Reflection\4.1.0\ref\netstandard1.5\System.Reflection.dll"
@"System.Reflection.DispatchProxy\4.0.1-rc2-24027\ref\netstandard1.3\System.Reflection.DispatchProxy.dll"
@"System.Reflection.Emit\4.0.1-rc2-24027\ref\netstandard1.1\System.Reflection.Emit.dll"
@"System.Reflection.Emit.ILGeneration\4.0.1-rc2-24027\ref\netstandard1.0\System.Reflection.Emit.ILGeneration.dll"
@"System.Reflection.Extensions\4.0.1-rc2-24027\ref\netstandard1.0\System.Reflection.Extensions.dll"
@"System.Reflection.Metadata\1.3.0-rc2-24027\lib\netstandard1.1\System.Reflection.Metadata.dll"
@"System.Reflection.Primitives\4.0.1\ref\netstandard1.0\System.Reflection.Primitives.dll"
@"System.Reflection.TypeExtensions\4.1.0-rc2-24027\ref\netstandard1.5\System.Reflection.TypeExtensions.dll"
@"System.Resources.Reader\4.0.0-rc2-24027\lib\netstandard1.0\System.Resources.Reader.dll"
@"System.Resources.ResourceManager\4.0.1\ref\netstandard1.0\System.Resources.ResourceManager.dll"
@"System.Runtime\4.1.0\ref\netstandard1.5\System.Runtime.dll"
@"System.Runtime.Extensions\4.1.0\ref\netstandard1.5\System.Runtime.Extensions.dll"
@"System.Runtime.Handles\4.0.1-rc2-24027\ref\netstandard1.3\System.Runtime.Handles.dll"
@"System.Runtime.InteropServices\4.1.0-rc2-24027\ref\netstandard1.5\System.Runtime.InteropServices.dll"
@"System.Runtime.InteropServices.PInvoke\4.0.0-rc2-24027\ref\netstandard1.3\System.Runtime.InteropServices.PInvoke.dll"
@"System.Runtime.InteropServices.RuntimeInformation\4.0.0-rc2-24027\ref\netstandard1.1\System.Runtime.InteropServices.RuntimeInformation.dll"
@"System.Runtime.Loader\4.0.0-rc2-24027\ref\netstandard1.5\System.Runtime.Loader.dll"
@"System.Runtime.Numerics\4.0.1-rc2-24027\ref\netstandard1.1\System.Runtime.Numerics.dll"
@"System.Security.Cryptography.Algorithms\4.1.0-rc2-24027\ref\netstandard1.4\System.Security.Cryptography.Algorithms.dll"
@"System.Security.Cryptography.Encoding\4.0.0-rc2-24027\ref\netstandard1.3\System.Security.Cryptography.Encoding.dll"
@"System.Security.Cryptography.Primitives\4.0.0-rc2-24027\ref\netstandard1.3\System.Security.Cryptography.Primitives.dll"
@"System.Security.Cryptography.X509Certificates\4.1.0-rc2-24027\ref\netstandard1.4\System.Security.Cryptography.X509Certificates.dll"
@"System.Security.Principal\4.0.1-rc2-24027\ref\netstandard1.0\System.Security.Principal.dll"
@"System.Text.Encoding\4.0.11\ref\netstandard1.3\System.Text.Encoding.dll"
@"System.Text.Encoding.Extensions\4.0.11-rc2-24027\ref\netstandard1.3\System.Text.Encoding.Extensions.dll"
@"System.Text.RegularExpressions\4.0.12-rc2-24027\ref\netstandard1.3\System.Text.RegularExpressions.dll"
@"System.Threading\4.0.11\ref\netstandard1.3\System.Threading.dll"
@"System.Threading.Tasks\4.0.11\ref\netstandard1.3\System.Threading.Tasks.dll"
@"System.Threading.Tasks.Dataflow\4.6.0-rc2-24027\lib\netstandard1.1\System.Threading.Tasks.Dataflow.dll"
@"System.Threading.Tasks.Extensions\4.0.0-rc2-24027\lib\netstandard1.0\System.Threading.Tasks.Extensions.dll"
@"System.Threading.Tasks.Parallel\4.0.1-rc2-24027\ref\netstandard1.1\System.Threading.Tasks.Parallel.dll"
@"System.Threading.Thread\4.0.0-rc2-24027\ref\netstandard1.3\System.Threading.Thread.dll"
@"System.Threading.ThreadPool\4.0.10-rc2-24027\ref\netstandard1.3\System.Threading.ThreadPool.dll"
@"System.Threading.Timer\4.0.1-rc2-24027\ref\netstandard1.2\System.Threading.Timer.dll"
@"System.Xml.ReaderWriter\4.0.11-rc2-24027\ref\netstandard1.3\System.Xml.ReaderWriter.dll"
@"System.Xml.XDocument\4.0.11-rc2-24027\ref\netstandard1.3\System.Xml.XDocument.dll" ]
System.IO.Directory.GetFiles(basePath, "*.dll")
|> Seq.filter (fun r -> not (System.IO.Path.GetFileName(r).ToLowerInvariant().StartsWith("api-ms")))
|> Seq.filter (fun r ->
try Mono.Cecil.ModuleDefinition.ReadModule(r) |> ignore
true
with e ->
printfn "No assembly (%s): %O" r e.Message
false)
|> Seq.toList
let split = "\n\t - "
printfn "references %s%s" (if references.Length > 0 then split else "") (System.String.Join(split, references))
// Msbuild code in FCS is broken on .net core
let options =
{ options with
NoFramework = true
Debug = Some DebugMode.Portable
References = (references |> List.map (sprintf @"C:\Users\dragon\.nuget\packages\%s")) @ options.References }
References = (references) @ options.References }
#endif
let getScriptAndHash fileName =
let matched = hashRegex.Match(fileName)
Expand Down

0 comments on commit cf807d3

Please sign in to comment.