isaacabraham / vsts-fsharp

Azure Devops extension for F#-friendly tools
https://marketplace.visualstudio.com/items?itemName=isaacabraham.fsharp-helpers-extension
Apache License 2.0
13 stars 7 forks source link

F# 4.1 support #3

Closed cgravill closed 6 years ago

cgravill commented 6 years ago

Thanks for these helpers @isaacabraham they're really useful for some ad hoc tasks on VSTS.

We have some build agents with only F# 4.1/VS2017 which means fsi is only present in: C:\Program Files (x86)\Microsoft SDKs\F#\4.1\Framework\v4.0

The script is hard-coded against: "C:\\Program Files (x86)\\Microsoft SDKs\\F#\\4.0\\Framework\\v4.0\\fsi.exe"

I was able to workaround this using https://docs.microsoft.com/en-gb/vsts/build-release/tasks/utility/batch-script but it'd be great to use the more specific tasks with F# 4.1

isaacabraham commented 6 years ago

We could add a parameter of where the F# path is?

isaacabraham commented 6 years ago

To be honest I think this needs a rewrite anyway, apparently using the command-line runner for VSTS tasks is "out of date" now and the PS one is the way to go.

cgravill commented 6 years ago

Sure a parameter could do it.

I'm not really in the loop is there some advice that PowerShell is the way to go now?

isaacabraham commented 6 years ago

Have a look here https://github.com/Microsoft/vsts-tasks/tree/master/Tasks there's loads of tasks.

isaacabraham commented 6 years ago

@cgravill I've just pushed an updated version which allows you to specify the version of F# you want. This then is used to form the path to FSI.exe.

Completely untested - could you give it a go?

skovlund commented 6 years ago

Does not seem to work. I get the below error: "C:\Program Files (x86)\Microsoft SDKs\F#\${FSharpVersion}\Framework\v4.0\fsi.exe" <My script path> <My args> The system cannot find the path specified. Process completed with exit code 1 and had 1 error(s) written to the error stream.

It seems the reference to the F# version does not work. Changing ${FSharpVersion} to $(FSharpVersion) might do.

isaacabraham commented 6 years ago

@skovlund I've reopened this. do let me know if it's fixed.

skovlund commented 6 years ago

It is, thank you for your quick response.

cgravill commented 6 years ago

This works great! I've switched our builds over to this task, thank