-
Notifications
You must be signed in to change notification settings - Fork 847
Update framework refencing #10502
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
Update framework refencing #10502
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -117,6 +117,16 @@ type CompilerAssert private () = | |
|
|
||
| </Project>""" | ||
|
|
||
| static let directoryBuildProps = """ | ||
| <Project> | ||
| <PropertyGroup> | ||
| <DisableCompilerRedirection>true</DisableCompilerRedirection> | ||
| </PropertyGroup> | ||
|
|
||
| <Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" /> | ||
| </Project> | ||
| """ | ||
|
|
||
| static let programFs = """ | ||
| open System | ||
|
|
||
|
|
@@ -127,20 +137,23 @@ let main argv = 0""" | |
| let mutable output = "" | ||
| let mutable errors = "" | ||
| let mutable cleanUp = true | ||
| let projectDirectory = Path.Combine(Path.GetTempPath(), "CompilerAssert", Path.GetRandomFileName()) | ||
| let pathToTemp = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "../../../../Temp")) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not resolve
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not at all, I want us to pick up the global.json in the repo. %temp% is in the user directory, and so is nowhere near the repo |
||
| let projectDirectory = Path.Combine(pathToTemp, "CompilerAssert", Path.GetRandomFileName()) | ||
| let pathToFSharpCore = typeof<RequireQualifiedAccessAttribute>.Assembly.Location | ||
| try | ||
| try | ||
| Directory.CreateDirectory(projectDirectory) |> ignore | ||
| let projectFileName = Path.Combine(projectDirectory, "ProjectFile.fsproj") | ||
| let programFsFileName = Path.Combine(projectDirectory, "Program.fs") | ||
| let directoryBuildPropsFileName = Path.Combine(projectDirectory, "Directory.Build.props") | ||
| let frameworkReferencesFileName = Path.Combine(projectDirectory, "FrameworkReferences.txt") | ||
| #if NETCOREAPP | ||
| File.WriteAllText(projectFileName, projectFile.Replace("$TARGETFRAMEWORK", "netcoreapp3.1").Replace("$FSHARPCORELOCATION", pathToFSharpCore)) | ||
| #else | ||
| File.WriteAllText(projectFileName, projectFile.Replace("$TARGETFRAMEWORK", "net472").Replace("$FSHARPCORELOCATION", pathToFSharpCore)) | ||
| #endif | ||
| File.WriteAllText(programFsFileName, programFs) | ||
| File.WriteAllText(directoryBuildPropsFileName, directoryBuildProps) | ||
|
|
||
| let pInfo = ProcessStartInfo () | ||
| pInfo.FileName <- config.DotNetExe | ||
|
|
@@ -166,7 +179,9 @@ let main argv = 0""" | |
| cleanUp <- false | ||
| printfn "Project directory: %s" projectDirectory | ||
| printfn "STDOUT: %s" output | ||
| File.WriteAllText(Path.Combine(projectDirectory, "project.stdout"), output) | ||
| printfn "STDERR: %s" errors | ||
| File.WriteAllText(Path.Combine(projectDirectory, "project.stderror"), errors) | ||
| raise (new Exception (sprintf "An error occurred getting netcoreapp references: %A" e)) | ||
| finally | ||
| if cleanUp then | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you trying to prevent all directory crawling? If so, this file should just be an empty
<Project />element and a similarly emtpyDirectory.Build.targetsshould be present, too.