Skip to content
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

Dotnetcore - Add support for .NET 5.0 #61

Open
wants to merge 4 commits into
base: dotnetcore
Choose a base branch
from

Conversation

trondr
Copy link

@trondr trondr commented Sep 19, 2021

After adding support for .net 5.0 it is now possible to create maml from .net 5.0 F# binary code with the added manual step of putting the FSharp.Core.dll in the same directory as XmlDoc2CmdletDoc.exe.

Post-build script on the cmdlet library project:

"$(ProjectDir)..\..\tools\XmlDoc2CmdletDoc\XmlDoc2CmdletDoc.exe" -strict "$(TargetPath)"

F# cmdlet code example:

namespace OsmPowerCli.Library.CmdLets

open System.Management.Automation
open OsmPowerCli.Library.OsmData

/// <summary>
/// <para type="synopsis"></para>
/// <para type="description">Get OSM map</para>
/// <example>
///     <code>Get-OsmMap -MinLongitude 10.1554 -MinLattitude 59.7368 -MaxLongitude 10.2276 -MaxLattitude 59.7448</code>
/// </example>
/// </summary>
[<Cmdlet(VerbsCommon.Get,"OsmMap")>]
[<OutputType(typeof<string>)>]
type GetOsmMapCommand () =
    inherit PSCmdlet ()
    
    /// <summary>
    /// <para type="description">Minimum longitude of the map.</para>
    /// </summary>
    [<Parameter(Mandatory=true)>]
    member val MinLongitude :float = 0.0 with get,set
    
    /// <summary>
    /// <para type="description">Minimum lattitude of the map.</para>
    /// </summary>
    [<Parameter(Mandatory=true)>]
    member val MinLattitude :float = 0.0 with get,set
    
    /// <summary>
    /// <para type="description">Maximum longitude of the map.</para>
    /// </summary>
    [<Parameter(Mandatory=true)>]
    member val MaxLongitude :float = 0.0 with get,set
    
    /// <summary>
    /// <para type="description">Maximum lattitude of the map.</para>
    /// </summary>
    [<Parameter(Mandatory=true)>]
    member val MaxLattitude :float = 0.0 with get,set
    
    override this.ProcessRecord() =
        let bounds = {
            MinLongitude = this.MinLongitude
            MinLattidue = this.MinLattitude
            MaxLongitude = this.MaxLongitude
            MaxLattitude = this.MaxLattitude
        }
        let osmMap = OsmPowerCli.Library.OsmData.getOsmMap bounds
        this.WriteObject(osmMap)
        ()
```

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.

1 participant