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

Update to .NET8 #18

Merged
merged 2 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"isRoot": true,
"tools": {
"paket": {
"version": "7.2.1",
"version": "8.0.0",
"commands": [
"paket"
]
},
"fantomas": {
"version": "6.0.2",
"version": "6.2.3",
"commands": [
"fantomas"
]
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ on:
jobs:
build:

strategy:
fail-fast: false

runs-on: [windows-latest]

steps:
Expand All @@ -22,7 +19,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
dotnet-version: 8.0.x

- name: Install local tools
run: dotnet tool restore
Expand Down
1 change: 0 additions & 1 deletion Arguments.fs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ module Arguments =

| Sms _ -> CliArguments_Sms.ResourceString


| PushInfo _ -> CliArguments_PushInfo.ResourceString
| Push _ -> CliArguments_Push.ResourceString
| Link _ -> CliArguments_Link.ResourceString
Expand Down
2 changes: 1 addition & 1 deletion Commands/ChatCommands.fs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module ChatCommands =
let list () =
HttpService.GetListRequest Chats
|> ChatListResponse.Parse
|> fun r -> r.Chats
|> _.Chats
|> Array.map (fun c ->
ChatListOutput.FormattedString(
c.Iden,
Expand Down
4 changes: 2 additions & 2 deletions Commands/DeviceCommands.fs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
let list () =
HttpService.GetListRequest Devices
|> DeviceListResponse.Parse
|> fun r -> r.Devices
|> _.Devices
|> Array.indexed
|> Array.map (fun (i, e) -> DeviceListOutput.FormattedString(i, e.Iden, e.Nickname))
|> String.concat Environment.NewLine
Expand All @@ -42,7 +42,7 @@
let getDeviceId (GetDeviceCommand index) =
HttpService.GetListRequest Devices
|> DeviceListResponse.Parse
|> fun r -> r.Devices
|> _.Devices

Check warning on line 45 in Commands/DeviceCommands.fs

View workflow job for this annotation

GitHub Actions / build

The meaning of _ is ambiguous here. It cannot be used for a discarded variable and a function shorthand in the same scope.

Check warning on line 45 in Commands/DeviceCommands.fs

View workflow job for this annotation

GitHub Actions / build

The meaning of _ is ambiguous here. It cannot be used for a discarded variable and a function shorthand in the same scope.
|> fun a -> a |> Array.tryItem index
|> function
| Some v -> v.Iden
Expand Down
4 changes: 2 additions & 2 deletions Commands/PushCommands.fs
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
else
ListTextPushOutput.FormattedString(p.Iden, p.Created.ofUnixTimeToDateTime, p.Type, p.Title, p.Body)

HttpService.GetRequest Pushes [ ("limit", limit); ("active", true) ]
HttpService.GetRequest Pushes [ ("limit", $"{limit}"); ("active", $"{true}") ]
|> PushListResponse.Parse
|> fun r -> r.Pushes
|> _.Pushes

Check warning on line 43 in Commands/PushCommands.fs

View workflow job for this annotation

GitHub Actions / build

The meaning of _ is ambiguous here. It cannot be used for a discarded variable and a function shorthand in the same scope.

Check warning on line 43 in Commands/PushCommands.fs

View workflow job for this annotation

GitHub Actions / build

The meaning of _ is ambiguous here. It cannot be used for a discarded variable and a function shorthand in the same scope.
|> Array.map formatPush
|> String.concat Environment.NewLine

Expand Down
2 changes: 1 addition & 1 deletion Commands/SubscriptionCommands.fs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module SubscriptionCommands =
let list () =
HttpService.GetListRequest Subscriptions
|> SubscriptionListResponse.Parse
|> fun r -> r.Subscriptions
|> _.Subscriptions
|> Array.map (fun s ->
ListSubscriptionOutput.FormattedString(s.Channel.Tag, s.Channel.Name, s.Channel.Description))
|> String.concat Environment.NewLine
Expand Down
2 changes: 1 addition & 1 deletion Commands/SystemCommands.fs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ module SystemCommands =
let listGrants () =
HttpService.GetListRequest "grants"
|> GrantListResponse.Parse
|> fun r -> r.Grants
|> _.Grants
|> Array.map (fun grant ->
ListGrantsOutput.FormattedString(
grant.Iden,
Expand Down
4 changes: 2 additions & 2 deletions HttpService.fs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module HttpService =

let private formatException (stream: Stream) =
new StreamReader(stream)
|> fun r -> r.ReadToEnd()
|> _.ReadToEnd()
|> ErrorResponse.Parse
|> fun e -> $"{e.ErrorCode}: {e.Error.Message} {e.Error.Cat}"

Expand Down Expand Up @@ -63,7 +63,7 @@ module HttpService =
|> Ok
| Choice2Of2 e -> e |> Response.toStream |> formatException |> Error

let GetRequest (path: string) (query': (string * obj) list) : string =
let GetRequest (path: string) (query': (string * string) list) : string =
http {
GET $"{BaseUrl}/{path}"
query query'
Expand Down
2 changes: 1 addition & 1 deletion Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ module Program =
|> SubscriptionCommands.DeleteSubscriptionCommand
|> SubscriptionCommands.delete
| [ DeleteArgs.Sms s ] -> s |> MessageCommands.DeleteMessageCommand |> MessageCommands.delete
| [ DeleteArgs.Key _ ] -> SystemCommands.deleteKey ()
| [ DeleteArgs.Key ] -> SystemCommands.deleteKey ()
| _ -> subCommand.Parser.PrintUsage()

| [ Clip arg ] -> arg |> PushCommands.PushClipCommand |> PushCommands.pushClip
Expand Down
3 changes: 2 additions & 1 deletion Serialization.fs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ module Serialization =

open System.Text.Json
open System.Text.Json.Serialization
open System.Text.Json.Serialization.Metadata

let options =
JsonSerializerOptions(PropertyNamingPolicy = JsonNamingPolicy.CamelCase)
JsonSerializerOptions(PropertyNamingPolicy = JsonNamingPolicy.CamelCase, TypeInfoResolver = DefaultJsonTypeInfoResolver())

options.Converters.Add(JsonFSharpConverter())

Expand Down
2 changes: 1 addition & 1 deletion paket.dependencies
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
source https://api.nuget.org/v3/index.json
framework: net7.0
framework: net8.0

github CaptnCodr/FSharpExtensions:main ResourceExtension.fs
github CaptnCodr/FSharpExtensions:main DateTimeExtension.fs
Expand Down
102 changes: 47 additions & 55 deletions paket.lock
Original file line number Diff line number Diff line change
@@ -1,66 +1,58 @@
RESTRICTION: == net7.0
RESTRICTION: == net8.0
NUGET
remote: https://api.nuget.org/v3/index.json
Argu (6.1.1)
FSharp.Core (>= 4.3.2)
System.Configuration.ConfigurationManager (>= 4.4)
FSharp.Core (7.0.200)
FSharp.Data (6.2)
FSharp.Core (>= 5.0.1)
FSharp.Data.Csv.Core (>= 6.2)
FSharp.Data.Html.Core (>= 6.2)
FSharp.Data.Http (>= 6.2)
FSharp.Data.Json.Core (>= 6.2)
FSharp.Data.Runtime.Utilities (>= 6.2)
FSharp.Data.WorldBank.Core (>= 6.2)
FSharp.Data.Xml.Core (>= 6.2)
FSharp.Data.Csv.Core (6.2)
FSharp.Core (>= 5.0.1)
FSharp.Data.Runtime.Utilities (>= 6.2)
FSharp.Data.Html.Core (6.2)
FSharp.Core (>= 5.0.1)
FSharp.Data.Csv.Core (>= 6.2)
FSharp.Data.Runtime.Utilities (>= 6.2)
FSharp.Data.Http (6.2)
FSharp.Core (>= 5.0.1)
FSharp.Data.Json.Core (6.2)
FSharp.Core (>= 5.0.1)
FSharp.Data.Http (>= 6.2)
FSharp.Data.Runtime.Utilities (>= 6.2)
FSharp.Data.Runtime.Utilities (6.2)
FSharp.Core (>= 5.0.1)
FSharp.Data.Http (>= 6.2)
FSharp.Data.WorldBank.Core (6.2)
FSharp.Core (>= 5.0.1)
FSharp.Data.Http (>= 6.2)
FSharp.Data.Json.Core (>= 6.2)
FSharp.Data.Runtime.Utilities (>= 6.2)
FSharp.Data.Xml.Core (6.2)
FSharp.Core (>= 5.0.1)
FSharp.Data.Http (>= 6.2)
FSharp.Data.Json.Core (>= 6.2)
FSharp.Data.Runtime.Utilities (>= 6.2)
FSharp.SystemTextJson (1.1.23)
FSharp.Core (8.0.100)
FSharp.Data (6.3)
FSharp.Core (>= 5.0.1)
FSharp.Data.Csv.Core (>= 6.3)
FSharp.Data.Html.Core (>= 6.3)
FSharp.Data.Http (>= 6.3)
FSharp.Data.Json.Core (>= 6.3)
FSharp.Data.Runtime.Utilities (>= 6.3)
FSharp.Data.WorldBank.Core (>= 6.3)
FSharp.Data.Xml.Core (>= 6.3)
FSharp.Data.Csv.Core (6.3)
FSharp.Core (>= 5.0.1)
FSharp.Data.Runtime.Utilities (>= 6.3)
FSharp.Data.Html.Core (6.3)
FSharp.Core (>= 5.0.1)
FSharp.Data.Csv.Core (>= 6.3)
FSharp.Data.Runtime.Utilities (>= 6.3)
FSharp.Data.Http (6.3)
FSharp.Core (>= 5.0.1)
FSharp.Data.Json.Core (6.3)
FSharp.Core (>= 5.0.1)
FSharp.Data.Http (>= 6.3)
FSharp.Data.Runtime.Utilities (>= 6.3)
FSharp.Data.Runtime.Utilities (6.3)
FSharp.Core (>= 5.0.1)
FSharp.Data.Http (>= 6.3)
FSharp.Data.WorldBank.Core (6.3)
FSharp.Core (>= 5.0.1)
FSharp.Data.Http (>= 6.3)
FSharp.Data.Json.Core (>= 6.3)
FSharp.Data.Runtime.Utilities (>= 6.3)
FSharp.Data.Xml.Core (6.3)
FSharp.Core (>= 5.0.1)
FSharp.Data.Http (>= 6.3)
FSharp.Data.Json.Core (>= 6.3)
FSharp.Data.Runtime.Utilities (>= 6.3)
FSharp.SystemTextJson (1.2.42)
FSharp.Core (>= 4.7)
System.Text.Json (>= 6.0)
FsHttp (10.0)
FsHttp (12.0)
FSharp.Core (>= 5.0)
Microsoft.Win32.SystemEvents (7.0)
System.Configuration.ConfigurationManager (7.0)
System.Diagnostics.EventLog (>= 7.0)
System.Security.Cryptography.ProtectedData (>= 7.0)
System.Security.Permissions (>= 7.0)
System.Diagnostics.EventLog (7.0)
System.Drawing.Common (7.0)
Microsoft.Win32.SystemEvents (>= 7.0)
System.Security.Cryptography.ProtectedData (7.0.1)
System.Security.Permissions (7.0)
System.Windows.Extensions (>= 7.0)
System.Text.Encodings.Web (7.0)
System.Text.Json (7.0.2)
System.Text.Encodings.Web (>= 7.0)
System.Windows.Extensions (7.0)
System.Drawing.Common (>= 7.0)
System.Configuration.ConfigurationManager (8.0)
System.Diagnostics.EventLog (>= 8.0)
System.Security.Cryptography.ProtectedData (>= 8.0)
System.Diagnostics.EventLog (8.0)
System.Security.Cryptography.ProtectedData (8.0)
System.Text.Encodings.Web (8.0)
System.Text.Json (8.0)
System.Text.Encodings.Web (>= 8.0)
GITHUB
remote: CaptnCodr/FSharpExtensions
DateTimeExtension.fs (69d59606ebf56406174e10ad121c979d4c469f75)
Expand Down
4 changes: 2 additions & 2 deletions pushbullet-cli.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
<PropertyGroup>
<AssemblyName>pb</AssemblyName>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<PublishSingleFile>true</PublishSingleFile>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<PublishTrimmed>true</PublishTrimmed>
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
<GenerateResourceUsePreserializedResources>true</GenerateResourceUsePreserializedResources>
<Version>0.7.0.0</Version>
<Version>0.8.0.0</Version>
</PropertyGroup>
<ItemGroup>
<Content Include=".config\dotnet-tools.json" />
Expand Down