Skip to content

Minor cleanup for Build Task - #3969

Merged
KevinRansom merged 9 commits into
dotnet:masterfrom
KevinRansom:trimfsi
Nov 19, 2017
Merged

Minor cleanup for Build Task#3969
KevinRansom merged 9 commits into
dotnet:masterfrom
KevinRansom:trimfsi

Conversation

@KevinRansom

Copy link
Copy Markdown
Contributor
  1. Remove .fsi files
  2. re-align some methods, trim some redundant spaces
  3. Always build in runningonmono rather that using #if
  4. We don't support Itanium .... no really we don't

| "ANYCPU", _, _ -> "anycpu"
| "X86" , _, _ -> "x86"
| "X64" , _, _ -> "x64"
| "ITANIUM", _, _ -> "Itanium"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hahahaha, oh wow

@TIHan

TIHan commented Nov 18, 2017

Copy link
Copy Markdown
Contributor

@dotnet-bot test Windows_NT Release_ci_part1 Build please

Comment thread src/fsharp/FSharp.Build/Fsc.fs Outdated
/// Return a list of the arguments (with no quoting for the cmd.exe shell)
member x.CapturedArguments() =
List.rev args
member x.CapturedArguments() = List.rev args

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possible additional cleanup: Whenever you see a mutable F# list plus a call to List.rev it's almost always cleaner to make it a use of a ResizeArray (i.e. System.Collections.Generic.List<T>) without the need for a reverse. It's a common F# code smell

Comment thread src/fsharp/FSharp.Build/Fsc.fs Outdated
type [<Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")>] Fsc() as this =
inherit ToolTask()
type
[<Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")>]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can place the attribute before the type keyword, it looks much nicer,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well that's the whole point of cleanup ... consider it done :-)

Comment thread src/fsharp/FSharp.Build/Fsc.fs Outdated
do
let runningOnMono = try System.Type.GetType("Mono.Runtime") <> null with e -> false
if not runningOnMono then
typeof<ToolTask>.InvokeMember("YieldDuringToolExecution",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mono probably has this available these days in the DLL - if so do this.YieldDuringToolExecution <- true is much cleaner and long-term safer.

If not I think I prefer the original code using #if

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dsyme xbuild is deprecated in favour of msbuild. So yes I will remove the running on mono check.

@KevinRansom
KevinRansom merged commit c03b9c1 into dotnet:master Nov 19, 2017
@KevinRansom
KevinRansom deleted the trimfsi branch November 20, 2017 04:14
// =====================================================================================================
// Todo: x.Compile(compile:System.Converter<int,int>, flags:string[], sources:string[]) for VS2017.7
// Earlier buildtasks usesd System.Converter<int,int> for cross platform we are moving to Func<int>
// This is so that during the interim, earlier VS's will still load the OSS project

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is so that during the interim, earlier VS's will still load the OSS project

Thanks for looking after this case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants