mirror of
https://github.com/Smaug123/WoofWare.Myriad
synced 2025-10-06 20:48:40 +00:00
Compare commits
6 Commits
WoofWare.M
...
main
Author | SHA1 | Date | |
---|---|---|---|
|
e83ec1f152 | ||
|
9d8cef8fdc | ||
|
1721ad1ac0 | ||
|
857bde0ba9 | ||
|
d10f608941 | ||
|
46effedfc4 |
14
.github/workflows/dotnet.yaml
vendored
14
.github/workflows/dotnet.yaml
vendored
@@ -301,12 +301,17 @@ jobs:
|
|||||||
- name: Identify `dotnet`
|
- name: Identify `dotnet`
|
||||||
id: dotnet-identify
|
id: dotnet-identify
|
||||||
run: nix develop --command bash -c 'echo "dotnet=$(which dotnet)" >> $GITHUB_OUTPUT'
|
run: nix develop --command bash -c 'echo "dotnet=$(which dotnet)" >> $GITHUB_OUTPUT'
|
||||||
|
- name: Obtain NuGet key
|
||||||
|
uses: NuGet/login@d22cc5f58ff5b88bf9bd452535b4335137e24544
|
||||||
|
id: login
|
||||||
|
with:
|
||||||
|
user: ${{ secrets.NUGET_USER }}
|
||||||
- name: Publish to NuGet
|
- name: Publish to NuGet
|
||||||
id: publish-success
|
id: publish-success
|
||||||
uses: G-Research/common-actions/publish-nuget@2b7dc49cb14f3344fbe6019c14a31165e258c059
|
uses: G-Research/common-actions/publish-nuget@2b7dc49cb14f3344fbe6019c14a31165e258c059
|
||||||
with:
|
with:
|
||||||
package-name: WoofWare.Myriad.Plugins.Attributes
|
package-name: WoofWare.Myriad.Plugins.Attributes
|
||||||
nuget-key: ${{ secrets.NUGET_API_KEY }}
|
nuget-key: ${{ steps.login.outputs.NUGET_API_KEY }}
|
||||||
nupkg-dir: packed/
|
nupkg-dir: packed/
|
||||||
dotnet: ${{ steps.dotnet-identify.outputs.dotnet }}
|
dotnet: ${{ steps.dotnet-identify.outputs.dotnet }}
|
||||||
|
|
||||||
@@ -334,12 +339,17 @@ jobs:
|
|||||||
- name: Identify `dotnet`
|
- name: Identify `dotnet`
|
||||||
id: dotnet-identify
|
id: dotnet-identify
|
||||||
run: nix develop --command bash -c 'echo "dotnet=$(which dotnet)" >> $GITHUB_OUTPUT'
|
run: nix develop --command bash -c 'echo "dotnet=$(which dotnet)" >> $GITHUB_OUTPUT'
|
||||||
|
- name: Obtain NuGet key
|
||||||
|
uses: NuGet/login@d22cc5f58ff5b88bf9bd452535b4335137e24544
|
||||||
|
id: login
|
||||||
|
with:
|
||||||
|
user: ${{ secrets.NUGET_USER }}
|
||||||
- name: Publish to NuGet
|
- name: Publish to NuGet
|
||||||
id: publish-success
|
id: publish-success
|
||||||
uses: G-Research/common-actions/publish-nuget@2b7dc49cb14f3344fbe6019c14a31165e258c059
|
uses: G-Research/common-actions/publish-nuget@2b7dc49cb14f3344fbe6019c14a31165e258c059
|
||||||
with:
|
with:
|
||||||
package-name: WoofWare.Myriad.Plugins
|
package-name: WoofWare.Myriad.Plugins
|
||||||
nuget-key: ${{ secrets.NUGET_API_KEY }}
|
nuget-key: ${{ steps.login.outputs.NUGET_API_KEY }}
|
||||||
nupkg-dir: packed/
|
nupkg-dir: packed/
|
||||||
dotnet: ${{ steps.dotnet-identify.outputs.dotnet }}
|
dotnet: ${{ steps.dotnet-identify.outputs.dotnet }}
|
||||||
|
|
||||||
|
@@ -37,7 +37,7 @@ type internal PublicTypeMock =
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// An implementation where every non-unit method throws.
|
/// An implementation where every non-unit method throws.
|
||||||
static member Empty : PublicTypeMock =
|
static member Empty () : PublicTypeMock =
|
||||||
{
|
{
|
||||||
Calls = PublicTypeMockCalls.Calls.Empty ()
|
Calls = PublicTypeMockCalls.Calls.Empty ()
|
||||||
Mem1 = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: Mem1"))
|
Mem1 = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: Mem1"))
|
||||||
@@ -90,7 +90,7 @@ type public PublicTypeInternalFalseMock =
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// An implementation where every non-unit method throws.
|
/// An implementation where every non-unit method throws.
|
||||||
static member Empty : PublicTypeInternalFalseMock =
|
static member Empty () : PublicTypeInternalFalseMock =
|
||||||
{
|
{
|
||||||
Calls = PublicTypeInternalFalseMockCalls.Calls.Empty ()
|
Calls = PublicTypeInternalFalseMockCalls.Calls.Empty ()
|
||||||
Mem1 = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: Mem1"))
|
Mem1 = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: Mem1"))
|
||||||
@@ -140,7 +140,7 @@ type internal InternalTypeMock =
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// An implementation where every non-unit method throws.
|
/// An implementation where every non-unit method throws.
|
||||||
static member Empty : InternalTypeMock =
|
static member Empty () : InternalTypeMock =
|
||||||
{
|
{
|
||||||
Calls = InternalTypeMockCalls.Calls.Empty ()
|
Calls = InternalTypeMockCalls.Calls.Empty ()
|
||||||
Mem1 = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: Mem1"))
|
Mem1 = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: Mem1"))
|
||||||
@@ -185,7 +185,7 @@ type private PrivateTypeMock =
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// An implementation where every non-unit method throws.
|
/// An implementation where every non-unit method throws.
|
||||||
static member Empty : PrivateTypeMock =
|
static member Empty () : PrivateTypeMock =
|
||||||
{
|
{
|
||||||
Calls = PrivateTypeMockCalls.Calls.Empty ()
|
Calls = PrivateTypeMockCalls.Calls.Empty ()
|
||||||
Mem1 = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: Mem1"))
|
Mem1 = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: Mem1"))
|
||||||
@@ -230,7 +230,7 @@ type private PrivateTypeInternalFalseMock =
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// An implementation where every non-unit method throws.
|
/// An implementation where every non-unit method throws.
|
||||||
static member Empty : PrivateTypeInternalFalseMock =
|
static member Empty () : PrivateTypeInternalFalseMock =
|
||||||
{
|
{
|
||||||
Calls = PrivateTypeInternalFalseMockCalls.Calls.Empty ()
|
Calls = PrivateTypeInternalFalseMockCalls.Calls.Empty ()
|
||||||
Mem1 = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: Mem1"))
|
Mem1 = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: Mem1"))
|
||||||
@@ -487,7 +487,7 @@ type internal TypeWithInterfaceMock =
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// An implementation where every non-unit method throws.
|
/// An implementation where every non-unit method throws.
|
||||||
static member Empty : TypeWithInterfaceMock =
|
static member Empty () : TypeWithInterfaceMock =
|
||||||
{
|
{
|
||||||
Calls = TypeWithInterfaceMockCalls.Calls.Empty ()
|
Calls = TypeWithInterfaceMockCalls.Calls.Empty ()
|
||||||
Dispose = (fun () -> ())
|
Dispose = (fun () -> ())
|
||||||
@@ -541,7 +541,7 @@ type internal TypeWithPropertiesMock =
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// An implementation where every non-unit method throws.
|
/// An implementation where every non-unit method throws.
|
||||||
static member Empty : TypeWithPropertiesMock =
|
static member Empty () : TypeWithPropertiesMock =
|
||||||
{
|
{
|
||||||
Calls = TypeWithPropertiesMockCalls.Calls.Empty ()
|
Calls = TypeWithPropertiesMockCalls.Calls.Empty ()
|
||||||
Dispose = (fun () -> ())
|
Dispose = (fun () -> ())
|
||||||
|
@@ -36,7 +36,7 @@ type internal PublicTypeNoAttrMock =
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// An implementation where every non-unit method throws.
|
/// An implementation where every non-unit method throws.
|
||||||
static member Empty : PublicTypeNoAttrMock =
|
static member Empty () : PublicTypeNoAttrMock =
|
||||||
{
|
{
|
||||||
Calls = PublicTypeNoAttrMockCalls.Calls.Empty ()
|
Calls = PublicTypeNoAttrMockCalls.Calls.Empty ()
|
||||||
Mem1 = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: Mem1"))
|
Mem1 = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: Mem1"))
|
||||||
@@ -88,7 +88,7 @@ type public PublicTypeInternalFalseNoAttrMock =
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// An implementation where every non-unit method throws.
|
/// An implementation where every non-unit method throws.
|
||||||
static member Empty : PublicTypeInternalFalseNoAttrMock =
|
static member Empty () : PublicTypeInternalFalseNoAttrMock =
|
||||||
{
|
{
|
||||||
Calls = PublicTypeInternalFalseNoAttrMockCalls.Calls.Empty ()
|
Calls = PublicTypeInternalFalseNoAttrMockCalls.Calls.Empty ()
|
||||||
Mem1 = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: Mem1"))
|
Mem1 = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: Mem1"))
|
||||||
@@ -137,7 +137,7 @@ type internal InternalTypeNoAttrMock =
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// An implementation where every non-unit method throws.
|
/// An implementation where every non-unit method throws.
|
||||||
static member Empty : InternalTypeNoAttrMock =
|
static member Empty () : InternalTypeNoAttrMock =
|
||||||
{
|
{
|
||||||
Calls = InternalTypeNoAttrMockCalls.Calls.Empty ()
|
Calls = InternalTypeNoAttrMockCalls.Calls.Empty ()
|
||||||
Mem1 = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: Mem1"))
|
Mem1 = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: Mem1"))
|
||||||
@@ -181,7 +181,7 @@ type private PrivateTypeNoAttrMock =
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// An implementation where every non-unit method throws.
|
/// An implementation where every non-unit method throws.
|
||||||
static member Empty : PrivateTypeNoAttrMock =
|
static member Empty () : PrivateTypeNoAttrMock =
|
||||||
{
|
{
|
||||||
Calls = PrivateTypeNoAttrMockCalls.Calls.Empty ()
|
Calls = PrivateTypeNoAttrMockCalls.Calls.Empty ()
|
||||||
Mem1 = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: Mem1"))
|
Mem1 = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: Mem1"))
|
||||||
@@ -225,7 +225,7 @@ type private PrivateTypeInternalFalseNoAttrMock =
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// An implementation where every non-unit method throws.
|
/// An implementation where every non-unit method throws.
|
||||||
static member Empty : PrivateTypeInternalFalseNoAttrMock =
|
static member Empty () : PrivateTypeInternalFalseNoAttrMock =
|
||||||
{
|
{
|
||||||
Calls = PrivateTypeInternalFalseNoAttrMockCalls.Calls.Empty ()
|
Calls = PrivateTypeInternalFalseNoAttrMockCalls.Calls.Empty ()
|
||||||
Mem1 = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: Mem1"))
|
Mem1 = (fun _ -> raise (System.NotImplementedException "Unimplemented mock function: Mem1"))
|
||||||
@@ -479,7 +479,7 @@ type internal TypeWithInterfaceNoAttrMock =
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// An implementation where every non-unit method throws.
|
/// An implementation where every non-unit method throws.
|
||||||
static member Empty : TypeWithInterfaceNoAttrMock =
|
static member Empty () : TypeWithInterfaceNoAttrMock =
|
||||||
{
|
{
|
||||||
Calls = TypeWithInterfaceNoAttrMockCalls.Calls.Empty ()
|
Calls = TypeWithInterfaceNoAttrMockCalls.Calls.Empty ()
|
||||||
Dispose = (fun () -> ())
|
Dispose = (fun () -> ())
|
||||||
|
@@ -10,7 +10,7 @@
|
|||||||
<WarnOn>FS3388,FS3559</WarnOn>
|
<WarnOn>FS3388,FS3559</WarnOn>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Nerdbank.GitVersioning" Version="3.8.38-alpha" PrivateAssets="all" />
|
<PackageReference Include="Nerdbank.GitVersioning" Version="3.8.118" PrivateAssets="all" />
|
||||||
<SourceLinkGitHubHost Include="github.com" ContentUrl="https://raw.githubusercontent.com" />
|
<SourceLinkGitHubHost Include="github.com" ContentUrl="https://raw.githubusercontent.com" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<PropertyGroup Condition="'$(GITHUB_ACTION)' != ''">
|
<PropertyGroup Condition="'$(GITHUB_ACTION)' != ''">
|
||||||
|
@@ -652,13 +652,13 @@ For example, [PureGymDto.fs](./ConsumePlugin/PureGymDto.fs) is a real-world set
|
|||||||
* In your `.fsproj` file, define a helper variable so that subsequent steps don't all have to be kept in sync:
|
* In your `.fsproj` file, define a helper variable so that subsequent steps don't all have to be kept in sync:
|
||||||
```xml
|
```xml
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<WoofWareMyriadPluginVersion>2.0.1</WoofWareMyriadPluginVersion>
|
<WoofWareMyriadPluginVersion>9.0.1</WoofWareMyriadPluginVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
```
|
```
|
||||||
* Take a reference on `WoofWare.Myriad.Plugins.Attributes` (which has no other dependencies), to obtain access to the attributes which the generator will recognise:
|
* Take a reference on `WoofWare.Myriad.Plugins.Attributes` (which has no other dependencies), to obtain access to the attributes which the generator will recognise:
|
||||||
```xml
|
```xml
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="WoofWare.Myriad.Plugins.Attributes" Version="2.0.2" />
|
<PackageReference Include="WoofWare.Myriad.Plugins.Attributes" Version="3.7.2" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
```
|
```
|
||||||
* Take a reference (with private assets, to prevent these from propagating to your own assembly) on `WoofWare.Myriad.Plugins`, to obtain the plugins which Myriad will run, and on `Myriad.Sdk`, to obtain the Myriad binary itself:
|
* Take a reference (with private assets, to prevent these from propagating to your own assembly) on `WoofWare.Myriad.Plugins`, to obtain the plugins which Myriad will run, and on `Myriad.Sdk`, to obtain the Myriad binary itself:
|
||||||
|
@@ -11,7 +11,7 @@ module TestCapturingMockGenerator =
|
|||||||
[<Test>]
|
[<Test>]
|
||||||
let ``Example of use: IPublicType`` () =
|
let ``Example of use: IPublicType`` () =
|
||||||
let mock : IPublicType =
|
let mock : IPublicType =
|
||||||
{ PublicTypeMock.Empty with
|
{ PublicTypeMock.Empty () with
|
||||||
Mem1 = fun (s, count) -> List.replicate count s
|
Mem1 = fun (s, count) -> List.replicate count s
|
||||||
}
|
}
|
||||||
:> _
|
:> _
|
||||||
@@ -38,7 +38,7 @@ module TestCapturingMockGenerator =
|
|||||||
[<Test>]
|
[<Test>]
|
||||||
let ``Example of use: properties`` () =
|
let ``Example of use: properties`` () =
|
||||||
let mock : TypeWithProperties =
|
let mock : TypeWithProperties =
|
||||||
{ TypeWithPropertiesMock.Empty with
|
{ TypeWithPropertiesMock.Empty () with
|
||||||
Mem1 = fun i -> async { return Option.toArray i }
|
Mem1 = fun i -> async { return Option.toArray i }
|
||||||
Prop1 = fun () -> 44
|
Prop1 = fun () -> 44
|
||||||
}
|
}
|
||||||
|
@@ -11,7 +11,7 @@ module TestCapturingMockGeneratorNoAttr =
|
|||||||
[<Test>]
|
[<Test>]
|
||||||
let ``Example of use: IPublicType`` () =
|
let ``Example of use: IPublicType`` () =
|
||||||
let mock : IPublicTypeNoAttr =
|
let mock : IPublicTypeNoAttr =
|
||||||
{ PublicTypeNoAttrMock.Empty with
|
{ PublicTypeNoAttrMock.Empty () with
|
||||||
Mem1 = fun (s, count) -> List.replicate count s
|
Mem1 = fun (s, count) -> List.replicate count s
|
||||||
}
|
}
|
||||||
:> _
|
:> _
|
||||||
|
@@ -273,10 +273,7 @@ module internal CapturingInterfaceMockGenerator =
|
|||||||
let staticMemberEmpty =
|
let staticMemberEmpty =
|
||||||
SynBinding.basic
|
SynBinding.basic
|
||||||
[ Ident.create "Empty" ]
|
[ Ident.create "Empty" ]
|
||||||
(if interfaceType.Generics.IsNone then
|
[ SynPat.unit ]
|
||||||
[]
|
|
||||||
else
|
|
||||||
[ SynPat.unit ])
|
|
||||||
(SynExpr.createRecord None emptyRecordFieldInstantiations)
|
(SynExpr.createRecord None emptyRecordFieldInstantiations)
|
||||||
|> SynBinding.withXmlDoc (PreXmlDoc.create "An implementation where every non-unit method throws.")
|
|> SynBinding.withXmlDoc (PreXmlDoc.create "An implementation where every non-unit method throws.")
|
||||||
|> SynBinding.withReturnAnnotation constructorReturnType
|
|> SynBinding.withReturnAnnotation constructorReturnType
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"version": "8.1",
|
"version": "9.0",
|
||||||
"publicReleaseRefSpec": [
|
"publicReleaseRefSpec": [
|
||||||
"^refs/heads/main$"
|
"^refs/heads/main$"
|
||||||
],
|
],
|
||||||
@@ -11,4 +11,4 @@
|
|||||||
":/README.md",
|
":/README.md",
|
||||||
":/Directory.Build.props"
|
":/Directory.Build.props"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
6
flake.lock
generated
6
flake.lock
generated
@@ -20,11 +20,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1757746433,
|
"lastModified": 1759536663,
|
||||||
"narHash": "sha256-fEvTiU4s9lWgW7mYEU/1QUPirgkn+odUBTaindgiziY=",
|
"narHash": "sha256-hhM8SUI6kQMei5TImFdNQy9EDT8g2hAD161DUtbfAy0=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "6d7ec06d6868ac6d94c371458fc2391ded9ff13d",
|
"rev": "27ac93958969b5f3dccd654b402599cf3de633ac",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@@ -216,8 +216,8 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pname": "Nerdbank.GitVersioning",
|
"pname": "Nerdbank.GitVersioning",
|
||||||
"version": "3.8.38-alpha",
|
"version": "3.8.118",
|
||||||
"hash": "sha256-gPMrVbjOZxXoofczF/pn6eVkLhjVSJIyQrLO2oljrDc="
|
"hash": "sha256-Hmyy0ZKOmwN4zIhI4+MqoN8geZNc1sd033aZJ6APrO8="
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pname": "NETStandard.Library",
|
"pname": "NETStandard.Library",
|
||||||
|
Reference in New Issue
Block a user